diff --git a/deployments/goerli/.chainId b/deployments/goerli/.chainId deleted file mode 100644 index 7813681..0000000 --- a/deployments/goerli/.chainId +++ /dev/null @@ -1 +0,0 @@ -5 \ No newline at end of file diff --git a/deployments/goerli/AttestationsRegistry.json b/deployments/goerli/AttestationsRegistry.json deleted file mode 100644 index b1dcdb8..0000000 --- a/deployments/goerli/AttestationsRegistry.json +++ /dev/null @@ -1,1797 +0,0 @@ -{ - "address": "0xf85BA0afA375495eE625910Db61b6b1406756234", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "badgesAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "ArgsLengthDoesNotMatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - } - ], - "name": "AttesterNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - } - ], - "name": "AttributeAlreadyExists", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - } - ], - "name": "AttributeDoesNotExist", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "rangeIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedFirstId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedLastId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "FirstId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "IdsMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "IndexOutOfBounds", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "IssuerNotAuthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "owners", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - } - ], - "name": "OwnersAndCollectionIdsLengthMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "expectedArrayLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rangeIndex", - "type": "uint256" - } - ], - "name": "RangeIndexOutOfBounds", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "value", - "type": "uint8" - } - ], - "name": "ValueOutOfBounds", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationRecorded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "attributeValue", - "type": "uint8" - } - ], - "name": "AttestationsCollectionAttributeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "deletedAttributeName", - "type": "bytes32" - } - ], - "name": "AttributeDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "newAttributeName", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "previousAttributeName", - "type": "bytes32" - } - ], - "name": "AttributeNameUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "firstCollectionId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "IssuerAuthorized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "firstCollectionId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "IssuerUnauthorized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "attributeName", - "type": "bytes32" - } - ], - "name": "NewAttributeCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Unpaused", - "type": "event" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "attestationsCollectionHasAttribute", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - } - ], - "name": "attestationsCollectionHasAttributes", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "firstCollectionId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "authorizeRange", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Range[]", - "name": "ranges", - "type": "tuple[]" - } - ], - "name": "authorizeRanges", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "name", - "type": "bytes32" - } - ], - "name": "createNewAttribute", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - }, - { - "internalType": "bytes32[]", - "name": "names", - "type": "bytes32[]" - } - ], - "name": "createNewAttributes", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "owners", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - } - ], - "name": "deleteAttestations", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "deleteAttribute", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - } - ], - "name": "deleteAttributes", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationData", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct AttestationData", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "owners", - "type": "address[]" - } - ], - "name": "getAttestationDataBatch", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct AttestationData[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationDataTuple", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationExtraData", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationIssuer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationTimestamp", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationValue", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "owners", - "type": "address[]" - } - ], - "name": "getAttestationValueBatch", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "getAttributeValueForAttestationsCollection", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "getAttributesNamesAndValuesForAttestationsCollection", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - }, - { - "internalType": "uint8[]", - "name": "", - "type": "uint8[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - } - ], - "name": "getAttributesValuesForAttestationsCollection", - "outputs": [ - { - "internalType": "uint8[]", - "name": "", - "type": "uint8[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "hasAttestation", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "isAuthorized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "paused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "attestations", - "type": "tuple[]" - } - ], - "name": "recordAttestations", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "value", - "type": "uint8" - } - ], - "name": "setAttributeValueForAttestationsCollection", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - }, - { - "internalType": "uint8[]", - "name": "values", - "type": "uint8[]" - } - ], - "name": "setAttributesValuesForAttestationsCollections", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "rangeIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "firstCollectionId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "unauthorizeRange", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Range[]", - "name": "ranges", - "type": "tuple[]" - }, - { - "internalType": "uint256[]", - "name": "rangeIndexes", - "type": "uint256[]" - } - ], - "name": "unauthorizeRanges", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "unpause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "newName", - "type": "bytes32" - } - ], - "name": "updateAttributeName", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - }, - { - "internalType": "bytes32[]", - "name": "newNames", - "type": "bytes32[]" - } - ], - "name": "updateAttributesName", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xbb2f078e951041b389a49f7511f5cc9bcb3ec482b869cc7f559219850f1876ed", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0xDb80166478D50EDEFc4dD72c304d44D270c6b494", - "transactionIndex": 106, - "gasUsed": "3121566", - "logsBloom": "0x00000000000200000000000000020000000080000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000080000000000000000000020000000000000000000800002000000000000000000000000000400000000000000000000000000000000000000000000080000000000000000000000000000000000000000000800400000000000000000000000000000000000000000000000000000000000000040000000000000000400000000000000020000000000000000200000000000000000000000000000000000000008000000000", - "blockHash": "0xa9ac885baeb6adea2c0e2fdeb3a1bb2f3dd0507acf93db251dfdf26b025868de", - "transactionHash": "0xbb2f078e951041b389a49f7511f5cc9bcb3ec482b869cc7f559219850f1876ed", - "logs": [ - { - "transactionIndex": 106, - "blockNumber": 8080251, - "transactionHash": "0xbb2f078e951041b389a49f7511f5cc9bcb3ec482b869cc7f559219850f1876ed", - "address": "0xDb80166478D50EDEFc4dD72c304d44D270c6b494", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "data": "0x", - "logIndex": 165, - "blockHash": "0xa9ac885baeb6adea2c0e2fdeb3a1bb2f3dd0507acf93db251dfdf26b025868de" - }, - { - "transactionIndex": 106, - "blockNumber": 8080251, - "transactionHash": "0xbb2f078e951041b389a49f7511f5cc9bcb3ec482b869cc7f559219850f1876ed", - "address": "0xDb80166478D50EDEFc4dD72c304d44D270c6b494", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954" - ], - "data": "0x", - "logIndex": 166, - "blockHash": "0xa9ac885baeb6adea2c0e2fdeb3a1bb2f3dd0507acf93db251dfdf26b025868de" - }, - { - "transactionIndex": 106, - "blockNumber": 8080251, - "transactionHash": "0xbb2f078e951041b389a49f7511f5cc9bcb3ec482b869cc7f559219850f1876ed", - "address": "0xDb80166478D50EDEFc4dD72c304d44D270c6b494", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 167, - "blockHash": "0xa9ac885baeb6adea2c0e2fdeb3a1bb2f3dd0507acf93db251dfdf26b025868de" - } - ], - "blockNumber": 8080251, - "cumulativeGasUsed": "25947331", - "status": 1, - "byzantium": true - }, - "args": [ - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954", - "0xE06B14D5835925e1642d7216F4563a1273509F10" - ], - "numDeployments": 6, - "solcInputHash": "24c70469fd559e01f6ff2a10472da9a6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"badgesAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ArgsLengthDoesNotMatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"}],\"name\":\"AttesterNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"}],\"name\":\"AttributeAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"}],\"name\":\"AttributeDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rangeIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedFirstId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedLastId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"FirstId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"IdsMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"IndexOutOfBounds\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"IssuerNotAuthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"}],\"name\":\"OwnersAndCollectionIdsLengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"expectedArrayLength\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rangeIndex\",\"type\":\"uint256\"}],\"name\":\"RangeIndexOutOfBounds\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"value\",\"type\":\"uint8\"}],\"name\":\"ValueOutOfBounds\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationRecorded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeValue\",\"type\":\"uint8\"}],\"name\":\"AttestationsCollectionAttributeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"deletedAttributeName\",\"type\":\"bytes32\"}],\"name\":\"AttributeDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"newAttributeName\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"previousAttributeName\",\"type\":\"bytes32\"}],\"name\":\"AttributeNameUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"IssuerAuthorized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"IssuerUnauthorized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"attributeName\",\"type\":\"bytes32\"}],\"name\":\"NewAttributeCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"attestationsCollectionHasAttribute\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"}],\"name\":\"attestationsCollectionHasAttributes\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"authorizeRange\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"internalType\":\"struct Range[]\",\"name\":\"ranges\",\"type\":\"tuple[]\"}],\"name\":\"authorizeRanges\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"createNewAttribute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"names\",\"type\":\"bytes32[]\"}],\"name\":\"createNewAttributes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"}],\"name\":\"deleteAttestations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"deleteAttribute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"}],\"name\":\"deleteAttributes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationData\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct AttestationData\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"}],\"name\":\"getAttestationDataBatch\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct AttestationData[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationDataTuple\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationIssuer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationTimestamp\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationValue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"}],\"name\":\"getAttestationValueBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"getAttributeValueForAttestationsCollection\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"getAttributesNamesAndValuesForAttestationsCollection\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"}],\"name\":\"getAttributesValuesForAttestationsCollection\",\"outputs\":[{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"hasAttestation\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"isAuthorized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"attestations\",\"type\":\"tuple[]\"}],\"name\":\"recordAttestations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"value\",\"type\":\"uint8\"}],\"name\":\"setAttributeValueForAttestationsCollection\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"},{\"internalType\":\"uint8[]\",\"name\":\"values\",\"type\":\"uint8[]\"}],\"name\":\"setAttributesValuesForAttestationsCollections\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rangeIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"unauthorizeRange\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"internalType\":\"struct Range[]\",\"name\":\"ranges\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256[]\",\"name\":\"rangeIndexes\",\"type\":\"uint256[]\"}],\"name\":\"unauthorizeRanges\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"newName\",\"type\":\"bytes32\"}],\"name\":\"updateAttributeName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"newNames\",\"type\":\"bytes32[]\"}],\"name\":\"updateAttributesName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"attestationsCollectionHasAttribute(uint256,uint8)\":{\"details\":\"Returns whether an attestationsCollection has a specific attribute referenced by its index\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\",\"index\":\"Index of the attribute. Can go from 0 to 63.\"}},\"authorizeRange(address,uint256,uint256)\":{\"details\":\"Authorize an issuer for a specific range\",\"params\":{\"firstCollectionId\":\"First collection Id of the range for which the issuer will be authorized\",\"issuer\":\"Issuer that will be authorized\",\"lastCollectionId\":\"Last collection Id of the range for which the issuer will be authorized\"}},\"authorizeRanges(address,(uint256,uint256)[])\":{\"details\":\"Authorize an issuer for specific ranges\",\"params\":{\"issuer\":\"Issuer that will be authorized\",\"ranges\":\"Ranges for which the issuer will be authorized\"}},\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"badgesAddress\":\"Stateless ERC1155 Badges contract\",\"owner\":\"Owner of the contract, has the right to authorize/unauthorize attestations issuers\"}},\"createNewAttribute(uint8,bytes32)\":{\"details\":\"Create a new attribute.\",\"params\":{\"index\":\"Index of the attribute. Can go from 0 to 63.\",\"name\":\"Name in bytes32 of the attribute\"}},\"deleteAttestations(address[],uint256[])\":{\"details\":\"Delete function to be called by authorized issuers\",\"params\":{\"collectionIds\":\"The collection ids of the attestations to be deleted\",\"owners\":\"The owners of the attestations to be deleted\"}},\"deleteAttribute(uint8)\":{\"details\":\"Delete an existing attribute\",\"params\":{\"index\":\"Index of the attribute. Can go from 0 to 63. The attribute must already exist\"}},\"getAttestationData(uint256,address)\":{\"details\":\"Getter of the data of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationDataBatch(uint256[],address[])\":{\"details\":\"Getter of the data of specific attestations\",\"params\":{\"collectionIds\":\"Collection identifiers of the targeted attestations\",\"owners\":\"Owners of the targeted attestations\"}},\"getAttestationDataTuple(uint256,address)\":{\"details\":\"Getter of the data of a specific attestation as tuple\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationExtraData(uint256,address)\":{\"details\":\"Getter of the extraData of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationIssuer(uint256,address)\":{\"details\":\"Getter of the issuer of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationTimestamp(uint256,address)\":{\"details\":\"Getter of the timestamp of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationValue(uint256,address)\":{\"details\":\"Getter of the value of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationValueBatch(uint256[],address[])\":{\"details\":\"Getter of the values of specific attestations\",\"params\":{\"collectionIds\":\"Collection identifiers of the targeted attestations\",\"owners\":\"Owners of the targeted attestations\"}},\"getAttributeValueForAttestationsCollection(uint256,uint8)\":{\"details\":\"Returns the attribute's value (from 0 to 15) of an attestationsCollection\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\",\"index\":\"Index of the attribute. Can go from 0 to 63.\"}},\"getAttributesNamesAndValuesForAttestationsCollection(uint256)\":{\"details\":\"Returns all the enabled attributes names and their values for a specific attestationsCollection\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\"}},\"hasAttestation(uint256,address)\":{\"details\":\"Returns whether a user has an attestation from a collection\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"initialize(address)\":{\"details\":\"Initialize function, to be called by the proxy delegating calls to this implementation\",\"params\":{\"ownerAddress\":\"Owner of the contract, has the right to authorize/unauthorize attestations issuers\"}},\"isAuthorized(address,uint256)\":{\"details\":\"Returns whether a specific issuer is authorized or not to record in a specific attestations collection\",\"params\":{\"collectionId\":\"Collection Id for which the issuer will be checked\",\"issuer\":\"Issuer to be checked\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pause()\":{\"details\":\"Pauses the registry. Issuers can no longer record or delete attestations\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"recordAttestations((uint256,address,address,uint256,uint32,bytes)[])\":{\"details\":\"Main function to be called by authorized issuers\",\"params\":{\"attestations\":\"Attestations to be recorded (creates a new one or overrides an existing one)\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAttributeValueForAttestationsCollection(uint256,uint8,uint8)\":{\"details\":\"Set a value for an attribute of an attestationsCollection. The attribute should already be created.\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\",\"index\":\"Index of the attribute (must be between 0 and 63)\",\"value\":\"Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unauthorizeRange(address,uint256,uint256,uint256)\":{\"details\":\"Unauthorize an issuer for a specific range\",\"params\":{\"firstCollectionId\":\"First collection Id of the range for which the issuer will be unauthorized\",\"issuer\":\"Issuer that will be unauthorized\",\"lastCollectionId\":\"Last collection Id of the range for which the issuer will be unauthorized\",\"rangeIndex\":\"Index of the range to be unauthorized\"}},\"unauthorizeRanges(address,(uint256,uint256)[],uint256[])\":{\"details\":\"Unauthorize an issuer for specific ranges\",\"params\":{\"issuer\":\"Issuer that will be unauthorized\",\"ranges\":\"Ranges for which the issuer will be unauthorized\"}},\"unpause()\":{\"details\":\"Unpauses the registry\"},\"updateAttributeName(uint8,bytes32)\":{\"details\":\"Update the name of an existing attribute\",\"params\":{\"index\":\"Index of the attribute. Can go from 0 to 63. The attribute must exist\",\"newName\":\"new name in bytes32 of the attribute\"}}},\"title\":\"Attestations Registry\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"Main contract of Sismo, stores all recorded attestations in attestations collections Only authorized attestations issuers can record attestation in the registry Attesters that expect to record in the Attestations Registry must be authorized issuers For more information: https://attestations-registry.docs.sismo.io For each attestation recorded, a badge is received by the user The badge is the Non transferrable NFT representation of an attestation Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts It enables off-chain apps such as opensea to catch the \\\"shadow mint\\\" of the badge*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/AttestationsRegistry.sol\":\"AttestationsRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/core/AttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\\nimport {Attestation, AttestationData} from './libs/Structs.sol';\\nimport {IBadges} from './interfaces/IBadges.sol';\\n\\n/**\\n * @title Attestations Registry\\n * @author Sismo\\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\\n * Only authorized attestations issuers can record attestation in the registry\\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\\n * For more information: https://attestations-registry.docs.sismo.io\\n\\n * For each attestation recorded, a badge is received by the user\\n * The badge is the Non transferrable NFT representation of an attestation \\n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\\n * It enables off-chain apps such as opensea to catch the \\\"shadow mint\\\" of the badge\\n **/\\ncontract AttestationsRegistry is\\n AttestationsRegistryState,\\n IAttestationsRegistry,\\n AttestationsRegistryConfigLogic\\n{\\n uint8 public constant IMPLEMENTATION_VERSION = 3;\\n IBadges immutable BADGES;\\n\\n /**\\n * @dev Constructor.\\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @param badgesAddress Stateless ERC1155 Badges contract\\n */\\n constructor(address owner, address badgesAddress) {\\n BADGES = IBadges(badgesAddress);\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\\n address issuer = _msgSender();\\n for (uint256 i = 0; i < attestations.length; i++) {\\n if (!_isAuthorized(issuer, attestations[i].collectionId))\\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\\n\\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\\n attestations[i].owner\\n ].value;\\n\\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\\n attestations[i].issuer,\\n attestations[i].value,\\n attestations[i].timestamp,\\n attestations[i].extraData\\n );\\n\\n _triggerBadgeTransferEvent(\\n attestations[i].collectionId,\\n attestations[i].owner,\\n previousAttestationValue,\\n attestations[i].value\\n );\\n emit AttestationRecorded(attestations[i]);\\n }\\n }\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(\\n address[] calldata owners,\\n uint256[] calldata collectionIds\\n ) external override whenNotPaused {\\n if (owners.length != collectionIds.length)\\n revert OwnersAndCollectionIdsLengthMismatch(owners, collectionIds);\\n\\n address issuer = _msgSender();\\n for (uint256 i = 0; i < owners.length; i++) {\\n AttestationData memory attestationData = _attestationsData[collectionIds[i]][owners[i]];\\n\\n if (!_isAuthorized(issuer, collectionIds[i]))\\n revert IssuerNotAuthorized(issuer, collectionIds[i]);\\n delete _attestationsData[collectionIds[i]][owners[i]];\\n\\n _triggerBadgeTransferEvent(collectionIds[i], owners[i], attestationData.value, 0);\\n\\n emit AttestationDeleted(\\n Attestation(\\n collectionIds[i],\\n owners[i],\\n attestationData.issuer,\\n attestationData.value,\\n attestationData.timestamp,\\n attestationData.extraData\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (bool) {\\n return _getAttestationValue(collectionId, owner) != 0;\\n }\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (AttestationData memory) {\\n return _getAttestationData(collectionId, owner);\\n }\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (uint256) {\\n return _getAttestationValue(collectionId, owner);\\n }\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (address, uint256, uint32, bytes memory) {\\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\\n return (\\n attestationData.issuer,\\n attestationData.value,\\n attestationData.timestamp,\\n attestationData.extraData\\n );\\n }\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (bytes memory) {\\n return _attestationsData[collectionId][owner].extraData;\\n }\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (address) {\\n return _attestationsData[collectionId][owner].issuer;\\n }\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (uint32) {\\n return _attestationsData[collectionId][owner].timestamp;\\n }\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view override returns (AttestationData[] memory) {\\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\\n }\\n return attestationsDataArray;\\n }\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view override returns (uint256[] memory) {\\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\\n }\\n return attestationsValues;\\n }\\n\\n /**\\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\\n * It enables off-chain apps such as opensea to catch the \\\"shadow mints/burns\\\" of badges\\n */\\n function _triggerBadgeTransferEvent(\\n uint256 badgeTokenId,\\n address owner,\\n uint256 previousValue,\\n uint256 newValue\\n ) internal {\\n bool isGreaterValue = newValue > previousValue;\\n address operator = address(this);\\n address from = isGreaterValue ? address(0) : owner;\\n address to = isGreaterValue ? owner : address(0);\\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\\n\\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\\n }\\n\\n function _getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) internal view returns (AttestationData memory) {\\n return (_attestationsData[collectionId][owner]);\\n }\\n\\n function _getAttestationValue(\\n uint256 collectionId,\\n address owner\\n ) internal view returns (uint256) {\\n return _attestationsData[collectionId][owner].value;\\n }\\n}\\n\",\"keccak256\":\"0xc21afe30d8096d2bab3683ca28b2533f99f53fa20a1f2c13aa44f1d46ecb9ae6\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IBadges.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Interface for Badges contract\\n * @author Sismo\\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\\n * The associated attestations registry triggers TransferSingle events from this contract\\n * It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms\\n */\\ninterface IBadges {\\n error BadgesNonTransferrable();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(string memory uri, address owner) external;\\n\\n /**\\n * @dev Main function of the ERC1155 badge\\n * The balance of a user is equal to the value of the underlying attestation.\\n * attestationCollectionId == badgeId\\n * @param account Address to check badge balance (= value of attestation)\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\\n * @param operator who is calling the TransferEvent\\n * @param from address(0) if minting, address of the badge holder if burning\\n * @param to address of the badge holder is minting, address(0) if burning\\n * @param id badgeId for which to trigger the event\\n * @param value minted/burned balance\\n */\\n function triggerTransferEvent(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 value\\n ) external;\\n\\n /**\\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\\n * @param attestationsRegistry new attestations registry address\\n */\\n function setAttestationsRegistry(address attestationsRegistry) external;\\n\\n /**\\n * @dev Set the URI. Can only be called by owner (default admin)\\n * @param uri new attestations registry address\\n */\\n function setUri(string memory uri) external;\\n\\n /**\\n * @dev Getter of the attestations registry\\n */\\n function getAttestationsRegistry() external view returns (address);\\n\\n /**\\n * @dev Getter of the badge issuer\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeIssuer(address account, uint256 id) external view returns (address);\\n\\n /**\\n * @dev Getter of the badge timestamp\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the value of a specific badge attribute\\n * @param id Badge Id to check (= attestationCollectionId)\\n * @param index Index of the attribute\\n */\\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);\\n\\n /**\\n * @dev Getter of all badge attributes and their values for a specific badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getAttributesNamesAndValuesForBadge(\\n uint256 id\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n}\\n\",\"keccak256\":\"0xd6bdfc887ef15ee022eb05d89dbe2e2938ee6c0a55a55f8db527ef650242c6bb\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport './OwnableLogic.sol';\\nimport './PausableLogic.sol';\\nimport './InitializableLogic.sol';\\nimport './AttestationsRegistryState.sol';\\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\\nimport {Bitmap256Bit} from '../utils/Bitmap256Bit.sol';\\n\\n/**\\n * @title Attestations Registry Config Logic contract\\n * @author Sismo\\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\\n **/\\ncontract AttestationsRegistryConfigLogic is\\n AttestationsRegistryState,\\n IAttestationsRegistryConfigLogic,\\n OwnableLogic,\\n PausableLogic,\\n InitializableLogic\\n{\\n using RangeUtils for Range[];\\n using Bitmap256Bit for uint256;\\n using Bitmap256Bit for uint8;\\n\\n /******************************************\\n *\\n * ATTESTATION REGISTRY WRITE ACCESS MANAGEMENT (ISSUERS)\\n *\\n *****************************************/\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external override onlyOwner {\\n _pause();\\n }\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external override onlyOwner {\\n _unpause();\\n }\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external override onlyOwner {\\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\\n }\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external override onlyOwner {\\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\\n }\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\\n }\\n }\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external override onlyOwner {\\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\\n return _isAuthorized(issuer, collectionId);\\n }\\n\\n /******************************************\\n *\\n * ATTRIBUTES CONFIG LOGIC\\n *\\n *****************************************/\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) public onlyOwner {\\n index._checkIndexIsValid();\\n if (_isAttributeCreated(index)) {\\n revert AttributeAlreadyExists(index);\\n }\\n _createNewAttribute(index, name);\\n }\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external onlyOwner {\\n if (indices.length != names.length) {\\n revert ArgsLengthDoesNotMatch();\\n }\\n\\n for (uint256 i = 0; i < indices.length; i++) {\\n createNewAttribute(indices[i], names[i]);\\n }\\n }\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) public onlyOwner {\\n index._checkIndexIsValid();\\n if (!_isAttributeCreated(index)) {\\n revert AttributeDoesNotExist(index);\\n }\\n _updateAttributeName(index, newName);\\n }\\n\\n function updateAttributesName(\\n uint8[] memory indices,\\n bytes32[] memory newNames\\n ) external onlyOwner {\\n if (indices.length != newNames.length) {\\n revert ArgsLengthDoesNotMatch();\\n }\\n\\n for (uint256 i = 0; i < indices.length; i++) {\\n updateAttributeName(indices[i], newNames[i]);\\n }\\n }\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must already exist\\n */\\n function deleteAttribute(uint8 index) public onlyOwner {\\n index._checkIndexIsValid();\\n if (!_isAttributeCreated(index)) {\\n revert AttributeDoesNotExist(index);\\n }\\n _deleteAttribute(index);\\n }\\n\\n function deleteAttributes(uint8[] memory indices) external onlyOwner {\\n for (uint256 i = 0; i < indices.length; i++) {\\n deleteAttribute(indices[i]);\\n }\\n }\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) public onlyOwner {\\n index._checkIndexIsValid();\\n\\n if (!_isAttributeCreated(index)) {\\n revert AttributeDoesNotExist(index);\\n }\\n\\n _setAttributeForAttestationsCollection(collectionId, index, value);\\n }\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external onlyOwner {\\n if (collectionIds.length != indices.length || collectionIds.length != values.length) {\\n revert ArgsLengthDoesNotMatch();\\n }\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n setAttributeValueForAttestationsCollection(collectionIds[i], indices[i], values[i]);\\n }\\n }\\n\\n /**\\n * @dev Returns the attribute's value (from 0 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index\\n ) public view returns (uint8) {\\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\\n collectionId\\n );\\n return currentAttributesValues._get(index);\\n }\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory) {\\n uint8[] memory attributesValues = new uint8[](indices.length);\\n for (uint256 i = 0; i < indices.length; i++) {\\n attributesValues[i] = getAttributeValueForAttestationsCollection(collectionId, indices[i]);\\n }\\n return attributesValues;\\n }\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) public view returns (bool) {\\n uint256 currentAttributeValues = _getAttributesValuesBitmapForAttestationsCollection(\\n collectionId\\n );\\n return currentAttributeValues._get(index) > 0;\\n }\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool) {\\n for (uint256 i = 0; i < indices.length; i++) {\\n if (!attestationsCollectionHasAttribute(collectionId, indices[i])) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) public view returns (bytes32[] memory, uint8[] memory) {\\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\\n collectionId\\n );\\n\\n (\\n uint8[] memory indices,\\n uint8[] memory values,\\n uint8 nbOfNonZeroValues\\n ) = currentAttributesValues._getAllNonZeroValues();\\n\\n bytes32[] memory attributesNames = new bytes32[](nbOfNonZeroValues);\\n uint8[] memory attributesValues = new uint8[](nbOfNonZeroValues);\\n for (uint8 i = 0; i < nbOfNonZeroValues; i++) {\\n attributesNames[i] = _attributesNames[indices[i]];\\n attributesValues[i] = values[i];\\n }\\n\\n return (attributesNames, attributesValues);\\n }\\n\\n /*****************************\\n *\\n * INTERNAL FUNCTIONS\\n *\\n *****************************/\\n\\n function _authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) internal {\\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\\n _authorizedRanges[issuer].push(newRange);\\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\\n }\\n\\n function _unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) internal onlyOwner {\\n if (rangeIndex >= _authorizedRanges[issuer].length)\\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\\n\\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\\n revert IdsMismatch(\\n issuer,\\n rangeIndex,\\n expectedFirstId,\\n expectedLastId,\\n firstCollectionId,\\n lastCollectionId\\n );\\n\\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\\n _authorizedRanges[issuer].length - 1\\n ];\\n _authorizedRanges[issuer].pop();\\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\\n }\\n\\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\\n return _authorizedRanges[issuer]._includes(collectionId);\\n }\\n\\n function _setAttributeForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) internal {\\n uint256 currentAttributes = _getAttributesValuesBitmapForAttestationsCollection(collectionId);\\n\\n _attestationsCollectionAttributesValuesBitmap[collectionId] = currentAttributes._set(\\n index,\\n value\\n );\\n\\n emit AttestationsCollectionAttributeSet(collectionId, index, value);\\n }\\n\\n function _createNewAttribute(uint8 index, bytes32 name) internal {\\n _attributesNames[index] = name;\\n\\n emit NewAttributeCreated(index, name);\\n }\\n\\n function _updateAttributeName(uint8 index, bytes32 newName) internal {\\n bytes32 previousName = _attributesNames[index];\\n\\n _attributesNames[index] = newName;\\n\\n emit AttributeNameUpdated(index, newName, previousName);\\n }\\n\\n function _deleteAttribute(uint8 index) internal {\\n bytes32 deletedName = _attributesNames[index];\\n\\n delete _attributesNames[index];\\n\\n emit AttributeDeleted(index, deletedName);\\n }\\n\\n function _getAttributesValuesBitmapForAttestationsCollection(\\n uint256 collectionId\\n ) internal view returns (uint256) {\\n return _attestationsCollectionAttributesValuesBitmap[collectionId];\\n }\\n\\n function _isAttributeCreated(uint8 index) internal view returns (bool) {\\n if (_attributesNames[index] == 0) {\\n return false;\\n }\\n return true;\\n }\\n}\\n\",\"keccak256\":\"0xa48b3131a3870684389282cb863a34734c67194d7f50d266ed8421114b3d786a\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/AttestationsRegistryState.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Range} from '../utils/RangeLib.sol';\\nimport {Attestation, AttestationData} from '../Structs.sol';\\n\\ncontract AttestationsRegistryState {\\n /*******************************************************\\n Storage layout:\\n 19 slots for config\\n 4 currently used for _initialized, _initializing, _paused, _owner\\n 15 place holders\\n 16 slots for logic\\n 3 currently used for _authorizedRanges, _attestationsCollectionAttributesValuesBitmap, _attributesNames\\n 13 place holders\\n 1 slot for _attestationsData \\n *******************************************************/\\n\\n // main config\\n // changed `_initialized` from bool to uint8\\n // as we were using OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n // and changed to OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n // PR: https://github.com/sismo-core/sismo-protocol/pull/41\\n uint8 internal _initialized;\\n bool internal _initializing;\\n bool internal _paused;\\n address internal _owner;\\n // keeping some space for future\\n uint256[15] private _placeHoldersAdmin;\\n\\n // storing the authorized ranges for each attesters\\n mapping(address => Range[]) internal _authorizedRanges;\\n // Storing the attributes values used for each attestations collection\\n // Each attribute value is an hexadecimal\\n mapping(uint256 => uint256) internal _attestationsCollectionAttributesValuesBitmap;\\n // Storing the attribute name for each attributes index\\n mapping(uint8 => bytes32) internal _attributesNames;\\n // keeping some space for future\\n uint256[13] private _placeHoldersConfig;\\n // storing the data of attestations\\n // =collectionId=> =owner=> attestationData\\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\\n}\\n\",\"keccak256\":\"0xabd7a629901a128cc32f80102ce06db228a76bd04f27818ccaf54827921eb149\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/InitializableLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport '../utils/Address.sol';\\nimport './AttestationsRegistryState.sol';\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract InitializableLogic is AttestationsRegistryState {\\n // only diff with oz\\n // /**\\n // * @dev Indicates that the contract has been initialized.\\n // */\\n // bool private _initialized;\\n\\n // /**\\n // * @dev Indicates that the contract is in the process of being initialized.\\n // */\\n // bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) ||\\n (!Address.isContract(address(this)) && _initialized == 1),\\n 'Initializable: contract is already initialized'\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(\\n !_initializing && _initialized < version,\\n 'Initializable: contract is already initialized'\\n );\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, 'Initializable: contract is not initializing');\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, 'Initializable: contract is initializing');\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x64d931c5e29318bd4ae2ec44b3be45783ad7ad20431594bbcb9ae4e2014bc5ef\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/OwnableLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport '../utils/Context.sol';\\nimport './AttestationsRegistryState.sol';\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n // This is the only diff with OZ contract\\n // address private _owner;\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x74ff8ebdd6ad706a45354f1045ef623840aa1dbde37874dde2b6bfa498e0bdb3\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/PausableLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport '../utils/Context.sol';\\nimport './AttestationsRegistryState.sol';\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableLogic is Context, AttestationsRegistryState {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n // this is the only diff with OZ contract\\n // bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n require(!paused(), 'Pausable: paused');\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n require(paused(), 'Pausable: not paused');\\n _;\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0x234c48f5eb48bb15b6c2535428f1e28e172bc2c6fbf58c99ba7b3ca75e884c60\",\"license\":\"MIT\"},\"contracts/core/libs/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, 'Address: insufficient balance');\\n\\n (bool success, ) = recipient.call{value: amount}('');\\n require(success, 'Address: unable to send value, recipient may have reverted');\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, 'Address: low-level call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, 'Address: insufficient balance for call');\\n require(isContract(target), 'Address: call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data\\n ) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, 'Address: low-level static call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), 'Address: static call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), 'Address: delegate call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xdbca640e165333604a6121b07d206eea2b596dd3c3bb4d62caa436a05ac1d91d\",\"license\":\"MIT\"},\"contracts/core/libs/utils/Bitmap256Bit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/*\\n * The 256-bit bitmap is structured in 64 chuncks of 4 bits each.\\n * The 4 bits can encode any value from 0 to 15.\\n\\n chunck63 chunck2 chunck1 chunck0\\n bits bits bits bits \\n \\u250c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510 \\u250c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u252c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u252c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510\\n \\u2502 1 1 1 1 \\u2502 .... \\u2502 1 0 1 1 \\u2502 0 0 0 0 \\u2502 0 0 0 1 \\u2502\\n \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518 \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2534\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2534\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518\\n value 15 value 11 value 0 value 1\\n\\n * A chunck index must be between 0 and 63.\\n * A value must be between 0 and 15.\\n **/\\n\\nlibrary Bitmap256Bit {\\n uint256 constant MAX_INT = 2 ** 256 - 1;\\n\\n error IndexOutOfBounds(uint8 index);\\n error ValueOutOfBounds(uint8 value);\\n\\n /**\\n * @dev Return the value at a given index of a 256-bit bitmap\\n * @param index index where the value can be found. Can be between 0 and 63\\n */\\n function _get(uint256 self, uint8 index) internal pure returns (uint8) {\\n uint256 currentValues = self;\\n // Get the encoded 4-bit value by right shifting to the `index` position\\n uint256 shifted = currentValues >> (4 * index);\\n // Get the value by only masking the last 4 bits with an AND operator\\n return uint8(shifted & (2 ** 4 - 1));\\n }\\n\\n /**\\n * @dev Set a value at a chosen index in a 256-bit bitmap\\n * @param index index where the value will be stored. Can be between 0 and 63\\n * @param value value to store. Can be between 0 and 15\\n */\\n function _set(uint256 self, uint8 index, uint8 value) internal pure returns (uint256) {\\n _checkIndexIsValid(index);\\n _checkValueIsValid(value);\\n\\n uint256 currentValues = self;\\n // 1. first we need to remove the current value for the inputed `index`\\n // Left Shift 4 bits mask (1111 mask) to the `index` position\\n uint256 mask = (2 ** 4 - 1) << (4 * index);\\n // Apply a XOR operation to obtain a mask with all bits set to 1 except the 4 bits that we want to remove\\n uint256 negativeMask = MAX_INT ^ mask;\\n // Apply a AND operation between the current values and the negative mask to remove the wanted bits\\n uint256 newValues = currentValues & negativeMask;\\n\\n // 2. We set the new value wanted at the `index` position\\n // Create the 4 bits encoding the new value and left shift them to the `index` position\\n uint256 newValueMask = uint256(value) << (4 * index);\\n // Apply an OR operation between the current values and the newValueMask to reference new value\\n return newValues | newValueMask;\\n }\\n\\n /**\\n * @dev Get all the non-zero values in a 256-bit bitmap\\n * @param self a 256-bit bitmap\\n */\\n function _getAllNonZeroValues(\\n uint256 self\\n ) internal pure returns (uint8[] memory, uint8[] memory, uint8) {\\n uint8[] memory indices = new uint8[](64);\\n uint8[] memory values = new uint8[](64);\\n uint8 nbOfNonZeroValues = 0;\\n for (uint8 i = 0; i < 63; i++) {\\n uint8 value = _get(self, i);\\n if (value > 0) {\\n indices[nbOfNonZeroValues] = i;\\n values[nbOfNonZeroValues] = value;\\n nbOfNonZeroValues++;\\n }\\n }\\n return (indices, values, nbOfNonZeroValues);\\n }\\n\\n /**\\n * @dev Check if the index is valid (is between 0 and 63)\\n * @param index index of a chunck\\n */\\n function _checkIndexIsValid(uint8 index) internal pure {\\n if (index > 63) {\\n revert IndexOutOfBounds(index);\\n }\\n }\\n\\n /**\\n * @dev Check if the value is valid (is between 0 and 15)\\n * @param value value to encode in a chunck\\n */\\n function _checkValueIsValid(uint8 value) internal pure {\\n if (value > 15) {\\n revert ValueOutOfBounds(value);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xac6ca38e106fb9e999b0c765dba0f8894697c3aead9459ffeab6b32e3560b39e\",\"license\":\"MIT\"},\"contracts/core/libs/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2dba7215628ceb3bb6f28422c7ca48d79615dd7aa8ba54978d4d8cad996f57e\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60a06040523480156200001157600080fd5b506040516200393538038062003935833981016040819052620000349162000209565b6200003f336200006b565b6000805462ff0000191690556001600160a01b0381166080526200006382620000c8565b505062000241565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600390610100900460ff16158015620000eb575060005460ff8083169116105b620001535760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff83161761010017815562000181600054630100000090046001600160a01b031690565b6001600160a01b03161480620001965750303b155b15620001a757620001a7826200006b565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b80516001600160a01b03811681146200020457600080fd5b919050565b600080604083850312156200021d57600080fd5b6200022883620001ec565b91506200023860208401620001ec565b90509250929050565b6080516136d86200025d600039600061258301526136d86000f3fe608060405234801561001057600080fd5b50600436106102275760003560e01c80637ffe93fc11610130578063b8865673116100b8578063dc873d011161007c578063dc873d0114610566578063e78d54bb14610586578063e972f91014610599578063ebc5c093146105ac578063f2fde38b146105bf57600080fd5b8063b8865673146104e5578063c06d5db6146104f8578063c4d66de81461050b578063c7da9aa61461051e578063da5d314b1461055357600080fd5b806384c2ad82116100ff57806384c2ad821461044d5780638c3c9e321461046d5780638da5cb5b1461048e578063aad9a979146104bf578063b1cb1662146104d257600080fd5b80637ffe93fc1461040c578063811a6af71461041f57806381213f22146104325780638456cb591461044557600080fd5b8063436a76f3116101b35780636d7fbb67116101825780636d7fbb67146103a4578063715018a6146103c4578063754b377c146103cc5780637cc920b4146103e65780637cde0fe2146103f957600080fd5b8063436a76f31461033f5780635657f0361461035f5780635c975abb1461038057806364fff83c1461039157600080fd5b80631538ff08116101fa5780631538ff08146102db578063181dfdff146102ee5780632972b0f0146103015780633be1ced7146103145780633f4ba83a1461033757600080fd5b8063011023901461022c57806305b374211461025457806314067f8b1461026957806315027bda146102bb575b600080fd5b61023f61023a366004612932565b6105d2565b60405190151581526020015b60405180910390f35b61026761026236600461296f565b6105e9565b005b6102a6610277366004612932565b6000918252602080805260408084206001600160a01b0393909316845291905290206002015463ffffffff1690565b60405163ffffffff909116815260200161024b565b6102ce6102c9366004612a95565b610669565b60405161024b9190612be4565b6102676102e9366004612ca8565b61075a565b6102676102fc366004612dd2565b61080d565b61023f61030f366004612e45565b6108cd565b610327610322366004612932565b6108e0565b60405161024b9493929190612e61565b6102676109f6565b61035261034d366004612e9e565b610a32565b60405161024b9190612f22565b61037261036d366004612f35565b610ae0565b60405161024b929190612f4e565b60005462010000900460ff1661023f565b61026761039f366004612f9b565b610c65565b6103b76103b2366004612932565b610cd7565b60405161024b9190612fcf565b610267610d8f565b6103d4600381565b60405160ff909116815260200161024b565b6102676103f4366004612fe2565b610dcb565b61026761040736600461305f565b610ea2565b61026761041a366004613092565b610edf565b61026761042d3660046130f8565b610f54565b61023f610440366004612e9e565b611330565b61026761138a565b61046061045b366004612932565b6113c4565b60405161024b9190613163565b61048061047b366004612932565b6113f1565b60405190815260200161024b565b6104a7600054630100000090046001600160a01b031690565b6040516001600160a01b03909116815260200161024b565b6102676104cd36600461296f565b6113fd565b6102676104e0366004612ca8565b611471565b6102676104f3366004613176565b61151f565b6102676105063660046131b9565b6115b4565b6102676105193660046131f2565b6115f2565b6104a761052c366004612932565b6000918252602080805260408084206001600160a01b039384168552909152909120541690565b61023f61056136600461320d565b61170c565b610579610574366004612a95565b611733565b60405161024b9190613230565b610267610594366004613274565b6117f3565b6103d46105a736600461320d565b611867565b6102676105ba3660046132b0565b611888565b6102676105cd3660046131f2565b611ce0565b60006105de8383611d80565b151590505b92915050565b6000546001600160a01b0363010000009091041633146106245760405162461bcd60e51b815260040161061b906132f1565b60405180910390fd5b6106308260ff16611da9565b61063982611dd3565b61065b5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6106658282611dfc565b5050565b6060600083516001600160401b0381111561068657610686612999565b6040519080825280602002602001820160405280156106d757816020015b60408051608081018252600080825260208083018290529282015260608082015282526000199092019101816106a45790505b50905060005b8451811015610752576107228582815181106106fb576106fb613326565b602002602001015185838151811061071557610715613326565b6020026020010151611e5c565b82828151811061073457610734613326565b6020026020010181905250808061074a90613352565b9150506106dd565b509392505050565b6000546001600160a01b03630100000090910416331461078c5760405162461bcd60e51b815260040161061b906132f1565b80518251146107ae57604051636e37235160e11b815260040160405180910390fd5b60005b8251811015610808576107f68382815181106107cf576107cf613326565b60200260200101518383815181106107e9576107e9613326565b60200260200101516105e9565b8061080081613352565b9150506107b1565b505050565b6000546001600160a01b03630100000090910416331461083f5760405162461bcd60e51b815260040161061b906132f1565b60005b81518110156108c7576108b5848284848151811061086257610862613326565b6020026020010151610874919061336b565b85848151811061088657610886613326565b6020026020010151600001518685815181106108a4576108a4613326565b602002602001015160200151611f6b565b806108bf81613352565b915050610842565b50505050565b60006108d9838361220a565b9392505050565b6000828152602080805260408083206001600160a01b038086168552908352818420825160808101845281549092168252600181015493820193909352600283015463ffffffff1691810191909152600382018054849384936060938593919291838601919061094f90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461097b90613382565b80156109c85780601f1061099d576101008083540402835291602001916109c8565b820191906000526020600020905b8154815290600101906020018083116109ab57829003601f168201915b505050919092525050815160208301516040840151606090940151919b909a50929850965090945050505050565b6000546001600160a01b036301000000909104163314610a285760405162461bcd60e51b815260040161061b906132f1565b610a3061222c565b565b6060600082516001600160401b03811115610a4f57610a4f612999565b604051908082528060200260200182016040528015610a78578160200160208202803683370190505b50905060005b835181101561075257610aaa85858381518110610a9d57610a9d613326565b6020026020010151611867565b828281518110610abc57610abc613326565b60ff9092166020928302919091019091015280610ad881613352565b915050610a7e565b6000818152601160205260408120546060918291908080610b00846122c7565b92509250925060008160ff166001600160401b03811115610b2357610b23612999565b604051908082528060200260200182016040528015610b4c578160200160208202803683370190505b50905060008260ff166001600160401b03811115610b6c57610b6c612999565b604051908082528060200260200182016040528015610b95578160200160208202803683370190505b50905060005b8360ff168160ff161015610c565760126000878360ff1681518110610bc257610bc2613326565b602002602001015160ff1660ff16815260200190815260200160002054838260ff1681518110610bf457610bf4613326565b602002602001018181525050848160ff1681518110610c1557610c15613326565b6020026020010151828260ff1681518110610c3257610c32613326565b60ff9092166020928302919091019091015280610c4e816133bc565b915050610b9b565b50909890975095505050505050565b6000546001600160a01b036301000000909104163314610c975760405162461bcd60e51b815260040161061b906132f1565b60005b815181101561066557610cc5828281518110610cb857610cb8613326565b6020026020010151610edf565b80610ccf81613352565b915050610c9a565b6000828152602080805260408083206001600160a01b03851684529091529020600301805460609190610d0990613382565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3590613382565b8015610d825780601f10610d5757610100808354040283529160200191610d82565b820191906000526020600020905b815481529060010190602001808311610d6557829003601f168201915b5050505050905092915050565b6000546001600160a01b036301000000909104163314610dc15760405162461bcd60e51b815260040161061b906132f1565b610a3060006123bc565b6000546001600160a01b036301000000909104163314610dfd5760405162461bcd60e51b815260040161061b906132f1565b81518351141580610e1057508051835114155b15610e2e57604051636e37235160e11b815260040160405180910390fd5b60005b83518110156108c757610e90848281518110610e4f57610e4f613326565b6020026020010151848381518110610e6957610e69613326565b6020026020010151848481518110610e8357610e83613326565b60200260200101516117f3565b80610e9a81613352565b915050610e31565b6000546001600160a01b036301000000909104163314610ed45760405162461bcd60e51b815260040161061b906132f1565b610808838383612419565b6000546001600160a01b036301000000909104163314610f115760405162461bcd60e51b815260040161061b906132f1565b610f1d8160ff16611da9565b610f2681611dd3565b610f485760405163eabeadd360e01b815260ff8216600482015260240161061b565b610f51816124ac565b50565b60005462010000900460ff1615610f7d5760405162461bcd60e51b815260040161061b906133db565b828114610fa55783838383604051638ceb003d60e01b815260040161061b9493929190613405565b3360005b8481101561132857600060206000868685818110610fc957610fc9613326565b9050602002013581526020019081526020016000206000888885818110610ff257610ff2613326565b905060200201602081019061100791906131f2565b6001600160a01b0390811682526020808301939093526040918201600020825160808101845281549092168252600181015493820193909352600283015463ffffffff169181019190915260038201805491929160608401919061106a90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461109690613382565b80156110e35780601f106110b8576101008083540402835291602001916110e3565b820191906000526020600020905b8154815290600101906020018083116110c657829003601f168201915b50505050508152505090506111108386868581811061110457611104613326565b9050602002013561220a565b61115a578285858481811061112757611127613326565b60405163c522f21160e01b81526001600160a01b039094166004850152602002919091013560248301525060440161061b565b6020600086868581811061117057611170613326565b905060200201358152602001908152602001600020600088888581811061119957611199613326565b90506020020160208101906111ae91906131f2565b6001600160a01b031681526020810191909152604001600090812080546001600160a01b03191681556001810182905560028101805463ffffffff19169055906111fb6003830182612843565b505061124c85858481811061121257611212613326565b9050602002013588888581811061122b5761122b613326565b905060200201602081019061124091906131f2565b836020015160006124fb565b7f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b6040518060c0016040528087878681811061128a5761128a613326565b9050602002013581526020018989868181106112a8576112a8613326565b90506020020160208101906112bd91906131f2565b6001600160a01b0316815260200183600001516001600160a01b0316815260200183602001518152602001836040015163ffffffff168152602001836060015181525060405161130d9190613487565b60405180910390a1508061132081613352565b915050610fa9565b505050505050565b6000805b8251811015611380576113608484838151811061135357611353613326565b602002602001015161170c565b61136e5760009150506105e3565b8061137881613352565b915050611334565b5060019392505050565b6000546001600160a01b0363010000009091041633146113bc5760405162461bcd60e51b815260040161061b906132f1565b610a306125ec565b60408051608081018252600080825260208201819052918101919091526060808201526108d98383611e5c565b60006108d98383611d80565b6000546001600160a01b03630100000090910416331461142f5760405162461bcd60e51b815260040161061b906132f1565b61143b8260ff16611da9565b61144482611dd3565b1561146757604051635d04d75160e01b815260ff8316600482015260240161061b565b610665828261264e565b6000546001600160a01b0363010000009091041633146114a35760405162461bcd60e51b815260040161061b906132f1565b80518251146114c557604051636e37235160e11b815260040160405180910390fd5b60005b82518110156108085761150d8382815181106114e6576114e6613326565b602002602001015183838151811061150057611500613326565b60200260200101516113fd565b8061151781613352565b9150506114c8565b6000546001600160a01b0363010000009091041633146115515760405162461bcd60e51b815260040161061b906132f1565b60005b8151811015610808576115a28383838151811061157357611573613326565b60200260200101516000015184848151811061159157611591613326565b602002602001015160200151612419565b806115ac81613352565b915050611554565b6000546001600160a01b0363010000009091041633146115e65760405162461bcd60e51b815260040161061b906132f1565b6108c784848484611f6b565b600054600390610100900460ff16158015611614575060005460ff8083169116105b6116775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161061b565b6000805461ffff191660ff8316176101001781556116a4600054630100000090046001600160a01b031690565b6001600160a01b031614806116b85750303b155b156116c6576116c6826123bc565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60008281526011602052604081205460006117278285612699565b60ff1611949350505050565b6060600083516001600160401b0381111561175057611750612999565b604051908082528060200260200182016040528015611779578160200160208202803683370190505b50905060005b8451811015610752576117c485828151811061179d5761179d613326565b60200260200101518583815181106117b7576117b7613326565b6020026020010151611d80565b8282815181106117d6576117d6613326565b6020908102919091010152806117eb81613352565b91505061177f565b6000546001600160a01b0363010000009091041633146118255760405162461bcd60e51b815260040161061b906132f1565b6118318260ff16611da9565b61183a82611dd3565b61185c5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6108088383836126be565b6000828152601160205260408120546118808184612699565b949350505050565b60005462010000900460ff16156118b15760405162461bcd60e51b815260040161061b906133db565b3360005b828110156108c7576118eb828585848181106118d3576118d3613326565b90506020028101906118e591906134e8565b3561220a565b61193f578184848381811061190257611902613326565b905060200281019061191491906134e8565b60405163c522f21160e01b81526001600160a01b03909216600483015235602482015260440161061b565b60006020600086868581811061195757611957613326565b905060200281019061196991906134e8565b600001358152602001908152602001600020600086868581811061198f5761198f613326565b90506020028101906119a191906134e8565b6119b29060408101906020016131f2565b6001600160a01b03166001600160a01b0316815260200190815260200160002060010154905060405180608001604052808686858181106119f5576119f5613326565b9050602002810190611a0791906134e8565b611a189060608101906040016131f2565b6001600160a01b03168152602001868685818110611a3857611a38613326565b9050602002810190611a4a91906134e8565b606001358152602001868685818110611a6557611a65613326565b9050602002810190611a7791906134e8565b611a889060a081019060800161351c565b63ffffffff168152602001868685818110611aa557611aa5613326565b9050602002810190611ab791906134e8565b611ac59060a0810190613537565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250602092508890508786818110611b1257611b12613326565b9050602002810190611b2491906134e8565b6000013581526020019081526020016000206000878786818110611b4a57611b4a613326565b9050602002810190611b5c91906134e8565b611b6d9060408101906020016131f2565b6001600160a01b0390811682526020808301939093526040918201600020845181546001600160a01b03191692169190911781558383015160018201559083015160028201805463ffffffff191663ffffffff909216919091179055606083015180519192611be49260038501929091019061287d565b50905050611c73858584818110611bfd57611bfd613326565b9050602002810190611c0f91906134e8565b35868685818110611c2257611c22613326565b9050602002810190611c3491906134e8565b611c459060408101906020016131f2565b83888887818110611c5857611c58613326565b9050602002810190611c6a91906134e8565b606001356124fb565b7f8c20c3acb6b5208b7affea2fd90dabc8d47e77cee9766c855ce42730505cb205858584818110611ca657611ca6613326565b9050602002810190611cb891906134e8565b604051611cc591906135a6565b60405180910390a15080611cd881613352565b9150506118b5565b6000546001600160a01b036301000000909104163314611d125760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b038116611d775760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061b565b610f51816123bc565b6000918252602080805260408084206001600160a01b0393909316845291905290206001015490565b603f8160ff161115610f515760405163453e14b960e01b815260ff8216600482015260240161061b565b60ff81166000908152601260205260408120548103611df457506000919050565b506001919050565b60ff82166000818152601260209081526040918290208054908590558251938452908301849052908201819052907f0d3d8d66bac9b2a9f0e5c83181a30443294ab849472526080d03fffd7187f7169060600160405180910390a1505050565b60408051608081018252600080825260208201819052918101919091526060808201526000838152602080805260408083206001600160a01b03808716855290835292819020815160808101835281549094168452600181015492840192909252600282015463ffffffff1690830152600381018054606084019190611ee190613382565b80601f0160208091040260200160405190810160405280929190818152602001828054611f0d90613382565b8015611f5a5780601f10611f2f57610100808354040283529160200191611f5a565b820191906000526020600020905b815481529060010190602001808311611f3d57829003601f168201915b505050505081525050905092915050565b6000546001600160a01b036301000000909104163314611f9d5760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b0384166000908152601060205260409020548310611fff576001600160a01b038416600081815260106020526040908190205490516345e388eb60e01b8152600481019290925260248201526044810184905260640161061b565b6001600160a01b038416600090815260106020526040812080548590811061202957612029613326565b600091825260208083206002909202909101546001600160a01b03881683526010909152604082208054919350908690811061206757612067613326565b9060005260206000209060020201600101549050818414158061208a5750808314155b156120d657604051637a4dd76560e01b81526001600160a01b03871660048201526024810186905260448101839052606481018290526084810185905260a4810184905260c40161061b565b6001600160a01b038616600090815260106020526040902080546120fc9060019061336b565b8154811061210c5761210c613326565b906000526020600020906002020160106000886001600160a01b03166001600160a01b03168152602001908152602001600020868154811061215057612150613326565b60009182526020808320845460029093020191825560019384015493909101929092556001600160a01b038816815260109091526040902080548061219757612197613663565b6000828152602080822060026000199490940193840201828155600101919091559155604080516001600160a01b038916815291820186905281018490527f33cff58e54c3a8acae85cad63487b5dcf617521e33bb03f071299f374c29de1f9060600160405180910390a1505050505050565b6001600160a01b03821660009081526010602052604081206108d99083612732565b60005462010000900460ff1661227b5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161061b565b6000805462ff0000191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60408051818152610820810182526060918291600091829190602082016108008036833750506040805181815261082081018252929350600092915060208201610800803683370190505090506000805b603f8160ff1610156123ae5760006123308983612699565b905060ff81161561239b5781858460ff168151811061235157612351613326565b602002602001019060ff16908160ff168152505080848460ff168151811061237b5761237b613326565b60ff9092166020928302919091019091015282612397816133bc565b9350505b50806123a6816133bc565b915050612318565b509196909550909350915050565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60408051808201825283815260208082018481526001600160a01b03871660008181526010845285812080546001808201835591835291859020865160029093020191825592519201919091558351908152908101859052918201839052907fe7d6ac0b740347f7f96a97e6a9dc0f20f4f11eca65495315adc009a55b6762f8906060015b60405180910390a150505050565b60ff811660008181526012602090815260408083208054939055805193845290830182905290917feb82955a27e39ea7559b6ec7e7d8b371081ab0d8783c7b0d01597555e7dcadbf9101611700565b8181113060008261250c578561250f565b60005b905060008361251f576000612521565b865b905060008461253957612534868861336b565b612543565b612543878761336b565b604051633885984b60e11b81526001600160a01b03868116600483015285811660248301528481166044830152606482018c9052608482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063710b30969060a401600060405180830381600087803b1580156125c957600080fd5b505af11580156125dd573d6000803e3d6000fd5b50505050505050505050505050565b60005462010000900460ff16156126155760405162461bcd60e51b815260040161061b906133db565b6000805462ff00001916620100001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122aa3390565b60ff8216600081815260126020908152604091829020849055815192835282018390527f16f0bfe4b02efd5423ef8906906b049c0943f21df8f10347d319fddbc59222079101611700565b600082816126a8846004613679565b60ff1682901c905080600f169250505092915050565b6000838152601160205260409020546126d88184846127c0565b6000858152601160205260409081902091909155517f393b86c90799fa411201ae723a54e105823fcf7c6c8dffa90903fc44c03b4ac79061249e9086908690869092835260ff918216602084015216604082015260600190565b6000805b83548110156127b65783818154811061275157612751613326565b9060005260206000209060020201600001548310158015612795575083818154811061277f5761277f613326565b9060005260206000209060020201600101548311155b156127a45760019150506105e3565b806127ae81613352565b915050612736565b5060009392505050565b60006127cb83611da9565b6127d482612819565b8360006127e2856004613679565b600f60ff919091161b905060001981188281166000612802886004613679565b60ff97881697169690961b17979650505050505050565b600f8160ff161115610f51576040516329afd27b60e21b815260ff8216600482015260240161061b565b50805461284f90613382565b6000825580601f1061285f575050565b601f016020900490600052602060002090810190610f519190612901565b82805461288990613382565b90600052602060002090601f0160209004810192826128ab57600085556128f1565b82601f106128c457805160ff19168380011785556128f1565b828001600101855582156128f1579182015b828111156128f15782518255916020019190600101906128d6565b506128fd929150612901565b5090565b5b808211156128fd5760008155600101612902565b80356001600160a01b038116811461292d57600080fd5b919050565b6000806040838503121561294557600080fd5b8235915061295560208401612916565b90509250929050565b803560ff8116811461292d57600080fd5b6000806040838503121561298257600080fd5b61298b8361295e565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156129d1576129d1612999565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129ff576129ff612999565b604052919050565b60006001600160401b03821115612a2057612a20612999565b5060051b60200190565b600082601f830112612a3b57600080fd5b81356020612a50612a4b83612a07565b6129d7565b82815260059290921b84018101918181019086841115612a6f57600080fd5b8286015b84811015612a8a5780358352918301918301612a73565b509695505050505050565b60008060408385031215612aa857600080fd5b82356001600160401b0380821115612abf57600080fd5b612acb86838701612a2a565b9350602091508185013581811115612ae257600080fd5b85019050601f81018613612af557600080fd5b8035612b03612a4b82612a07565b81815260059190911b82018301908381019088831115612b2257600080fd5b928401925b82841015612b4757612b3884612916565b82529284019290840190612b27565b80955050505050509250929050565b6000815180845260005b81811015612b7c57602081850181015186830182015201612b60565b81811115612b8e576000602083870101525b50601f01601f19169290920160200192915050565b60018060a01b0381511682526020810151602083015263ffffffff604082015116604083015260006060820151608060608501526118806080850182612b56565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612c3957603f19888603018452612c27858351612ba3565b94509285019290850190600101612c0b565b5092979650505050505050565b600082601f830112612c5757600080fd5b81356020612c67612a4b83612a07565b82815260059290921b84018101918181019086841115612c8657600080fd5b8286015b84811015612a8a57612c9b8161295e565b8352918301918301612c8a565b60008060408385031215612cbb57600080fd5b82356001600160401b0380821115612cd257600080fd5b612cde86838701612c46565b9350602091508185013581811115612cf557600080fd5b85019050601f81018613612d0857600080fd5b8035612d16612a4b82612a07565b81815260059190911b82018301908381019088831115612d3557600080fd5b928401925b82841015612b4757833582529284019290840190612d3a565b600082601f830112612d6457600080fd5b81356020612d74612a4b83612a07565b82815260069290921b84018101918181019086841115612d9357600080fd5b8286015b84811015612a8a5760408189031215612db05760008081fd5b612db86129af565b813581528482013585820152835291830191604001612d97565b600080600060608486031215612de757600080fd5b612df084612916565b925060208401356001600160401b0380821115612e0c57600080fd5b612e1887838801612d53565b93506040860135915080821115612e2e57600080fd5b50612e3b86828701612a2a565b9150509250925092565b60008060408385031215612e5857600080fd5b61298b83612916565b60018060a01b038516815283602082015263ffffffff83166040820152608060608201526000612e946080830184612b56565b9695505050505050565b60008060408385031215612eb157600080fd5b8235915060208301356001600160401b03811115612ece57600080fd5b612eda85828601612c46565b9150509250929050565b600081518084526020808501945080840160005b83811015612f1757815160ff1687529582019590820190600101612ef8565b509495945050505050565b6020815260006108d96020830184612ee4565b600060208284031215612f4757600080fd5b5035919050565b604080825283519082018190526000906020906060840190828701845b82811015612f8757815184529284019290840190600101612f6b565b50505083810382850152612e948186612ee4565b600060208284031215612fad57600080fd5b81356001600160401b03811115612fc357600080fd5b61188084828501612c46565b6020815260006108d96020830184612b56565b600080600060608486031215612ff757600080fd5b83356001600160401b038082111561300e57600080fd5b61301a87838801612a2a565b9450602086013591508082111561303057600080fd5b61303c87838801612c46565b9350604086013591508082111561305257600080fd5b50612e3b86828701612c46565b60008060006060848603121561307457600080fd5b61307d84612916565b95602085013595506040909401359392505050565b6000602082840312156130a457600080fd5b6108d98261295e565b60008083601f8401126130bf57600080fd5b5081356001600160401b038111156130d657600080fd5b6020830191508360208260051b85010111156130f157600080fd5b9250929050565b6000806000806040858703121561310e57600080fd5b84356001600160401b038082111561312557600080fd5b613131888389016130ad565b9096509450602087013591508082111561314a57600080fd5b50613157878288016130ad565b95989497509550505050565b6020815260006108d96020830184612ba3565b6000806040838503121561318957600080fd5b61319283612916565b915060208301356001600160401b038111156131ad57600080fd5b612eda85828601612d53565b600080600080608085870312156131cf57600080fd5b6131d885612916565b966020860135965060408601359560600135945092505050565b60006020828403121561320457600080fd5b6108d982612916565b6000806040838503121561322057600080fd5b823591506129556020840161295e565b6020808252825182820181905260009190848201906040850190845b818110156132685783518352928401929184019160010161324c565b50909695505050505050565b60008060006060848603121561328957600080fd5b833592506132996020850161295e565b91506132a76040850161295e565b90509250925092565b600080602083850312156132c357600080fd5b82356001600160401b038111156132d957600080fd5b6132e5858286016130ad565b90969095509350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016133645761336461333c565b5060010190565b60008282101561337d5761337d61333c565b500390565b600181811c9082168061339657607f821691505b6020821081036133b657634e487b7160e01b600052602260045260246000fd5b50919050565b600060ff821660ff81036133d2576133d261333c565b60010192915050565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6040808252810184905260008560608301825b87811015613446576001600160a01b0361343184612916565b16825260209283019290910190600101613418565b5083810360208501528481526001600160fb1b0385111561346657600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b60208152815160208201526000602083015160018060a01b03808216604085015280604086015116606085015250506060830151608083015263ffffffff60808401511660a083015260a083015160c08084015261188060e0840182612b56565b6000823560be198336030181126134fe57600080fd5b9190910192915050565b803563ffffffff8116811461292d57600080fd5b60006020828403121561352e57600080fd5b6108d982613508565b6000808335601e1984360301811261354e57600080fd5b8301803591506001600160401b0382111561356857600080fd5b6020019150368190038213156130f157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b602081528135602082015260006135bf60208401612916565b60018060a01b038082166040850152806135db60408701612916565b16606085015250506060830135608083015263ffffffff6135fe60808501613508565b1660a083015260a0830135601e1984360301811261361b57600080fd5b83016020810190356001600160401b0381111561363757600080fd5b80360382131561364657600080fd5b60c08085015261365a60e08501828461357d565b95945050505050565b634e487b7160e01b600052603160045260246000fd5b600060ff821660ff84168160ff048111821515161561369a5761369a61333c565b02939250505056fea26469706673582212209714c1001d19740a655ea4426b52e9f5d8348f9df38d027a88d1f1095e244e9464736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102275760003560e01c80637ffe93fc11610130578063b8865673116100b8578063dc873d011161007c578063dc873d0114610566578063e78d54bb14610586578063e972f91014610599578063ebc5c093146105ac578063f2fde38b146105bf57600080fd5b8063b8865673146104e5578063c06d5db6146104f8578063c4d66de81461050b578063c7da9aa61461051e578063da5d314b1461055357600080fd5b806384c2ad82116100ff57806384c2ad821461044d5780638c3c9e321461046d5780638da5cb5b1461048e578063aad9a979146104bf578063b1cb1662146104d257600080fd5b80637ffe93fc1461040c578063811a6af71461041f57806381213f22146104325780638456cb591461044557600080fd5b8063436a76f3116101b35780636d7fbb67116101825780636d7fbb67146103a4578063715018a6146103c4578063754b377c146103cc5780637cc920b4146103e65780637cde0fe2146103f957600080fd5b8063436a76f31461033f5780635657f0361461035f5780635c975abb1461038057806364fff83c1461039157600080fd5b80631538ff08116101fa5780631538ff08146102db578063181dfdff146102ee5780632972b0f0146103015780633be1ced7146103145780633f4ba83a1461033757600080fd5b8063011023901461022c57806305b374211461025457806314067f8b1461026957806315027bda146102bb575b600080fd5b61023f61023a366004612932565b6105d2565b60405190151581526020015b60405180910390f35b61026761026236600461296f565b6105e9565b005b6102a6610277366004612932565b6000918252602080805260408084206001600160a01b0393909316845291905290206002015463ffffffff1690565b60405163ffffffff909116815260200161024b565b6102ce6102c9366004612a95565b610669565b60405161024b9190612be4565b6102676102e9366004612ca8565b61075a565b6102676102fc366004612dd2565b61080d565b61023f61030f366004612e45565b6108cd565b610327610322366004612932565b6108e0565b60405161024b9493929190612e61565b6102676109f6565b61035261034d366004612e9e565b610a32565b60405161024b9190612f22565b61037261036d366004612f35565b610ae0565b60405161024b929190612f4e565b60005462010000900460ff1661023f565b61026761039f366004612f9b565b610c65565b6103b76103b2366004612932565b610cd7565b60405161024b9190612fcf565b610267610d8f565b6103d4600381565b60405160ff909116815260200161024b565b6102676103f4366004612fe2565b610dcb565b61026761040736600461305f565b610ea2565b61026761041a366004613092565b610edf565b61026761042d3660046130f8565b610f54565b61023f610440366004612e9e565b611330565b61026761138a565b61046061045b366004612932565b6113c4565b60405161024b9190613163565b61048061047b366004612932565b6113f1565b60405190815260200161024b565b6104a7600054630100000090046001600160a01b031690565b6040516001600160a01b03909116815260200161024b565b6102676104cd36600461296f565b6113fd565b6102676104e0366004612ca8565b611471565b6102676104f3366004613176565b61151f565b6102676105063660046131b9565b6115b4565b6102676105193660046131f2565b6115f2565b6104a761052c366004612932565b6000918252602080805260408084206001600160a01b039384168552909152909120541690565b61023f61056136600461320d565b61170c565b610579610574366004612a95565b611733565b60405161024b9190613230565b610267610594366004613274565b6117f3565b6103d46105a736600461320d565b611867565b6102676105ba3660046132b0565b611888565b6102676105cd3660046131f2565b611ce0565b60006105de8383611d80565b151590505b92915050565b6000546001600160a01b0363010000009091041633146106245760405162461bcd60e51b815260040161061b906132f1565b60405180910390fd5b6106308260ff16611da9565b61063982611dd3565b61065b5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6106658282611dfc565b5050565b6060600083516001600160401b0381111561068657610686612999565b6040519080825280602002602001820160405280156106d757816020015b60408051608081018252600080825260208083018290529282015260608082015282526000199092019101816106a45790505b50905060005b8451811015610752576107228582815181106106fb576106fb613326565b602002602001015185838151811061071557610715613326565b6020026020010151611e5c565b82828151811061073457610734613326565b6020026020010181905250808061074a90613352565b9150506106dd565b509392505050565b6000546001600160a01b03630100000090910416331461078c5760405162461bcd60e51b815260040161061b906132f1565b80518251146107ae57604051636e37235160e11b815260040160405180910390fd5b60005b8251811015610808576107f68382815181106107cf576107cf613326565b60200260200101518383815181106107e9576107e9613326565b60200260200101516105e9565b8061080081613352565b9150506107b1565b505050565b6000546001600160a01b03630100000090910416331461083f5760405162461bcd60e51b815260040161061b906132f1565b60005b81518110156108c7576108b5848284848151811061086257610862613326565b6020026020010151610874919061336b565b85848151811061088657610886613326565b6020026020010151600001518685815181106108a4576108a4613326565b602002602001015160200151611f6b565b806108bf81613352565b915050610842565b50505050565b60006108d9838361220a565b9392505050565b6000828152602080805260408083206001600160a01b038086168552908352818420825160808101845281549092168252600181015493820193909352600283015463ffffffff1691810191909152600382018054849384936060938593919291838601919061094f90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461097b90613382565b80156109c85780601f1061099d576101008083540402835291602001916109c8565b820191906000526020600020905b8154815290600101906020018083116109ab57829003601f168201915b505050919092525050815160208301516040840151606090940151919b909a50929850965090945050505050565b6000546001600160a01b036301000000909104163314610a285760405162461bcd60e51b815260040161061b906132f1565b610a3061222c565b565b6060600082516001600160401b03811115610a4f57610a4f612999565b604051908082528060200260200182016040528015610a78578160200160208202803683370190505b50905060005b835181101561075257610aaa85858381518110610a9d57610a9d613326565b6020026020010151611867565b828281518110610abc57610abc613326565b60ff9092166020928302919091019091015280610ad881613352565b915050610a7e565b6000818152601160205260408120546060918291908080610b00846122c7565b92509250925060008160ff166001600160401b03811115610b2357610b23612999565b604051908082528060200260200182016040528015610b4c578160200160208202803683370190505b50905060008260ff166001600160401b03811115610b6c57610b6c612999565b604051908082528060200260200182016040528015610b95578160200160208202803683370190505b50905060005b8360ff168160ff161015610c565760126000878360ff1681518110610bc257610bc2613326565b602002602001015160ff1660ff16815260200190815260200160002054838260ff1681518110610bf457610bf4613326565b602002602001018181525050848160ff1681518110610c1557610c15613326565b6020026020010151828260ff1681518110610c3257610c32613326565b60ff9092166020928302919091019091015280610c4e816133bc565b915050610b9b565b50909890975095505050505050565b6000546001600160a01b036301000000909104163314610c975760405162461bcd60e51b815260040161061b906132f1565b60005b815181101561066557610cc5828281518110610cb857610cb8613326565b6020026020010151610edf565b80610ccf81613352565b915050610c9a565b6000828152602080805260408083206001600160a01b03851684529091529020600301805460609190610d0990613382565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3590613382565b8015610d825780601f10610d5757610100808354040283529160200191610d82565b820191906000526020600020905b815481529060010190602001808311610d6557829003601f168201915b5050505050905092915050565b6000546001600160a01b036301000000909104163314610dc15760405162461bcd60e51b815260040161061b906132f1565b610a3060006123bc565b6000546001600160a01b036301000000909104163314610dfd5760405162461bcd60e51b815260040161061b906132f1565b81518351141580610e1057508051835114155b15610e2e57604051636e37235160e11b815260040160405180910390fd5b60005b83518110156108c757610e90848281518110610e4f57610e4f613326565b6020026020010151848381518110610e6957610e69613326565b6020026020010151848481518110610e8357610e83613326565b60200260200101516117f3565b80610e9a81613352565b915050610e31565b6000546001600160a01b036301000000909104163314610ed45760405162461bcd60e51b815260040161061b906132f1565b610808838383612419565b6000546001600160a01b036301000000909104163314610f115760405162461bcd60e51b815260040161061b906132f1565b610f1d8160ff16611da9565b610f2681611dd3565b610f485760405163eabeadd360e01b815260ff8216600482015260240161061b565b610f51816124ac565b50565b60005462010000900460ff1615610f7d5760405162461bcd60e51b815260040161061b906133db565b828114610fa55783838383604051638ceb003d60e01b815260040161061b9493929190613405565b3360005b8481101561132857600060206000868685818110610fc957610fc9613326565b9050602002013581526020019081526020016000206000888885818110610ff257610ff2613326565b905060200201602081019061100791906131f2565b6001600160a01b0390811682526020808301939093526040918201600020825160808101845281549092168252600181015493820193909352600283015463ffffffff169181019190915260038201805491929160608401919061106a90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461109690613382565b80156110e35780601f106110b8576101008083540402835291602001916110e3565b820191906000526020600020905b8154815290600101906020018083116110c657829003601f168201915b50505050508152505090506111108386868581811061110457611104613326565b9050602002013561220a565b61115a578285858481811061112757611127613326565b60405163c522f21160e01b81526001600160a01b039094166004850152602002919091013560248301525060440161061b565b6020600086868581811061117057611170613326565b905060200201358152602001908152602001600020600088888581811061119957611199613326565b90506020020160208101906111ae91906131f2565b6001600160a01b031681526020810191909152604001600090812080546001600160a01b03191681556001810182905560028101805463ffffffff19169055906111fb6003830182612843565b505061124c85858481811061121257611212613326565b9050602002013588888581811061122b5761122b613326565b905060200201602081019061124091906131f2565b836020015160006124fb565b7f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b6040518060c0016040528087878681811061128a5761128a613326565b9050602002013581526020018989868181106112a8576112a8613326565b90506020020160208101906112bd91906131f2565b6001600160a01b0316815260200183600001516001600160a01b0316815260200183602001518152602001836040015163ffffffff168152602001836060015181525060405161130d9190613487565b60405180910390a1508061132081613352565b915050610fa9565b505050505050565b6000805b8251811015611380576113608484838151811061135357611353613326565b602002602001015161170c565b61136e5760009150506105e3565b8061137881613352565b915050611334565b5060019392505050565b6000546001600160a01b0363010000009091041633146113bc5760405162461bcd60e51b815260040161061b906132f1565b610a306125ec565b60408051608081018252600080825260208201819052918101919091526060808201526108d98383611e5c565b60006108d98383611d80565b6000546001600160a01b03630100000090910416331461142f5760405162461bcd60e51b815260040161061b906132f1565b61143b8260ff16611da9565b61144482611dd3565b1561146757604051635d04d75160e01b815260ff8316600482015260240161061b565b610665828261264e565b6000546001600160a01b0363010000009091041633146114a35760405162461bcd60e51b815260040161061b906132f1565b80518251146114c557604051636e37235160e11b815260040160405180910390fd5b60005b82518110156108085761150d8382815181106114e6576114e6613326565b602002602001015183838151811061150057611500613326565b60200260200101516113fd565b8061151781613352565b9150506114c8565b6000546001600160a01b0363010000009091041633146115515760405162461bcd60e51b815260040161061b906132f1565b60005b8151811015610808576115a28383838151811061157357611573613326565b60200260200101516000015184848151811061159157611591613326565b602002602001015160200151612419565b806115ac81613352565b915050611554565b6000546001600160a01b0363010000009091041633146115e65760405162461bcd60e51b815260040161061b906132f1565b6108c784848484611f6b565b600054600390610100900460ff16158015611614575060005460ff8083169116105b6116775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161061b565b6000805461ffff191660ff8316176101001781556116a4600054630100000090046001600160a01b031690565b6001600160a01b031614806116b85750303b155b156116c6576116c6826123bc565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60008281526011602052604081205460006117278285612699565b60ff1611949350505050565b6060600083516001600160401b0381111561175057611750612999565b604051908082528060200260200182016040528015611779578160200160208202803683370190505b50905060005b8451811015610752576117c485828151811061179d5761179d613326565b60200260200101518583815181106117b7576117b7613326565b6020026020010151611d80565b8282815181106117d6576117d6613326565b6020908102919091010152806117eb81613352565b91505061177f565b6000546001600160a01b0363010000009091041633146118255760405162461bcd60e51b815260040161061b906132f1565b6118318260ff16611da9565b61183a82611dd3565b61185c5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6108088383836126be565b6000828152601160205260408120546118808184612699565b949350505050565b60005462010000900460ff16156118b15760405162461bcd60e51b815260040161061b906133db565b3360005b828110156108c7576118eb828585848181106118d3576118d3613326565b90506020028101906118e591906134e8565b3561220a565b61193f578184848381811061190257611902613326565b905060200281019061191491906134e8565b60405163c522f21160e01b81526001600160a01b03909216600483015235602482015260440161061b565b60006020600086868581811061195757611957613326565b905060200281019061196991906134e8565b600001358152602001908152602001600020600086868581811061198f5761198f613326565b90506020028101906119a191906134e8565b6119b29060408101906020016131f2565b6001600160a01b03166001600160a01b0316815260200190815260200160002060010154905060405180608001604052808686858181106119f5576119f5613326565b9050602002810190611a0791906134e8565b611a189060608101906040016131f2565b6001600160a01b03168152602001868685818110611a3857611a38613326565b9050602002810190611a4a91906134e8565b606001358152602001868685818110611a6557611a65613326565b9050602002810190611a7791906134e8565b611a889060a081019060800161351c565b63ffffffff168152602001868685818110611aa557611aa5613326565b9050602002810190611ab791906134e8565b611ac59060a0810190613537565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250602092508890508786818110611b1257611b12613326565b9050602002810190611b2491906134e8565b6000013581526020019081526020016000206000878786818110611b4a57611b4a613326565b9050602002810190611b5c91906134e8565b611b6d9060408101906020016131f2565b6001600160a01b0390811682526020808301939093526040918201600020845181546001600160a01b03191692169190911781558383015160018201559083015160028201805463ffffffff191663ffffffff909216919091179055606083015180519192611be49260038501929091019061287d565b50905050611c73858584818110611bfd57611bfd613326565b9050602002810190611c0f91906134e8565b35868685818110611c2257611c22613326565b9050602002810190611c3491906134e8565b611c459060408101906020016131f2565b83888887818110611c5857611c58613326565b9050602002810190611c6a91906134e8565b606001356124fb565b7f8c20c3acb6b5208b7affea2fd90dabc8d47e77cee9766c855ce42730505cb205858584818110611ca657611ca6613326565b9050602002810190611cb891906134e8565b604051611cc591906135a6565b60405180910390a15080611cd881613352565b9150506118b5565b6000546001600160a01b036301000000909104163314611d125760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b038116611d775760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061b565b610f51816123bc565b6000918252602080805260408084206001600160a01b0393909316845291905290206001015490565b603f8160ff161115610f515760405163453e14b960e01b815260ff8216600482015260240161061b565b60ff81166000908152601260205260408120548103611df457506000919050565b506001919050565b60ff82166000818152601260209081526040918290208054908590558251938452908301849052908201819052907f0d3d8d66bac9b2a9f0e5c83181a30443294ab849472526080d03fffd7187f7169060600160405180910390a1505050565b60408051608081018252600080825260208201819052918101919091526060808201526000838152602080805260408083206001600160a01b03808716855290835292819020815160808101835281549094168452600181015492840192909252600282015463ffffffff1690830152600381018054606084019190611ee190613382565b80601f0160208091040260200160405190810160405280929190818152602001828054611f0d90613382565b8015611f5a5780601f10611f2f57610100808354040283529160200191611f5a565b820191906000526020600020905b815481529060010190602001808311611f3d57829003601f168201915b505050505081525050905092915050565b6000546001600160a01b036301000000909104163314611f9d5760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b0384166000908152601060205260409020548310611fff576001600160a01b038416600081815260106020526040908190205490516345e388eb60e01b8152600481019290925260248201526044810184905260640161061b565b6001600160a01b038416600090815260106020526040812080548590811061202957612029613326565b600091825260208083206002909202909101546001600160a01b03881683526010909152604082208054919350908690811061206757612067613326565b9060005260206000209060020201600101549050818414158061208a5750808314155b156120d657604051637a4dd76560e01b81526001600160a01b03871660048201526024810186905260448101839052606481018290526084810185905260a4810184905260c40161061b565b6001600160a01b038616600090815260106020526040902080546120fc9060019061336b565b8154811061210c5761210c613326565b906000526020600020906002020160106000886001600160a01b03166001600160a01b03168152602001908152602001600020868154811061215057612150613326565b60009182526020808320845460029093020191825560019384015493909101929092556001600160a01b038816815260109091526040902080548061219757612197613663565b6000828152602080822060026000199490940193840201828155600101919091559155604080516001600160a01b038916815291820186905281018490527f33cff58e54c3a8acae85cad63487b5dcf617521e33bb03f071299f374c29de1f9060600160405180910390a1505050505050565b6001600160a01b03821660009081526010602052604081206108d99083612732565b60005462010000900460ff1661227b5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161061b565b6000805462ff0000191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60408051818152610820810182526060918291600091829190602082016108008036833750506040805181815261082081018252929350600092915060208201610800803683370190505090506000805b603f8160ff1610156123ae5760006123308983612699565b905060ff81161561239b5781858460ff168151811061235157612351613326565b602002602001019060ff16908160ff168152505080848460ff168151811061237b5761237b613326565b60ff9092166020928302919091019091015282612397816133bc565b9350505b50806123a6816133bc565b915050612318565b509196909550909350915050565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60408051808201825283815260208082018481526001600160a01b03871660008181526010845285812080546001808201835591835291859020865160029093020191825592519201919091558351908152908101859052918201839052907fe7d6ac0b740347f7f96a97e6a9dc0f20f4f11eca65495315adc009a55b6762f8906060015b60405180910390a150505050565b60ff811660008181526012602090815260408083208054939055805193845290830182905290917feb82955a27e39ea7559b6ec7e7d8b371081ab0d8783c7b0d01597555e7dcadbf9101611700565b8181113060008261250c578561250f565b60005b905060008361251f576000612521565b865b905060008461253957612534868861336b565b612543565b612543878761336b565b604051633885984b60e11b81526001600160a01b03868116600483015285811660248301528481166044830152606482018c9052608482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063710b30969060a401600060405180830381600087803b1580156125c957600080fd5b505af11580156125dd573d6000803e3d6000fd5b50505050505050505050505050565b60005462010000900460ff16156126155760405162461bcd60e51b815260040161061b906133db565b6000805462ff00001916620100001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122aa3390565b60ff8216600081815260126020908152604091829020849055815192835282018390527f16f0bfe4b02efd5423ef8906906b049c0943f21df8f10347d319fddbc59222079101611700565b600082816126a8846004613679565b60ff1682901c905080600f169250505092915050565b6000838152601160205260409020546126d88184846127c0565b6000858152601160205260409081902091909155517f393b86c90799fa411201ae723a54e105823fcf7c6c8dffa90903fc44c03b4ac79061249e9086908690869092835260ff918216602084015216604082015260600190565b6000805b83548110156127b65783818154811061275157612751613326565b9060005260206000209060020201600001548310158015612795575083818154811061277f5761277f613326565b9060005260206000209060020201600101548311155b156127a45760019150506105e3565b806127ae81613352565b915050612736565b5060009392505050565b60006127cb83611da9565b6127d482612819565b8360006127e2856004613679565b600f60ff919091161b905060001981188281166000612802886004613679565b60ff97881697169690961b17979650505050505050565b600f8160ff161115610f51576040516329afd27b60e21b815260ff8216600482015260240161061b565b50805461284f90613382565b6000825580601f1061285f575050565b601f016020900490600052602060002090810190610f519190612901565b82805461288990613382565b90600052602060002090601f0160209004810192826128ab57600085556128f1565b82601f106128c457805160ff19168380011785556128f1565b828001600101855582156128f1579182015b828111156128f15782518255916020019190600101906128d6565b506128fd929150612901565b5090565b5b808211156128fd5760008155600101612902565b80356001600160a01b038116811461292d57600080fd5b919050565b6000806040838503121561294557600080fd5b8235915061295560208401612916565b90509250929050565b803560ff8116811461292d57600080fd5b6000806040838503121561298257600080fd5b61298b8361295e565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156129d1576129d1612999565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129ff576129ff612999565b604052919050565b60006001600160401b03821115612a2057612a20612999565b5060051b60200190565b600082601f830112612a3b57600080fd5b81356020612a50612a4b83612a07565b6129d7565b82815260059290921b84018101918181019086841115612a6f57600080fd5b8286015b84811015612a8a5780358352918301918301612a73565b509695505050505050565b60008060408385031215612aa857600080fd5b82356001600160401b0380821115612abf57600080fd5b612acb86838701612a2a565b9350602091508185013581811115612ae257600080fd5b85019050601f81018613612af557600080fd5b8035612b03612a4b82612a07565b81815260059190911b82018301908381019088831115612b2257600080fd5b928401925b82841015612b4757612b3884612916565b82529284019290840190612b27565b80955050505050509250929050565b6000815180845260005b81811015612b7c57602081850181015186830182015201612b60565b81811115612b8e576000602083870101525b50601f01601f19169290920160200192915050565b60018060a01b0381511682526020810151602083015263ffffffff604082015116604083015260006060820151608060608501526118806080850182612b56565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612c3957603f19888603018452612c27858351612ba3565b94509285019290850190600101612c0b565b5092979650505050505050565b600082601f830112612c5757600080fd5b81356020612c67612a4b83612a07565b82815260059290921b84018101918181019086841115612c8657600080fd5b8286015b84811015612a8a57612c9b8161295e565b8352918301918301612c8a565b60008060408385031215612cbb57600080fd5b82356001600160401b0380821115612cd257600080fd5b612cde86838701612c46565b9350602091508185013581811115612cf557600080fd5b85019050601f81018613612d0857600080fd5b8035612d16612a4b82612a07565b81815260059190911b82018301908381019088831115612d3557600080fd5b928401925b82841015612b4757833582529284019290840190612d3a565b600082601f830112612d6457600080fd5b81356020612d74612a4b83612a07565b82815260069290921b84018101918181019086841115612d9357600080fd5b8286015b84811015612a8a5760408189031215612db05760008081fd5b612db86129af565b813581528482013585820152835291830191604001612d97565b600080600060608486031215612de757600080fd5b612df084612916565b925060208401356001600160401b0380821115612e0c57600080fd5b612e1887838801612d53565b93506040860135915080821115612e2e57600080fd5b50612e3b86828701612a2a565b9150509250925092565b60008060408385031215612e5857600080fd5b61298b83612916565b60018060a01b038516815283602082015263ffffffff83166040820152608060608201526000612e946080830184612b56565b9695505050505050565b60008060408385031215612eb157600080fd5b8235915060208301356001600160401b03811115612ece57600080fd5b612eda85828601612c46565b9150509250929050565b600081518084526020808501945080840160005b83811015612f1757815160ff1687529582019590820190600101612ef8565b509495945050505050565b6020815260006108d96020830184612ee4565b600060208284031215612f4757600080fd5b5035919050565b604080825283519082018190526000906020906060840190828701845b82811015612f8757815184529284019290840190600101612f6b565b50505083810382850152612e948186612ee4565b600060208284031215612fad57600080fd5b81356001600160401b03811115612fc357600080fd5b61188084828501612c46565b6020815260006108d96020830184612b56565b600080600060608486031215612ff757600080fd5b83356001600160401b038082111561300e57600080fd5b61301a87838801612a2a565b9450602086013591508082111561303057600080fd5b61303c87838801612c46565b9350604086013591508082111561305257600080fd5b50612e3b86828701612c46565b60008060006060848603121561307457600080fd5b61307d84612916565b95602085013595506040909401359392505050565b6000602082840312156130a457600080fd5b6108d98261295e565b60008083601f8401126130bf57600080fd5b5081356001600160401b038111156130d657600080fd5b6020830191508360208260051b85010111156130f157600080fd5b9250929050565b6000806000806040858703121561310e57600080fd5b84356001600160401b038082111561312557600080fd5b613131888389016130ad565b9096509450602087013591508082111561314a57600080fd5b50613157878288016130ad565b95989497509550505050565b6020815260006108d96020830184612ba3565b6000806040838503121561318957600080fd5b61319283612916565b915060208301356001600160401b038111156131ad57600080fd5b612eda85828601612d53565b600080600080608085870312156131cf57600080fd5b6131d885612916565b966020860135965060408601359560600135945092505050565b60006020828403121561320457600080fd5b6108d982612916565b6000806040838503121561322057600080fd5b823591506129556020840161295e565b6020808252825182820181905260009190848201906040850190845b818110156132685783518352928401929184019160010161324c565b50909695505050505050565b60008060006060848603121561328957600080fd5b833592506132996020850161295e565b91506132a76040850161295e565b90509250925092565b600080602083850312156132c357600080fd5b82356001600160401b038111156132d957600080fd5b6132e5858286016130ad565b90969095509350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016133645761336461333c565b5060010190565b60008282101561337d5761337d61333c565b500390565b600181811c9082168061339657607f821691505b6020821081036133b657634e487b7160e01b600052602260045260246000fd5b50919050565b600060ff821660ff81036133d2576133d261333c565b60010192915050565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6040808252810184905260008560608301825b87811015613446576001600160a01b0361343184612916565b16825260209283019290910190600101613418565b5083810360208501528481526001600160fb1b0385111561346657600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b60208152815160208201526000602083015160018060a01b03808216604085015280604086015116606085015250506060830151608083015263ffffffff60808401511660a083015260a083015160c08084015261188060e0840182612b56565b6000823560be198336030181126134fe57600080fd5b9190910192915050565b803563ffffffff8116811461292d57600080fd5b60006020828403121561352e57600080fd5b6108d982613508565b6000808335601e1984360301811261354e57600080fd5b8301803591506001600160401b0382111561356857600080fd5b6020019150368190038213156130f157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b602081528135602082015260006135bf60208401612916565b60018060a01b038082166040850152806135db60408701612916565b16606085015250506060830135608083015263ffffffff6135fe60808501613508565b1660a083015260a0830135601e1984360301811261361b57600080fd5b83016020810190356001600160401b0381111561363757600080fd5b80360382131561364657600080fd5b60c08085015261365a60e08501828461357d565b95945050505050565b634e487b7160e01b600052603160045260246000fd5b600060ff821660ff84168160ff048111821515161561369a5761369a61333c565b02939250505056fea26469706673582212209714c1001d19740a655ea4426b52e9f5d8348f9df38d027a88d1f1095e244e9464736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "attestationsCollectionHasAttribute(uint256,uint8)": { - "details": "Returns whether an attestationsCollection has a specific attribute referenced by its index", - "params": { - "collectionId": "Collection Id of the targeted attestationsCollection", - "index": "Index of the attribute. Can go from 0 to 63." - } - }, - "authorizeRange(address,uint256,uint256)": { - "details": "Authorize an issuer for a specific range", - "params": { - "firstCollectionId": "First collection Id of the range for which the issuer will be authorized", - "issuer": "Issuer that will be authorized", - "lastCollectionId": "Last collection Id of the range for which the issuer will be authorized" - } - }, - "authorizeRanges(address,(uint256,uint256)[])": { - "details": "Authorize an issuer for specific ranges", - "params": { - "issuer": "Issuer that will be authorized", - "ranges": "Ranges for which the issuer will be authorized" - } - }, - "constructor": { - "details": "Constructor.", - "params": { - "badgesAddress": "Stateless ERC1155 Badges contract", - "owner": "Owner of the contract, has the right to authorize/unauthorize attestations issuers" - } - }, - "createNewAttribute(uint8,bytes32)": { - "details": "Create a new attribute.", - "params": { - "index": "Index of the attribute. Can go from 0 to 63.", - "name": "Name in bytes32 of the attribute" - } - }, - "deleteAttestations(address[],uint256[])": { - "details": "Delete function to be called by authorized issuers", - "params": { - "collectionIds": "The collection ids of the attestations to be deleted", - "owners": "The owners of the attestations to be deleted" - } - }, - "deleteAttribute(uint8)": { - "details": "Delete an existing attribute", - "params": { - "index": "Index of the attribute. Can go from 0 to 63. The attribute must already exist" - } - }, - "getAttestationData(uint256,address)": { - "details": "Getter of the data of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationDataBatch(uint256[],address[])": { - "details": "Getter of the data of specific attestations", - "params": { - "collectionIds": "Collection identifiers of the targeted attestations", - "owners": "Owners of the targeted attestations" - } - }, - "getAttestationDataTuple(uint256,address)": { - "details": "Getter of the data of a specific attestation as tuple", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationExtraData(uint256,address)": { - "details": "Getter of the extraData of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationIssuer(uint256,address)": { - "details": "Getter of the issuer of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationTimestamp(uint256,address)": { - "details": "Getter of the timestamp of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationValue(uint256,address)": { - "details": "Getter of the value of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationValueBatch(uint256[],address[])": { - "details": "Getter of the values of specific attestations", - "params": { - "collectionIds": "Collection identifiers of the targeted attestations", - "owners": "Owners of the targeted attestations" - } - }, - "getAttributeValueForAttestationsCollection(uint256,uint8)": { - "details": "Returns the attribute's value (from 0 to 15) of an attestationsCollection", - "params": { - "collectionId": "Collection Id of the targeted attestationsCollection", - "index": "Index of the attribute. Can go from 0 to 63." - } - }, - "getAttributesNamesAndValuesForAttestationsCollection(uint256)": { - "details": "Returns all the enabled attributes names and their values for a specific attestationsCollection", - "params": { - "collectionId": "Collection Id of the targeted attestationsCollection" - } - }, - "hasAttestation(uint256,address)": { - "details": "Returns whether a user has an attestation from a collection", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "initialize(address)": { - "details": "Initialize function, to be called by the proxy delegating calls to this implementation", - "params": { - "ownerAddress": "Owner of the contract, has the right to authorize/unauthorize attestations issuers" - } - }, - "isAuthorized(address,uint256)": { - "details": "Returns whether a specific issuer is authorized or not to record in a specific attestations collection", - "params": { - "collectionId": "Collection Id for which the issuer will be checked", - "issuer": "Issuer to be checked" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "pause()": { - "details": "Pauses the registry. Issuers can no longer record or delete attestations" - }, - "paused()": { - "details": "Returns true if the contract is paused, and false otherwise." - }, - "recordAttestations((uint256,address,address,uint256,uint32,bytes)[])": { - "details": "Main function to be called by authorized issuers", - "params": { - "attestations": "Attestations to be recorded (creates a new one or overrides an existing one)" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "setAttributeValueForAttestationsCollection(uint256,uint8,uint8)": { - "details": "Set a value for an attribute of an attestationsCollection. The attribute should already be created.", - "params": { - "collectionId": "Collection Id of the targeted attestationsCollection", - "index": "Index of the attribute (must be between 0 and 63)", - "value": "Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "unauthorizeRange(address,uint256,uint256,uint256)": { - "details": "Unauthorize an issuer for a specific range", - "params": { - "firstCollectionId": "First collection Id of the range for which the issuer will be unauthorized", - "issuer": "Issuer that will be unauthorized", - "lastCollectionId": "Last collection Id of the range for which the issuer will be unauthorized", - "rangeIndex": "Index of the range to be unauthorized" - } - }, - "unauthorizeRanges(address,(uint256,uint256)[],uint256[])": { - "details": "Unauthorize an issuer for specific ranges", - "params": { - "issuer": "Issuer that will be unauthorized", - "ranges": "Ranges for which the issuer will be unauthorized" - } - }, - "unpause()": { - "details": "Unpauses the registry" - }, - "updateAttributeName(uint8,bytes32)": { - "details": "Update the name of an existing attribute", - "params": { - "index": "Index of the attribute. Can go from 0 to 63. The attribute must exist", - "newName": "new name in bytes32 of the attribute" - } - } - }, - "title": "Attestations Registry", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "Main contract of Sismo, stores all recorded attestations in attestations collections Only authorized attestations issuers can record attestation in the registry Attesters that expect to record in the Attestations Registry must be authorized issuers For more information: https://attestations-registry.docs.sismo.io For each attestation recorded, a badge is received by the user The badge is the Non transferrable NFT representation of an attestation Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts It enables off-chain apps such as opensea to catch the \"shadow mint\" of the badge*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 14389, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 14391, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 14393, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_paused", - "offset": 2, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 14395, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_owner", - "offset": 3, - "slot": "0", - "type": "t_address" - }, - { - "astId": 14399, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_placeHoldersAdmin", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)15_storage" - }, - { - "astId": 14405, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_authorizedRanges", - "offset": 0, - "slot": "16", - "type": "t_mapping(t_address,t_array(t_struct(Range)15352_storage)dyn_storage)" - }, - { - "astId": 14409, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_attestationsCollectionAttributesValuesBitmap", - "offset": 0, - "slot": "17", - "type": "t_mapping(t_uint256,t_uint256)" - }, - { - "astId": 14413, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_attributesNames", - "offset": 0, - "slot": "18", - "type": "t_mapping(t_uint8,t_bytes32)" - }, - { - "astId": 14417, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_placeHoldersConfig", - "offset": 0, - "slot": "19", - "type": "t_array(t_uint256)13_storage" - }, - { - "astId": 14424, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_attestationsData", - "offset": 0, - "slot": "32", - "type": "t_mapping(t_uint256,t_mapping(t_address,t_struct(AttestationData)13388_storage))" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_struct(Range)15352_storage)dyn_storage": { - "base": "t_struct(Range)15352_storage", - "encoding": "dynamic_array", - "label": "struct Range[]", - "numberOfBytes": "32" - }, - "t_array(t_uint256)13_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[13]", - "numberOfBytes": "416" - }, - "t_array(t_uint256)15_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[15]", - "numberOfBytes": "480" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_bytes_storage": { - "encoding": "bytes", - "label": "bytes", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_array(t_struct(Range)15352_storage)dyn_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct Range[])", - "numberOfBytes": "32", - "value": "t_array(t_struct(Range)15352_storage)dyn_storage" - }, - "t_mapping(t_address,t_struct(AttestationData)13388_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct AttestationData)", - "numberOfBytes": "32", - "value": "t_struct(AttestationData)13388_storage" - }, - "t_mapping(t_uint256,t_mapping(t_address,t_struct(AttestationData)13388_storage))": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => mapping(address => struct AttestationData))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_struct(AttestationData)13388_storage)" - }, - "t_mapping(t_uint256,t_uint256)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_mapping(t_uint8,t_bytes32)": { - "encoding": "mapping", - "key": "t_uint8", - "label": "mapping(uint8 => bytes32)", - "numberOfBytes": "32", - "value": "t_bytes32" - }, - "t_struct(AttestationData)13388_storage": { - "encoding": "inplace", - "label": "struct AttestationData", - "members": [ - { - "astId": 13381, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "issuer", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 13383, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "value", - "offset": 0, - "slot": "1", - "type": "t_uint256" - }, - { - "astId": 13385, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "timestamp", - "offset": 0, - "slot": "2", - "type": "t_uint32" - }, - { - "astId": 13387, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "extraData", - "offset": 0, - "slot": "3", - "type": "t_bytes_storage" - } - ], - "numberOfBytes": "128" - }, - "t_struct(Range)15352_storage": { - "encoding": "inplace", - "label": "struct Range", - "members": [ - { - "astId": 15349, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "min", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 15351, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "max", - "offset": 0, - "slot": "1", - "type": "t_uint256" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/AttestationsRegistryImplem.json b/deployments/goerli/AttestationsRegistryImplem.json deleted file mode 100644 index a91c669..0000000 --- a/deployments/goerli/AttestationsRegistryImplem.json +++ /dev/null @@ -1,1797 +0,0 @@ -{ - "address": "0xDb80166478D50EDEFc4dD72c304d44D270c6b494", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "badgesAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "ArgsLengthDoesNotMatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - } - ], - "name": "AttesterNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - } - ], - "name": "AttributeAlreadyExists", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - } - ], - "name": "AttributeDoesNotExist", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "rangeIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedFirstId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedLastId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "FirstId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "IdsMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "IndexOutOfBounds", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "IssuerNotAuthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "owners", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - } - ], - "name": "OwnersAndCollectionIdsLengthMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "expectedArrayLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rangeIndex", - "type": "uint256" - } - ], - "name": "RangeIndexOutOfBounds", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "value", - "type": "uint8" - } - ], - "name": "ValueOutOfBounds", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationRecorded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "attributeValue", - "type": "uint8" - } - ], - "name": "AttestationsCollectionAttributeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "deletedAttributeName", - "type": "bytes32" - } - ], - "name": "AttributeDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "newAttributeName", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "previousAttributeName", - "type": "bytes32" - } - ], - "name": "AttributeNameUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "firstCollectionId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "IssuerAuthorized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "firstCollectionId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "IssuerUnauthorized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "attributeName", - "type": "bytes32" - } - ], - "name": "NewAttributeCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Unpaused", - "type": "event" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "attestationsCollectionHasAttribute", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - } - ], - "name": "attestationsCollectionHasAttributes", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "firstCollectionId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "authorizeRange", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Range[]", - "name": "ranges", - "type": "tuple[]" - } - ], - "name": "authorizeRanges", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "name", - "type": "bytes32" - } - ], - "name": "createNewAttribute", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - }, - { - "internalType": "bytes32[]", - "name": "names", - "type": "bytes32[]" - } - ], - "name": "createNewAttributes", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "owners", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - } - ], - "name": "deleteAttestations", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "deleteAttribute", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - } - ], - "name": "deleteAttributes", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationData", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct AttestationData", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "owners", - "type": "address[]" - } - ], - "name": "getAttestationDataBatch", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct AttestationData[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationDataTuple", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationExtraData", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationIssuer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationTimestamp", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationValue", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "owners", - "type": "address[]" - } - ], - "name": "getAttestationValueBatch", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "getAttributeValueForAttestationsCollection", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "getAttributesNamesAndValuesForAttestationsCollection", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - }, - { - "internalType": "uint8[]", - "name": "", - "type": "uint8[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - } - ], - "name": "getAttributesValuesForAttestationsCollection", - "outputs": [ - { - "internalType": "uint8[]", - "name": "", - "type": "uint8[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "hasAttestation", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "isAuthorized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "paused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "attestations", - "type": "tuple[]" - } - ], - "name": "recordAttestations", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "value", - "type": "uint8" - } - ], - "name": "setAttributeValueForAttestationsCollection", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - }, - { - "internalType": "uint8[]", - "name": "values", - "type": "uint8[]" - } - ], - "name": "setAttributesValuesForAttestationsCollections", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "rangeIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "firstCollectionId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "unauthorizeRange", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Range[]", - "name": "ranges", - "type": "tuple[]" - }, - { - "internalType": "uint256[]", - "name": "rangeIndexes", - "type": "uint256[]" - } - ], - "name": "unauthorizeRanges", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "unpause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "newName", - "type": "bytes32" - } - ], - "name": "updateAttributeName", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - }, - { - "internalType": "bytes32[]", - "name": "newNames", - "type": "bytes32[]" - } - ], - "name": "updateAttributesName", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xbb2f078e951041b389a49f7511f5cc9bcb3ec482b869cc7f559219850f1876ed", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0xDb80166478D50EDEFc4dD72c304d44D270c6b494", - "transactionIndex": 106, - "gasUsed": "3121566", - "logsBloom": "0x00000000000200000000000000020000000080000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000000000000080000000000000000000020000000000000000000800002000000000000000000000000000400000000000000000000000000000000000000000000080000000000000000000000000000000000000000000800400000000000000000000000000000000000000000000000000000000000000040000000000000000400000000000000020000000000000000200000000000000000000000000000000000000008000000000", - "blockHash": "0xa9ac885baeb6adea2c0e2fdeb3a1bb2f3dd0507acf93db251dfdf26b025868de", - "transactionHash": "0xbb2f078e951041b389a49f7511f5cc9bcb3ec482b869cc7f559219850f1876ed", - "logs": [ - { - "transactionIndex": 106, - "blockNumber": 8080251, - "transactionHash": "0xbb2f078e951041b389a49f7511f5cc9bcb3ec482b869cc7f559219850f1876ed", - "address": "0xDb80166478D50EDEFc4dD72c304d44D270c6b494", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "data": "0x", - "logIndex": 165, - "blockHash": "0xa9ac885baeb6adea2c0e2fdeb3a1bb2f3dd0507acf93db251dfdf26b025868de" - }, - { - "transactionIndex": 106, - "blockNumber": 8080251, - "transactionHash": "0xbb2f078e951041b389a49f7511f5cc9bcb3ec482b869cc7f559219850f1876ed", - "address": "0xDb80166478D50EDEFc4dD72c304d44D270c6b494", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954" - ], - "data": "0x", - "logIndex": 166, - "blockHash": "0xa9ac885baeb6adea2c0e2fdeb3a1bb2f3dd0507acf93db251dfdf26b025868de" - }, - { - "transactionIndex": 106, - "blockNumber": 8080251, - "transactionHash": "0xbb2f078e951041b389a49f7511f5cc9bcb3ec482b869cc7f559219850f1876ed", - "address": "0xDb80166478D50EDEFc4dD72c304d44D270c6b494", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 167, - "blockHash": "0xa9ac885baeb6adea2c0e2fdeb3a1bb2f3dd0507acf93db251dfdf26b025868de" - } - ], - "blockNumber": 8080251, - "cumulativeGasUsed": "25947331", - "status": 1, - "byzantium": true - }, - "args": [ - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954", - "0xE06B14D5835925e1642d7216F4563a1273509F10" - ], - "numDeployments": 3, - "solcInputHash": "24c70469fd559e01f6ff2a10472da9a6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"badgesAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ArgsLengthDoesNotMatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"}],\"name\":\"AttesterNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"}],\"name\":\"AttributeAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"}],\"name\":\"AttributeDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rangeIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedFirstId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedLastId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"FirstId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"IdsMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"IndexOutOfBounds\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"IssuerNotAuthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"}],\"name\":\"OwnersAndCollectionIdsLengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"expectedArrayLength\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rangeIndex\",\"type\":\"uint256\"}],\"name\":\"RangeIndexOutOfBounds\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"value\",\"type\":\"uint8\"}],\"name\":\"ValueOutOfBounds\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationRecorded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeValue\",\"type\":\"uint8\"}],\"name\":\"AttestationsCollectionAttributeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"deletedAttributeName\",\"type\":\"bytes32\"}],\"name\":\"AttributeDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"newAttributeName\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"previousAttributeName\",\"type\":\"bytes32\"}],\"name\":\"AttributeNameUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"IssuerAuthorized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"IssuerUnauthorized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"attributeName\",\"type\":\"bytes32\"}],\"name\":\"NewAttributeCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"attestationsCollectionHasAttribute\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"}],\"name\":\"attestationsCollectionHasAttributes\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"authorizeRange\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"internalType\":\"struct Range[]\",\"name\":\"ranges\",\"type\":\"tuple[]\"}],\"name\":\"authorizeRanges\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"createNewAttribute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"names\",\"type\":\"bytes32[]\"}],\"name\":\"createNewAttributes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"}],\"name\":\"deleteAttestations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"deleteAttribute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"}],\"name\":\"deleteAttributes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationData\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct AttestationData\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"}],\"name\":\"getAttestationDataBatch\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct AttestationData[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationDataTuple\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationIssuer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationTimestamp\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationValue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"}],\"name\":\"getAttestationValueBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"getAttributeValueForAttestationsCollection\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"getAttributesNamesAndValuesForAttestationsCollection\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"}],\"name\":\"getAttributesValuesForAttestationsCollection\",\"outputs\":[{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"hasAttestation\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"isAuthorized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"attestations\",\"type\":\"tuple[]\"}],\"name\":\"recordAttestations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"value\",\"type\":\"uint8\"}],\"name\":\"setAttributeValueForAttestationsCollection\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"},{\"internalType\":\"uint8[]\",\"name\":\"values\",\"type\":\"uint8[]\"}],\"name\":\"setAttributesValuesForAttestationsCollections\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rangeIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"unauthorizeRange\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"internalType\":\"struct Range[]\",\"name\":\"ranges\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256[]\",\"name\":\"rangeIndexes\",\"type\":\"uint256[]\"}],\"name\":\"unauthorizeRanges\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"newName\",\"type\":\"bytes32\"}],\"name\":\"updateAttributeName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"newNames\",\"type\":\"bytes32[]\"}],\"name\":\"updateAttributesName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"attestationsCollectionHasAttribute(uint256,uint8)\":{\"details\":\"Returns whether an attestationsCollection has a specific attribute referenced by its index\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\",\"index\":\"Index of the attribute. Can go from 0 to 63.\"}},\"authorizeRange(address,uint256,uint256)\":{\"details\":\"Authorize an issuer for a specific range\",\"params\":{\"firstCollectionId\":\"First collection Id of the range for which the issuer will be authorized\",\"issuer\":\"Issuer that will be authorized\",\"lastCollectionId\":\"Last collection Id of the range for which the issuer will be authorized\"}},\"authorizeRanges(address,(uint256,uint256)[])\":{\"details\":\"Authorize an issuer for specific ranges\",\"params\":{\"issuer\":\"Issuer that will be authorized\",\"ranges\":\"Ranges for which the issuer will be authorized\"}},\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"badgesAddress\":\"Stateless ERC1155 Badges contract\",\"owner\":\"Owner of the contract, has the right to authorize/unauthorize attestations issuers\"}},\"createNewAttribute(uint8,bytes32)\":{\"details\":\"Create a new attribute.\",\"params\":{\"index\":\"Index of the attribute. Can go from 0 to 63.\",\"name\":\"Name in bytes32 of the attribute\"}},\"deleteAttestations(address[],uint256[])\":{\"details\":\"Delete function to be called by authorized issuers\",\"params\":{\"collectionIds\":\"The collection ids of the attestations to be deleted\",\"owners\":\"The owners of the attestations to be deleted\"}},\"deleteAttribute(uint8)\":{\"details\":\"Delete an existing attribute\",\"params\":{\"index\":\"Index of the attribute. Can go from 0 to 63. The attribute must already exist\"}},\"getAttestationData(uint256,address)\":{\"details\":\"Getter of the data of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationDataBatch(uint256[],address[])\":{\"details\":\"Getter of the data of specific attestations\",\"params\":{\"collectionIds\":\"Collection identifiers of the targeted attestations\",\"owners\":\"Owners of the targeted attestations\"}},\"getAttestationDataTuple(uint256,address)\":{\"details\":\"Getter of the data of a specific attestation as tuple\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationExtraData(uint256,address)\":{\"details\":\"Getter of the extraData of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationIssuer(uint256,address)\":{\"details\":\"Getter of the issuer of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationTimestamp(uint256,address)\":{\"details\":\"Getter of the timestamp of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationValue(uint256,address)\":{\"details\":\"Getter of the value of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationValueBatch(uint256[],address[])\":{\"details\":\"Getter of the values of specific attestations\",\"params\":{\"collectionIds\":\"Collection identifiers of the targeted attestations\",\"owners\":\"Owners of the targeted attestations\"}},\"getAttributeValueForAttestationsCollection(uint256,uint8)\":{\"details\":\"Returns the attribute's value (from 0 to 15) of an attestationsCollection\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\",\"index\":\"Index of the attribute. Can go from 0 to 63.\"}},\"getAttributesNamesAndValuesForAttestationsCollection(uint256)\":{\"details\":\"Returns all the enabled attributes names and their values for a specific attestationsCollection\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\"}},\"hasAttestation(uint256,address)\":{\"details\":\"Returns whether a user has an attestation from a collection\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"initialize(address)\":{\"details\":\"Initialize function, to be called by the proxy delegating calls to this implementation\",\"params\":{\"ownerAddress\":\"Owner of the contract, has the right to authorize/unauthorize attestations issuers\"}},\"isAuthorized(address,uint256)\":{\"details\":\"Returns whether a specific issuer is authorized or not to record in a specific attestations collection\",\"params\":{\"collectionId\":\"Collection Id for which the issuer will be checked\",\"issuer\":\"Issuer to be checked\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pause()\":{\"details\":\"Pauses the registry. Issuers can no longer record or delete attestations\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"recordAttestations((uint256,address,address,uint256,uint32,bytes)[])\":{\"details\":\"Main function to be called by authorized issuers\",\"params\":{\"attestations\":\"Attestations to be recorded (creates a new one or overrides an existing one)\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAttributeValueForAttestationsCollection(uint256,uint8,uint8)\":{\"details\":\"Set a value for an attribute of an attestationsCollection. The attribute should already be created.\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\",\"index\":\"Index of the attribute (must be between 0 and 63)\",\"value\":\"Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unauthorizeRange(address,uint256,uint256,uint256)\":{\"details\":\"Unauthorize an issuer for a specific range\",\"params\":{\"firstCollectionId\":\"First collection Id of the range for which the issuer will be unauthorized\",\"issuer\":\"Issuer that will be unauthorized\",\"lastCollectionId\":\"Last collection Id of the range for which the issuer will be unauthorized\",\"rangeIndex\":\"Index of the range to be unauthorized\"}},\"unauthorizeRanges(address,(uint256,uint256)[],uint256[])\":{\"details\":\"Unauthorize an issuer for specific ranges\",\"params\":{\"issuer\":\"Issuer that will be unauthorized\",\"ranges\":\"Ranges for which the issuer will be unauthorized\"}},\"unpause()\":{\"details\":\"Unpauses the registry\"},\"updateAttributeName(uint8,bytes32)\":{\"details\":\"Update the name of an existing attribute\",\"params\":{\"index\":\"Index of the attribute. Can go from 0 to 63. The attribute must exist\",\"newName\":\"new name in bytes32 of the attribute\"}}},\"title\":\"Attestations Registry\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"Main contract of Sismo, stores all recorded attestations in attestations collections Only authorized attestations issuers can record attestation in the registry Attesters that expect to record in the Attestations Registry must be authorized issuers For more information: https://attestations-registry.docs.sismo.io For each attestation recorded, a badge is received by the user The badge is the Non transferrable NFT representation of an attestation Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts It enables off-chain apps such as opensea to catch the \\\"shadow mint\\\" of the badge*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/AttestationsRegistry.sol\":\"AttestationsRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/core/AttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\\nimport {Attestation, AttestationData} from './libs/Structs.sol';\\nimport {IBadges} from './interfaces/IBadges.sol';\\n\\n/**\\n * @title Attestations Registry\\n * @author Sismo\\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\\n * Only authorized attestations issuers can record attestation in the registry\\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\\n * For more information: https://attestations-registry.docs.sismo.io\\n\\n * For each attestation recorded, a badge is received by the user\\n * The badge is the Non transferrable NFT representation of an attestation \\n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\\n * It enables off-chain apps such as opensea to catch the \\\"shadow mint\\\" of the badge\\n **/\\ncontract AttestationsRegistry is\\n AttestationsRegistryState,\\n IAttestationsRegistry,\\n AttestationsRegistryConfigLogic\\n{\\n uint8 public constant IMPLEMENTATION_VERSION = 3;\\n IBadges immutable BADGES;\\n\\n /**\\n * @dev Constructor.\\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @param badgesAddress Stateless ERC1155 Badges contract\\n */\\n constructor(address owner, address badgesAddress) {\\n BADGES = IBadges(badgesAddress);\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\\n address issuer = _msgSender();\\n for (uint256 i = 0; i < attestations.length; i++) {\\n if (!_isAuthorized(issuer, attestations[i].collectionId))\\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\\n\\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\\n attestations[i].owner\\n ].value;\\n\\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\\n attestations[i].issuer,\\n attestations[i].value,\\n attestations[i].timestamp,\\n attestations[i].extraData\\n );\\n\\n _triggerBadgeTransferEvent(\\n attestations[i].collectionId,\\n attestations[i].owner,\\n previousAttestationValue,\\n attestations[i].value\\n );\\n emit AttestationRecorded(attestations[i]);\\n }\\n }\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(\\n address[] calldata owners,\\n uint256[] calldata collectionIds\\n ) external override whenNotPaused {\\n if (owners.length != collectionIds.length)\\n revert OwnersAndCollectionIdsLengthMismatch(owners, collectionIds);\\n\\n address issuer = _msgSender();\\n for (uint256 i = 0; i < owners.length; i++) {\\n AttestationData memory attestationData = _attestationsData[collectionIds[i]][owners[i]];\\n\\n if (!_isAuthorized(issuer, collectionIds[i]))\\n revert IssuerNotAuthorized(issuer, collectionIds[i]);\\n delete _attestationsData[collectionIds[i]][owners[i]];\\n\\n _triggerBadgeTransferEvent(collectionIds[i], owners[i], attestationData.value, 0);\\n\\n emit AttestationDeleted(\\n Attestation(\\n collectionIds[i],\\n owners[i],\\n attestationData.issuer,\\n attestationData.value,\\n attestationData.timestamp,\\n attestationData.extraData\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (bool) {\\n return _getAttestationValue(collectionId, owner) != 0;\\n }\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (AttestationData memory) {\\n return _getAttestationData(collectionId, owner);\\n }\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (uint256) {\\n return _getAttestationValue(collectionId, owner);\\n }\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (address, uint256, uint32, bytes memory) {\\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\\n return (\\n attestationData.issuer,\\n attestationData.value,\\n attestationData.timestamp,\\n attestationData.extraData\\n );\\n }\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (bytes memory) {\\n return _attestationsData[collectionId][owner].extraData;\\n }\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (address) {\\n return _attestationsData[collectionId][owner].issuer;\\n }\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (uint32) {\\n return _attestationsData[collectionId][owner].timestamp;\\n }\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view override returns (AttestationData[] memory) {\\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\\n }\\n return attestationsDataArray;\\n }\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view override returns (uint256[] memory) {\\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\\n }\\n return attestationsValues;\\n }\\n\\n /**\\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\\n * It enables off-chain apps such as opensea to catch the \\\"shadow mints/burns\\\" of badges\\n */\\n function _triggerBadgeTransferEvent(\\n uint256 badgeTokenId,\\n address owner,\\n uint256 previousValue,\\n uint256 newValue\\n ) internal {\\n bool isGreaterValue = newValue > previousValue;\\n address operator = address(this);\\n address from = isGreaterValue ? address(0) : owner;\\n address to = isGreaterValue ? owner : address(0);\\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\\n\\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\\n }\\n\\n function _getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) internal view returns (AttestationData memory) {\\n return (_attestationsData[collectionId][owner]);\\n }\\n\\n function _getAttestationValue(\\n uint256 collectionId,\\n address owner\\n ) internal view returns (uint256) {\\n return _attestationsData[collectionId][owner].value;\\n }\\n}\\n\",\"keccak256\":\"0xc21afe30d8096d2bab3683ca28b2533f99f53fa20a1f2c13aa44f1d46ecb9ae6\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IBadges.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Interface for Badges contract\\n * @author Sismo\\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\\n * The associated attestations registry triggers TransferSingle events from this contract\\n * It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms\\n */\\ninterface IBadges {\\n error BadgesNonTransferrable();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(string memory uri, address owner) external;\\n\\n /**\\n * @dev Main function of the ERC1155 badge\\n * The balance of a user is equal to the value of the underlying attestation.\\n * attestationCollectionId == badgeId\\n * @param account Address to check badge balance (= value of attestation)\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\\n * @param operator who is calling the TransferEvent\\n * @param from address(0) if minting, address of the badge holder if burning\\n * @param to address of the badge holder is minting, address(0) if burning\\n * @param id badgeId for which to trigger the event\\n * @param value minted/burned balance\\n */\\n function triggerTransferEvent(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 value\\n ) external;\\n\\n /**\\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\\n * @param attestationsRegistry new attestations registry address\\n */\\n function setAttestationsRegistry(address attestationsRegistry) external;\\n\\n /**\\n * @dev Set the URI. Can only be called by owner (default admin)\\n * @param uri new attestations registry address\\n */\\n function setUri(string memory uri) external;\\n\\n /**\\n * @dev Getter of the attestations registry\\n */\\n function getAttestationsRegistry() external view returns (address);\\n\\n /**\\n * @dev Getter of the badge issuer\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeIssuer(address account, uint256 id) external view returns (address);\\n\\n /**\\n * @dev Getter of the badge timestamp\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the value of a specific badge attribute\\n * @param id Badge Id to check (= attestationCollectionId)\\n * @param index Index of the attribute\\n */\\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);\\n\\n /**\\n * @dev Getter of all badge attributes and their values for a specific badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getAttributesNamesAndValuesForBadge(\\n uint256 id\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n}\\n\",\"keccak256\":\"0xd6bdfc887ef15ee022eb05d89dbe2e2938ee6c0a55a55f8db527ef650242c6bb\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport './OwnableLogic.sol';\\nimport './PausableLogic.sol';\\nimport './InitializableLogic.sol';\\nimport './AttestationsRegistryState.sol';\\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\\nimport {Bitmap256Bit} from '../utils/Bitmap256Bit.sol';\\n\\n/**\\n * @title Attestations Registry Config Logic contract\\n * @author Sismo\\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\\n **/\\ncontract AttestationsRegistryConfigLogic is\\n AttestationsRegistryState,\\n IAttestationsRegistryConfigLogic,\\n OwnableLogic,\\n PausableLogic,\\n InitializableLogic\\n{\\n using RangeUtils for Range[];\\n using Bitmap256Bit for uint256;\\n using Bitmap256Bit for uint8;\\n\\n /******************************************\\n *\\n * ATTESTATION REGISTRY WRITE ACCESS MANAGEMENT (ISSUERS)\\n *\\n *****************************************/\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external override onlyOwner {\\n _pause();\\n }\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external override onlyOwner {\\n _unpause();\\n }\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external override onlyOwner {\\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\\n }\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external override onlyOwner {\\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\\n }\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\\n }\\n }\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external override onlyOwner {\\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\\n return _isAuthorized(issuer, collectionId);\\n }\\n\\n /******************************************\\n *\\n * ATTRIBUTES CONFIG LOGIC\\n *\\n *****************************************/\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) public onlyOwner {\\n index._checkIndexIsValid();\\n if (_isAttributeCreated(index)) {\\n revert AttributeAlreadyExists(index);\\n }\\n _createNewAttribute(index, name);\\n }\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external onlyOwner {\\n if (indices.length != names.length) {\\n revert ArgsLengthDoesNotMatch();\\n }\\n\\n for (uint256 i = 0; i < indices.length; i++) {\\n createNewAttribute(indices[i], names[i]);\\n }\\n }\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) public onlyOwner {\\n index._checkIndexIsValid();\\n if (!_isAttributeCreated(index)) {\\n revert AttributeDoesNotExist(index);\\n }\\n _updateAttributeName(index, newName);\\n }\\n\\n function updateAttributesName(\\n uint8[] memory indices,\\n bytes32[] memory newNames\\n ) external onlyOwner {\\n if (indices.length != newNames.length) {\\n revert ArgsLengthDoesNotMatch();\\n }\\n\\n for (uint256 i = 0; i < indices.length; i++) {\\n updateAttributeName(indices[i], newNames[i]);\\n }\\n }\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must already exist\\n */\\n function deleteAttribute(uint8 index) public onlyOwner {\\n index._checkIndexIsValid();\\n if (!_isAttributeCreated(index)) {\\n revert AttributeDoesNotExist(index);\\n }\\n _deleteAttribute(index);\\n }\\n\\n function deleteAttributes(uint8[] memory indices) external onlyOwner {\\n for (uint256 i = 0; i < indices.length; i++) {\\n deleteAttribute(indices[i]);\\n }\\n }\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) public onlyOwner {\\n index._checkIndexIsValid();\\n\\n if (!_isAttributeCreated(index)) {\\n revert AttributeDoesNotExist(index);\\n }\\n\\n _setAttributeForAttestationsCollection(collectionId, index, value);\\n }\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external onlyOwner {\\n if (collectionIds.length != indices.length || collectionIds.length != values.length) {\\n revert ArgsLengthDoesNotMatch();\\n }\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n setAttributeValueForAttestationsCollection(collectionIds[i], indices[i], values[i]);\\n }\\n }\\n\\n /**\\n * @dev Returns the attribute's value (from 0 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index\\n ) public view returns (uint8) {\\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\\n collectionId\\n );\\n return currentAttributesValues._get(index);\\n }\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory) {\\n uint8[] memory attributesValues = new uint8[](indices.length);\\n for (uint256 i = 0; i < indices.length; i++) {\\n attributesValues[i] = getAttributeValueForAttestationsCollection(collectionId, indices[i]);\\n }\\n return attributesValues;\\n }\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) public view returns (bool) {\\n uint256 currentAttributeValues = _getAttributesValuesBitmapForAttestationsCollection(\\n collectionId\\n );\\n return currentAttributeValues._get(index) > 0;\\n }\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool) {\\n for (uint256 i = 0; i < indices.length; i++) {\\n if (!attestationsCollectionHasAttribute(collectionId, indices[i])) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) public view returns (bytes32[] memory, uint8[] memory) {\\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\\n collectionId\\n );\\n\\n (\\n uint8[] memory indices,\\n uint8[] memory values,\\n uint8 nbOfNonZeroValues\\n ) = currentAttributesValues._getAllNonZeroValues();\\n\\n bytes32[] memory attributesNames = new bytes32[](nbOfNonZeroValues);\\n uint8[] memory attributesValues = new uint8[](nbOfNonZeroValues);\\n for (uint8 i = 0; i < nbOfNonZeroValues; i++) {\\n attributesNames[i] = _attributesNames[indices[i]];\\n attributesValues[i] = values[i];\\n }\\n\\n return (attributesNames, attributesValues);\\n }\\n\\n /*****************************\\n *\\n * INTERNAL FUNCTIONS\\n *\\n *****************************/\\n\\n function _authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) internal {\\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\\n _authorizedRanges[issuer].push(newRange);\\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\\n }\\n\\n function _unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) internal onlyOwner {\\n if (rangeIndex >= _authorizedRanges[issuer].length)\\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\\n\\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\\n revert IdsMismatch(\\n issuer,\\n rangeIndex,\\n expectedFirstId,\\n expectedLastId,\\n firstCollectionId,\\n lastCollectionId\\n );\\n\\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\\n _authorizedRanges[issuer].length - 1\\n ];\\n _authorizedRanges[issuer].pop();\\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\\n }\\n\\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\\n return _authorizedRanges[issuer]._includes(collectionId);\\n }\\n\\n function _setAttributeForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) internal {\\n uint256 currentAttributes = _getAttributesValuesBitmapForAttestationsCollection(collectionId);\\n\\n _attestationsCollectionAttributesValuesBitmap[collectionId] = currentAttributes._set(\\n index,\\n value\\n );\\n\\n emit AttestationsCollectionAttributeSet(collectionId, index, value);\\n }\\n\\n function _createNewAttribute(uint8 index, bytes32 name) internal {\\n _attributesNames[index] = name;\\n\\n emit NewAttributeCreated(index, name);\\n }\\n\\n function _updateAttributeName(uint8 index, bytes32 newName) internal {\\n bytes32 previousName = _attributesNames[index];\\n\\n _attributesNames[index] = newName;\\n\\n emit AttributeNameUpdated(index, newName, previousName);\\n }\\n\\n function _deleteAttribute(uint8 index) internal {\\n bytes32 deletedName = _attributesNames[index];\\n\\n delete _attributesNames[index];\\n\\n emit AttributeDeleted(index, deletedName);\\n }\\n\\n function _getAttributesValuesBitmapForAttestationsCollection(\\n uint256 collectionId\\n ) internal view returns (uint256) {\\n return _attestationsCollectionAttributesValuesBitmap[collectionId];\\n }\\n\\n function _isAttributeCreated(uint8 index) internal view returns (bool) {\\n if (_attributesNames[index] == 0) {\\n return false;\\n }\\n return true;\\n }\\n}\\n\",\"keccak256\":\"0xa48b3131a3870684389282cb863a34734c67194d7f50d266ed8421114b3d786a\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/AttestationsRegistryState.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Range} from '../utils/RangeLib.sol';\\nimport {Attestation, AttestationData} from '../Structs.sol';\\n\\ncontract AttestationsRegistryState {\\n /*******************************************************\\n Storage layout:\\n 19 slots for config\\n 4 currently used for _initialized, _initializing, _paused, _owner\\n 15 place holders\\n 16 slots for logic\\n 3 currently used for _authorizedRanges, _attestationsCollectionAttributesValuesBitmap, _attributesNames\\n 13 place holders\\n 1 slot for _attestationsData \\n *******************************************************/\\n\\n // main config\\n // changed `_initialized` from bool to uint8\\n // as we were using OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n // and changed to OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n // PR: https://github.com/sismo-core/sismo-protocol/pull/41\\n uint8 internal _initialized;\\n bool internal _initializing;\\n bool internal _paused;\\n address internal _owner;\\n // keeping some space for future\\n uint256[15] private _placeHoldersAdmin;\\n\\n // storing the authorized ranges for each attesters\\n mapping(address => Range[]) internal _authorizedRanges;\\n // Storing the attributes values used for each attestations collection\\n // Each attribute value is an hexadecimal\\n mapping(uint256 => uint256) internal _attestationsCollectionAttributesValuesBitmap;\\n // Storing the attribute name for each attributes index\\n mapping(uint8 => bytes32) internal _attributesNames;\\n // keeping some space for future\\n uint256[13] private _placeHoldersConfig;\\n // storing the data of attestations\\n // =collectionId=> =owner=> attestationData\\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\\n}\\n\",\"keccak256\":\"0xabd7a629901a128cc32f80102ce06db228a76bd04f27818ccaf54827921eb149\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/InitializableLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport '../utils/Address.sol';\\nimport './AttestationsRegistryState.sol';\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract InitializableLogic is AttestationsRegistryState {\\n // only diff with oz\\n // /**\\n // * @dev Indicates that the contract has been initialized.\\n // */\\n // bool private _initialized;\\n\\n // /**\\n // * @dev Indicates that the contract is in the process of being initialized.\\n // */\\n // bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) ||\\n (!Address.isContract(address(this)) && _initialized == 1),\\n 'Initializable: contract is already initialized'\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(\\n !_initializing && _initialized < version,\\n 'Initializable: contract is already initialized'\\n );\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, 'Initializable: contract is not initializing');\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, 'Initializable: contract is initializing');\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x64d931c5e29318bd4ae2ec44b3be45783ad7ad20431594bbcb9ae4e2014bc5ef\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/OwnableLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport '../utils/Context.sol';\\nimport './AttestationsRegistryState.sol';\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n // This is the only diff with OZ contract\\n // address private _owner;\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x74ff8ebdd6ad706a45354f1045ef623840aa1dbde37874dde2b6bfa498e0bdb3\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/PausableLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport '../utils/Context.sol';\\nimport './AttestationsRegistryState.sol';\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableLogic is Context, AttestationsRegistryState {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n // this is the only diff with OZ contract\\n // bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n require(!paused(), 'Pausable: paused');\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n require(paused(), 'Pausable: not paused');\\n _;\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0x234c48f5eb48bb15b6c2535428f1e28e172bc2c6fbf58c99ba7b3ca75e884c60\",\"license\":\"MIT\"},\"contracts/core/libs/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, 'Address: insufficient balance');\\n\\n (bool success, ) = recipient.call{value: amount}('');\\n require(success, 'Address: unable to send value, recipient may have reverted');\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, 'Address: low-level call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, 'Address: insufficient balance for call');\\n require(isContract(target), 'Address: call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data\\n ) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, 'Address: low-level static call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), 'Address: static call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), 'Address: delegate call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xdbca640e165333604a6121b07d206eea2b596dd3c3bb4d62caa436a05ac1d91d\",\"license\":\"MIT\"},\"contracts/core/libs/utils/Bitmap256Bit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/*\\n * The 256-bit bitmap is structured in 64 chuncks of 4 bits each.\\n * The 4 bits can encode any value from 0 to 15.\\n\\n chunck63 chunck2 chunck1 chunck0\\n bits bits bits bits \\n \\u250c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510 \\u250c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u252c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u252c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510\\n \\u2502 1 1 1 1 \\u2502 .... \\u2502 1 0 1 1 \\u2502 0 0 0 0 \\u2502 0 0 0 1 \\u2502\\n \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518 \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2534\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2534\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518\\n value 15 value 11 value 0 value 1\\n\\n * A chunck index must be between 0 and 63.\\n * A value must be between 0 and 15.\\n **/\\n\\nlibrary Bitmap256Bit {\\n uint256 constant MAX_INT = 2 ** 256 - 1;\\n\\n error IndexOutOfBounds(uint8 index);\\n error ValueOutOfBounds(uint8 value);\\n\\n /**\\n * @dev Return the value at a given index of a 256-bit bitmap\\n * @param index index where the value can be found. Can be between 0 and 63\\n */\\n function _get(uint256 self, uint8 index) internal pure returns (uint8) {\\n uint256 currentValues = self;\\n // Get the encoded 4-bit value by right shifting to the `index` position\\n uint256 shifted = currentValues >> (4 * index);\\n // Get the value by only masking the last 4 bits with an AND operator\\n return uint8(shifted & (2 ** 4 - 1));\\n }\\n\\n /**\\n * @dev Set a value at a chosen index in a 256-bit bitmap\\n * @param index index where the value will be stored. Can be between 0 and 63\\n * @param value value to store. Can be between 0 and 15\\n */\\n function _set(uint256 self, uint8 index, uint8 value) internal pure returns (uint256) {\\n _checkIndexIsValid(index);\\n _checkValueIsValid(value);\\n\\n uint256 currentValues = self;\\n // 1. first we need to remove the current value for the inputed `index`\\n // Left Shift 4 bits mask (1111 mask) to the `index` position\\n uint256 mask = (2 ** 4 - 1) << (4 * index);\\n // Apply a XOR operation to obtain a mask with all bits set to 1 except the 4 bits that we want to remove\\n uint256 negativeMask = MAX_INT ^ mask;\\n // Apply a AND operation between the current values and the negative mask to remove the wanted bits\\n uint256 newValues = currentValues & negativeMask;\\n\\n // 2. We set the new value wanted at the `index` position\\n // Create the 4 bits encoding the new value and left shift them to the `index` position\\n uint256 newValueMask = uint256(value) << (4 * index);\\n // Apply an OR operation between the current values and the newValueMask to reference new value\\n return newValues | newValueMask;\\n }\\n\\n /**\\n * @dev Get all the non-zero values in a 256-bit bitmap\\n * @param self a 256-bit bitmap\\n */\\n function _getAllNonZeroValues(\\n uint256 self\\n ) internal pure returns (uint8[] memory, uint8[] memory, uint8) {\\n uint8[] memory indices = new uint8[](64);\\n uint8[] memory values = new uint8[](64);\\n uint8 nbOfNonZeroValues = 0;\\n for (uint8 i = 0; i < 63; i++) {\\n uint8 value = _get(self, i);\\n if (value > 0) {\\n indices[nbOfNonZeroValues] = i;\\n values[nbOfNonZeroValues] = value;\\n nbOfNonZeroValues++;\\n }\\n }\\n return (indices, values, nbOfNonZeroValues);\\n }\\n\\n /**\\n * @dev Check if the index is valid (is between 0 and 63)\\n * @param index index of a chunck\\n */\\n function _checkIndexIsValid(uint8 index) internal pure {\\n if (index > 63) {\\n revert IndexOutOfBounds(index);\\n }\\n }\\n\\n /**\\n * @dev Check if the value is valid (is between 0 and 15)\\n * @param value value to encode in a chunck\\n */\\n function _checkValueIsValid(uint8 value) internal pure {\\n if (value > 15) {\\n revert ValueOutOfBounds(value);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xac6ca38e106fb9e999b0c765dba0f8894697c3aead9459ffeab6b32e3560b39e\",\"license\":\"MIT\"},\"contracts/core/libs/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2dba7215628ceb3bb6f28422c7ca48d79615dd7aa8ba54978d4d8cad996f57e\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60a06040523480156200001157600080fd5b506040516200393538038062003935833981016040819052620000349162000209565b6200003f336200006b565b6000805462ff0000191690556001600160a01b0381166080526200006382620000c8565b505062000241565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600390610100900460ff16158015620000eb575060005460ff8083169116105b620001535760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff83161761010017815562000181600054630100000090046001600160a01b031690565b6001600160a01b03161480620001965750303b155b15620001a757620001a7826200006b565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b80516001600160a01b03811681146200020457600080fd5b919050565b600080604083850312156200021d57600080fd5b6200022883620001ec565b91506200023860208401620001ec565b90509250929050565b6080516136d86200025d600039600061258301526136d86000f3fe608060405234801561001057600080fd5b50600436106102275760003560e01c80637ffe93fc11610130578063b8865673116100b8578063dc873d011161007c578063dc873d0114610566578063e78d54bb14610586578063e972f91014610599578063ebc5c093146105ac578063f2fde38b146105bf57600080fd5b8063b8865673146104e5578063c06d5db6146104f8578063c4d66de81461050b578063c7da9aa61461051e578063da5d314b1461055357600080fd5b806384c2ad82116100ff57806384c2ad821461044d5780638c3c9e321461046d5780638da5cb5b1461048e578063aad9a979146104bf578063b1cb1662146104d257600080fd5b80637ffe93fc1461040c578063811a6af71461041f57806381213f22146104325780638456cb591461044557600080fd5b8063436a76f3116101b35780636d7fbb67116101825780636d7fbb67146103a4578063715018a6146103c4578063754b377c146103cc5780637cc920b4146103e65780637cde0fe2146103f957600080fd5b8063436a76f31461033f5780635657f0361461035f5780635c975abb1461038057806364fff83c1461039157600080fd5b80631538ff08116101fa5780631538ff08146102db578063181dfdff146102ee5780632972b0f0146103015780633be1ced7146103145780633f4ba83a1461033757600080fd5b8063011023901461022c57806305b374211461025457806314067f8b1461026957806315027bda146102bb575b600080fd5b61023f61023a366004612932565b6105d2565b60405190151581526020015b60405180910390f35b61026761026236600461296f565b6105e9565b005b6102a6610277366004612932565b6000918252602080805260408084206001600160a01b0393909316845291905290206002015463ffffffff1690565b60405163ffffffff909116815260200161024b565b6102ce6102c9366004612a95565b610669565b60405161024b9190612be4565b6102676102e9366004612ca8565b61075a565b6102676102fc366004612dd2565b61080d565b61023f61030f366004612e45565b6108cd565b610327610322366004612932565b6108e0565b60405161024b9493929190612e61565b6102676109f6565b61035261034d366004612e9e565b610a32565b60405161024b9190612f22565b61037261036d366004612f35565b610ae0565b60405161024b929190612f4e565b60005462010000900460ff1661023f565b61026761039f366004612f9b565b610c65565b6103b76103b2366004612932565b610cd7565b60405161024b9190612fcf565b610267610d8f565b6103d4600381565b60405160ff909116815260200161024b565b6102676103f4366004612fe2565b610dcb565b61026761040736600461305f565b610ea2565b61026761041a366004613092565b610edf565b61026761042d3660046130f8565b610f54565b61023f610440366004612e9e565b611330565b61026761138a565b61046061045b366004612932565b6113c4565b60405161024b9190613163565b61048061047b366004612932565b6113f1565b60405190815260200161024b565b6104a7600054630100000090046001600160a01b031690565b6040516001600160a01b03909116815260200161024b565b6102676104cd36600461296f565b6113fd565b6102676104e0366004612ca8565b611471565b6102676104f3366004613176565b61151f565b6102676105063660046131b9565b6115b4565b6102676105193660046131f2565b6115f2565b6104a761052c366004612932565b6000918252602080805260408084206001600160a01b039384168552909152909120541690565b61023f61056136600461320d565b61170c565b610579610574366004612a95565b611733565b60405161024b9190613230565b610267610594366004613274565b6117f3565b6103d46105a736600461320d565b611867565b6102676105ba3660046132b0565b611888565b6102676105cd3660046131f2565b611ce0565b60006105de8383611d80565b151590505b92915050565b6000546001600160a01b0363010000009091041633146106245760405162461bcd60e51b815260040161061b906132f1565b60405180910390fd5b6106308260ff16611da9565b61063982611dd3565b61065b5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6106658282611dfc565b5050565b6060600083516001600160401b0381111561068657610686612999565b6040519080825280602002602001820160405280156106d757816020015b60408051608081018252600080825260208083018290529282015260608082015282526000199092019101816106a45790505b50905060005b8451811015610752576107228582815181106106fb576106fb613326565b602002602001015185838151811061071557610715613326565b6020026020010151611e5c565b82828151811061073457610734613326565b6020026020010181905250808061074a90613352565b9150506106dd565b509392505050565b6000546001600160a01b03630100000090910416331461078c5760405162461bcd60e51b815260040161061b906132f1565b80518251146107ae57604051636e37235160e11b815260040160405180910390fd5b60005b8251811015610808576107f68382815181106107cf576107cf613326565b60200260200101518383815181106107e9576107e9613326565b60200260200101516105e9565b8061080081613352565b9150506107b1565b505050565b6000546001600160a01b03630100000090910416331461083f5760405162461bcd60e51b815260040161061b906132f1565b60005b81518110156108c7576108b5848284848151811061086257610862613326565b6020026020010151610874919061336b565b85848151811061088657610886613326565b6020026020010151600001518685815181106108a4576108a4613326565b602002602001015160200151611f6b565b806108bf81613352565b915050610842565b50505050565b60006108d9838361220a565b9392505050565b6000828152602080805260408083206001600160a01b038086168552908352818420825160808101845281549092168252600181015493820193909352600283015463ffffffff1691810191909152600382018054849384936060938593919291838601919061094f90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461097b90613382565b80156109c85780601f1061099d576101008083540402835291602001916109c8565b820191906000526020600020905b8154815290600101906020018083116109ab57829003601f168201915b505050919092525050815160208301516040840151606090940151919b909a50929850965090945050505050565b6000546001600160a01b036301000000909104163314610a285760405162461bcd60e51b815260040161061b906132f1565b610a3061222c565b565b6060600082516001600160401b03811115610a4f57610a4f612999565b604051908082528060200260200182016040528015610a78578160200160208202803683370190505b50905060005b835181101561075257610aaa85858381518110610a9d57610a9d613326565b6020026020010151611867565b828281518110610abc57610abc613326565b60ff9092166020928302919091019091015280610ad881613352565b915050610a7e565b6000818152601160205260408120546060918291908080610b00846122c7565b92509250925060008160ff166001600160401b03811115610b2357610b23612999565b604051908082528060200260200182016040528015610b4c578160200160208202803683370190505b50905060008260ff166001600160401b03811115610b6c57610b6c612999565b604051908082528060200260200182016040528015610b95578160200160208202803683370190505b50905060005b8360ff168160ff161015610c565760126000878360ff1681518110610bc257610bc2613326565b602002602001015160ff1660ff16815260200190815260200160002054838260ff1681518110610bf457610bf4613326565b602002602001018181525050848160ff1681518110610c1557610c15613326565b6020026020010151828260ff1681518110610c3257610c32613326565b60ff9092166020928302919091019091015280610c4e816133bc565b915050610b9b565b50909890975095505050505050565b6000546001600160a01b036301000000909104163314610c975760405162461bcd60e51b815260040161061b906132f1565b60005b815181101561066557610cc5828281518110610cb857610cb8613326565b6020026020010151610edf565b80610ccf81613352565b915050610c9a565b6000828152602080805260408083206001600160a01b03851684529091529020600301805460609190610d0990613382565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3590613382565b8015610d825780601f10610d5757610100808354040283529160200191610d82565b820191906000526020600020905b815481529060010190602001808311610d6557829003601f168201915b5050505050905092915050565b6000546001600160a01b036301000000909104163314610dc15760405162461bcd60e51b815260040161061b906132f1565b610a3060006123bc565b6000546001600160a01b036301000000909104163314610dfd5760405162461bcd60e51b815260040161061b906132f1565b81518351141580610e1057508051835114155b15610e2e57604051636e37235160e11b815260040160405180910390fd5b60005b83518110156108c757610e90848281518110610e4f57610e4f613326565b6020026020010151848381518110610e6957610e69613326565b6020026020010151848481518110610e8357610e83613326565b60200260200101516117f3565b80610e9a81613352565b915050610e31565b6000546001600160a01b036301000000909104163314610ed45760405162461bcd60e51b815260040161061b906132f1565b610808838383612419565b6000546001600160a01b036301000000909104163314610f115760405162461bcd60e51b815260040161061b906132f1565b610f1d8160ff16611da9565b610f2681611dd3565b610f485760405163eabeadd360e01b815260ff8216600482015260240161061b565b610f51816124ac565b50565b60005462010000900460ff1615610f7d5760405162461bcd60e51b815260040161061b906133db565b828114610fa55783838383604051638ceb003d60e01b815260040161061b9493929190613405565b3360005b8481101561132857600060206000868685818110610fc957610fc9613326565b9050602002013581526020019081526020016000206000888885818110610ff257610ff2613326565b905060200201602081019061100791906131f2565b6001600160a01b0390811682526020808301939093526040918201600020825160808101845281549092168252600181015493820193909352600283015463ffffffff169181019190915260038201805491929160608401919061106a90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461109690613382565b80156110e35780601f106110b8576101008083540402835291602001916110e3565b820191906000526020600020905b8154815290600101906020018083116110c657829003601f168201915b50505050508152505090506111108386868581811061110457611104613326565b9050602002013561220a565b61115a578285858481811061112757611127613326565b60405163c522f21160e01b81526001600160a01b039094166004850152602002919091013560248301525060440161061b565b6020600086868581811061117057611170613326565b905060200201358152602001908152602001600020600088888581811061119957611199613326565b90506020020160208101906111ae91906131f2565b6001600160a01b031681526020810191909152604001600090812080546001600160a01b03191681556001810182905560028101805463ffffffff19169055906111fb6003830182612843565b505061124c85858481811061121257611212613326565b9050602002013588888581811061122b5761122b613326565b905060200201602081019061124091906131f2565b836020015160006124fb565b7f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b6040518060c0016040528087878681811061128a5761128a613326565b9050602002013581526020018989868181106112a8576112a8613326565b90506020020160208101906112bd91906131f2565b6001600160a01b0316815260200183600001516001600160a01b0316815260200183602001518152602001836040015163ffffffff168152602001836060015181525060405161130d9190613487565b60405180910390a1508061132081613352565b915050610fa9565b505050505050565b6000805b8251811015611380576113608484838151811061135357611353613326565b602002602001015161170c565b61136e5760009150506105e3565b8061137881613352565b915050611334565b5060019392505050565b6000546001600160a01b0363010000009091041633146113bc5760405162461bcd60e51b815260040161061b906132f1565b610a306125ec565b60408051608081018252600080825260208201819052918101919091526060808201526108d98383611e5c565b60006108d98383611d80565b6000546001600160a01b03630100000090910416331461142f5760405162461bcd60e51b815260040161061b906132f1565b61143b8260ff16611da9565b61144482611dd3565b1561146757604051635d04d75160e01b815260ff8316600482015260240161061b565b610665828261264e565b6000546001600160a01b0363010000009091041633146114a35760405162461bcd60e51b815260040161061b906132f1565b80518251146114c557604051636e37235160e11b815260040160405180910390fd5b60005b82518110156108085761150d8382815181106114e6576114e6613326565b602002602001015183838151811061150057611500613326565b60200260200101516113fd565b8061151781613352565b9150506114c8565b6000546001600160a01b0363010000009091041633146115515760405162461bcd60e51b815260040161061b906132f1565b60005b8151811015610808576115a28383838151811061157357611573613326565b60200260200101516000015184848151811061159157611591613326565b602002602001015160200151612419565b806115ac81613352565b915050611554565b6000546001600160a01b0363010000009091041633146115e65760405162461bcd60e51b815260040161061b906132f1565b6108c784848484611f6b565b600054600390610100900460ff16158015611614575060005460ff8083169116105b6116775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161061b565b6000805461ffff191660ff8316176101001781556116a4600054630100000090046001600160a01b031690565b6001600160a01b031614806116b85750303b155b156116c6576116c6826123bc565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60008281526011602052604081205460006117278285612699565b60ff1611949350505050565b6060600083516001600160401b0381111561175057611750612999565b604051908082528060200260200182016040528015611779578160200160208202803683370190505b50905060005b8451811015610752576117c485828151811061179d5761179d613326565b60200260200101518583815181106117b7576117b7613326565b6020026020010151611d80565b8282815181106117d6576117d6613326565b6020908102919091010152806117eb81613352565b91505061177f565b6000546001600160a01b0363010000009091041633146118255760405162461bcd60e51b815260040161061b906132f1565b6118318260ff16611da9565b61183a82611dd3565b61185c5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6108088383836126be565b6000828152601160205260408120546118808184612699565b949350505050565b60005462010000900460ff16156118b15760405162461bcd60e51b815260040161061b906133db565b3360005b828110156108c7576118eb828585848181106118d3576118d3613326565b90506020028101906118e591906134e8565b3561220a565b61193f578184848381811061190257611902613326565b905060200281019061191491906134e8565b60405163c522f21160e01b81526001600160a01b03909216600483015235602482015260440161061b565b60006020600086868581811061195757611957613326565b905060200281019061196991906134e8565b600001358152602001908152602001600020600086868581811061198f5761198f613326565b90506020028101906119a191906134e8565b6119b29060408101906020016131f2565b6001600160a01b03166001600160a01b0316815260200190815260200160002060010154905060405180608001604052808686858181106119f5576119f5613326565b9050602002810190611a0791906134e8565b611a189060608101906040016131f2565b6001600160a01b03168152602001868685818110611a3857611a38613326565b9050602002810190611a4a91906134e8565b606001358152602001868685818110611a6557611a65613326565b9050602002810190611a7791906134e8565b611a889060a081019060800161351c565b63ffffffff168152602001868685818110611aa557611aa5613326565b9050602002810190611ab791906134e8565b611ac59060a0810190613537565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250602092508890508786818110611b1257611b12613326565b9050602002810190611b2491906134e8565b6000013581526020019081526020016000206000878786818110611b4a57611b4a613326565b9050602002810190611b5c91906134e8565b611b6d9060408101906020016131f2565b6001600160a01b0390811682526020808301939093526040918201600020845181546001600160a01b03191692169190911781558383015160018201559083015160028201805463ffffffff191663ffffffff909216919091179055606083015180519192611be49260038501929091019061287d565b50905050611c73858584818110611bfd57611bfd613326565b9050602002810190611c0f91906134e8565b35868685818110611c2257611c22613326565b9050602002810190611c3491906134e8565b611c459060408101906020016131f2565b83888887818110611c5857611c58613326565b9050602002810190611c6a91906134e8565b606001356124fb565b7f8c20c3acb6b5208b7affea2fd90dabc8d47e77cee9766c855ce42730505cb205858584818110611ca657611ca6613326565b9050602002810190611cb891906134e8565b604051611cc591906135a6565b60405180910390a15080611cd881613352565b9150506118b5565b6000546001600160a01b036301000000909104163314611d125760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b038116611d775760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061b565b610f51816123bc565b6000918252602080805260408084206001600160a01b0393909316845291905290206001015490565b603f8160ff161115610f515760405163453e14b960e01b815260ff8216600482015260240161061b565b60ff81166000908152601260205260408120548103611df457506000919050565b506001919050565b60ff82166000818152601260209081526040918290208054908590558251938452908301849052908201819052907f0d3d8d66bac9b2a9f0e5c83181a30443294ab849472526080d03fffd7187f7169060600160405180910390a1505050565b60408051608081018252600080825260208201819052918101919091526060808201526000838152602080805260408083206001600160a01b03808716855290835292819020815160808101835281549094168452600181015492840192909252600282015463ffffffff1690830152600381018054606084019190611ee190613382565b80601f0160208091040260200160405190810160405280929190818152602001828054611f0d90613382565b8015611f5a5780601f10611f2f57610100808354040283529160200191611f5a565b820191906000526020600020905b815481529060010190602001808311611f3d57829003601f168201915b505050505081525050905092915050565b6000546001600160a01b036301000000909104163314611f9d5760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b0384166000908152601060205260409020548310611fff576001600160a01b038416600081815260106020526040908190205490516345e388eb60e01b8152600481019290925260248201526044810184905260640161061b565b6001600160a01b038416600090815260106020526040812080548590811061202957612029613326565b600091825260208083206002909202909101546001600160a01b03881683526010909152604082208054919350908690811061206757612067613326565b9060005260206000209060020201600101549050818414158061208a5750808314155b156120d657604051637a4dd76560e01b81526001600160a01b03871660048201526024810186905260448101839052606481018290526084810185905260a4810184905260c40161061b565b6001600160a01b038616600090815260106020526040902080546120fc9060019061336b565b8154811061210c5761210c613326565b906000526020600020906002020160106000886001600160a01b03166001600160a01b03168152602001908152602001600020868154811061215057612150613326565b60009182526020808320845460029093020191825560019384015493909101929092556001600160a01b038816815260109091526040902080548061219757612197613663565b6000828152602080822060026000199490940193840201828155600101919091559155604080516001600160a01b038916815291820186905281018490527f33cff58e54c3a8acae85cad63487b5dcf617521e33bb03f071299f374c29de1f9060600160405180910390a1505050505050565b6001600160a01b03821660009081526010602052604081206108d99083612732565b60005462010000900460ff1661227b5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161061b565b6000805462ff0000191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60408051818152610820810182526060918291600091829190602082016108008036833750506040805181815261082081018252929350600092915060208201610800803683370190505090506000805b603f8160ff1610156123ae5760006123308983612699565b905060ff81161561239b5781858460ff168151811061235157612351613326565b602002602001019060ff16908160ff168152505080848460ff168151811061237b5761237b613326565b60ff9092166020928302919091019091015282612397816133bc565b9350505b50806123a6816133bc565b915050612318565b509196909550909350915050565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60408051808201825283815260208082018481526001600160a01b03871660008181526010845285812080546001808201835591835291859020865160029093020191825592519201919091558351908152908101859052918201839052907fe7d6ac0b740347f7f96a97e6a9dc0f20f4f11eca65495315adc009a55b6762f8906060015b60405180910390a150505050565b60ff811660008181526012602090815260408083208054939055805193845290830182905290917feb82955a27e39ea7559b6ec7e7d8b371081ab0d8783c7b0d01597555e7dcadbf9101611700565b8181113060008261250c578561250f565b60005b905060008361251f576000612521565b865b905060008461253957612534868861336b565b612543565b612543878761336b565b604051633885984b60e11b81526001600160a01b03868116600483015285811660248301528481166044830152606482018c9052608482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063710b30969060a401600060405180830381600087803b1580156125c957600080fd5b505af11580156125dd573d6000803e3d6000fd5b50505050505050505050505050565b60005462010000900460ff16156126155760405162461bcd60e51b815260040161061b906133db565b6000805462ff00001916620100001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122aa3390565b60ff8216600081815260126020908152604091829020849055815192835282018390527f16f0bfe4b02efd5423ef8906906b049c0943f21df8f10347d319fddbc59222079101611700565b600082816126a8846004613679565b60ff1682901c905080600f169250505092915050565b6000838152601160205260409020546126d88184846127c0565b6000858152601160205260409081902091909155517f393b86c90799fa411201ae723a54e105823fcf7c6c8dffa90903fc44c03b4ac79061249e9086908690869092835260ff918216602084015216604082015260600190565b6000805b83548110156127b65783818154811061275157612751613326565b9060005260206000209060020201600001548310158015612795575083818154811061277f5761277f613326565b9060005260206000209060020201600101548311155b156127a45760019150506105e3565b806127ae81613352565b915050612736565b5060009392505050565b60006127cb83611da9565b6127d482612819565b8360006127e2856004613679565b600f60ff919091161b905060001981188281166000612802886004613679565b60ff97881697169690961b17979650505050505050565b600f8160ff161115610f51576040516329afd27b60e21b815260ff8216600482015260240161061b565b50805461284f90613382565b6000825580601f1061285f575050565b601f016020900490600052602060002090810190610f519190612901565b82805461288990613382565b90600052602060002090601f0160209004810192826128ab57600085556128f1565b82601f106128c457805160ff19168380011785556128f1565b828001600101855582156128f1579182015b828111156128f15782518255916020019190600101906128d6565b506128fd929150612901565b5090565b5b808211156128fd5760008155600101612902565b80356001600160a01b038116811461292d57600080fd5b919050565b6000806040838503121561294557600080fd5b8235915061295560208401612916565b90509250929050565b803560ff8116811461292d57600080fd5b6000806040838503121561298257600080fd5b61298b8361295e565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156129d1576129d1612999565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129ff576129ff612999565b604052919050565b60006001600160401b03821115612a2057612a20612999565b5060051b60200190565b600082601f830112612a3b57600080fd5b81356020612a50612a4b83612a07565b6129d7565b82815260059290921b84018101918181019086841115612a6f57600080fd5b8286015b84811015612a8a5780358352918301918301612a73565b509695505050505050565b60008060408385031215612aa857600080fd5b82356001600160401b0380821115612abf57600080fd5b612acb86838701612a2a565b9350602091508185013581811115612ae257600080fd5b85019050601f81018613612af557600080fd5b8035612b03612a4b82612a07565b81815260059190911b82018301908381019088831115612b2257600080fd5b928401925b82841015612b4757612b3884612916565b82529284019290840190612b27565b80955050505050509250929050565b6000815180845260005b81811015612b7c57602081850181015186830182015201612b60565b81811115612b8e576000602083870101525b50601f01601f19169290920160200192915050565b60018060a01b0381511682526020810151602083015263ffffffff604082015116604083015260006060820151608060608501526118806080850182612b56565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612c3957603f19888603018452612c27858351612ba3565b94509285019290850190600101612c0b565b5092979650505050505050565b600082601f830112612c5757600080fd5b81356020612c67612a4b83612a07565b82815260059290921b84018101918181019086841115612c8657600080fd5b8286015b84811015612a8a57612c9b8161295e565b8352918301918301612c8a565b60008060408385031215612cbb57600080fd5b82356001600160401b0380821115612cd257600080fd5b612cde86838701612c46565b9350602091508185013581811115612cf557600080fd5b85019050601f81018613612d0857600080fd5b8035612d16612a4b82612a07565b81815260059190911b82018301908381019088831115612d3557600080fd5b928401925b82841015612b4757833582529284019290840190612d3a565b600082601f830112612d6457600080fd5b81356020612d74612a4b83612a07565b82815260069290921b84018101918181019086841115612d9357600080fd5b8286015b84811015612a8a5760408189031215612db05760008081fd5b612db86129af565b813581528482013585820152835291830191604001612d97565b600080600060608486031215612de757600080fd5b612df084612916565b925060208401356001600160401b0380821115612e0c57600080fd5b612e1887838801612d53565b93506040860135915080821115612e2e57600080fd5b50612e3b86828701612a2a565b9150509250925092565b60008060408385031215612e5857600080fd5b61298b83612916565b60018060a01b038516815283602082015263ffffffff83166040820152608060608201526000612e946080830184612b56565b9695505050505050565b60008060408385031215612eb157600080fd5b8235915060208301356001600160401b03811115612ece57600080fd5b612eda85828601612c46565b9150509250929050565b600081518084526020808501945080840160005b83811015612f1757815160ff1687529582019590820190600101612ef8565b509495945050505050565b6020815260006108d96020830184612ee4565b600060208284031215612f4757600080fd5b5035919050565b604080825283519082018190526000906020906060840190828701845b82811015612f8757815184529284019290840190600101612f6b565b50505083810382850152612e948186612ee4565b600060208284031215612fad57600080fd5b81356001600160401b03811115612fc357600080fd5b61188084828501612c46565b6020815260006108d96020830184612b56565b600080600060608486031215612ff757600080fd5b83356001600160401b038082111561300e57600080fd5b61301a87838801612a2a565b9450602086013591508082111561303057600080fd5b61303c87838801612c46565b9350604086013591508082111561305257600080fd5b50612e3b86828701612c46565b60008060006060848603121561307457600080fd5b61307d84612916565b95602085013595506040909401359392505050565b6000602082840312156130a457600080fd5b6108d98261295e565b60008083601f8401126130bf57600080fd5b5081356001600160401b038111156130d657600080fd5b6020830191508360208260051b85010111156130f157600080fd5b9250929050565b6000806000806040858703121561310e57600080fd5b84356001600160401b038082111561312557600080fd5b613131888389016130ad565b9096509450602087013591508082111561314a57600080fd5b50613157878288016130ad565b95989497509550505050565b6020815260006108d96020830184612ba3565b6000806040838503121561318957600080fd5b61319283612916565b915060208301356001600160401b038111156131ad57600080fd5b612eda85828601612d53565b600080600080608085870312156131cf57600080fd5b6131d885612916565b966020860135965060408601359560600135945092505050565b60006020828403121561320457600080fd5b6108d982612916565b6000806040838503121561322057600080fd5b823591506129556020840161295e565b6020808252825182820181905260009190848201906040850190845b818110156132685783518352928401929184019160010161324c565b50909695505050505050565b60008060006060848603121561328957600080fd5b833592506132996020850161295e565b91506132a76040850161295e565b90509250925092565b600080602083850312156132c357600080fd5b82356001600160401b038111156132d957600080fd5b6132e5858286016130ad565b90969095509350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016133645761336461333c565b5060010190565b60008282101561337d5761337d61333c565b500390565b600181811c9082168061339657607f821691505b6020821081036133b657634e487b7160e01b600052602260045260246000fd5b50919050565b600060ff821660ff81036133d2576133d261333c565b60010192915050565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6040808252810184905260008560608301825b87811015613446576001600160a01b0361343184612916565b16825260209283019290910190600101613418565b5083810360208501528481526001600160fb1b0385111561346657600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b60208152815160208201526000602083015160018060a01b03808216604085015280604086015116606085015250506060830151608083015263ffffffff60808401511660a083015260a083015160c08084015261188060e0840182612b56565b6000823560be198336030181126134fe57600080fd5b9190910192915050565b803563ffffffff8116811461292d57600080fd5b60006020828403121561352e57600080fd5b6108d982613508565b6000808335601e1984360301811261354e57600080fd5b8301803591506001600160401b0382111561356857600080fd5b6020019150368190038213156130f157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b602081528135602082015260006135bf60208401612916565b60018060a01b038082166040850152806135db60408701612916565b16606085015250506060830135608083015263ffffffff6135fe60808501613508565b1660a083015260a0830135601e1984360301811261361b57600080fd5b83016020810190356001600160401b0381111561363757600080fd5b80360382131561364657600080fd5b60c08085015261365a60e08501828461357d565b95945050505050565b634e487b7160e01b600052603160045260246000fd5b600060ff821660ff84168160ff048111821515161561369a5761369a61333c565b02939250505056fea26469706673582212209714c1001d19740a655ea4426b52e9f5d8348f9df38d027a88d1f1095e244e9464736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102275760003560e01c80637ffe93fc11610130578063b8865673116100b8578063dc873d011161007c578063dc873d0114610566578063e78d54bb14610586578063e972f91014610599578063ebc5c093146105ac578063f2fde38b146105bf57600080fd5b8063b8865673146104e5578063c06d5db6146104f8578063c4d66de81461050b578063c7da9aa61461051e578063da5d314b1461055357600080fd5b806384c2ad82116100ff57806384c2ad821461044d5780638c3c9e321461046d5780638da5cb5b1461048e578063aad9a979146104bf578063b1cb1662146104d257600080fd5b80637ffe93fc1461040c578063811a6af71461041f57806381213f22146104325780638456cb591461044557600080fd5b8063436a76f3116101b35780636d7fbb67116101825780636d7fbb67146103a4578063715018a6146103c4578063754b377c146103cc5780637cc920b4146103e65780637cde0fe2146103f957600080fd5b8063436a76f31461033f5780635657f0361461035f5780635c975abb1461038057806364fff83c1461039157600080fd5b80631538ff08116101fa5780631538ff08146102db578063181dfdff146102ee5780632972b0f0146103015780633be1ced7146103145780633f4ba83a1461033757600080fd5b8063011023901461022c57806305b374211461025457806314067f8b1461026957806315027bda146102bb575b600080fd5b61023f61023a366004612932565b6105d2565b60405190151581526020015b60405180910390f35b61026761026236600461296f565b6105e9565b005b6102a6610277366004612932565b6000918252602080805260408084206001600160a01b0393909316845291905290206002015463ffffffff1690565b60405163ffffffff909116815260200161024b565b6102ce6102c9366004612a95565b610669565b60405161024b9190612be4565b6102676102e9366004612ca8565b61075a565b6102676102fc366004612dd2565b61080d565b61023f61030f366004612e45565b6108cd565b610327610322366004612932565b6108e0565b60405161024b9493929190612e61565b6102676109f6565b61035261034d366004612e9e565b610a32565b60405161024b9190612f22565b61037261036d366004612f35565b610ae0565b60405161024b929190612f4e565b60005462010000900460ff1661023f565b61026761039f366004612f9b565b610c65565b6103b76103b2366004612932565b610cd7565b60405161024b9190612fcf565b610267610d8f565b6103d4600381565b60405160ff909116815260200161024b565b6102676103f4366004612fe2565b610dcb565b61026761040736600461305f565b610ea2565b61026761041a366004613092565b610edf565b61026761042d3660046130f8565b610f54565b61023f610440366004612e9e565b611330565b61026761138a565b61046061045b366004612932565b6113c4565b60405161024b9190613163565b61048061047b366004612932565b6113f1565b60405190815260200161024b565b6104a7600054630100000090046001600160a01b031690565b6040516001600160a01b03909116815260200161024b565b6102676104cd36600461296f565b6113fd565b6102676104e0366004612ca8565b611471565b6102676104f3366004613176565b61151f565b6102676105063660046131b9565b6115b4565b6102676105193660046131f2565b6115f2565b6104a761052c366004612932565b6000918252602080805260408084206001600160a01b039384168552909152909120541690565b61023f61056136600461320d565b61170c565b610579610574366004612a95565b611733565b60405161024b9190613230565b610267610594366004613274565b6117f3565b6103d46105a736600461320d565b611867565b6102676105ba3660046132b0565b611888565b6102676105cd3660046131f2565b611ce0565b60006105de8383611d80565b151590505b92915050565b6000546001600160a01b0363010000009091041633146106245760405162461bcd60e51b815260040161061b906132f1565b60405180910390fd5b6106308260ff16611da9565b61063982611dd3565b61065b5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6106658282611dfc565b5050565b6060600083516001600160401b0381111561068657610686612999565b6040519080825280602002602001820160405280156106d757816020015b60408051608081018252600080825260208083018290529282015260608082015282526000199092019101816106a45790505b50905060005b8451811015610752576107228582815181106106fb576106fb613326565b602002602001015185838151811061071557610715613326565b6020026020010151611e5c565b82828151811061073457610734613326565b6020026020010181905250808061074a90613352565b9150506106dd565b509392505050565b6000546001600160a01b03630100000090910416331461078c5760405162461bcd60e51b815260040161061b906132f1565b80518251146107ae57604051636e37235160e11b815260040160405180910390fd5b60005b8251811015610808576107f68382815181106107cf576107cf613326565b60200260200101518383815181106107e9576107e9613326565b60200260200101516105e9565b8061080081613352565b9150506107b1565b505050565b6000546001600160a01b03630100000090910416331461083f5760405162461bcd60e51b815260040161061b906132f1565b60005b81518110156108c7576108b5848284848151811061086257610862613326565b6020026020010151610874919061336b565b85848151811061088657610886613326565b6020026020010151600001518685815181106108a4576108a4613326565b602002602001015160200151611f6b565b806108bf81613352565b915050610842565b50505050565b60006108d9838361220a565b9392505050565b6000828152602080805260408083206001600160a01b038086168552908352818420825160808101845281549092168252600181015493820193909352600283015463ffffffff1691810191909152600382018054849384936060938593919291838601919061094f90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461097b90613382565b80156109c85780601f1061099d576101008083540402835291602001916109c8565b820191906000526020600020905b8154815290600101906020018083116109ab57829003601f168201915b505050919092525050815160208301516040840151606090940151919b909a50929850965090945050505050565b6000546001600160a01b036301000000909104163314610a285760405162461bcd60e51b815260040161061b906132f1565b610a3061222c565b565b6060600082516001600160401b03811115610a4f57610a4f612999565b604051908082528060200260200182016040528015610a78578160200160208202803683370190505b50905060005b835181101561075257610aaa85858381518110610a9d57610a9d613326565b6020026020010151611867565b828281518110610abc57610abc613326565b60ff9092166020928302919091019091015280610ad881613352565b915050610a7e565b6000818152601160205260408120546060918291908080610b00846122c7565b92509250925060008160ff166001600160401b03811115610b2357610b23612999565b604051908082528060200260200182016040528015610b4c578160200160208202803683370190505b50905060008260ff166001600160401b03811115610b6c57610b6c612999565b604051908082528060200260200182016040528015610b95578160200160208202803683370190505b50905060005b8360ff168160ff161015610c565760126000878360ff1681518110610bc257610bc2613326565b602002602001015160ff1660ff16815260200190815260200160002054838260ff1681518110610bf457610bf4613326565b602002602001018181525050848160ff1681518110610c1557610c15613326565b6020026020010151828260ff1681518110610c3257610c32613326565b60ff9092166020928302919091019091015280610c4e816133bc565b915050610b9b565b50909890975095505050505050565b6000546001600160a01b036301000000909104163314610c975760405162461bcd60e51b815260040161061b906132f1565b60005b815181101561066557610cc5828281518110610cb857610cb8613326565b6020026020010151610edf565b80610ccf81613352565b915050610c9a565b6000828152602080805260408083206001600160a01b03851684529091529020600301805460609190610d0990613382565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3590613382565b8015610d825780601f10610d5757610100808354040283529160200191610d82565b820191906000526020600020905b815481529060010190602001808311610d6557829003601f168201915b5050505050905092915050565b6000546001600160a01b036301000000909104163314610dc15760405162461bcd60e51b815260040161061b906132f1565b610a3060006123bc565b6000546001600160a01b036301000000909104163314610dfd5760405162461bcd60e51b815260040161061b906132f1565b81518351141580610e1057508051835114155b15610e2e57604051636e37235160e11b815260040160405180910390fd5b60005b83518110156108c757610e90848281518110610e4f57610e4f613326565b6020026020010151848381518110610e6957610e69613326565b6020026020010151848481518110610e8357610e83613326565b60200260200101516117f3565b80610e9a81613352565b915050610e31565b6000546001600160a01b036301000000909104163314610ed45760405162461bcd60e51b815260040161061b906132f1565b610808838383612419565b6000546001600160a01b036301000000909104163314610f115760405162461bcd60e51b815260040161061b906132f1565b610f1d8160ff16611da9565b610f2681611dd3565b610f485760405163eabeadd360e01b815260ff8216600482015260240161061b565b610f51816124ac565b50565b60005462010000900460ff1615610f7d5760405162461bcd60e51b815260040161061b906133db565b828114610fa55783838383604051638ceb003d60e01b815260040161061b9493929190613405565b3360005b8481101561132857600060206000868685818110610fc957610fc9613326565b9050602002013581526020019081526020016000206000888885818110610ff257610ff2613326565b905060200201602081019061100791906131f2565b6001600160a01b0390811682526020808301939093526040918201600020825160808101845281549092168252600181015493820193909352600283015463ffffffff169181019190915260038201805491929160608401919061106a90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461109690613382565b80156110e35780601f106110b8576101008083540402835291602001916110e3565b820191906000526020600020905b8154815290600101906020018083116110c657829003601f168201915b50505050508152505090506111108386868581811061110457611104613326565b9050602002013561220a565b61115a578285858481811061112757611127613326565b60405163c522f21160e01b81526001600160a01b039094166004850152602002919091013560248301525060440161061b565b6020600086868581811061117057611170613326565b905060200201358152602001908152602001600020600088888581811061119957611199613326565b90506020020160208101906111ae91906131f2565b6001600160a01b031681526020810191909152604001600090812080546001600160a01b03191681556001810182905560028101805463ffffffff19169055906111fb6003830182612843565b505061124c85858481811061121257611212613326565b9050602002013588888581811061122b5761122b613326565b905060200201602081019061124091906131f2565b836020015160006124fb565b7f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b6040518060c0016040528087878681811061128a5761128a613326565b9050602002013581526020018989868181106112a8576112a8613326565b90506020020160208101906112bd91906131f2565b6001600160a01b0316815260200183600001516001600160a01b0316815260200183602001518152602001836040015163ffffffff168152602001836060015181525060405161130d9190613487565b60405180910390a1508061132081613352565b915050610fa9565b505050505050565b6000805b8251811015611380576113608484838151811061135357611353613326565b602002602001015161170c565b61136e5760009150506105e3565b8061137881613352565b915050611334565b5060019392505050565b6000546001600160a01b0363010000009091041633146113bc5760405162461bcd60e51b815260040161061b906132f1565b610a306125ec565b60408051608081018252600080825260208201819052918101919091526060808201526108d98383611e5c565b60006108d98383611d80565b6000546001600160a01b03630100000090910416331461142f5760405162461bcd60e51b815260040161061b906132f1565b61143b8260ff16611da9565b61144482611dd3565b1561146757604051635d04d75160e01b815260ff8316600482015260240161061b565b610665828261264e565b6000546001600160a01b0363010000009091041633146114a35760405162461bcd60e51b815260040161061b906132f1565b80518251146114c557604051636e37235160e11b815260040160405180910390fd5b60005b82518110156108085761150d8382815181106114e6576114e6613326565b602002602001015183838151811061150057611500613326565b60200260200101516113fd565b8061151781613352565b9150506114c8565b6000546001600160a01b0363010000009091041633146115515760405162461bcd60e51b815260040161061b906132f1565b60005b8151811015610808576115a28383838151811061157357611573613326565b60200260200101516000015184848151811061159157611591613326565b602002602001015160200151612419565b806115ac81613352565b915050611554565b6000546001600160a01b0363010000009091041633146115e65760405162461bcd60e51b815260040161061b906132f1565b6108c784848484611f6b565b600054600390610100900460ff16158015611614575060005460ff8083169116105b6116775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161061b565b6000805461ffff191660ff8316176101001781556116a4600054630100000090046001600160a01b031690565b6001600160a01b031614806116b85750303b155b156116c6576116c6826123bc565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60008281526011602052604081205460006117278285612699565b60ff1611949350505050565b6060600083516001600160401b0381111561175057611750612999565b604051908082528060200260200182016040528015611779578160200160208202803683370190505b50905060005b8451811015610752576117c485828151811061179d5761179d613326565b60200260200101518583815181106117b7576117b7613326565b6020026020010151611d80565b8282815181106117d6576117d6613326565b6020908102919091010152806117eb81613352565b91505061177f565b6000546001600160a01b0363010000009091041633146118255760405162461bcd60e51b815260040161061b906132f1565b6118318260ff16611da9565b61183a82611dd3565b61185c5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6108088383836126be565b6000828152601160205260408120546118808184612699565b949350505050565b60005462010000900460ff16156118b15760405162461bcd60e51b815260040161061b906133db565b3360005b828110156108c7576118eb828585848181106118d3576118d3613326565b90506020028101906118e591906134e8565b3561220a565b61193f578184848381811061190257611902613326565b905060200281019061191491906134e8565b60405163c522f21160e01b81526001600160a01b03909216600483015235602482015260440161061b565b60006020600086868581811061195757611957613326565b905060200281019061196991906134e8565b600001358152602001908152602001600020600086868581811061198f5761198f613326565b90506020028101906119a191906134e8565b6119b29060408101906020016131f2565b6001600160a01b03166001600160a01b0316815260200190815260200160002060010154905060405180608001604052808686858181106119f5576119f5613326565b9050602002810190611a0791906134e8565b611a189060608101906040016131f2565b6001600160a01b03168152602001868685818110611a3857611a38613326565b9050602002810190611a4a91906134e8565b606001358152602001868685818110611a6557611a65613326565b9050602002810190611a7791906134e8565b611a889060a081019060800161351c565b63ffffffff168152602001868685818110611aa557611aa5613326565b9050602002810190611ab791906134e8565b611ac59060a0810190613537565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250602092508890508786818110611b1257611b12613326565b9050602002810190611b2491906134e8565b6000013581526020019081526020016000206000878786818110611b4a57611b4a613326565b9050602002810190611b5c91906134e8565b611b6d9060408101906020016131f2565b6001600160a01b0390811682526020808301939093526040918201600020845181546001600160a01b03191692169190911781558383015160018201559083015160028201805463ffffffff191663ffffffff909216919091179055606083015180519192611be49260038501929091019061287d565b50905050611c73858584818110611bfd57611bfd613326565b9050602002810190611c0f91906134e8565b35868685818110611c2257611c22613326565b9050602002810190611c3491906134e8565b611c459060408101906020016131f2565b83888887818110611c5857611c58613326565b9050602002810190611c6a91906134e8565b606001356124fb565b7f8c20c3acb6b5208b7affea2fd90dabc8d47e77cee9766c855ce42730505cb205858584818110611ca657611ca6613326565b9050602002810190611cb891906134e8565b604051611cc591906135a6565b60405180910390a15080611cd881613352565b9150506118b5565b6000546001600160a01b036301000000909104163314611d125760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b038116611d775760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061b565b610f51816123bc565b6000918252602080805260408084206001600160a01b0393909316845291905290206001015490565b603f8160ff161115610f515760405163453e14b960e01b815260ff8216600482015260240161061b565b60ff81166000908152601260205260408120548103611df457506000919050565b506001919050565b60ff82166000818152601260209081526040918290208054908590558251938452908301849052908201819052907f0d3d8d66bac9b2a9f0e5c83181a30443294ab849472526080d03fffd7187f7169060600160405180910390a1505050565b60408051608081018252600080825260208201819052918101919091526060808201526000838152602080805260408083206001600160a01b03808716855290835292819020815160808101835281549094168452600181015492840192909252600282015463ffffffff1690830152600381018054606084019190611ee190613382565b80601f0160208091040260200160405190810160405280929190818152602001828054611f0d90613382565b8015611f5a5780601f10611f2f57610100808354040283529160200191611f5a565b820191906000526020600020905b815481529060010190602001808311611f3d57829003601f168201915b505050505081525050905092915050565b6000546001600160a01b036301000000909104163314611f9d5760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b0384166000908152601060205260409020548310611fff576001600160a01b038416600081815260106020526040908190205490516345e388eb60e01b8152600481019290925260248201526044810184905260640161061b565b6001600160a01b038416600090815260106020526040812080548590811061202957612029613326565b600091825260208083206002909202909101546001600160a01b03881683526010909152604082208054919350908690811061206757612067613326565b9060005260206000209060020201600101549050818414158061208a5750808314155b156120d657604051637a4dd76560e01b81526001600160a01b03871660048201526024810186905260448101839052606481018290526084810185905260a4810184905260c40161061b565b6001600160a01b038616600090815260106020526040902080546120fc9060019061336b565b8154811061210c5761210c613326565b906000526020600020906002020160106000886001600160a01b03166001600160a01b03168152602001908152602001600020868154811061215057612150613326565b60009182526020808320845460029093020191825560019384015493909101929092556001600160a01b038816815260109091526040902080548061219757612197613663565b6000828152602080822060026000199490940193840201828155600101919091559155604080516001600160a01b038916815291820186905281018490527f33cff58e54c3a8acae85cad63487b5dcf617521e33bb03f071299f374c29de1f9060600160405180910390a1505050505050565b6001600160a01b03821660009081526010602052604081206108d99083612732565b60005462010000900460ff1661227b5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161061b565b6000805462ff0000191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60408051818152610820810182526060918291600091829190602082016108008036833750506040805181815261082081018252929350600092915060208201610800803683370190505090506000805b603f8160ff1610156123ae5760006123308983612699565b905060ff81161561239b5781858460ff168151811061235157612351613326565b602002602001019060ff16908160ff168152505080848460ff168151811061237b5761237b613326565b60ff9092166020928302919091019091015282612397816133bc565b9350505b50806123a6816133bc565b915050612318565b509196909550909350915050565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60408051808201825283815260208082018481526001600160a01b03871660008181526010845285812080546001808201835591835291859020865160029093020191825592519201919091558351908152908101859052918201839052907fe7d6ac0b740347f7f96a97e6a9dc0f20f4f11eca65495315adc009a55b6762f8906060015b60405180910390a150505050565b60ff811660008181526012602090815260408083208054939055805193845290830182905290917feb82955a27e39ea7559b6ec7e7d8b371081ab0d8783c7b0d01597555e7dcadbf9101611700565b8181113060008261250c578561250f565b60005b905060008361251f576000612521565b865b905060008461253957612534868861336b565b612543565b612543878761336b565b604051633885984b60e11b81526001600160a01b03868116600483015285811660248301528481166044830152606482018c9052608482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063710b30969060a401600060405180830381600087803b1580156125c957600080fd5b505af11580156125dd573d6000803e3d6000fd5b50505050505050505050505050565b60005462010000900460ff16156126155760405162461bcd60e51b815260040161061b906133db565b6000805462ff00001916620100001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122aa3390565b60ff8216600081815260126020908152604091829020849055815192835282018390527f16f0bfe4b02efd5423ef8906906b049c0943f21df8f10347d319fddbc59222079101611700565b600082816126a8846004613679565b60ff1682901c905080600f169250505092915050565b6000838152601160205260409020546126d88184846127c0565b6000858152601160205260409081902091909155517f393b86c90799fa411201ae723a54e105823fcf7c6c8dffa90903fc44c03b4ac79061249e9086908690869092835260ff918216602084015216604082015260600190565b6000805b83548110156127b65783818154811061275157612751613326565b9060005260206000209060020201600001548310158015612795575083818154811061277f5761277f613326565b9060005260206000209060020201600101548311155b156127a45760019150506105e3565b806127ae81613352565b915050612736565b5060009392505050565b60006127cb83611da9565b6127d482612819565b8360006127e2856004613679565b600f60ff919091161b905060001981188281166000612802886004613679565b60ff97881697169690961b17979650505050505050565b600f8160ff161115610f51576040516329afd27b60e21b815260ff8216600482015260240161061b565b50805461284f90613382565b6000825580601f1061285f575050565b601f016020900490600052602060002090810190610f519190612901565b82805461288990613382565b90600052602060002090601f0160209004810192826128ab57600085556128f1565b82601f106128c457805160ff19168380011785556128f1565b828001600101855582156128f1579182015b828111156128f15782518255916020019190600101906128d6565b506128fd929150612901565b5090565b5b808211156128fd5760008155600101612902565b80356001600160a01b038116811461292d57600080fd5b919050565b6000806040838503121561294557600080fd5b8235915061295560208401612916565b90509250929050565b803560ff8116811461292d57600080fd5b6000806040838503121561298257600080fd5b61298b8361295e565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156129d1576129d1612999565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129ff576129ff612999565b604052919050565b60006001600160401b03821115612a2057612a20612999565b5060051b60200190565b600082601f830112612a3b57600080fd5b81356020612a50612a4b83612a07565b6129d7565b82815260059290921b84018101918181019086841115612a6f57600080fd5b8286015b84811015612a8a5780358352918301918301612a73565b509695505050505050565b60008060408385031215612aa857600080fd5b82356001600160401b0380821115612abf57600080fd5b612acb86838701612a2a565b9350602091508185013581811115612ae257600080fd5b85019050601f81018613612af557600080fd5b8035612b03612a4b82612a07565b81815260059190911b82018301908381019088831115612b2257600080fd5b928401925b82841015612b4757612b3884612916565b82529284019290840190612b27565b80955050505050509250929050565b6000815180845260005b81811015612b7c57602081850181015186830182015201612b60565b81811115612b8e576000602083870101525b50601f01601f19169290920160200192915050565b60018060a01b0381511682526020810151602083015263ffffffff604082015116604083015260006060820151608060608501526118806080850182612b56565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612c3957603f19888603018452612c27858351612ba3565b94509285019290850190600101612c0b565b5092979650505050505050565b600082601f830112612c5757600080fd5b81356020612c67612a4b83612a07565b82815260059290921b84018101918181019086841115612c8657600080fd5b8286015b84811015612a8a57612c9b8161295e565b8352918301918301612c8a565b60008060408385031215612cbb57600080fd5b82356001600160401b0380821115612cd257600080fd5b612cde86838701612c46565b9350602091508185013581811115612cf557600080fd5b85019050601f81018613612d0857600080fd5b8035612d16612a4b82612a07565b81815260059190911b82018301908381019088831115612d3557600080fd5b928401925b82841015612b4757833582529284019290840190612d3a565b600082601f830112612d6457600080fd5b81356020612d74612a4b83612a07565b82815260069290921b84018101918181019086841115612d9357600080fd5b8286015b84811015612a8a5760408189031215612db05760008081fd5b612db86129af565b813581528482013585820152835291830191604001612d97565b600080600060608486031215612de757600080fd5b612df084612916565b925060208401356001600160401b0380821115612e0c57600080fd5b612e1887838801612d53565b93506040860135915080821115612e2e57600080fd5b50612e3b86828701612a2a565b9150509250925092565b60008060408385031215612e5857600080fd5b61298b83612916565b60018060a01b038516815283602082015263ffffffff83166040820152608060608201526000612e946080830184612b56565b9695505050505050565b60008060408385031215612eb157600080fd5b8235915060208301356001600160401b03811115612ece57600080fd5b612eda85828601612c46565b9150509250929050565b600081518084526020808501945080840160005b83811015612f1757815160ff1687529582019590820190600101612ef8565b509495945050505050565b6020815260006108d96020830184612ee4565b600060208284031215612f4757600080fd5b5035919050565b604080825283519082018190526000906020906060840190828701845b82811015612f8757815184529284019290840190600101612f6b565b50505083810382850152612e948186612ee4565b600060208284031215612fad57600080fd5b81356001600160401b03811115612fc357600080fd5b61188084828501612c46565b6020815260006108d96020830184612b56565b600080600060608486031215612ff757600080fd5b83356001600160401b038082111561300e57600080fd5b61301a87838801612a2a565b9450602086013591508082111561303057600080fd5b61303c87838801612c46565b9350604086013591508082111561305257600080fd5b50612e3b86828701612c46565b60008060006060848603121561307457600080fd5b61307d84612916565b95602085013595506040909401359392505050565b6000602082840312156130a457600080fd5b6108d98261295e565b60008083601f8401126130bf57600080fd5b5081356001600160401b038111156130d657600080fd5b6020830191508360208260051b85010111156130f157600080fd5b9250929050565b6000806000806040858703121561310e57600080fd5b84356001600160401b038082111561312557600080fd5b613131888389016130ad565b9096509450602087013591508082111561314a57600080fd5b50613157878288016130ad565b95989497509550505050565b6020815260006108d96020830184612ba3565b6000806040838503121561318957600080fd5b61319283612916565b915060208301356001600160401b038111156131ad57600080fd5b612eda85828601612d53565b600080600080608085870312156131cf57600080fd5b6131d885612916565b966020860135965060408601359560600135945092505050565b60006020828403121561320457600080fd5b6108d982612916565b6000806040838503121561322057600080fd5b823591506129556020840161295e565b6020808252825182820181905260009190848201906040850190845b818110156132685783518352928401929184019160010161324c565b50909695505050505050565b60008060006060848603121561328957600080fd5b833592506132996020850161295e565b91506132a76040850161295e565b90509250925092565b600080602083850312156132c357600080fd5b82356001600160401b038111156132d957600080fd5b6132e5858286016130ad565b90969095509350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016133645761336461333c565b5060010190565b60008282101561337d5761337d61333c565b500390565b600181811c9082168061339657607f821691505b6020821081036133b657634e487b7160e01b600052602260045260246000fd5b50919050565b600060ff821660ff81036133d2576133d261333c565b60010192915050565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6040808252810184905260008560608301825b87811015613446576001600160a01b0361343184612916565b16825260209283019290910190600101613418565b5083810360208501528481526001600160fb1b0385111561346657600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b60208152815160208201526000602083015160018060a01b03808216604085015280604086015116606085015250506060830151608083015263ffffffff60808401511660a083015260a083015160c08084015261188060e0840182612b56565b6000823560be198336030181126134fe57600080fd5b9190910192915050565b803563ffffffff8116811461292d57600080fd5b60006020828403121561352e57600080fd5b6108d982613508565b6000808335601e1984360301811261354e57600080fd5b8301803591506001600160401b0382111561356857600080fd5b6020019150368190038213156130f157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b602081528135602082015260006135bf60208401612916565b60018060a01b038082166040850152806135db60408701612916565b16606085015250506060830135608083015263ffffffff6135fe60808501613508565b1660a083015260a0830135601e1984360301811261361b57600080fd5b83016020810190356001600160401b0381111561363757600080fd5b80360382131561364657600080fd5b60c08085015261365a60e08501828461357d565b95945050505050565b634e487b7160e01b600052603160045260246000fd5b600060ff821660ff84168160ff048111821515161561369a5761369a61333c565b02939250505056fea26469706673582212209714c1001d19740a655ea4426b52e9f5d8348f9df38d027a88d1f1095e244e9464736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "attestationsCollectionHasAttribute(uint256,uint8)": { - "details": "Returns whether an attestationsCollection has a specific attribute referenced by its index", - "params": { - "collectionId": "Collection Id of the targeted attestationsCollection", - "index": "Index of the attribute. Can go from 0 to 63." - } - }, - "authorizeRange(address,uint256,uint256)": { - "details": "Authorize an issuer for a specific range", - "params": { - "firstCollectionId": "First collection Id of the range for which the issuer will be authorized", - "issuer": "Issuer that will be authorized", - "lastCollectionId": "Last collection Id of the range for which the issuer will be authorized" - } - }, - "authorizeRanges(address,(uint256,uint256)[])": { - "details": "Authorize an issuer for specific ranges", - "params": { - "issuer": "Issuer that will be authorized", - "ranges": "Ranges for which the issuer will be authorized" - } - }, - "constructor": { - "details": "Constructor.", - "params": { - "badgesAddress": "Stateless ERC1155 Badges contract", - "owner": "Owner of the contract, has the right to authorize/unauthorize attestations issuers" - } - }, - "createNewAttribute(uint8,bytes32)": { - "details": "Create a new attribute.", - "params": { - "index": "Index of the attribute. Can go from 0 to 63.", - "name": "Name in bytes32 of the attribute" - } - }, - "deleteAttestations(address[],uint256[])": { - "details": "Delete function to be called by authorized issuers", - "params": { - "collectionIds": "The collection ids of the attestations to be deleted", - "owners": "The owners of the attestations to be deleted" - } - }, - "deleteAttribute(uint8)": { - "details": "Delete an existing attribute", - "params": { - "index": "Index of the attribute. Can go from 0 to 63. The attribute must already exist" - } - }, - "getAttestationData(uint256,address)": { - "details": "Getter of the data of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationDataBatch(uint256[],address[])": { - "details": "Getter of the data of specific attestations", - "params": { - "collectionIds": "Collection identifiers of the targeted attestations", - "owners": "Owners of the targeted attestations" - } - }, - "getAttestationDataTuple(uint256,address)": { - "details": "Getter of the data of a specific attestation as tuple", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationExtraData(uint256,address)": { - "details": "Getter of the extraData of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationIssuer(uint256,address)": { - "details": "Getter of the issuer of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationTimestamp(uint256,address)": { - "details": "Getter of the timestamp of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationValue(uint256,address)": { - "details": "Getter of the value of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationValueBatch(uint256[],address[])": { - "details": "Getter of the values of specific attestations", - "params": { - "collectionIds": "Collection identifiers of the targeted attestations", - "owners": "Owners of the targeted attestations" - } - }, - "getAttributeValueForAttestationsCollection(uint256,uint8)": { - "details": "Returns the attribute's value (from 0 to 15) of an attestationsCollection", - "params": { - "collectionId": "Collection Id of the targeted attestationsCollection", - "index": "Index of the attribute. Can go from 0 to 63." - } - }, - "getAttributesNamesAndValuesForAttestationsCollection(uint256)": { - "details": "Returns all the enabled attributes names and their values for a specific attestationsCollection", - "params": { - "collectionId": "Collection Id of the targeted attestationsCollection" - } - }, - "hasAttestation(uint256,address)": { - "details": "Returns whether a user has an attestation from a collection", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "initialize(address)": { - "details": "Initialize function, to be called by the proxy delegating calls to this implementation", - "params": { - "ownerAddress": "Owner of the contract, has the right to authorize/unauthorize attestations issuers" - } - }, - "isAuthorized(address,uint256)": { - "details": "Returns whether a specific issuer is authorized or not to record in a specific attestations collection", - "params": { - "collectionId": "Collection Id for which the issuer will be checked", - "issuer": "Issuer to be checked" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "pause()": { - "details": "Pauses the registry. Issuers can no longer record or delete attestations" - }, - "paused()": { - "details": "Returns true if the contract is paused, and false otherwise." - }, - "recordAttestations((uint256,address,address,uint256,uint32,bytes)[])": { - "details": "Main function to be called by authorized issuers", - "params": { - "attestations": "Attestations to be recorded (creates a new one or overrides an existing one)" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "setAttributeValueForAttestationsCollection(uint256,uint8,uint8)": { - "details": "Set a value for an attribute of an attestationsCollection. The attribute should already be created.", - "params": { - "collectionId": "Collection Id of the targeted attestationsCollection", - "index": "Index of the attribute (must be between 0 and 63)", - "value": "Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "unauthorizeRange(address,uint256,uint256,uint256)": { - "details": "Unauthorize an issuer for a specific range", - "params": { - "firstCollectionId": "First collection Id of the range for which the issuer will be unauthorized", - "issuer": "Issuer that will be unauthorized", - "lastCollectionId": "Last collection Id of the range for which the issuer will be unauthorized", - "rangeIndex": "Index of the range to be unauthorized" - } - }, - "unauthorizeRanges(address,(uint256,uint256)[],uint256[])": { - "details": "Unauthorize an issuer for specific ranges", - "params": { - "issuer": "Issuer that will be unauthorized", - "ranges": "Ranges for which the issuer will be unauthorized" - } - }, - "unpause()": { - "details": "Unpauses the registry" - }, - "updateAttributeName(uint8,bytes32)": { - "details": "Update the name of an existing attribute", - "params": { - "index": "Index of the attribute. Can go from 0 to 63. The attribute must exist", - "newName": "new name in bytes32 of the attribute" - } - } - }, - "title": "Attestations Registry", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "Main contract of Sismo, stores all recorded attestations in attestations collections Only authorized attestations issuers can record attestation in the registry Attesters that expect to record in the Attestations Registry must be authorized issuers For more information: https://attestations-registry.docs.sismo.io For each attestation recorded, a badge is received by the user The badge is the Non transferrable NFT representation of an attestation Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts It enables off-chain apps such as opensea to catch the \"shadow mint\" of the badge*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 14389, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 14391, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 14393, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_paused", - "offset": 2, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 14395, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_owner", - "offset": 3, - "slot": "0", - "type": "t_address" - }, - { - "astId": 14399, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_placeHoldersAdmin", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)15_storage" - }, - { - "astId": 14405, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_authorizedRanges", - "offset": 0, - "slot": "16", - "type": "t_mapping(t_address,t_array(t_struct(Range)15352_storage)dyn_storage)" - }, - { - "astId": 14409, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_attestationsCollectionAttributesValuesBitmap", - "offset": 0, - "slot": "17", - "type": "t_mapping(t_uint256,t_uint256)" - }, - { - "astId": 14413, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_attributesNames", - "offset": 0, - "slot": "18", - "type": "t_mapping(t_uint8,t_bytes32)" - }, - { - "astId": 14417, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_placeHoldersConfig", - "offset": 0, - "slot": "19", - "type": "t_array(t_uint256)13_storage" - }, - { - "astId": 14424, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_attestationsData", - "offset": 0, - "slot": "32", - "type": "t_mapping(t_uint256,t_mapping(t_address,t_struct(AttestationData)13388_storage))" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_struct(Range)15352_storage)dyn_storage": { - "base": "t_struct(Range)15352_storage", - "encoding": "dynamic_array", - "label": "struct Range[]", - "numberOfBytes": "32" - }, - "t_array(t_uint256)13_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[13]", - "numberOfBytes": "416" - }, - "t_array(t_uint256)15_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[15]", - "numberOfBytes": "480" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_bytes_storage": { - "encoding": "bytes", - "label": "bytes", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_array(t_struct(Range)15352_storage)dyn_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct Range[])", - "numberOfBytes": "32", - "value": "t_array(t_struct(Range)15352_storage)dyn_storage" - }, - "t_mapping(t_address,t_struct(AttestationData)13388_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct AttestationData)", - "numberOfBytes": "32", - "value": "t_struct(AttestationData)13388_storage" - }, - "t_mapping(t_uint256,t_mapping(t_address,t_struct(AttestationData)13388_storage))": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => mapping(address => struct AttestationData))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_struct(AttestationData)13388_storage)" - }, - "t_mapping(t_uint256,t_uint256)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_mapping(t_uint8,t_bytes32)": { - "encoding": "mapping", - "key": "t_uint8", - "label": "mapping(uint8 => bytes32)", - "numberOfBytes": "32", - "value": "t_bytes32" - }, - "t_struct(AttestationData)13388_storage": { - "encoding": "inplace", - "label": "struct AttestationData", - "members": [ - { - "astId": 13381, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "issuer", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 13383, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "value", - "offset": 0, - "slot": "1", - "type": "t_uint256" - }, - { - "astId": 13385, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "timestamp", - "offset": 0, - "slot": "2", - "type": "t_uint32" - }, - { - "astId": 13387, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "extraData", - "offset": 0, - "slot": "3", - "type": "t_bytes_storage" - } - ], - "numberOfBytes": "128" - }, - "t_struct(Range)15352_storage": { - "encoding": "inplace", - "label": "struct Range", - "members": [ - { - "astId": 15349, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "min", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 15351, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "max", - "offset": 0, - "slot": "1", - "type": "t_uint256" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/AttestationsRegistryProxy.json b/deployments/goerli/AttestationsRegistryProxy.json deleted file mode 100644 index 45ef2ef..0000000 --- a/deployments/goerli/AttestationsRegistryProxy.json +++ /dev/null @@ -1,249 +0,0 @@ -{ - "address": "0xf85BA0afA375495eE625910Db61b6b1406756234", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x521fc780b97210af6e47ce07818a758632d2ea21237ed2f700606342e2c3d018", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0xf85BA0afA375495eE625910Db61b6b1406756234", - "transactionIndex": 6, - "gasUsed": "609943", - "logsBloom": "0x00000000000200000000000000000000400000000000000000800000000000000000000080000000000000000000000000000000000000000000000000000000020000000000000000000000000002000001000000000000000000000000000000000000020000000000000000000800000000800000000000000000000000400000000000000200000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000020000000000400400000000000000020000000000000000000000000000000000002400000000000000000008000000000", - "blockHash": "0xd496cea5a8d667e99a173b819490ab3168cc898ae658422d36c8f897f2f4248c", - "transactionHash": "0x521fc780b97210af6e47ce07818a758632d2ea21237ed2f700606342e2c3d018", - "logs": [ - { - "transactionIndex": 6, - "blockNumber": 7711009, - "transactionHash": "0x521fc780b97210af6e47ce07818a758632d2ea21237ed2f700606342e2c3d018", - "address": "0xf85BA0afA375495eE625910Db61b6b1406756234", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x00000000000000000000000021a1b1e5c2e2dddf34851838a05d009357973ca4" - ], - "data": "0x", - "logIndex": 6, - "blockHash": "0xd496cea5a8d667e99a173b819490ab3168cc898ae658422d36c8f897f2f4248c" - }, - { - "transactionIndex": 6, - "blockNumber": 7711009, - "transactionHash": "0x521fc780b97210af6e47ce07818a758632d2ea21237ed2f700606342e2c3d018", - "address": "0xf85BA0afA375495eE625910Db61b6b1406756234", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "data": "0x", - "logIndex": 7, - "blockHash": "0xd496cea5a8d667e99a173b819490ab3168cc898ae658422d36c8f897f2f4248c" - }, - { - "transactionIndex": 6, - "blockNumber": 7711009, - "transactionHash": "0x521fc780b97210af6e47ce07818a758632d2ea21237ed2f700606342e2c3d018", - "address": "0xf85BA0afA375495eE625910Db61b6b1406756234", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000246e71bc2a257f4be9c7fad4664e6d7444844adc", - "logIndex": 8, - "blockHash": "0xd496cea5a8d667e99a173b819490ab3168cc898ae658422d36c8f897f2f4248c" - } - ], - "blockNumber": 7711009, - "cumulativeGasUsed": "7039965", - "status": 1, - "byzantium": true - }, - "args": [ - "0x21A1b1e5c2e2dDDf34851838a05D009357973ca4", - "0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc", - "0xc4d66de8000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/goerli/AvailableRootsRegistry.json b/deployments/goerli/AvailableRootsRegistry.json deleted file mode 100644 index fca107f..0000000 --- a/deployments/goerli/AvailableRootsRegistry.json +++ /dev/null @@ -1,525 +0,0 @@ -{ - "address": "0xdDa4c8d2933dAA21Aac75B88fF59725725ba813F", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "CannotRegisterForZeroAddress", - "type": "error" - }, - { - "inputs": [], - "name": "CannotUnregisterForZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "RegisteredRootForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "RegisteredRootForAttester", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "UnregisteredRootForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "UnregisteredRootForAttester", - "type": "event" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "_roots", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "isRootAvailableForAttester", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "isRootAvailableForMe", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "registerRootForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "registerRootForAttester", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "unregisterRootForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "unregisterRootForAttester", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xacd5209603d0630d29e8a00e6c80bd7f7cb9e64f18568bb51ad52a9e417316a7", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x3899e306478bA1C54706FD04628f9ECD060ddD5E", - "transactionIndex": 70, - "gasUsed": "508612", - "logsBloom": "0x00000000000200000000000000000000000000000000000000800000000000000000000000000000800000000000000000000000000000010000000000000000000000000000000000000000000000000001000000000000000000000000000000008000020000080000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000080000000000000000000004000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000400000000000000020000000002000000000000000000000000000000000000000000000008000000000", - "blockHash": "0x0001c824871c2d116fa3fdf4e2dfe6ff98496e636301b7ee0ac9118d81fe5e3b", - "transactionHash": "0xacd5209603d0630d29e8a00e6c80bd7f7cb9e64f18568bb51ad52a9e417316a7", - "logs": [ - { - "transactionIndex": 70, - "blockNumber": 8080323, - "transactionHash": "0xacd5209603d0630d29e8a00e6c80bd7f7cb9e64f18568bb51ad52a9e417316a7", - "address": "0x3899e306478bA1C54706FD04628f9ECD060ddD5E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "data": "0x", - "logIndex": 82, - "blockHash": "0x0001c824871c2d116fa3fdf4e2dfe6ff98496e636301b7ee0ac9118d81fe5e3b" - }, - { - "transactionIndex": 70, - "blockNumber": 8080323, - "transactionHash": "0xacd5209603d0630d29e8a00e6c80bd7f7cb9e64f18568bb51ad52a9e417316a7", - "address": "0x3899e306478bA1C54706FD04628f9ECD060ddD5E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e", - "0x0000000000000000000000007f2e6e158643bcaf85f30c57ae8625f623d82659" - ], - "data": "0x", - "logIndex": 83, - "blockHash": "0x0001c824871c2d116fa3fdf4e2dfe6ff98496e636301b7ee0ac9118d81fe5e3b" - }, - { - "transactionIndex": 70, - "blockNumber": 8080323, - "transactionHash": "0xacd5209603d0630d29e8a00e6c80bd7f7cb9e64f18568bb51ad52a9e417316a7", - "address": "0x3899e306478bA1C54706FD04628f9ECD060ddD5E", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000002", - "logIndex": 84, - "blockHash": "0x0001c824871c2d116fa3fdf4e2dfe6ff98496e636301b7ee0ac9118d81fe5e3b" - } - ], - "blockNumber": 8080323, - "cumulativeGasUsed": "29541202", - "status": 1, - "byzantium": true - }, - "args": [ - "0x7f2e6e158643bcaf85f30c57ae8625f623d82659" - ], - "numDeployments": 4, - "solcInputHash": "24c70469fd559e01f6ff2a10472da9a6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CannotRegisterForZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotUnregisterForZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"RegisteredRootForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"RegisteredRootForAttester\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"UnregisteredRootForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"UnregisteredRootForAttester\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"_roots\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"isRootAvailableForAttester\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"isRootAvailableForMe\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"registerRootForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"registerRootForAttester\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"unregisterRootForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"unregisterRootForAttester\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"owner\":\"Owner of the contract, can register/ unregister roots\"}},\"initialize(address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"ownerAddress\":\"Owner of the contract, can update public key and address\"}},\"isRootAvailableForAttester(address,uint256)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"attester\":\"Owner of the contract, can update public key and address\",\"root\":\"Owner of the contract, can update public key and address\"}},\"isRootAvailableForMe(uint256)\":{\"details\":\"returns whether a root is available for a caller (msg.sender)\",\"params\":{\"root\":\"root to check whether it is registered for me or not\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"registerRootForAll(uint256)\":{\"details\":\"Registers a root, available for all contracts\",\"params\":{\"root\":\"Root to register\"}},\"registerRootForAttester(address,uint256)\":{\"details\":\"Register a root available for an attester\",\"params\":{\"attester\":\"Attester which will have the root available\",\"root\":\"Root to register\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unregisterRootForAll(uint256)\":{\"details\":\"Unregister a root, available for all contracts\",\"params\":{\"root\":\"Root to unregister\"}},\"unregisterRootForAttester(address,uint256)\":{\"details\":\"Unregister a root for an attester\",\"params\":{\"attester\":\"Attester which will no longer have the root available\",\"root\":\"Root to unregister\"}}},\"title\":\"Attesters Groups Registry\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"This contract stores that data required by attesters to be available so they can verify user claims This contract is deployed behind a proxy and this implementation is focused on storing merkle roots For more information: https://available-roots-registry.docs.sismo.io*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/AvailableRootsRegistry.sol\":\"AvailableRootsRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3467998cbdb82b0c64aa8627efc5893d2b369f73e66e5d1095305e4609593cc5\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5e882d3091e816f1286837eef92ae17737abf66fdeece1282b752f27ba18492b\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5060405161099538038061099583398101604081905261002f916101be565b61003833610047565b610041816100a2565b506101ee565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600290610100900460ff161580156100c4575060005460ff8083169116105b61012b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff8316176101001781556101576000546201000090046001600160a01b031690565b6001600160a01b0316148061016b5750303b155b156101795761017982610047565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6000602082840312156101d057600080fd5b81516001600160a01b03811681146101e757600080fd5b9392505050565b610798806101fd6000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063be4a605611610071578063be4a605614610170578063c4d66de814610183578063e5e477a014610196578063ebea45cb146101a9578063f2fde38b146101bc578063fe7e7750146101cf57600080fd5b80632f56be56146100b95780634e473f8f146100ce578063715018a6146100f6578063754b377c146100fe57806380b404ce146101185780638da5cb5b14610146575b600080fd5b6100cc6100c7366004610704565b6101e2565b005b6100e16100dc366004610704565b61021f565b60405190151581526020015b60405180910390f35b6100cc610285565b610106600281565b60405160ff90911681526020016100ed565b6100e1610126366004610704565b600160209081526000928352604080842090915290825290205460ff1681565b6000546201000090046001600160a01b03166040516001600160a01b0390911681526020016100ed565b6100cc61017e36600461072e565b610299565b6100cc610191366004610747565b6102af565b6100e16101a436600461072e565b6103ce565b6100cc6101b7366004610704565b61042a565b6100cc6101ca366004610747565b610463565b6100cc6101dd36600461072e565b6104d9565b6101ea6104ec565b6001600160a01b03821661021157604051639e95e88b60e01b815260040160405180910390fd5b61021b828261054d565b5050565b6001600160a01b038216600090815260016020908152604080832084845290915281205460ff168061027e575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b9392505050565b61028d6104ec565b61029760006105ef565b565b6102a16104ec565b6102ac60008261054d565b50565b600054600290610100900460ff161580156102d1575060005460ff8083169116105b6103395760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556103666000546001600160a01b03620100009091041690565b6001600160a01b0316148061037a5750303b155b1561038857610388826105ef565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b33600090815260016020908152604080832084845290915281205460ff1680610424575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b92915050565b6104326104ec565b6001600160a01b03821661045957604051631b25a00160e31b815260040160405180910390fd5b61021b828261064a565b61046b6104ec565b6001600160a01b0381166104d05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610330565b6102ac816105ef565b6104e16104ec565b6102ac60008261064a565b6000546001600160a01b03620100009091041633146102975760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610330565b6001600160a01b0382166000818152600160208181526040808420868552909152909120805460ff191690911790556105b0576040518181527f22f0a171f00eeea3af5276d1f77587471dcc3bde32d62560046549b34bacd38a906020016103c2565b604080516001600160a01b0384168152602081018390527f21cdff046578afe71b78f95ac4891306af3a9b9eb71e2f0ef380b35b487d2f1291016103c2565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6001600160a01b03821660008181526001602090815260408083208584529091529020805460ff191690556106a9576040518181527f7261c2abe5e576aac50024de639315f10783f67935bf118bbb49b33c20ef70ef906020016103c2565b604080516001600160a01b0384168152602081018390527fba8195cc62a4086b7cd93d22db90e43ae42d8b5febd8c66b3453771e455b7a3391016103c2565b80356001600160a01b03811681146106ff57600080fd5b919050565b6000806040838503121561071757600080fd5b610720836106e8565b946020939093013593505050565b60006020828403121561074057600080fd5b5035919050565b60006020828403121561075957600080fd5b61027e826106e856fea264697066735822122096da5c8d33677e6203057d911bba2c609059e50119bb896ec169d0349a48641d64736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063be4a605611610071578063be4a605614610170578063c4d66de814610183578063e5e477a014610196578063ebea45cb146101a9578063f2fde38b146101bc578063fe7e7750146101cf57600080fd5b80632f56be56146100b95780634e473f8f146100ce578063715018a6146100f6578063754b377c146100fe57806380b404ce146101185780638da5cb5b14610146575b600080fd5b6100cc6100c7366004610704565b6101e2565b005b6100e16100dc366004610704565b61021f565b60405190151581526020015b60405180910390f35b6100cc610285565b610106600281565b60405160ff90911681526020016100ed565b6100e1610126366004610704565b600160209081526000928352604080842090915290825290205460ff1681565b6000546201000090046001600160a01b03166040516001600160a01b0390911681526020016100ed565b6100cc61017e36600461072e565b610299565b6100cc610191366004610747565b6102af565b6100e16101a436600461072e565b6103ce565b6100cc6101b7366004610704565b61042a565b6100cc6101ca366004610747565b610463565b6100cc6101dd36600461072e565b6104d9565b6101ea6104ec565b6001600160a01b03821661021157604051639e95e88b60e01b815260040160405180910390fd5b61021b828261054d565b5050565b6001600160a01b038216600090815260016020908152604080832084845290915281205460ff168061027e575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b9392505050565b61028d6104ec565b61029760006105ef565b565b6102a16104ec565b6102ac60008261054d565b50565b600054600290610100900460ff161580156102d1575060005460ff8083169116105b6103395760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556103666000546001600160a01b03620100009091041690565b6001600160a01b0316148061037a5750303b155b1561038857610388826105ef565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b33600090815260016020908152604080832084845290915281205460ff1680610424575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b92915050565b6104326104ec565b6001600160a01b03821661045957604051631b25a00160e31b815260040160405180910390fd5b61021b828261064a565b61046b6104ec565b6001600160a01b0381166104d05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610330565b6102ac816105ef565b6104e16104ec565b6102ac60008261064a565b6000546001600160a01b03620100009091041633146102975760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610330565b6001600160a01b0382166000818152600160208181526040808420868552909152909120805460ff191690911790556105b0576040518181527f22f0a171f00eeea3af5276d1f77587471dcc3bde32d62560046549b34bacd38a906020016103c2565b604080516001600160a01b0384168152602081018390527f21cdff046578afe71b78f95ac4891306af3a9b9eb71e2f0ef380b35b487d2f1291016103c2565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6001600160a01b03821660008181526001602090815260408083208584529091529020805460ff191690556106a9576040518181527f7261c2abe5e576aac50024de639315f10783f67935bf118bbb49b33c20ef70ef906020016103c2565b604080516001600160a01b0384168152602081018390527fba8195cc62a4086b7cd93d22db90e43ae42d8b5febd8c66b3453771e455b7a3391016103c2565b80356001600160a01b03811681146106ff57600080fd5b919050565b6000806040838503121561071757600080fd5b610720836106e8565b946020939093013593505050565b60006020828403121561074057600080fd5b5035919050565b60006020828403121561075957600080fd5b61027e826106e856fea264697066735822122096da5c8d33677e6203057d911bba2c609059e50119bb896ec169d0349a48641d64736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "constructor": { - "details": "Constructor", - "params": { - "owner": "Owner of the contract, can register/ unregister roots" - } - }, - "initialize(address)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "ownerAddress": "Owner of the contract, can update public key and address" - } - }, - "isRootAvailableForAttester(address,uint256)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "attester": "Owner of the contract, can update public key and address", - "root": "Owner of the contract, can update public key and address" - } - }, - "isRootAvailableForMe(uint256)": { - "details": "returns whether a root is available for a caller (msg.sender)", - "params": { - "root": "root to check whether it is registered for me or not" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "registerRootForAll(uint256)": { - "details": "Registers a root, available for all contracts", - "params": { - "root": "Root to register" - } - }, - "registerRootForAttester(address,uint256)": { - "details": "Register a root available for an attester", - "params": { - "attester": "Attester which will have the root available", - "root": "Root to register" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "unregisterRootForAll(uint256)": { - "details": "Unregister a root, available for all contracts", - "params": { - "root": "Root to unregister" - } - }, - "unregisterRootForAttester(address,uint256)": { - "details": "Unregister a root for an attester", - "params": { - "attester": "Attester which will no longer have the root available", - "root": "Root to unregister" - } - } - }, - "title": "Attesters Groups Registry", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "This contract stores that data required by attesters to be available so they can verify user claims This contract is deployed behind a proxy and this implementation is focused on storing merkle roots For more information: https://available-roots-registry.docs.sismo.io*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/periphery/utils/AvailableRootsRegistry.sol:AvailableRootsRegistry", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/periphery/utils/AvailableRootsRegistry.sol:AvailableRootsRegistry", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 396, - "contract": "contracts/periphery/utils/AvailableRootsRegistry.sol:AvailableRootsRegistry", - "label": "_owner", - "offset": 2, - "slot": "0", - "type": "t_address" - }, - { - "astId": 15495, - "contract": "contracts/periphery/utils/AvailableRootsRegistry.sol:AvailableRootsRegistry", - "label": "_roots", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_mapping(t_uint256,t_bool))" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_address,t_mapping(t_uint256,t_bool))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(uint256 => bool))", - "numberOfBytes": "32", - "value": "t_mapping(t_uint256,t_bool)" - }, - "t_mapping(t_uint256,t_bool)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/AvailableRootsRegistryImplem.json b/deployments/goerli/AvailableRootsRegistryImplem.json deleted file mode 100644 index 21646b4..0000000 --- a/deployments/goerli/AvailableRootsRegistryImplem.json +++ /dev/null @@ -1,525 +0,0 @@ -{ - "address": "0x3899e306478bA1C54706FD04628f9ECD060ddD5E", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "CannotRegisterForZeroAddress", - "type": "error" - }, - { - "inputs": [], - "name": "CannotUnregisterForZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "RegisteredRootForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "RegisteredRootForAttester", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "UnregisteredRootForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "UnregisteredRootForAttester", - "type": "event" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "_roots", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "isRootAvailableForAttester", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "isRootAvailableForMe", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "registerRootForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "registerRootForAttester", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "unregisterRootForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "unregisterRootForAttester", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xacd5209603d0630d29e8a00e6c80bd7f7cb9e64f18568bb51ad52a9e417316a7", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x3899e306478bA1C54706FD04628f9ECD060ddD5E", - "transactionIndex": 70, - "gasUsed": "508612", - "logsBloom": "0x00000000000200000000000000000000000000000000000000800000000000000000000000000000800000000000000000000000000000010000000000000000000000000000000000000000000000000001000000000000000000000000000000008000020000080000000000000800000000000000000000000000000000400000000000000000000000000000000000000000000080000000000000000000004000000000000000000000000400000000000000000000000000000000000000000000000000000000000000040000000000000000400000000000000020000000002000000000000000000000000000000000000000000000008000000000", - "blockHash": "0x0001c824871c2d116fa3fdf4e2dfe6ff98496e636301b7ee0ac9118d81fe5e3b", - "transactionHash": "0xacd5209603d0630d29e8a00e6c80bd7f7cb9e64f18568bb51ad52a9e417316a7", - "logs": [ - { - "transactionIndex": 70, - "blockNumber": 8080323, - "transactionHash": "0xacd5209603d0630d29e8a00e6c80bd7f7cb9e64f18568bb51ad52a9e417316a7", - "address": "0x3899e306478bA1C54706FD04628f9ECD060ddD5E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "data": "0x", - "logIndex": 82, - "blockHash": "0x0001c824871c2d116fa3fdf4e2dfe6ff98496e636301b7ee0ac9118d81fe5e3b" - }, - { - "transactionIndex": 70, - "blockNumber": 8080323, - "transactionHash": "0xacd5209603d0630d29e8a00e6c80bd7f7cb9e64f18568bb51ad52a9e417316a7", - "address": "0x3899e306478bA1C54706FD04628f9ECD060ddD5E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e", - "0x0000000000000000000000007f2e6e158643bcaf85f30c57ae8625f623d82659" - ], - "data": "0x", - "logIndex": 83, - "blockHash": "0x0001c824871c2d116fa3fdf4e2dfe6ff98496e636301b7ee0ac9118d81fe5e3b" - }, - { - "transactionIndex": 70, - "blockNumber": 8080323, - "transactionHash": "0xacd5209603d0630d29e8a00e6c80bd7f7cb9e64f18568bb51ad52a9e417316a7", - "address": "0x3899e306478bA1C54706FD04628f9ECD060ddD5E", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000002", - "logIndex": 84, - "blockHash": "0x0001c824871c2d116fa3fdf4e2dfe6ff98496e636301b7ee0ac9118d81fe5e3b" - } - ], - "blockNumber": 8080323, - "cumulativeGasUsed": "29541202", - "status": 1, - "byzantium": true - }, - "args": [ - "0x7f2e6e158643bcaf85f30c57ae8625f623d82659" - ], - "numDeployments": 2, - "solcInputHash": "24c70469fd559e01f6ff2a10472da9a6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CannotRegisterForZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotUnregisterForZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"RegisteredRootForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"RegisteredRootForAttester\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"UnregisteredRootForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"UnregisteredRootForAttester\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"_roots\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"isRootAvailableForAttester\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"isRootAvailableForMe\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"registerRootForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"registerRootForAttester\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"unregisterRootForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"unregisterRootForAttester\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"owner\":\"Owner of the contract, can register/ unregister roots\"}},\"initialize(address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"ownerAddress\":\"Owner of the contract, can update public key and address\"}},\"isRootAvailableForAttester(address,uint256)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"attester\":\"Owner of the contract, can update public key and address\",\"root\":\"Owner of the contract, can update public key and address\"}},\"isRootAvailableForMe(uint256)\":{\"details\":\"returns whether a root is available for a caller (msg.sender)\",\"params\":{\"root\":\"root to check whether it is registered for me or not\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"registerRootForAll(uint256)\":{\"details\":\"Registers a root, available for all contracts\",\"params\":{\"root\":\"Root to register\"}},\"registerRootForAttester(address,uint256)\":{\"details\":\"Register a root available for an attester\",\"params\":{\"attester\":\"Attester which will have the root available\",\"root\":\"Root to register\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unregisterRootForAll(uint256)\":{\"details\":\"Unregister a root, available for all contracts\",\"params\":{\"root\":\"Root to unregister\"}},\"unregisterRootForAttester(address,uint256)\":{\"details\":\"Unregister a root for an attester\",\"params\":{\"attester\":\"Attester which will no longer have the root available\",\"root\":\"Root to unregister\"}}},\"title\":\"Attesters Groups Registry\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"This contract stores that data required by attesters to be available so they can verify user claims This contract is deployed behind a proxy and this implementation is focused on storing merkle roots For more information: https://available-roots-registry.docs.sismo.io*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/AvailableRootsRegistry.sol\":\"AvailableRootsRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3467998cbdb82b0c64aa8627efc5893d2b369f73e66e5d1095305e4609593cc5\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5e882d3091e816f1286837eef92ae17737abf66fdeece1282b752f27ba18492b\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5060405161099538038061099583398101604081905261002f916101be565b61003833610047565b610041816100a2565b506101ee565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600290610100900460ff161580156100c4575060005460ff8083169116105b61012b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff8316176101001781556101576000546201000090046001600160a01b031690565b6001600160a01b0316148061016b5750303b155b156101795761017982610047565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6000602082840312156101d057600080fd5b81516001600160a01b03811681146101e757600080fd5b9392505050565b610798806101fd6000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063be4a605611610071578063be4a605614610170578063c4d66de814610183578063e5e477a014610196578063ebea45cb146101a9578063f2fde38b146101bc578063fe7e7750146101cf57600080fd5b80632f56be56146100b95780634e473f8f146100ce578063715018a6146100f6578063754b377c146100fe57806380b404ce146101185780638da5cb5b14610146575b600080fd5b6100cc6100c7366004610704565b6101e2565b005b6100e16100dc366004610704565b61021f565b60405190151581526020015b60405180910390f35b6100cc610285565b610106600281565b60405160ff90911681526020016100ed565b6100e1610126366004610704565b600160209081526000928352604080842090915290825290205460ff1681565b6000546201000090046001600160a01b03166040516001600160a01b0390911681526020016100ed565b6100cc61017e36600461072e565b610299565b6100cc610191366004610747565b6102af565b6100e16101a436600461072e565b6103ce565b6100cc6101b7366004610704565b61042a565b6100cc6101ca366004610747565b610463565b6100cc6101dd36600461072e565b6104d9565b6101ea6104ec565b6001600160a01b03821661021157604051639e95e88b60e01b815260040160405180910390fd5b61021b828261054d565b5050565b6001600160a01b038216600090815260016020908152604080832084845290915281205460ff168061027e575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b9392505050565b61028d6104ec565b61029760006105ef565b565b6102a16104ec565b6102ac60008261054d565b50565b600054600290610100900460ff161580156102d1575060005460ff8083169116105b6103395760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556103666000546001600160a01b03620100009091041690565b6001600160a01b0316148061037a5750303b155b1561038857610388826105ef565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b33600090815260016020908152604080832084845290915281205460ff1680610424575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b92915050565b6104326104ec565b6001600160a01b03821661045957604051631b25a00160e31b815260040160405180910390fd5b61021b828261064a565b61046b6104ec565b6001600160a01b0381166104d05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610330565b6102ac816105ef565b6104e16104ec565b6102ac60008261064a565b6000546001600160a01b03620100009091041633146102975760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610330565b6001600160a01b0382166000818152600160208181526040808420868552909152909120805460ff191690911790556105b0576040518181527f22f0a171f00eeea3af5276d1f77587471dcc3bde32d62560046549b34bacd38a906020016103c2565b604080516001600160a01b0384168152602081018390527f21cdff046578afe71b78f95ac4891306af3a9b9eb71e2f0ef380b35b487d2f1291016103c2565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6001600160a01b03821660008181526001602090815260408083208584529091529020805460ff191690556106a9576040518181527f7261c2abe5e576aac50024de639315f10783f67935bf118bbb49b33c20ef70ef906020016103c2565b604080516001600160a01b0384168152602081018390527fba8195cc62a4086b7cd93d22db90e43ae42d8b5febd8c66b3453771e455b7a3391016103c2565b80356001600160a01b03811681146106ff57600080fd5b919050565b6000806040838503121561071757600080fd5b610720836106e8565b946020939093013593505050565b60006020828403121561074057600080fd5b5035919050565b60006020828403121561075957600080fd5b61027e826106e856fea264697066735822122096da5c8d33677e6203057d911bba2c609059e50119bb896ec169d0349a48641d64736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063be4a605611610071578063be4a605614610170578063c4d66de814610183578063e5e477a014610196578063ebea45cb146101a9578063f2fde38b146101bc578063fe7e7750146101cf57600080fd5b80632f56be56146100b95780634e473f8f146100ce578063715018a6146100f6578063754b377c146100fe57806380b404ce146101185780638da5cb5b14610146575b600080fd5b6100cc6100c7366004610704565b6101e2565b005b6100e16100dc366004610704565b61021f565b60405190151581526020015b60405180910390f35b6100cc610285565b610106600281565b60405160ff90911681526020016100ed565b6100e1610126366004610704565b600160209081526000928352604080842090915290825290205460ff1681565b6000546201000090046001600160a01b03166040516001600160a01b0390911681526020016100ed565b6100cc61017e36600461072e565b610299565b6100cc610191366004610747565b6102af565b6100e16101a436600461072e565b6103ce565b6100cc6101b7366004610704565b61042a565b6100cc6101ca366004610747565b610463565b6100cc6101dd36600461072e565b6104d9565b6101ea6104ec565b6001600160a01b03821661021157604051639e95e88b60e01b815260040160405180910390fd5b61021b828261054d565b5050565b6001600160a01b038216600090815260016020908152604080832084845290915281205460ff168061027e575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b9392505050565b61028d6104ec565b61029760006105ef565b565b6102a16104ec565b6102ac60008261054d565b50565b600054600290610100900460ff161580156102d1575060005460ff8083169116105b6103395760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556103666000546001600160a01b03620100009091041690565b6001600160a01b0316148061037a5750303b155b1561038857610388826105ef565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b33600090815260016020908152604080832084845290915281205460ff1680610424575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b92915050565b6104326104ec565b6001600160a01b03821661045957604051631b25a00160e31b815260040160405180910390fd5b61021b828261064a565b61046b6104ec565b6001600160a01b0381166104d05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610330565b6102ac816105ef565b6104e16104ec565b6102ac60008261064a565b6000546001600160a01b03620100009091041633146102975760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610330565b6001600160a01b0382166000818152600160208181526040808420868552909152909120805460ff191690911790556105b0576040518181527f22f0a171f00eeea3af5276d1f77587471dcc3bde32d62560046549b34bacd38a906020016103c2565b604080516001600160a01b0384168152602081018390527f21cdff046578afe71b78f95ac4891306af3a9b9eb71e2f0ef380b35b487d2f1291016103c2565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6001600160a01b03821660008181526001602090815260408083208584529091529020805460ff191690556106a9576040518181527f7261c2abe5e576aac50024de639315f10783f67935bf118bbb49b33c20ef70ef906020016103c2565b604080516001600160a01b0384168152602081018390527fba8195cc62a4086b7cd93d22db90e43ae42d8b5febd8c66b3453771e455b7a3391016103c2565b80356001600160a01b03811681146106ff57600080fd5b919050565b6000806040838503121561071757600080fd5b610720836106e8565b946020939093013593505050565b60006020828403121561074057600080fd5b5035919050565b60006020828403121561075957600080fd5b61027e826106e856fea264697066735822122096da5c8d33677e6203057d911bba2c609059e50119bb896ec169d0349a48641d64736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "constructor": { - "details": "Constructor", - "params": { - "owner": "Owner of the contract, can register/ unregister roots" - } - }, - "initialize(address)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "ownerAddress": "Owner of the contract, can update public key and address" - } - }, - "isRootAvailableForAttester(address,uint256)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "attester": "Owner of the contract, can update public key and address", - "root": "Owner of the contract, can update public key and address" - } - }, - "isRootAvailableForMe(uint256)": { - "details": "returns whether a root is available for a caller (msg.sender)", - "params": { - "root": "root to check whether it is registered for me or not" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "registerRootForAll(uint256)": { - "details": "Registers a root, available for all contracts", - "params": { - "root": "Root to register" - } - }, - "registerRootForAttester(address,uint256)": { - "details": "Register a root available for an attester", - "params": { - "attester": "Attester which will have the root available", - "root": "Root to register" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "unregisterRootForAll(uint256)": { - "details": "Unregister a root, available for all contracts", - "params": { - "root": "Root to unregister" - } - }, - "unregisterRootForAttester(address,uint256)": { - "details": "Unregister a root for an attester", - "params": { - "attester": "Attester which will no longer have the root available", - "root": "Root to unregister" - } - } - }, - "title": "Attesters Groups Registry", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "This contract stores that data required by attesters to be available so they can verify user claims This contract is deployed behind a proxy and this implementation is focused on storing merkle roots For more information: https://available-roots-registry.docs.sismo.io*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/periphery/utils/AvailableRootsRegistry.sol:AvailableRootsRegistry", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/periphery/utils/AvailableRootsRegistry.sol:AvailableRootsRegistry", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 396, - "contract": "contracts/periphery/utils/AvailableRootsRegistry.sol:AvailableRootsRegistry", - "label": "_owner", - "offset": 2, - "slot": "0", - "type": "t_address" - }, - { - "astId": 15495, - "contract": "contracts/periphery/utils/AvailableRootsRegistry.sol:AvailableRootsRegistry", - "label": "_roots", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_mapping(t_uint256,t_bool))" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_address,t_mapping(t_uint256,t_bool))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(uint256 => bool))", - "numberOfBytes": "32", - "value": "t_mapping(t_uint256,t_bool)" - }, - "t_mapping(t_uint256,t_bool)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/AvailableRootsRegistryProxy.json b/deployments/goerli/AvailableRootsRegistryProxy.json deleted file mode 100644 index eef193a..0000000 --- a/deployments/goerli/AvailableRootsRegistryProxy.json +++ /dev/null @@ -1,249 +0,0 @@ -{ - "address": "0xdDa4c8d2933dAA21Aac75B88fF59725725ba813F", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x773838fcf6484f8ad77bc64e4ee1fc400533a434a765e8b585ba6b265d84c8ee", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0xdDa4c8d2933dAA21Aac75B88fF59725725ba813F", - "transactionIndex": 6, - "gasUsed": "609954", - "logsBloom": "0x00000000000200000000000000000000400000000000000000800000000000000000000000000000000000000000004000000000000000000080000000000000000000000000000000000000000002000001000000010000000000000000000000000000020000000000000000000800000000800000000000000000000000400000000000000000000000000040000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000001000000000000000400400004000000000020000000000000000000000000000000000000000000000000000000008000000000", - "blockHash": "0x70f42606ef0e392c63a9be440ffd3f7fa490373ceea2d34be1c3ab15f96ddc5e", - "transactionHash": "0x773838fcf6484f8ad77bc64e4ee1fc400533a434a765e8b585ba6b265d84c8ee", - "logs": [ - { - "transactionIndex": 6, - "blockNumber": 7711032, - "transactionHash": "0x773838fcf6484f8ad77bc64e4ee1fc400533a434a765e8b585ba6b265d84c8ee", - "address": "0xdDa4c8d2933dAA21Aac75B88fF59725725ba813F", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x0000000000000000000000008aebc853d243fb05c9499dbb25d22a5eaee12f66" - ], - "data": "0x", - "logIndex": 8, - "blockHash": "0x70f42606ef0e392c63a9be440ffd3f7fa490373ceea2d34be1c3ab15f96ddc5e" - }, - { - "transactionIndex": 6, - "blockNumber": 7711032, - "transactionHash": "0x773838fcf6484f8ad77bc64e4ee1fc400533a434a765e8b585ba6b265d84c8ee", - "address": "0xdDa4c8d2933dAA21Aac75B88fF59725725ba813F", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "data": "0x", - "logIndex": 9, - "blockHash": "0x70f42606ef0e392c63a9be440ffd3f7fa490373ceea2d34be1c3ab15f96ddc5e" - }, - { - "transactionIndex": 6, - "blockNumber": 7711032, - "transactionHash": "0x773838fcf6484f8ad77bc64e4ee1fc400533a434a765e8b585ba6b265d84c8ee", - "address": "0xdDa4c8d2933dAA21Aac75B88fF59725725ba813F", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000246e71bc2a257f4be9c7fad4664e6d7444844adc", - "logIndex": 10, - "blockHash": "0x70f42606ef0e392c63a9be440ffd3f7fa490373ceea2d34be1c3ab15f96ddc5e" - } - ], - "blockNumber": 7711032, - "cumulativeGasUsed": "1227293", - "status": 1, - "byzantium": true - }, - "args": [ - "0x8AebC853D243Fb05C9499DBb25D22A5EaEE12F66", - "0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc", - "0xc4d66de8000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/goerli/Badges.json b/deployments/goerli/Badges.json deleted file mode 100644 index c1531a3..0000000 --- a/deployments/goerli/Badges.json +++ /dev/null @@ -1,1114 +0,0 @@ -{ - "address": "0xE06B14D5835925e1642d7216F4563a1273509F10", - "abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "BadgesNonTransferrable", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - } - ], - "name": "TransferBatch", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "TransferSingle", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "value", - "type": "string" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "URI", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "EVENT_TRIGGERER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "accounts", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - } - ], - "name": "balanceOfBatch", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationsRegistry", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "getAttributeValueForBadge", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "getAttributesNamesAndValuesForBadge", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - }, - { - "internalType": "uint8[]", - "name": "", - "type": "uint8[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "getBadgeExtraData", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "getBadgeIssuer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "getBadgeTimestamp", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeBatchTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistry", - "type": "address" - } - ], - "name": "setAttestationsRegistry", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "setUri", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "triggerTransferEvent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "uri", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x11dc97a8b2cf850794f3b362302f2dd567485a0246bf3906a9ce60cd84b7fffe", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0xd1FB2b5E3E1695283a882131CcEdD181c638Fa86", - "transactionIndex": 53, - "gasUsed": "2131254", - "logsBloom": "0x00000004000200000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800002000000000000000000000000000000000000000000000000400000000000000000000200080040000000000000000000000000000000000000000800400000000000000000000001000000000000000000000000000000000000000040000000000000000400100000000000020000000000000000000000000000000000000000000000000000000008000000000", - "blockHash": "0x14b2694344df2fd261cb701ed8e1f3aa6f1c490aef6fcf1996821f9cc6994827", - "transactionHash": "0x11dc97a8b2cf850794f3b362302f2dd567485a0246bf3906a9ce60cd84b7fffe", - "logs": [ - { - "transactionIndex": 53, - "blockNumber": 8080254, - "transactionHash": "0x11dc97a8b2cf850794f3b362302f2dd567485a0246bf3906a9ce60cd84b7fffe", - "address": "0xd1FB2b5E3E1695283a882131CcEdD181c638Fa86", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "data": "0x", - "logIndex": 186, - "blockHash": "0x14b2694344df2fd261cb701ed8e1f3aa6f1c490aef6fcf1996821f9cc6994827" - }, - { - "transactionIndex": 53, - "blockNumber": 8080254, - "transactionHash": "0x11dc97a8b2cf850794f3b362302f2dd567485a0246bf3906a9ce60cd84b7fffe", - "address": "0xd1FB2b5E3E1695283a882131CcEdD181c638Fa86", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 187, - "blockHash": "0x14b2694344df2fd261cb701ed8e1f3aa6f1c490aef6fcf1996821f9cc6994827" - } - ], - "blockNumber": 8080254, - "cumulativeGasUsed": "15883057", - "status": 1, - "byzantium": true - }, - "args": [ - "https://hub.staging.zikies.io/badges/goerli/{id}.json", - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954" - ], - "numDeployments": 6, - "solcInputHash": "24c70469fd559e01f6ff2a10472da9a6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BadgesNonTransferrable\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EVENT_TRIGGERER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationsRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"getAttributeValueForBadge\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getAttributesNamesAndValuesForBadge\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBadgeExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBadgeIssuer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBadgeTimestamp\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistry\",\"type\":\"address\"}],\"name\":\"setAttestationsRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"setUri\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"triggerTransferEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"balanceOf(address,uint256)\":{\"details\":\"Main function of the ERC1155 badge The balance of a user is equal to the value of the underlying attestation. attestationCollectionId == badgeId\",\"params\":{\"account\":\"Address to check badge balance (= value of attestation)\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"balanceOfBatch(address[],uint256[])\":{\"details\":\"See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length.\"},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"owner\":\"Owner of the contract, super admin, can setup roles and update the attestation registry\",\"uri\":\"Uri for the metadata of badges\"}},\"getAttestationsRegistry()\":{\"details\":\"Getter of the attestations registry\"},\"getAttributeValueForBadge(uint256,uint8)\":{\"details\":\"Getter of the value of a specific badge attribute\",\"params\":{\"id\":\"Badge Id to check (= attestationCollectionId)\",\"index\":\"Index of the attribute\"}},\"getAttributesNamesAndValuesForBadge(uint256)\":{\"details\":\"Getter of all badge attributes and their values for a specific badge\",\"params\":{\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getBadgeExtraData(address,uint256)\":{\"details\":\"Getter of the badge extra data (it can store nullifier and burnCount)\",\"params\":{\"account\":\"Address that holds the badge\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getBadgeIssuer(address,uint256)\":{\"details\":\"Getter of the badge issuer\",\"params\":{\"account\":\"Address that holds the badge\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getBadgeTimestamp(address,uint256)\":{\"details\":\"Getter of the badge timestamp\",\"params\":{\"account\":\"Address that holds the badge\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initialize(string,address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"owner\":\"Owner of the contract, super admin, can setup roles and update the attestation registry\",\"uri\":\"Uri for the metadata of badges\"}},\"isApprovedForAll(address,address)\":{\"details\":\"Reverts, this is a non transferable ERC115 contract\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)\":{\"details\":\"See {IERC1155-safeBatchTransferFrom}.\"},\"safeTransferFrom(address,address,uint256,uint256,bytes)\":{\"details\":\"See {IERC1155-safeTransferFrom}.\"},\"setApprovalForAll(address,bool)\":{\"details\":\"Reverts, this is a non transferable ERC115 contract\"},\"setAttestationsRegistry(address)\":{\"details\":\"Set the attestations registry address. Can only be called by owner (default admin)\",\"params\":{\"attestationsRegistry\":\"new attestations registry address\"}},\"setUri(string)\":{\"details\":\"Set the URI. Can only be called by owner (default admin)\",\"params\":{\"uri\":\"new attestations registry address\"}},\"supportsInterface(bytes4)\":{\"details\":\"ERC165\"},\"triggerTransferEvent(address,address,address,uint256,uint256)\":{\"details\":\"Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\",\"params\":{\"from\":\"address(0) if minting, address of the badge holder if burning\",\"id\":\"badgeId for which to trigger the event\",\"operator\":\"who is calling the TransferEvent\",\"to\":\"address of the badge holder is minting, address(0) if burning\",\"value\":\"minted/burned balance\"}},\"uri(uint256)\":{\"details\":\"See {IERC1155MetadataURI-uri}. This implementation returns the same URI for *all* token types. It relies on the token type ID substitution mechanism https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. Clients calling this function must replace the `\\\\{id\\\\}` substring with the actual token type ID.\"}},\"title\":\"Badges contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(string,address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations The associated attestations registry triggers TransferSingle events from this contract It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms For more information: https://badges.docs.sismo.io\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/Badges.sol\":\"Badges\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\nimport \\\"../utils/Context.sol\\\";\\nimport \\\"../utils/Strings.sol\\\";\\nimport \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\\n * Overriding this function changes the behavior of the {onlyRole} modifier.\\n *\\n * Format of the revert message is described in {_checkRole}.\\n *\\n * _Available since v4.6._\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n Strings.toHexString(account),\\n \\\" is missing role \\\",\\n Strings.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * May emit a {RoleGranted} event.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n}\\n\",\"keccak256\":\"0x67e3daf189111d6d5b0464ed09cf9f0605a22c4b965a7fcecd707101faff008a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/security/Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract Pausable is Context {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0x0849d93b16c9940beb286a7864ed02724b248b93e0d80ef6355af5ef15c64773\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/ERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC1155.sol\\\";\\nimport \\\"./IERC1155Receiver.sol\\\";\\nimport \\\"./extensions/IERC1155MetadataURI.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\nimport \\\"../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the basic standard multi-token.\\n * See https://eips.ethereum.org/EIPS/eip-1155\\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\\n *\\n * _Available since v3.1._\\n */\\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\\n using Address for address;\\n\\n // Mapping from token ID to account balances\\n mapping(uint256 => mapping(address => uint256)) private _balances;\\n\\n // Mapping from account to operator approvals\\n mapping(address => mapping(address => bool)) private _operatorApprovals;\\n\\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\\n string private _uri;\\n\\n /**\\n * @dev See {_setURI}.\\n */\\n constructor(string memory uri_) {\\n _setURI(uri_);\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC1155).interfaceId ||\\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC1155MetadataURI-uri}.\\n *\\n * This implementation returns the same URI for *all* token types. It relies\\n * on the token type ID substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * Clients calling this function must replace the `\\\\{id\\\\}` substring with the\\n * actual token type ID.\\n */\\n function uri(uint256) public view virtual override returns (string memory) {\\n return _uri;\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\\n require(account != address(0), \\\"ERC1155: address zero is not a valid owner\\\");\\n return _balances[id][account];\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOfBatch}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\\n public\\n view\\n virtual\\n override\\n returns (uint256[] memory)\\n {\\n require(accounts.length == ids.length, \\\"ERC1155: accounts and ids length mismatch\\\");\\n\\n uint256[] memory batchBalances = new uint256[](accounts.length);\\n\\n for (uint256 i = 0; i < accounts.length; ++i) {\\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\\n }\\n\\n return batchBalances;\\n }\\n\\n /**\\n * @dev See {IERC1155-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC1155-isApprovedForAll}.\\n */\\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\\n return _operatorApprovals[account][operator];\\n }\\n\\n /**\\n * @dev See {IERC1155-safeTransferFrom}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner or approved\\\"\\n );\\n _safeTransferFrom(from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev See {IERC1155-safeBatchTransferFrom}.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner or approved\\\"\\n );\\n _safeBatchTransferFrom(from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n\\n emit TransferSingle(operator, from, to, id, amount);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; ++i) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n }\\n\\n emit TransferBatch(operator, from, to, ids, amounts);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Sets a new URI for all token types, by relying on the token type ID\\n * substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * By this mechanism, any occurrence of the `\\\\{id\\\\}` substring in either the\\n * URI or any of the amounts in the JSON file at said URI will be replaced by\\n * clients with the token type ID.\\n *\\n * For example, the `https://token-cdn-domain/\\\\{id\\\\}.json` URI would be\\n * interpreted by clients as\\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\\n * for token type ID 0x4cce0.\\n *\\n * See {uri}.\\n *\\n * Because these URIs cannot be meaningfully represented by the {URI} event,\\n * this function emits no events.\\n */\\n function _setURI(string memory newuri) internal virtual {\\n _uri = newuri;\\n }\\n\\n /**\\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _mint(\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _balances[id][to] += amount;\\n emit TransferSingle(operator, address(0), to, id, amount);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _mintBatch(\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n _balances[ids[i]][to] += amounts[i];\\n }\\n\\n emit TransferBatch(operator, address(0), to, ids, amounts);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens of token type `id` from `from`\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `from` must have at least `amount` tokens of token type `id`.\\n */\\n function _burn(\\n address from,\\n uint256 id,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n\\n emit TransferSingle(operator, from, address(0), id, amount);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n */\\n function _burnBatch(\\n address from,\\n uint256[] memory ids,\\n uint256[] memory amounts\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n }\\n\\n emit TransferBatch(operator, from, address(0), ids, amounts);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(\\n address owner,\\n address operator,\\n bool approved\\n ) internal virtual {\\n require(owner != operator, \\\"ERC1155: setting approval status for self\\\");\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Hook that is called before any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `ids` and `amounts` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `id` and `amount` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n function _doSafeTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\\n if (response != IERC1155Receiver.onERC1155Received.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non-ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _doSafeBatchTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\\n bytes4 response\\n ) {\\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non-ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\\n uint256[] memory array = new uint256[](1);\\n array[0] = element;\\n\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0xd917747dc87f189c6779b894f367a028f9dca4be930283cccec8f312966af820\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155 is IERC165 {\\n /**\\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\\n */\\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\\n\\n /**\\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\\n * transfers.\\n */\\n event TransferBatch(\\n address indexed operator,\\n address indexed from,\\n address indexed to,\\n uint256[] ids,\\n uint256[] values\\n );\\n\\n /**\\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\\n * `approved`.\\n */\\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\\n\\n /**\\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\\n *\\n * If an {URI} event was emitted for `id`, the standard\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\\n * returned by {IERC1155MetadataURI-uri}.\\n */\\n event URI(string value, uint256 indexed id);\\n\\n /**\\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\\n external\\n view\\n returns (uint256[] memory);\\n\\n /**\\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\\n *\\n * Emits an {ApprovalForAll} event.\\n *\\n * Requirements:\\n *\\n * - `operator` cannot be the caller.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\\n *\\n * See {setApprovalForAll}.\\n */\\n function isApprovedForAll(address account, address operator) external view returns (bool);\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] calldata ids,\\n uint256[] calldata amounts,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x6392f2cfe3a5ee802227fe7a2dfd47096d881aec89bddd214b35c5b46d3cd941\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev _Available since v3.1._\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xeb373f1fdc7b755c6a750123a9b9e3a8a02c1470042fd6505d875000a80bde0b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1155.sol\\\";\\nimport \\\"../../../security/Pausable.sol\\\";\\n\\n/**\\n * @dev ERC1155 token with pausable token transfers, minting and burning.\\n *\\n * Useful for scenarios such as preventing trades until the end of an evaluation\\n * period, or having an emergency switch for freezing all token transfers in the\\n * event of a large bug.\\n *\\n * _Available since v3.1._\\n */\\nabstract contract ERC1155Pausable is ERC1155, Pausable {\\n /**\\n * @dev See {ERC1155-_beforeTokenTransfer}.\\n *\\n * Requirements:\\n *\\n * - the contract must not be paused.\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override {\\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n require(!paused(), \\\"ERC1155Pausable: token transfer while paused\\\");\\n }\\n}\\n\",\"keccak256\":\"0xdad22b949de979bb2ad9001c044b2aeaacf8a25e3de09ed6f022a9469f936d5b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC1155.sol\\\";\\n\\n/**\\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155MetadataURI is IERC1155 {\\n /**\\n * @dev Returns the URI for token type `id`.\\n *\\n * If the `\\\\{id\\\\}` substring is present in the URI, it must be replaced by\\n * clients with the actual token type ID.\\n */\\n function uri(uint256 id) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xa66d18b9a85458d28fc3304717964502ae36f7f8a2ff35bc83f6f85d74b03574\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"},\"contracts/core/Badges.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {IBadges} from './interfaces/IBadges.sol';\\n\\n/**\\n * @title Badges contract\\n * @author Sismo\\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\\n * The associated attestations registry triggers TransferSingle events from this contract\\n * It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms\\n * For more information: https://badges.docs.sismo.io\\n */\\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\\n uint8 public constant IMPLEMENTATION_VERSION = 3;\\n\\n IAttestationsRegistry internal _attestationsRegistry;\\n\\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\\n\\n /**\\n * @dev Constructor\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n */\\n constructor(\\n string memory uri,\\n address owner // This is Sismo Frontend Contract\\n ) ERC1155(uri) {\\n initialize(uri, owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n string memory uri,\\n address owner\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup uri yet or if called by constructor (for implem setup)\\n if (bytes(ERC1155.uri(0)).length == 0 || address(this).code.length == 0) {\\n _setURI(uri);\\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\\n }\\n }\\n\\n /**\\n * @dev Main function of the ERC1155 badge\\n * The balance of a user is equal to the value of the underlying attestation.\\n * attestationCollectionId == badgeId\\n * @param account Address to check badge balance (= value of attestation)\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function balanceOf(\\n address account,\\n uint256 id\\n ) public view virtual override(ERC1155, IBadges) returns (uint256) {\\n return _attestationsRegistry.getAttestationValue(id, account);\\n }\\n\\n /**\\n * @dev Reverts, this is a non transferable ERC115 contract\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n revert BadgesNonTransferrable();\\n }\\n\\n /**\\n * @dev Reverts, this is a non transferable ERC115 contract\\n */\\n function isApprovedForAll(\\n address account,\\n address operator\\n ) public view virtual override returns (bool) {\\n revert BadgesNonTransferrable();\\n }\\n\\n /**\\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\\n * @param operator who is calling the TransferEvent\\n * @param from address(0) if minting, address of the badge holder if burning\\n * @param to address of the badge holder is minting, address(0) if burning\\n * @param id badgeId for which to trigger the event\\n * @param value minted/burned balance\\n */\\n function triggerTransferEvent(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 value\\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\\n emit TransferSingle(operator, from, to, id, value);\\n }\\n\\n /**\\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\\n * @param attestationsRegistry new attestations registry address\\n */\\n function setAttestationsRegistry(\\n address attestationsRegistry\\n ) external override onlyRole(DEFAULT_ADMIN_ROLE) {\\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\\n }\\n\\n /**\\n * @dev Set the URI. Can only be called by owner (default admin)\\n * @param uri new attestations registry address\\n */\\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\\n _setURI(uri);\\n }\\n\\n /**\\n * @dev Getter of the attestations registry\\n */\\n function getAttestationsRegistry() external view override returns (address) {\\n return address(_attestationsRegistry);\\n }\\n\\n /**\\n * @dev Getter of the badge issuer\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeIssuer(address account, uint256 id) external view returns (address) {\\n return _attestationsRegistry.getAttestationIssuer(id, account);\\n }\\n\\n /**\\n * @dev Getter of the badge timestamp\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32) {\\n return _attestationsRegistry.getAttestationTimestamp(id, account);\\n }\\n\\n /**\\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory) {\\n return _attestationsRegistry.getAttestationExtraData(id, account);\\n }\\n\\n /**\\n * @dev Getter of the value of a specific badge attribute\\n * @param id Badge Id to check (= attestationCollectionId)\\n * @param index Index of the attribute\\n */\\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8) {\\n return _attestationsRegistry.getAttributeValueForAttestationsCollection(id, index);\\n }\\n\\n /**\\n * @dev Getter of all badge attributes and their values for a specific badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getAttributesNamesAndValuesForBadge(\\n uint256 id\\n ) external view returns (bytes32[] memory, uint8[] memory) {\\n return _attestationsRegistry.getAttributesNamesAndValuesForAttestationsCollection(id);\\n }\\n\\n /**\\n * @dev ERC165\\n */\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view virtual override(AccessControl, ERC1155) returns (bool) {\\n return super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Reverts, this is a non transferable ERC115 contract\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override {\\n revert BadgesNonTransferrable();\\n }\\n}\\n\",\"keccak256\":\"0x9982b753d43f2a4a9edb5987714b09f518b419339d4bf9cd63b600bee442fd01\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IBadges.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Interface for Badges contract\\n * @author Sismo\\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\\n * The associated attestations registry triggers TransferSingle events from this contract\\n * It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms\\n */\\ninterface IBadges {\\n error BadgesNonTransferrable();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(string memory uri, address owner) external;\\n\\n /**\\n * @dev Main function of the ERC1155 badge\\n * The balance of a user is equal to the value of the underlying attestation.\\n * attestationCollectionId == badgeId\\n * @param account Address to check badge balance (= value of attestation)\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\\n * @param operator who is calling the TransferEvent\\n * @param from address(0) if minting, address of the badge holder if burning\\n * @param to address of the badge holder is minting, address(0) if burning\\n * @param id badgeId for which to trigger the event\\n * @param value minted/burned balance\\n */\\n function triggerTransferEvent(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 value\\n ) external;\\n\\n /**\\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\\n * @param attestationsRegistry new attestations registry address\\n */\\n function setAttestationsRegistry(address attestationsRegistry) external;\\n\\n /**\\n * @dev Set the URI. Can only be called by owner (default admin)\\n * @param uri new attestations registry address\\n */\\n function setUri(string memory uri) external;\\n\\n /**\\n * @dev Getter of the attestations registry\\n */\\n function getAttestationsRegistry() external view returns (address);\\n\\n /**\\n * @dev Getter of the badge issuer\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeIssuer(address account, uint256 id) external view returns (address);\\n\\n /**\\n * @dev Getter of the badge timestamp\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the value of a specific badge attribute\\n * @param id Badge Id to check (= attestationCollectionId)\\n * @param index Index of the attribute\\n */\\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);\\n\\n /**\\n * @dev Getter of all badge attributes and their values for a specific badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getAttributesNamesAndValuesForBadge(\\n uint256 id\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n}\\n\",\"keccak256\":\"0xd6bdfc887ef15ee022eb05d89dbe2e2938ee6c0a55a55f8db527ef650242c6bb\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b50604051620027eb380380620027eb833981016040819052620000349162000395565b81620000408162000055565b506200004d82826200006e565b5050620004c2565b80516200006a906004906020840190620002bc565b5050565b600054600390610100900460ff1615801562000091575060005460ff8083169116105b620000f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff83161761010017815562000127906200051d62000198602090811b91909117901c565b511580620001345750303b155b156200015257620001458362000055565b6200015260008362000234565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b606060048054620001a99062000486565b80601f0160208091040260200160405190810160405280929190818152602001828054620001d79062000486565b8015620002285780601f10620001fc5761010080835404028352916020019162000228565b820191906000526020600020905b8154815290600101906020018083116200020a57829003601f168201915b50505050509050919050565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff166200006a5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b828054620002ca9062000486565b90600052602060002090601f016020900481019282620002ee576000855562000339565b82601f106200030957805160ff191683800117855562000339565b8280016001018555821562000339579182015b82811115620003395782518255916020019190600101906200031c565b50620003479291506200034b565b5090565b5b808211156200034757600081556001016200034c565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200039057600080fd5b919050565b60008060408385031215620003a957600080fd5b82516001600160401b0380821115620003c157600080fd5b818501915085601f830112620003d657600080fd5b815181811115620003eb57620003eb62000362565b604051601f8201601f19908116603f0116810190838211818310171562000416576200041662000362565b816040528281526020935088848487010111156200043357600080fd5b600091505b8282101562000457578482018401518183018501529083019062000438565b82821115620004695760008484830101525b95506200047b91505085820162000378565b925050509250929050565b600181811c908216806200049b57607f821691505b602082108103620004bc57634e487b7160e01b600052602260045260246000fd5b50919050565b61231980620004d26000396000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c8063754b377c116100de578063aed8c6bc11610097578063e37ffe7c11610071578063e37ffe7c146103aa578063e985e9c5146103cb578063f242432a146103de578063ff4468c4146103f157600080fd5b8063aed8c6bc14610371578063b3c1cb2114610384578063d547741f1461039757600080fd5b8063754b377c146103035780637ab4339d1461031d57806391d14854146103305780639b642de114610343578063a217fddf14610356578063a22cb4651461035e57600080fd5b80632f2ff15d1161014b57806344112ed81161012557806344112ed8146102985780634e1273f4146102bf578063710b3096146102df578063730cb7d5146102f257600080fd5b80632f2ff15d1461025f57806336568abe146102725780633e1f3c271461028557600080fd5b8062fdd58e1461019257806301ffc9a7146101b85780630e064366146101db5780630e89341c14610206578063248a9ca3146102265780632eb2c2d61461024a575b600080fd5b6101a56101a0366004611618565b610419565b6040519081526020015b60405180910390f35b6101cb6101c636600461165a565b610496565b60405190151581526020016101af565b6101ee6101e9366004611618565b6104a7565b6040516001600160a01b0390911681526020016101af565b610219610214366004611677565b61051d565b6040516101af91906116ec565b6101a5610234366004611677565b6000908152600160208190526040909120015490565b61025d610258366004611858565b6105b1565b005b61025d61026d366004611905565b610606565b61025d610280366004611905565b610631565b610219610293366004611618565b6106af565b6101a57fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa481565b6102d26102cd366004611935565b610729565b6040516101af9190611a3c565b61025d6102ed366004611a4f565b610852565b6005546001600160a01b03166101ee565b61030b600381565b60405160ff90911681526020016101af565b61025d61032b366004611aaa565b6108e4565b6101cb61033e366004611905565b6109f1565b61025d610351366004611af0565b610a1c565b6101a5600081565b61025d61036c366004611b2c565b610a30565b61030b61037f366004611b6e565b610a49565b61025d610392366004611b93565b610ac0565b61025d6103a5366004611905565b610aee565b6103bd6103b8366004611677565b610b14565b6040516101af929190611bb0565b6101cb6103d9366004611c2e565b610b93565b61025d6103ec366004611c5c565b610bae565b6104046103ff366004611618565b610bf3565b60405163ffffffff90911681526020016101af565b60055460405163461e4f1960e11b8152600481018390526001600160a01b0384811660248301526000921690638c3c9e3290604401602060405180830381865afa15801561046b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cc4565b9392505050565b60006104a182610c69565b92915050565b6005546040516363ed4d5360e11b8152600481018390526001600160a01b038481166024830152600092169063c7da9aa690604401602060405180830381865afa1580156104f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cdd565b60606004805461052c90611cfa565b80601f016020809104026020016040519081016040528092919081815260200182805461055890611cfa565b80156105a55780601f1061057a576101008083540402835291602001916105a5565b820191906000526020600020905b81548152906001019060200180831161058857829003601f168201915b50505050509050919050565b6001600160a01b0385163314806105cd57506105cd8533610b93565b6105f25760405162461bcd60e51b81526004016105e990611d34565b60405180910390fd5b6105ff8585858585610ca9565b5050505050565b6000828152600160208190526040909120015461062281610e97565b61062c8383610ea4565b505050565b6001600160a01b03811633146106a15760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105e9565b6106ab8282610f0f565b5050565b600554604051636d7fbb6760e01b8152600481018390526001600160a01b0384811660248301526060921690636d7fbb6790604401600060405180830381865afa158015610701573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261048f9190810190611d82565b6060815183511461078e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016105e9565b600083516001600160401b038111156107a9576107a96116ff565b6040519080825280602002602001820160405280156107d2578160200160208202803683370190505b50905060005b845181101561084a5761081d8582815181106107f6576107f6611e03565b602002602001015185838151811061081057610810611e03565b6020026020010151610419565b82828151811061082f5761082f611e03565b602090810291909101015261084381611e2f565b90506107d8565b509392505050565b7fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa461087c81610e97565b836001600160a01b0316856001600160a01b0316876001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6286866040516108d4929190918252602082015260400190565b60405180910390a4505050505050565b600054600390610100900460ff16158015610906575060005460ff8083169116105b6109695760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e9565b6000805461ffff191660ff8316176101001781556109869061051d565b5115806109925750303b155b156109ab576109a083610f76565b6109ab600083610ea4565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610a2781610e97565b6106ab82610f76565b6040516309a711b960e31b815260040160405180910390fd5b600554604051630e972f9160e41b81526004810184905260ff831660248201526000916001600160a01b03169063e972f91090604401602060405180830381865afa158015610a9c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611e48565b6000610acb81610e97565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526001602081905260409091200154610b0a81610e97565b61062c8383610f0f565b600554604051632b2bf81b60e11b81526004810183905260609182916001600160a01b0390911690635657f03690602401600060405180830381865afa158015610b62573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b8a9190810190611ed4565b91509150915091565b60006040516309a711b960e31b815260040160405180910390fd5b6001600160a01b038516331480610bca5750610bca8533610b93565b610be65760405162461bcd60e51b81526004016105e990611d34565b6105ff8585858585610f89565b6005546040516314067f8b60e01b8152600481018390526001600160a01b03848116602483015260009216906314067f8b90604401602060405180830381865afa158015610c45573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611f90565b60006001600160e01b03198216636cdb3d1360e11b1480610c9a57506001600160e01b031982166303a24d0760e21b145b806104a157506104a1826110c5565b8151835114610d0b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016105e9565b6001600160a01b038416610d315760405162461bcd60e51b81526004016105e990611fb6565b33610d40818787878787610a30565b60005b8451811015610e29576000858281518110610d6057610d60611e03565b602002602001015190506000858381518110610d7e57610d7e611e03565b60209081029190910181015160008481526002835260408082206001600160a01b038e168352909352919091205490915081811015610dcf5760405162461bcd60e51b81526004016105e990611ffb565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610e0e908490612045565b9250508190555050505080610e2290611e2f565b9050610d43565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610e7992919061205d565b60405180910390a4610e8f8187878787876110fa565b505050505050565b610ea1813361125e565b50565b610eae82826109f1565b6106ab5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b610f1982826109f1565b156106ab5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b80516106ab90600490602084019061156a565b6001600160a01b038416610faf5760405162461bcd60e51b81526004016105e990611fb6565b336000610fbb856112b7565b90506000610fc8856112b7565b9050610fd8838989858589610a30565b60008681526002602090815260408083206001600160a01b038c1684529091529020548581101561101b5760405162461bcd60e51b81526004016105e990611ffb565b60008781526002602090815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061105a908490612045565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46110ba848a8a8a8a8a611302565b505050505050505050565b60006001600160e01b03198216637965db0b60e01b14806104a157506301ffc9a760e01b6001600160e01b03198316146104a1565b6001600160a01b0384163b15610e8f5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061113e908990899088908890889060040161208b565b6020604051808303816000875af1925050508015611179575060408051601f3d908101601f19168201909252611176918101906120e9565b60015b61122557611185612106565b806308c379a0036111be5750611199612122565b806111a457506111c0565b8060405162461bcd60e51b81526004016105e991906116ec565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016105e9565b6001600160e01b0319811663bc197c8160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b50505050505050565b61126882826109f1565b6106ab57611275816113bd565b6112808360206113cf565b6040516020016112919291906121f3565b60408051601f198184030181529082905262461bcd60e51b82526105e9916004016116ec565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106112f1576112f1611e03565b602090810291909101015292915050565b6001600160a01b0384163b15610e8f5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906113469089908990889088908890600401612268565b6020604051808303816000875af1925050508015611381575060408051601f3d908101601f1916820190925261137e918101906120e9565b60015b61138d57611185612106565b6001600160e01b0319811663f23a6e6160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b60606104a16001600160a01b03831660145b606060006113de8360026122ad565b6113e9906002612045565b6001600160401b03811115611400576114006116ff565b6040519080825280601f01601f19166020018201604052801561142a576020820181803683370190505b509050600360fc1b8160008151811061144557611445611e03565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061147457611474611e03565b60200101906001600160f81b031916908160001a90535060006114988460026122ad565b6114a3906001612045565b90505b600181111561151b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106114d7576114d7611e03565b1a60f81b8282815181106114ed576114ed611e03565b60200101906001600160f81b031916908160001a90535060049490941c93611514816122cc565b90506114a6565b50831561048f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105e9565b82805461157690611cfa565b90600052602060002090601f01602090048101928261159857600085556115de565b82601f106115b157805160ff19168380011785556115de565b828001600101855582156115de579182015b828111156115de5782518255916020019190600101906115c3565b506115ea9291506115ee565b5090565b5b808211156115ea57600081556001016115ef565b6001600160a01b0381168114610ea157600080fd5b6000806040838503121561162b57600080fd5b823561163681611603565b946020939093013593505050565b6001600160e01b031981168114610ea157600080fd5b60006020828403121561166c57600080fd5b813561048f81611644565b60006020828403121561168957600080fd5b5035919050565b60005b838110156116ab578181015183820152602001611693565b838111156116ba576000848401525b50505050565b600081518084526116d8816020860160208601611690565b601f01601f19169290920160200192915050565b60208152600061048f60208301846116c0565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561173a5761173a6116ff565b6040525050565b60006001600160401b0382111561175a5761175a6116ff565b5060051b60200190565b600082601f83011261177557600080fd5b8135602061178282611741565b60405161178f8282611715565b83815260059390931b85018201928281019150868411156117af57600080fd5b8286015b848110156117ca57803583529183019183016117b3565b509695505050505050565b60006001600160401b038211156117ee576117ee6116ff565b50601f01601f191660200190565b600082601f83011261180d57600080fd5b8135611818816117d5565b6040516118258282611715565b82815285602084870101111561183a57600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a0868803121561187057600080fd5b853561187b81611603565b9450602086013561188b81611603565b935060408601356001600160401b03808211156118a757600080fd5b6118b389838a01611764565b945060608801359150808211156118c957600080fd5b6118d589838a01611764565b935060808801359150808211156118eb57600080fd5b506118f8888289016117fc565b9150509295509295909350565b6000806040838503121561191857600080fd5b82359150602083013561192a81611603565b809150509250929050565b6000806040838503121561194857600080fd5b82356001600160401b038082111561195f57600080fd5b818501915085601f83011261197357600080fd5b8135602061198082611741565b60405161198d8282611715565b83815260059390931b85018201928281019150898411156119ad57600080fd5b948201945b838610156119d45785356119c581611603565b825294820194908201906119b2565b965050860135925050808211156119ea57600080fd5b506119f785828601611764565b9150509250929050565b600081518084526020808501945080840160005b83811015611a3157815187529582019590820190600101611a15565b509495945050505050565b60208152600061048f6020830184611a01565b600080600080600060a08688031215611a6757600080fd5b8535611a7281611603565b94506020860135611a8281611603565b93506040860135611a9281611603565b94979396509394606081013594506080013592915050565b60008060408385031215611abd57600080fd5b82356001600160401b03811115611ad357600080fd5b611adf858286016117fc565b925050602083013561192a81611603565b600060208284031215611b0257600080fd5b81356001600160401b03811115611b1857600080fd5b611b24848285016117fc565b949350505050565b60008060408385031215611b3f57600080fd5b8235611b4a81611603565b91506020830135801515811461192a57600080fd5b60ff81168114610ea157600080fd5b60008060408385031215611b8157600080fd5b82359150602083013561192a81611b5f565b600060208284031215611ba557600080fd5b813561048f81611603565b604080825283519082018190526000906020906060840190828701845b82811015611be957815184529284019290840190600101611bcd565b5050508381038285015284518082528583019183019060005b81811015611c2157835160ff1683529284019291840191600101611c02565b5090979650505050505050565b60008060408385031215611c4157600080fd5b8235611c4c81611603565b9150602083013561192a81611603565b600080600080600060a08688031215611c7457600080fd5b8535611c7f81611603565b94506020860135611c8f81611603565b9350604086013592506060860135915060808601356001600160401b03811115611cb857600080fd5b6118f8888289016117fc565b600060208284031215611cd657600080fd5b5051919050565b600060208284031215611cef57600080fd5b815161048f81611603565b600181811c90821680611d0e57607f821691505b602082108103611d2e57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b600060208284031215611d9457600080fd5b81516001600160401b03811115611daa57600080fd5b8201601f81018413611dbb57600080fd5b8051611dc6816117d5565b604051611dd38282611715565b828152866020848601011115611de857600080fd5b611df9836020830160208701611690565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e4157611e41611e19565b5060010190565b600060208284031215611e5a57600080fd5b815161048f81611b5f565b600082601f830112611e7657600080fd5b81516020611e8382611741565b604051611e908282611715565b83815260059390931b8501820192828101915086841115611eb057600080fd5b8286015b848110156117ca578051611ec781611b5f565b8352918301918301611eb4565b60008060408385031215611ee757600080fd5b82516001600160401b0380821115611efe57600080fd5b818501915085601f830112611f1257600080fd5b81516020611f1f82611741565b604051611f2c8282611715565b83815260059390931b8501820192828101915089841115611f4c57600080fd5b948201945b83861015611f6a57855182529482019490820190611f51565b91880151919650909350505080821115611f8357600080fd5b506119f785828601611e65565b600060208284031215611fa257600080fd5b815163ffffffff8116811461048f57600080fd5b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6000821982111561205857612058611e19565b500190565b6040815260006120706040830185611a01565b82810360208401526120828185611a01565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906120b790830186611a01565b82810360608401526120c98186611a01565b905082810360808401526120dd81856116c0565b98975050505050505050565b6000602082840312156120fb57600080fd5b815161048f81611644565b600060033d111561211f5760046000803e5060005160e01c5b90565b600060443d10156121305790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561215f57505050505090565b82850191508151818111156121775750505050505090565b843d87010160208285010111156121915750505050505090565b6121a060208286010187611715565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161222b816017850160208801611690565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161225c816028840160208801611690565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906122a2908301846116c0565b979650505050505050565b60008160001904831182151516156122c7576122c7611e19565b500290565b6000816122db576122db611e19565b50600019019056fea26469706673582212209e33646a1ed2d51fcc749870e94aa69546c518fc5bfee43d37014ebc54dd767864736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061018d5760003560e01c8063754b377c116100de578063aed8c6bc11610097578063e37ffe7c11610071578063e37ffe7c146103aa578063e985e9c5146103cb578063f242432a146103de578063ff4468c4146103f157600080fd5b8063aed8c6bc14610371578063b3c1cb2114610384578063d547741f1461039757600080fd5b8063754b377c146103035780637ab4339d1461031d57806391d14854146103305780639b642de114610343578063a217fddf14610356578063a22cb4651461035e57600080fd5b80632f2ff15d1161014b57806344112ed81161012557806344112ed8146102985780634e1273f4146102bf578063710b3096146102df578063730cb7d5146102f257600080fd5b80632f2ff15d1461025f57806336568abe146102725780633e1f3c271461028557600080fd5b8062fdd58e1461019257806301ffc9a7146101b85780630e064366146101db5780630e89341c14610206578063248a9ca3146102265780632eb2c2d61461024a575b600080fd5b6101a56101a0366004611618565b610419565b6040519081526020015b60405180910390f35b6101cb6101c636600461165a565b610496565b60405190151581526020016101af565b6101ee6101e9366004611618565b6104a7565b6040516001600160a01b0390911681526020016101af565b610219610214366004611677565b61051d565b6040516101af91906116ec565b6101a5610234366004611677565b6000908152600160208190526040909120015490565b61025d610258366004611858565b6105b1565b005b61025d61026d366004611905565b610606565b61025d610280366004611905565b610631565b610219610293366004611618565b6106af565b6101a57fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa481565b6102d26102cd366004611935565b610729565b6040516101af9190611a3c565b61025d6102ed366004611a4f565b610852565b6005546001600160a01b03166101ee565b61030b600381565b60405160ff90911681526020016101af565b61025d61032b366004611aaa565b6108e4565b6101cb61033e366004611905565b6109f1565b61025d610351366004611af0565b610a1c565b6101a5600081565b61025d61036c366004611b2c565b610a30565b61030b61037f366004611b6e565b610a49565b61025d610392366004611b93565b610ac0565b61025d6103a5366004611905565b610aee565b6103bd6103b8366004611677565b610b14565b6040516101af929190611bb0565b6101cb6103d9366004611c2e565b610b93565b61025d6103ec366004611c5c565b610bae565b6104046103ff366004611618565b610bf3565b60405163ffffffff90911681526020016101af565b60055460405163461e4f1960e11b8152600481018390526001600160a01b0384811660248301526000921690638c3c9e3290604401602060405180830381865afa15801561046b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cc4565b9392505050565b60006104a182610c69565b92915050565b6005546040516363ed4d5360e11b8152600481018390526001600160a01b038481166024830152600092169063c7da9aa690604401602060405180830381865afa1580156104f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cdd565b60606004805461052c90611cfa565b80601f016020809104026020016040519081016040528092919081815260200182805461055890611cfa565b80156105a55780601f1061057a576101008083540402835291602001916105a5565b820191906000526020600020905b81548152906001019060200180831161058857829003601f168201915b50505050509050919050565b6001600160a01b0385163314806105cd57506105cd8533610b93565b6105f25760405162461bcd60e51b81526004016105e990611d34565b60405180910390fd5b6105ff8585858585610ca9565b5050505050565b6000828152600160208190526040909120015461062281610e97565b61062c8383610ea4565b505050565b6001600160a01b03811633146106a15760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105e9565b6106ab8282610f0f565b5050565b600554604051636d7fbb6760e01b8152600481018390526001600160a01b0384811660248301526060921690636d7fbb6790604401600060405180830381865afa158015610701573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261048f9190810190611d82565b6060815183511461078e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016105e9565b600083516001600160401b038111156107a9576107a96116ff565b6040519080825280602002602001820160405280156107d2578160200160208202803683370190505b50905060005b845181101561084a5761081d8582815181106107f6576107f6611e03565b602002602001015185838151811061081057610810611e03565b6020026020010151610419565b82828151811061082f5761082f611e03565b602090810291909101015261084381611e2f565b90506107d8565b509392505050565b7fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa461087c81610e97565b836001600160a01b0316856001600160a01b0316876001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6286866040516108d4929190918252602082015260400190565b60405180910390a4505050505050565b600054600390610100900460ff16158015610906575060005460ff8083169116105b6109695760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e9565b6000805461ffff191660ff8316176101001781556109869061051d565b5115806109925750303b155b156109ab576109a083610f76565b6109ab600083610ea4565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610a2781610e97565b6106ab82610f76565b6040516309a711b960e31b815260040160405180910390fd5b600554604051630e972f9160e41b81526004810184905260ff831660248201526000916001600160a01b03169063e972f91090604401602060405180830381865afa158015610a9c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611e48565b6000610acb81610e97565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526001602081905260409091200154610b0a81610e97565b61062c8383610f0f565b600554604051632b2bf81b60e11b81526004810183905260609182916001600160a01b0390911690635657f03690602401600060405180830381865afa158015610b62573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b8a9190810190611ed4565b91509150915091565b60006040516309a711b960e31b815260040160405180910390fd5b6001600160a01b038516331480610bca5750610bca8533610b93565b610be65760405162461bcd60e51b81526004016105e990611d34565b6105ff8585858585610f89565b6005546040516314067f8b60e01b8152600481018390526001600160a01b03848116602483015260009216906314067f8b90604401602060405180830381865afa158015610c45573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611f90565b60006001600160e01b03198216636cdb3d1360e11b1480610c9a57506001600160e01b031982166303a24d0760e21b145b806104a157506104a1826110c5565b8151835114610d0b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016105e9565b6001600160a01b038416610d315760405162461bcd60e51b81526004016105e990611fb6565b33610d40818787878787610a30565b60005b8451811015610e29576000858281518110610d6057610d60611e03565b602002602001015190506000858381518110610d7e57610d7e611e03565b60209081029190910181015160008481526002835260408082206001600160a01b038e168352909352919091205490915081811015610dcf5760405162461bcd60e51b81526004016105e990611ffb565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610e0e908490612045565b9250508190555050505080610e2290611e2f565b9050610d43565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610e7992919061205d565b60405180910390a4610e8f8187878787876110fa565b505050505050565b610ea1813361125e565b50565b610eae82826109f1565b6106ab5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b610f1982826109f1565b156106ab5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b80516106ab90600490602084019061156a565b6001600160a01b038416610faf5760405162461bcd60e51b81526004016105e990611fb6565b336000610fbb856112b7565b90506000610fc8856112b7565b9050610fd8838989858589610a30565b60008681526002602090815260408083206001600160a01b038c1684529091529020548581101561101b5760405162461bcd60e51b81526004016105e990611ffb565b60008781526002602090815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061105a908490612045565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46110ba848a8a8a8a8a611302565b505050505050505050565b60006001600160e01b03198216637965db0b60e01b14806104a157506301ffc9a760e01b6001600160e01b03198316146104a1565b6001600160a01b0384163b15610e8f5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061113e908990899088908890889060040161208b565b6020604051808303816000875af1925050508015611179575060408051601f3d908101601f19168201909252611176918101906120e9565b60015b61122557611185612106565b806308c379a0036111be5750611199612122565b806111a457506111c0565b8060405162461bcd60e51b81526004016105e991906116ec565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016105e9565b6001600160e01b0319811663bc197c8160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b50505050505050565b61126882826109f1565b6106ab57611275816113bd565b6112808360206113cf565b6040516020016112919291906121f3565b60408051601f198184030181529082905262461bcd60e51b82526105e9916004016116ec565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106112f1576112f1611e03565b602090810291909101015292915050565b6001600160a01b0384163b15610e8f5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906113469089908990889088908890600401612268565b6020604051808303816000875af1925050508015611381575060408051601f3d908101601f1916820190925261137e918101906120e9565b60015b61138d57611185612106565b6001600160e01b0319811663f23a6e6160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b60606104a16001600160a01b03831660145b606060006113de8360026122ad565b6113e9906002612045565b6001600160401b03811115611400576114006116ff565b6040519080825280601f01601f19166020018201604052801561142a576020820181803683370190505b509050600360fc1b8160008151811061144557611445611e03565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061147457611474611e03565b60200101906001600160f81b031916908160001a90535060006114988460026122ad565b6114a3906001612045565b90505b600181111561151b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106114d7576114d7611e03565b1a60f81b8282815181106114ed576114ed611e03565b60200101906001600160f81b031916908160001a90535060049490941c93611514816122cc565b90506114a6565b50831561048f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105e9565b82805461157690611cfa565b90600052602060002090601f01602090048101928261159857600085556115de565b82601f106115b157805160ff19168380011785556115de565b828001600101855582156115de579182015b828111156115de5782518255916020019190600101906115c3565b506115ea9291506115ee565b5090565b5b808211156115ea57600081556001016115ef565b6001600160a01b0381168114610ea157600080fd5b6000806040838503121561162b57600080fd5b823561163681611603565b946020939093013593505050565b6001600160e01b031981168114610ea157600080fd5b60006020828403121561166c57600080fd5b813561048f81611644565b60006020828403121561168957600080fd5b5035919050565b60005b838110156116ab578181015183820152602001611693565b838111156116ba576000848401525b50505050565b600081518084526116d8816020860160208601611690565b601f01601f19169290920160200192915050565b60208152600061048f60208301846116c0565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561173a5761173a6116ff565b6040525050565b60006001600160401b0382111561175a5761175a6116ff565b5060051b60200190565b600082601f83011261177557600080fd5b8135602061178282611741565b60405161178f8282611715565b83815260059390931b85018201928281019150868411156117af57600080fd5b8286015b848110156117ca57803583529183019183016117b3565b509695505050505050565b60006001600160401b038211156117ee576117ee6116ff565b50601f01601f191660200190565b600082601f83011261180d57600080fd5b8135611818816117d5565b6040516118258282611715565b82815285602084870101111561183a57600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a0868803121561187057600080fd5b853561187b81611603565b9450602086013561188b81611603565b935060408601356001600160401b03808211156118a757600080fd5b6118b389838a01611764565b945060608801359150808211156118c957600080fd5b6118d589838a01611764565b935060808801359150808211156118eb57600080fd5b506118f8888289016117fc565b9150509295509295909350565b6000806040838503121561191857600080fd5b82359150602083013561192a81611603565b809150509250929050565b6000806040838503121561194857600080fd5b82356001600160401b038082111561195f57600080fd5b818501915085601f83011261197357600080fd5b8135602061198082611741565b60405161198d8282611715565b83815260059390931b85018201928281019150898411156119ad57600080fd5b948201945b838610156119d45785356119c581611603565b825294820194908201906119b2565b965050860135925050808211156119ea57600080fd5b506119f785828601611764565b9150509250929050565b600081518084526020808501945080840160005b83811015611a3157815187529582019590820190600101611a15565b509495945050505050565b60208152600061048f6020830184611a01565b600080600080600060a08688031215611a6757600080fd5b8535611a7281611603565b94506020860135611a8281611603565b93506040860135611a9281611603565b94979396509394606081013594506080013592915050565b60008060408385031215611abd57600080fd5b82356001600160401b03811115611ad357600080fd5b611adf858286016117fc565b925050602083013561192a81611603565b600060208284031215611b0257600080fd5b81356001600160401b03811115611b1857600080fd5b611b24848285016117fc565b949350505050565b60008060408385031215611b3f57600080fd5b8235611b4a81611603565b91506020830135801515811461192a57600080fd5b60ff81168114610ea157600080fd5b60008060408385031215611b8157600080fd5b82359150602083013561192a81611b5f565b600060208284031215611ba557600080fd5b813561048f81611603565b604080825283519082018190526000906020906060840190828701845b82811015611be957815184529284019290840190600101611bcd565b5050508381038285015284518082528583019183019060005b81811015611c2157835160ff1683529284019291840191600101611c02565b5090979650505050505050565b60008060408385031215611c4157600080fd5b8235611c4c81611603565b9150602083013561192a81611603565b600080600080600060a08688031215611c7457600080fd5b8535611c7f81611603565b94506020860135611c8f81611603565b9350604086013592506060860135915060808601356001600160401b03811115611cb857600080fd5b6118f8888289016117fc565b600060208284031215611cd657600080fd5b5051919050565b600060208284031215611cef57600080fd5b815161048f81611603565b600181811c90821680611d0e57607f821691505b602082108103611d2e57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b600060208284031215611d9457600080fd5b81516001600160401b03811115611daa57600080fd5b8201601f81018413611dbb57600080fd5b8051611dc6816117d5565b604051611dd38282611715565b828152866020848601011115611de857600080fd5b611df9836020830160208701611690565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e4157611e41611e19565b5060010190565b600060208284031215611e5a57600080fd5b815161048f81611b5f565b600082601f830112611e7657600080fd5b81516020611e8382611741565b604051611e908282611715565b83815260059390931b8501820192828101915086841115611eb057600080fd5b8286015b848110156117ca578051611ec781611b5f565b8352918301918301611eb4565b60008060408385031215611ee757600080fd5b82516001600160401b0380821115611efe57600080fd5b818501915085601f830112611f1257600080fd5b81516020611f1f82611741565b604051611f2c8282611715565b83815260059390931b8501820192828101915089841115611f4c57600080fd5b948201945b83861015611f6a57855182529482019490820190611f51565b91880151919650909350505080821115611f8357600080fd5b506119f785828601611e65565b600060208284031215611fa257600080fd5b815163ffffffff8116811461048f57600080fd5b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6000821982111561205857612058611e19565b500190565b6040815260006120706040830185611a01565b82810360208401526120828185611a01565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906120b790830186611a01565b82810360608401526120c98186611a01565b905082810360808401526120dd81856116c0565b98975050505050505050565b6000602082840312156120fb57600080fd5b815161048f81611644565b600060033d111561211f5760046000803e5060005160e01c5b90565b600060443d10156121305790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561215f57505050505090565b82850191508151818111156121775750505050505090565b843d87010160208285010111156121915750505050505090565b6121a060208286010187611715565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161222b816017850160208801611690565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161225c816028840160208801611690565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906122a2908301846116c0565b979650505050505050565b60008160001904831182151516156122c7576122c7611e19565b500290565b6000816122db576122db611e19565b50600019019056fea26469706673582212209e33646a1ed2d51fcc749870e94aa69546c518fc5bfee43d37014ebc54dd767864736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "balanceOf(address,uint256)": { - "details": "Main function of the ERC1155 badge The balance of a user is equal to the value of the underlying attestation. attestationCollectionId == badgeId", - "params": { - "account": "Address to check badge balance (= value of attestation)", - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "balanceOfBatch(address[],uint256[])": { - "details": "See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length." - }, - "constructor": { - "details": "Constructor", - "params": { - "owner": "Owner of the contract, super admin, can setup roles and update the attestation registry", - "uri": "Uri for the metadata of badges" - } - }, - "getAttestationsRegistry()": { - "details": "Getter of the attestations registry" - }, - "getAttributeValueForBadge(uint256,uint8)": { - "details": "Getter of the value of a specific badge attribute", - "params": { - "id": "Badge Id to check (= attestationCollectionId)", - "index": "Index of the attribute" - } - }, - "getAttributesNamesAndValuesForBadge(uint256)": { - "details": "Getter of all badge attributes and their values for a specific badge", - "params": { - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "getBadgeExtraData(address,uint256)": { - "details": "Getter of the badge extra data (it can store nullifier and burnCount)", - "params": { - "account": "Address that holds the badge", - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "getBadgeIssuer(address,uint256)": { - "details": "Getter of the badge issuer", - "params": { - "account": "Address that holds the badge", - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "getBadgeTimestamp(address,uint256)": { - "details": "Getter of the badge timestamp", - "params": { - "account": "Address that holds the badge", - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "getRoleAdmin(bytes32)": { - "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." - }, - "grantRole(bytes32,address)": { - "details": "Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event." - }, - "hasRole(bytes32,address)": { - "details": "Returns `true` if `account` has been granted `role`." - }, - "initialize(string,address)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "owner": "Owner of the contract, super admin, can setup roles and update the attestation registry", - "uri": "Uri for the metadata of badges" - } - }, - "isApprovedForAll(address,address)": { - "details": "Reverts, this is a non transferable ERC115 contract" - }, - "renounceRole(bytes32,address)": { - "details": "Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event." - }, - "revokeRole(bytes32,address)": { - "details": "Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event." - }, - "safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)": { - "details": "See {IERC1155-safeBatchTransferFrom}." - }, - "safeTransferFrom(address,address,uint256,uint256,bytes)": { - "details": "See {IERC1155-safeTransferFrom}." - }, - "setApprovalForAll(address,bool)": { - "details": "Reverts, this is a non transferable ERC115 contract" - }, - "setAttestationsRegistry(address)": { - "details": "Set the attestations registry address. Can only be called by owner (default admin)", - "params": { - "attestationsRegistry": "new attestations registry address" - } - }, - "setUri(string)": { - "details": "Set the URI. Can only be called by owner (default admin)", - "params": { - "uri": "new attestations registry address" - } - }, - "supportsInterface(bytes4)": { - "details": "ERC165" - }, - "triggerTransferEvent(address,address,address,uint256,uint256)": { - "details": "Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)", - "params": { - "from": "address(0) if minting, address of the badge holder if burning", - "id": "badgeId for which to trigger the event", - "operator": "who is calling the TransferEvent", - "to": "address of the badge holder is minting, address(0) if burning", - "value": "minted/burned balance" - } - }, - "uri(uint256)": { - "details": "See {IERC1155MetadataURI-uri}. This implementation returns the same URI for *all* token types. It relies on the token type ID substitution mechanism https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. Clients calling this function must replace the `\\{id\\}` substring with the actual token type ID." - } - }, - "title": "Badges contract", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(string,address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations The associated attestations registry triggers TransferSingle events from this contract It allows badge \"shadow mints and burns\" to be caught by off-chain platforms For more information: https://badges.docs.sismo.io", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 24, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_roles", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 1231, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_balances", - "offset": 0, - "slot": "2", - "type": "t_mapping(t_uint256,t_mapping(t_address,t_uint256))" - }, - { - "astId": 1237, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_operatorApprovals", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_address,t_mapping(t_address,t_bool))" - }, - { - "astId": 1239, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_uri", - "offset": 0, - "slot": "4", - "type": "t_string_storage" - }, - { - "astId": 11990, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_attestationsRegistry", - "offset": 0, - "slot": "5", - "type": "t_contract(IAttestationsRegistry)12822" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(IAttestationsRegistry)12822": { - "encoding": "inplace", - "label": "contract IAttestationsRegistry", - "numberOfBytes": "20" - }, - "t_mapping(t_address,t_bool)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_address,t_mapping(t_address,t_bool))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(address => bool))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_bool)" - }, - "t_mapping(t_address,t_uint256)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => struct AccessControl.RoleData)", - "numberOfBytes": "32", - "value": "t_struct(RoleData)19_storage" - }, - "t_mapping(t_uint256,t_mapping(t_address,t_uint256))": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => mapping(address => uint256))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_uint256)" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(RoleData)19_storage": { - "encoding": "inplace", - "label": "struct AccessControl.RoleData", - "members": [ - { - "astId": 16, - "contract": "contracts/core/Badges.sol:Badges", - "label": "members", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_address,t_bool)" - }, - { - "astId": 18, - "contract": "contracts/core/Badges.sol:Badges", - "label": "adminRole", - "offset": 0, - "slot": "1", - "type": "t_bytes32" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/BadgesImplem.json b/deployments/goerli/BadgesImplem.json deleted file mode 100644 index 9d499f6..0000000 --- a/deployments/goerli/BadgesImplem.json +++ /dev/null @@ -1,1114 +0,0 @@ -{ - "address": "0xd1FB2b5E3E1695283a882131CcEdD181c638Fa86", - "abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "BadgesNonTransferrable", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - } - ], - "name": "TransferBatch", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "TransferSingle", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "value", - "type": "string" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "URI", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "EVENT_TRIGGERER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "accounts", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - } - ], - "name": "balanceOfBatch", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationsRegistry", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "getAttributeValueForBadge", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "getAttributesNamesAndValuesForBadge", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - }, - { - "internalType": "uint8[]", - "name": "", - "type": "uint8[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "getBadgeExtraData", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "getBadgeIssuer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "getBadgeTimestamp", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeBatchTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistry", - "type": "address" - } - ], - "name": "setAttestationsRegistry", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "setUri", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "triggerTransferEvent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "uri", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x11dc97a8b2cf850794f3b362302f2dd567485a0246bf3906a9ce60cd84b7fffe", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0xd1FB2b5E3E1695283a882131CcEdD181c638Fa86", - "transactionIndex": 53, - "gasUsed": "2131254", - "logsBloom": "0x00000004000200000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000800002000000000000000000000000000000000000000000000000400000000000000000000200080040000000000000000000000000000000000000000800400000000000000000000001000000000000000000000000000000000000000040000000000000000400100000000000020000000000000000000000000000000000000000000000000000000008000000000", - "blockHash": "0x14b2694344df2fd261cb701ed8e1f3aa6f1c490aef6fcf1996821f9cc6994827", - "transactionHash": "0x11dc97a8b2cf850794f3b362302f2dd567485a0246bf3906a9ce60cd84b7fffe", - "logs": [ - { - "transactionIndex": 53, - "blockNumber": 8080254, - "transactionHash": "0x11dc97a8b2cf850794f3b362302f2dd567485a0246bf3906a9ce60cd84b7fffe", - "address": "0xd1FB2b5E3E1695283a882131CcEdD181c638Fa86", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "data": "0x", - "logIndex": 186, - "blockHash": "0x14b2694344df2fd261cb701ed8e1f3aa6f1c490aef6fcf1996821f9cc6994827" - }, - { - "transactionIndex": 53, - "blockNumber": 8080254, - "transactionHash": "0x11dc97a8b2cf850794f3b362302f2dd567485a0246bf3906a9ce60cd84b7fffe", - "address": "0xd1FB2b5E3E1695283a882131CcEdD181c638Fa86", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 187, - "blockHash": "0x14b2694344df2fd261cb701ed8e1f3aa6f1c490aef6fcf1996821f9cc6994827" - } - ], - "blockNumber": 8080254, - "cumulativeGasUsed": "15883057", - "status": 1, - "byzantium": true - }, - "args": [ - "https://hub.staging.zikies.io/badges/goerli/{id}.json", - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954" - ], - "numDeployments": 3, - "solcInputHash": "24c70469fd559e01f6ff2a10472da9a6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BadgesNonTransferrable\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EVENT_TRIGGERER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationsRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"getAttributeValueForBadge\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getAttributesNamesAndValuesForBadge\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBadgeExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBadgeIssuer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBadgeTimestamp\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistry\",\"type\":\"address\"}],\"name\":\"setAttestationsRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"setUri\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"triggerTransferEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"balanceOf(address,uint256)\":{\"details\":\"Main function of the ERC1155 badge The balance of a user is equal to the value of the underlying attestation. attestationCollectionId == badgeId\",\"params\":{\"account\":\"Address to check badge balance (= value of attestation)\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"balanceOfBatch(address[],uint256[])\":{\"details\":\"See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length.\"},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"owner\":\"Owner of the contract, super admin, can setup roles and update the attestation registry\",\"uri\":\"Uri for the metadata of badges\"}},\"getAttestationsRegistry()\":{\"details\":\"Getter of the attestations registry\"},\"getAttributeValueForBadge(uint256,uint8)\":{\"details\":\"Getter of the value of a specific badge attribute\",\"params\":{\"id\":\"Badge Id to check (= attestationCollectionId)\",\"index\":\"Index of the attribute\"}},\"getAttributesNamesAndValuesForBadge(uint256)\":{\"details\":\"Getter of all badge attributes and their values for a specific badge\",\"params\":{\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getBadgeExtraData(address,uint256)\":{\"details\":\"Getter of the badge extra data (it can store nullifier and burnCount)\",\"params\":{\"account\":\"Address that holds the badge\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getBadgeIssuer(address,uint256)\":{\"details\":\"Getter of the badge issuer\",\"params\":{\"account\":\"Address that holds the badge\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getBadgeTimestamp(address,uint256)\":{\"details\":\"Getter of the badge timestamp\",\"params\":{\"account\":\"Address that holds the badge\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initialize(string,address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"owner\":\"Owner of the contract, super admin, can setup roles and update the attestation registry\",\"uri\":\"Uri for the metadata of badges\"}},\"isApprovedForAll(address,address)\":{\"details\":\"Reverts, this is a non transferable ERC115 contract\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)\":{\"details\":\"See {IERC1155-safeBatchTransferFrom}.\"},\"safeTransferFrom(address,address,uint256,uint256,bytes)\":{\"details\":\"See {IERC1155-safeTransferFrom}.\"},\"setApprovalForAll(address,bool)\":{\"details\":\"Reverts, this is a non transferable ERC115 contract\"},\"setAttestationsRegistry(address)\":{\"details\":\"Set the attestations registry address. Can only be called by owner (default admin)\",\"params\":{\"attestationsRegistry\":\"new attestations registry address\"}},\"setUri(string)\":{\"details\":\"Set the URI. Can only be called by owner (default admin)\",\"params\":{\"uri\":\"new attestations registry address\"}},\"supportsInterface(bytes4)\":{\"details\":\"ERC165\"},\"triggerTransferEvent(address,address,address,uint256,uint256)\":{\"details\":\"Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\",\"params\":{\"from\":\"address(0) if minting, address of the badge holder if burning\",\"id\":\"badgeId for which to trigger the event\",\"operator\":\"who is calling the TransferEvent\",\"to\":\"address of the badge holder is minting, address(0) if burning\",\"value\":\"minted/burned balance\"}},\"uri(uint256)\":{\"details\":\"See {IERC1155MetadataURI-uri}. This implementation returns the same URI for *all* token types. It relies on the token type ID substitution mechanism https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. Clients calling this function must replace the `\\\\{id\\\\}` substring with the actual token type ID.\"}},\"title\":\"Badges contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(string,address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations The associated attestations registry triggers TransferSingle events from this contract It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms For more information: https://badges.docs.sismo.io\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/Badges.sol\":\"Badges\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\nimport \\\"../utils/Context.sol\\\";\\nimport \\\"../utils/Strings.sol\\\";\\nimport \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\\n * Overriding this function changes the behavior of the {onlyRole} modifier.\\n *\\n * Format of the revert message is described in {_checkRole}.\\n *\\n * _Available since v4.6._\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n Strings.toHexString(account),\\n \\\" is missing role \\\",\\n Strings.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * May emit a {RoleGranted} event.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n}\\n\",\"keccak256\":\"0x67e3daf189111d6d5b0464ed09cf9f0605a22c4b965a7fcecd707101faff008a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/security/Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract Pausable is Context {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0x0849d93b16c9940beb286a7864ed02724b248b93e0d80ef6355af5ef15c64773\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/ERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC1155.sol\\\";\\nimport \\\"./IERC1155Receiver.sol\\\";\\nimport \\\"./extensions/IERC1155MetadataURI.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\nimport \\\"../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the basic standard multi-token.\\n * See https://eips.ethereum.org/EIPS/eip-1155\\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\\n *\\n * _Available since v3.1._\\n */\\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\\n using Address for address;\\n\\n // Mapping from token ID to account balances\\n mapping(uint256 => mapping(address => uint256)) private _balances;\\n\\n // Mapping from account to operator approvals\\n mapping(address => mapping(address => bool)) private _operatorApprovals;\\n\\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\\n string private _uri;\\n\\n /**\\n * @dev See {_setURI}.\\n */\\n constructor(string memory uri_) {\\n _setURI(uri_);\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC1155).interfaceId ||\\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC1155MetadataURI-uri}.\\n *\\n * This implementation returns the same URI for *all* token types. It relies\\n * on the token type ID substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * Clients calling this function must replace the `\\\\{id\\\\}` substring with the\\n * actual token type ID.\\n */\\n function uri(uint256) public view virtual override returns (string memory) {\\n return _uri;\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\\n require(account != address(0), \\\"ERC1155: address zero is not a valid owner\\\");\\n return _balances[id][account];\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOfBatch}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\\n public\\n view\\n virtual\\n override\\n returns (uint256[] memory)\\n {\\n require(accounts.length == ids.length, \\\"ERC1155: accounts and ids length mismatch\\\");\\n\\n uint256[] memory batchBalances = new uint256[](accounts.length);\\n\\n for (uint256 i = 0; i < accounts.length; ++i) {\\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\\n }\\n\\n return batchBalances;\\n }\\n\\n /**\\n * @dev See {IERC1155-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC1155-isApprovedForAll}.\\n */\\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\\n return _operatorApprovals[account][operator];\\n }\\n\\n /**\\n * @dev See {IERC1155-safeTransferFrom}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner or approved\\\"\\n );\\n _safeTransferFrom(from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev See {IERC1155-safeBatchTransferFrom}.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner or approved\\\"\\n );\\n _safeBatchTransferFrom(from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n\\n emit TransferSingle(operator, from, to, id, amount);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; ++i) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n }\\n\\n emit TransferBatch(operator, from, to, ids, amounts);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Sets a new URI for all token types, by relying on the token type ID\\n * substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * By this mechanism, any occurrence of the `\\\\{id\\\\}` substring in either the\\n * URI or any of the amounts in the JSON file at said URI will be replaced by\\n * clients with the token type ID.\\n *\\n * For example, the `https://token-cdn-domain/\\\\{id\\\\}.json` URI would be\\n * interpreted by clients as\\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\\n * for token type ID 0x4cce0.\\n *\\n * See {uri}.\\n *\\n * Because these URIs cannot be meaningfully represented by the {URI} event,\\n * this function emits no events.\\n */\\n function _setURI(string memory newuri) internal virtual {\\n _uri = newuri;\\n }\\n\\n /**\\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _mint(\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _balances[id][to] += amount;\\n emit TransferSingle(operator, address(0), to, id, amount);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _mintBatch(\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n _balances[ids[i]][to] += amounts[i];\\n }\\n\\n emit TransferBatch(operator, address(0), to, ids, amounts);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens of token type `id` from `from`\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `from` must have at least `amount` tokens of token type `id`.\\n */\\n function _burn(\\n address from,\\n uint256 id,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n\\n emit TransferSingle(operator, from, address(0), id, amount);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n */\\n function _burnBatch(\\n address from,\\n uint256[] memory ids,\\n uint256[] memory amounts\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n }\\n\\n emit TransferBatch(operator, from, address(0), ids, amounts);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(\\n address owner,\\n address operator,\\n bool approved\\n ) internal virtual {\\n require(owner != operator, \\\"ERC1155: setting approval status for self\\\");\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Hook that is called before any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `ids` and `amounts` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `id` and `amount` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n function _doSafeTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\\n if (response != IERC1155Receiver.onERC1155Received.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non-ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _doSafeBatchTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\\n bytes4 response\\n ) {\\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non-ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\\n uint256[] memory array = new uint256[](1);\\n array[0] = element;\\n\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0xd917747dc87f189c6779b894f367a028f9dca4be930283cccec8f312966af820\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155 is IERC165 {\\n /**\\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\\n */\\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\\n\\n /**\\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\\n * transfers.\\n */\\n event TransferBatch(\\n address indexed operator,\\n address indexed from,\\n address indexed to,\\n uint256[] ids,\\n uint256[] values\\n );\\n\\n /**\\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\\n * `approved`.\\n */\\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\\n\\n /**\\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\\n *\\n * If an {URI} event was emitted for `id`, the standard\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\\n * returned by {IERC1155MetadataURI-uri}.\\n */\\n event URI(string value, uint256 indexed id);\\n\\n /**\\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\\n external\\n view\\n returns (uint256[] memory);\\n\\n /**\\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\\n *\\n * Emits an {ApprovalForAll} event.\\n *\\n * Requirements:\\n *\\n * - `operator` cannot be the caller.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\\n *\\n * See {setApprovalForAll}.\\n */\\n function isApprovedForAll(address account, address operator) external view returns (bool);\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] calldata ids,\\n uint256[] calldata amounts,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x6392f2cfe3a5ee802227fe7a2dfd47096d881aec89bddd214b35c5b46d3cd941\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev _Available since v3.1._\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xeb373f1fdc7b755c6a750123a9b9e3a8a02c1470042fd6505d875000a80bde0b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1155.sol\\\";\\nimport \\\"../../../security/Pausable.sol\\\";\\n\\n/**\\n * @dev ERC1155 token with pausable token transfers, minting and burning.\\n *\\n * Useful for scenarios such as preventing trades until the end of an evaluation\\n * period, or having an emergency switch for freezing all token transfers in the\\n * event of a large bug.\\n *\\n * _Available since v3.1._\\n */\\nabstract contract ERC1155Pausable is ERC1155, Pausable {\\n /**\\n * @dev See {ERC1155-_beforeTokenTransfer}.\\n *\\n * Requirements:\\n *\\n * - the contract must not be paused.\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override {\\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n require(!paused(), \\\"ERC1155Pausable: token transfer while paused\\\");\\n }\\n}\\n\",\"keccak256\":\"0xdad22b949de979bb2ad9001c044b2aeaacf8a25e3de09ed6f022a9469f936d5b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC1155.sol\\\";\\n\\n/**\\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155MetadataURI is IERC1155 {\\n /**\\n * @dev Returns the URI for token type `id`.\\n *\\n * If the `\\\\{id\\\\}` substring is present in the URI, it must be replaced by\\n * clients with the actual token type ID.\\n */\\n function uri(uint256 id) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xa66d18b9a85458d28fc3304717964502ae36f7f8a2ff35bc83f6f85d74b03574\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"},\"contracts/core/Badges.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {IBadges} from './interfaces/IBadges.sol';\\n\\n/**\\n * @title Badges contract\\n * @author Sismo\\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\\n * The associated attestations registry triggers TransferSingle events from this contract\\n * It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms\\n * For more information: https://badges.docs.sismo.io\\n */\\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\\n uint8 public constant IMPLEMENTATION_VERSION = 3;\\n\\n IAttestationsRegistry internal _attestationsRegistry;\\n\\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\\n\\n /**\\n * @dev Constructor\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n */\\n constructor(\\n string memory uri,\\n address owner // This is Sismo Frontend Contract\\n ) ERC1155(uri) {\\n initialize(uri, owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n string memory uri,\\n address owner\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup uri yet or if called by constructor (for implem setup)\\n if (bytes(ERC1155.uri(0)).length == 0 || address(this).code.length == 0) {\\n _setURI(uri);\\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\\n }\\n }\\n\\n /**\\n * @dev Main function of the ERC1155 badge\\n * The balance of a user is equal to the value of the underlying attestation.\\n * attestationCollectionId == badgeId\\n * @param account Address to check badge balance (= value of attestation)\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function balanceOf(\\n address account,\\n uint256 id\\n ) public view virtual override(ERC1155, IBadges) returns (uint256) {\\n return _attestationsRegistry.getAttestationValue(id, account);\\n }\\n\\n /**\\n * @dev Reverts, this is a non transferable ERC115 contract\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n revert BadgesNonTransferrable();\\n }\\n\\n /**\\n * @dev Reverts, this is a non transferable ERC115 contract\\n */\\n function isApprovedForAll(\\n address account,\\n address operator\\n ) public view virtual override returns (bool) {\\n revert BadgesNonTransferrable();\\n }\\n\\n /**\\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\\n * @param operator who is calling the TransferEvent\\n * @param from address(0) if minting, address of the badge holder if burning\\n * @param to address of the badge holder is minting, address(0) if burning\\n * @param id badgeId for which to trigger the event\\n * @param value minted/burned balance\\n */\\n function triggerTransferEvent(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 value\\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\\n emit TransferSingle(operator, from, to, id, value);\\n }\\n\\n /**\\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\\n * @param attestationsRegistry new attestations registry address\\n */\\n function setAttestationsRegistry(\\n address attestationsRegistry\\n ) external override onlyRole(DEFAULT_ADMIN_ROLE) {\\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\\n }\\n\\n /**\\n * @dev Set the URI. Can only be called by owner (default admin)\\n * @param uri new attestations registry address\\n */\\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\\n _setURI(uri);\\n }\\n\\n /**\\n * @dev Getter of the attestations registry\\n */\\n function getAttestationsRegistry() external view override returns (address) {\\n return address(_attestationsRegistry);\\n }\\n\\n /**\\n * @dev Getter of the badge issuer\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeIssuer(address account, uint256 id) external view returns (address) {\\n return _attestationsRegistry.getAttestationIssuer(id, account);\\n }\\n\\n /**\\n * @dev Getter of the badge timestamp\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32) {\\n return _attestationsRegistry.getAttestationTimestamp(id, account);\\n }\\n\\n /**\\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory) {\\n return _attestationsRegistry.getAttestationExtraData(id, account);\\n }\\n\\n /**\\n * @dev Getter of the value of a specific badge attribute\\n * @param id Badge Id to check (= attestationCollectionId)\\n * @param index Index of the attribute\\n */\\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8) {\\n return _attestationsRegistry.getAttributeValueForAttestationsCollection(id, index);\\n }\\n\\n /**\\n * @dev Getter of all badge attributes and their values for a specific badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getAttributesNamesAndValuesForBadge(\\n uint256 id\\n ) external view returns (bytes32[] memory, uint8[] memory) {\\n return _attestationsRegistry.getAttributesNamesAndValuesForAttestationsCollection(id);\\n }\\n\\n /**\\n * @dev ERC165\\n */\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view virtual override(AccessControl, ERC1155) returns (bool) {\\n return super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Reverts, this is a non transferable ERC115 contract\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override {\\n revert BadgesNonTransferrable();\\n }\\n}\\n\",\"keccak256\":\"0x9982b753d43f2a4a9edb5987714b09f518b419339d4bf9cd63b600bee442fd01\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IBadges.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Interface for Badges contract\\n * @author Sismo\\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\\n * The associated attestations registry triggers TransferSingle events from this contract\\n * It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms\\n */\\ninterface IBadges {\\n error BadgesNonTransferrable();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(string memory uri, address owner) external;\\n\\n /**\\n * @dev Main function of the ERC1155 badge\\n * The balance of a user is equal to the value of the underlying attestation.\\n * attestationCollectionId == badgeId\\n * @param account Address to check badge balance (= value of attestation)\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\\n * @param operator who is calling the TransferEvent\\n * @param from address(0) if minting, address of the badge holder if burning\\n * @param to address of the badge holder is minting, address(0) if burning\\n * @param id badgeId for which to trigger the event\\n * @param value minted/burned balance\\n */\\n function triggerTransferEvent(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 value\\n ) external;\\n\\n /**\\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\\n * @param attestationsRegistry new attestations registry address\\n */\\n function setAttestationsRegistry(address attestationsRegistry) external;\\n\\n /**\\n * @dev Set the URI. Can only be called by owner (default admin)\\n * @param uri new attestations registry address\\n */\\n function setUri(string memory uri) external;\\n\\n /**\\n * @dev Getter of the attestations registry\\n */\\n function getAttestationsRegistry() external view returns (address);\\n\\n /**\\n * @dev Getter of the badge issuer\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeIssuer(address account, uint256 id) external view returns (address);\\n\\n /**\\n * @dev Getter of the badge timestamp\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the value of a specific badge attribute\\n * @param id Badge Id to check (= attestationCollectionId)\\n * @param index Index of the attribute\\n */\\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);\\n\\n /**\\n * @dev Getter of all badge attributes and their values for a specific badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getAttributesNamesAndValuesForBadge(\\n uint256 id\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n}\\n\",\"keccak256\":\"0xd6bdfc887ef15ee022eb05d89dbe2e2938ee6c0a55a55f8db527ef650242c6bb\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b50604051620027eb380380620027eb833981016040819052620000349162000395565b81620000408162000055565b506200004d82826200006e565b5050620004c2565b80516200006a906004906020840190620002bc565b5050565b600054600390610100900460ff1615801562000091575060005460ff8083169116105b620000f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff83161761010017815562000127906200051d62000198602090811b91909117901c565b511580620001345750303b155b156200015257620001458362000055565b6200015260008362000234565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b606060048054620001a99062000486565b80601f0160208091040260200160405190810160405280929190818152602001828054620001d79062000486565b8015620002285780601f10620001fc5761010080835404028352916020019162000228565b820191906000526020600020905b8154815290600101906020018083116200020a57829003601f168201915b50505050509050919050565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff166200006a5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b828054620002ca9062000486565b90600052602060002090601f016020900481019282620002ee576000855562000339565b82601f106200030957805160ff191683800117855562000339565b8280016001018555821562000339579182015b82811115620003395782518255916020019190600101906200031c565b50620003479291506200034b565b5090565b5b808211156200034757600081556001016200034c565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200039057600080fd5b919050565b60008060408385031215620003a957600080fd5b82516001600160401b0380821115620003c157600080fd5b818501915085601f830112620003d657600080fd5b815181811115620003eb57620003eb62000362565b604051601f8201601f19908116603f0116810190838211818310171562000416576200041662000362565b816040528281526020935088848487010111156200043357600080fd5b600091505b8282101562000457578482018401518183018501529083019062000438565b82821115620004695760008484830101525b95506200047b91505085820162000378565b925050509250929050565b600181811c908216806200049b57607f821691505b602082108103620004bc57634e487b7160e01b600052602260045260246000fd5b50919050565b61231980620004d26000396000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c8063754b377c116100de578063aed8c6bc11610097578063e37ffe7c11610071578063e37ffe7c146103aa578063e985e9c5146103cb578063f242432a146103de578063ff4468c4146103f157600080fd5b8063aed8c6bc14610371578063b3c1cb2114610384578063d547741f1461039757600080fd5b8063754b377c146103035780637ab4339d1461031d57806391d14854146103305780639b642de114610343578063a217fddf14610356578063a22cb4651461035e57600080fd5b80632f2ff15d1161014b57806344112ed81161012557806344112ed8146102985780634e1273f4146102bf578063710b3096146102df578063730cb7d5146102f257600080fd5b80632f2ff15d1461025f57806336568abe146102725780633e1f3c271461028557600080fd5b8062fdd58e1461019257806301ffc9a7146101b85780630e064366146101db5780630e89341c14610206578063248a9ca3146102265780632eb2c2d61461024a575b600080fd5b6101a56101a0366004611618565b610419565b6040519081526020015b60405180910390f35b6101cb6101c636600461165a565b610496565b60405190151581526020016101af565b6101ee6101e9366004611618565b6104a7565b6040516001600160a01b0390911681526020016101af565b610219610214366004611677565b61051d565b6040516101af91906116ec565b6101a5610234366004611677565b6000908152600160208190526040909120015490565b61025d610258366004611858565b6105b1565b005b61025d61026d366004611905565b610606565b61025d610280366004611905565b610631565b610219610293366004611618565b6106af565b6101a57fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa481565b6102d26102cd366004611935565b610729565b6040516101af9190611a3c565b61025d6102ed366004611a4f565b610852565b6005546001600160a01b03166101ee565b61030b600381565b60405160ff90911681526020016101af565b61025d61032b366004611aaa565b6108e4565b6101cb61033e366004611905565b6109f1565b61025d610351366004611af0565b610a1c565b6101a5600081565b61025d61036c366004611b2c565b610a30565b61030b61037f366004611b6e565b610a49565b61025d610392366004611b93565b610ac0565b61025d6103a5366004611905565b610aee565b6103bd6103b8366004611677565b610b14565b6040516101af929190611bb0565b6101cb6103d9366004611c2e565b610b93565b61025d6103ec366004611c5c565b610bae565b6104046103ff366004611618565b610bf3565b60405163ffffffff90911681526020016101af565b60055460405163461e4f1960e11b8152600481018390526001600160a01b0384811660248301526000921690638c3c9e3290604401602060405180830381865afa15801561046b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cc4565b9392505050565b60006104a182610c69565b92915050565b6005546040516363ed4d5360e11b8152600481018390526001600160a01b038481166024830152600092169063c7da9aa690604401602060405180830381865afa1580156104f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cdd565b60606004805461052c90611cfa565b80601f016020809104026020016040519081016040528092919081815260200182805461055890611cfa565b80156105a55780601f1061057a576101008083540402835291602001916105a5565b820191906000526020600020905b81548152906001019060200180831161058857829003601f168201915b50505050509050919050565b6001600160a01b0385163314806105cd57506105cd8533610b93565b6105f25760405162461bcd60e51b81526004016105e990611d34565b60405180910390fd5b6105ff8585858585610ca9565b5050505050565b6000828152600160208190526040909120015461062281610e97565b61062c8383610ea4565b505050565b6001600160a01b03811633146106a15760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105e9565b6106ab8282610f0f565b5050565b600554604051636d7fbb6760e01b8152600481018390526001600160a01b0384811660248301526060921690636d7fbb6790604401600060405180830381865afa158015610701573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261048f9190810190611d82565b6060815183511461078e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016105e9565b600083516001600160401b038111156107a9576107a96116ff565b6040519080825280602002602001820160405280156107d2578160200160208202803683370190505b50905060005b845181101561084a5761081d8582815181106107f6576107f6611e03565b602002602001015185838151811061081057610810611e03565b6020026020010151610419565b82828151811061082f5761082f611e03565b602090810291909101015261084381611e2f565b90506107d8565b509392505050565b7fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa461087c81610e97565b836001600160a01b0316856001600160a01b0316876001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6286866040516108d4929190918252602082015260400190565b60405180910390a4505050505050565b600054600390610100900460ff16158015610906575060005460ff8083169116105b6109695760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e9565b6000805461ffff191660ff8316176101001781556109869061051d565b5115806109925750303b155b156109ab576109a083610f76565b6109ab600083610ea4565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610a2781610e97565b6106ab82610f76565b6040516309a711b960e31b815260040160405180910390fd5b600554604051630e972f9160e41b81526004810184905260ff831660248201526000916001600160a01b03169063e972f91090604401602060405180830381865afa158015610a9c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611e48565b6000610acb81610e97565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526001602081905260409091200154610b0a81610e97565b61062c8383610f0f565b600554604051632b2bf81b60e11b81526004810183905260609182916001600160a01b0390911690635657f03690602401600060405180830381865afa158015610b62573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b8a9190810190611ed4565b91509150915091565b60006040516309a711b960e31b815260040160405180910390fd5b6001600160a01b038516331480610bca5750610bca8533610b93565b610be65760405162461bcd60e51b81526004016105e990611d34565b6105ff8585858585610f89565b6005546040516314067f8b60e01b8152600481018390526001600160a01b03848116602483015260009216906314067f8b90604401602060405180830381865afa158015610c45573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611f90565b60006001600160e01b03198216636cdb3d1360e11b1480610c9a57506001600160e01b031982166303a24d0760e21b145b806104a157506104a1826110c5565b8151835114610d0b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016105e9565b6001600160a01b038416610d315760405162461bcd60e51b81526004016105e990611fb6565b33610d40818787878787610a30565b60005b8451811015610e29576000858281518110610d6057610d60611e03565b602002602001015190506000858381518110610d7e57610d7e611e03565b60209081029190910181015160008481526002835260408082206001600160a01b038e168352909352919091205490915081811015610dcf5760405162461bcd60e51b81526004016105e990611ffb565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610e0e908490612045565b9250508190555050505080610e2290611e2f565b9050610d43565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610e7992919061205d565b60405180910390a4610e8f8187878787876110fa565b505050505050565b610ea1813361125e565b50565b610eae82826109f1565b6106ab5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b610f1982826109f1565b156106ab5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b80516106ab90600490602084019061156a565b6001600160a01b038416610faf5760405162461bcd60e51b81526004016105e990611fb6565b336000610fbb856112b7565b90506000610fc8856112b7565b9050610fd8838989858589610a30565b60008681526002602090815260408083206001600160a01b038c1684529091529020548581101561101b5760405162461bcd60e51b81526004016105e990611ffb565b60008781526002602090815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061105a908490612045565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46110ba848a8a8a8a8a611302565b505050505050505050565b60006001600160e01b03198216637965db0b60e01b14806104a157506301ffc9a760e01b6001600160e01b03198316146104a1565b6001600160a01b0384163b15610e8f5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061113e908990899088908890889060040161208b565b6020604051808303816000875af1925050508015611179575060408051601f3d908101601f19168201909252611176918101906120e9565b60015b61122557611185612106565b806308c379a0036111be5750611199612122565b806111a457506111c0565b8060405162461bcd60e51b81526004016105e991906116ec565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016105e9565b6001600160e01b0319811663bc197c8160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b50505050505050565b61126882826109f1565b6106ab57611275816113bd565b6112808360206113cf565b6040516020016112919291906121f3565b60408051601f198184030181529082905262461bcd60e51b82526105e9916004016116ec565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106112f1576112f1611e03565b602090810291909101015292915050565b6001600160a01b0384163b15610e8f5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906113469089908990889088908890600401612268565b6020604051808303816000875af1925050508015611381575060408051601f3d908101601f1916820190925261137e918101906120e9565b60015b61138d57611185612106565b6001600160e01b0319811663f23a6e6160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b60606104a16001600160a01b03831660145b606060006113de8360026122ad565b6113e9906002612045565b6001600160401b03811115611400576114006116ff565b6040519080825280601f01601f19166020018201604052801561142a576020820181803683370190505b509050600360fc1b8160008151811061144557611445611e03565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061147457611474611e03565b60200101906001600160f81b031916908160001a90535060006114988460026122ad565b6114a3906001612045565b90505b600181111561151b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106114d7576114d7611e03565b1a60f81b8282815181106114ed576114ed611e03565b60200101906001600160f81b031916908160001a90535060049490941c93611514816122cc565b90506114a6565b50831561048f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105e9565b82805461157690611cfa565b90600052602060002090601f01602090048101928261159857600085556115de565b82601f106115b157805160ff19168380011785556115de565b828001600101855582156115de579182015b828111156115de5782518255916020019190600101906115c3565b506115ea9291506115ee565b5090565b5b808211156115ea57600081556001016115ef565b6001600160a01b0381168114610ea157600080fd5b6000806040838503121561162b57600080fd5b823561163681611603565b946020939093013593505050565b6001600160e01b031981168114610ea157600080fd5b60006020828403121561166c57600080fd5b813561048f81611644565b60006020828403121561168957600080fd5b5035919050565b60005b838110156116ab578181015183820152602001611693565b838111156116ba576000848401525b50505050565b600081518084526116d8816020860160208601611690565b601f01601f19169290920160200192915050565b60208152600061048f60208301846116c0565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561173a5761173a6116ff565b6040525050565b60006001600160401b0382111561175a5761175a6116ff565b5060051b60200190565b600082601f83011261177557600080fd5b8135602061178282611741565b60405161178f8282611715565b83815260059390931b85018201928281019150868411156117af57600080fd5b8286015b848110156117ca57803583529183019183016117b3565b509695505050505050565b60006001600160401b038211156117ee576117ee6116ff565b50601f01601f191660200190565b600082601f83011261180d57600080fd5b8135611818816117d5565b6040516118258282611715565b82815285602084870101111561183a57600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a0868803121561187057600080fd5b853561187b81611603565b9450602086013561188b81611603565b935060408601356001600160401b03808211156118a757600080fd5b6118b389838a01611764565b945060608801359150808211156118c957600080fd5b6118d589838a01611764565b935060808801359150808211156118eb57600080fd5b506118f8888289016117fc565b9150509295509295909350565b6000806040838503121561191857600080fd5b82359150602083013561192a81611603565b809150509250929050565b6000806040838503121561194857600080fd5b82356001600160401b038082111561195f57600080fd5b818501915085601f83011261197357600080fd5b8135602061198082611741565b60405161198d8282611715565b83815260059390931b85018201928281019150898411156119ad57600080fd5b948201945b838610156119d45785356119c581611603565b825294820194908201906119b2565b965050860135925050808211156119ea57600080fd5b506119f785828601611764565b9150509250929050565b600081518084526020808501945080840160005b83811015611a3157815187529582019590820190600101611a15565b509495945050505050565b60208152600061048f6020830184611a01565b600080600080600060a08688031215611a6757600080fd5b8535611a7281611603565b94506020860135611a8281611603565b93506040860135611a9281611603565b94979396509394606081013594506080013592915050565b60008060408385031215611abd57600080fd5b82356001600160401b03811115611ad357600080fd5b611adf858286016117fc565b925050602083013561192a81611603565b600060208284031215611b0257600080fd5b81356001600160401b03811115611b1857600080fd5b611b24848285016117fc565b949350505050565b60008060408385031215611b3f57600080fd5b8235611b4a81611603565b91506020830135801515811461192a57600080fd5b60ff81168114610ea157600080fd5b60008060408385031215611b8157600080fd5b82359150602083013561192a81611b5f565b600060208284031215611ba557600080fd5b813561048f81611603565b604080825283519082018190526000906020906060840190828701845b82811015611be957815184529284019290840190600101611bcd565b5050508381038285015284518082528583019183019060005b81811015611c2157835160ff1683529284019291840191600101611c02565b5090979650505050505050565b60008060408385031215611c4157600080fd5b8235611c4c81611603565b9150602083013561192a81611603565b600080600080600060a08688031215611c7457600080fd5b8535611c7f81611603565b94506020860135611c8f81611603565b9350604086013592506060860135915060808601356001600160401b03811115611cb857600080fd5b6118f8888289016117fc565b600060208284031215611cd657600080fd5b5051919050565b600060208284031215611cef57600080fd5b815161048f81611603565b600181811c90821680611d0e57607f821691505b602082108103611d2e57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b600060208284031215611d9457600080fd5b81516001600160401b03811115611daa57600080fd5b8201601f81018413611dbb57600080fd5b8051611dc6816117d5565b604051611dd38282611715565b828152866020848601011115611de857600080fd5b611df9836020830160208701611690565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e4157611e41611e19565b5060010190565b600060208284031215611e5a57600080fd5b815161048f81611b5f565b600082601f830112611e7657600080fd5b81516020611e8382611741565b604051611e908282611715565b83815260059390931b8501820192828101915086841115611eb057600080fd5b8286015b848110156117ca578051611ec781611b5f565b8352918301918301611eb4565b60008060408385031215611ee757600080fd5b82516001600160401b0380821115611efe57600080fd5b818501915085601f830112611f1257600080fd5b81516020611f1f82611741565b604051611f2c8282611715565b83815260059390931b8501820192828101915089841115611f4c57600080fd5b948201945b83861015611f6a57855182529482019490820190611f51565b91880151919650909350505080821115611f8357600080fd5b506119f785828601611e65565b600060208284031215611fa257600080fd5b815163ffffffff8116811461048f57600080fd5b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6000821982111561205857612058611e19565b500190565b6040815260006120706040830185611a01565b82810360208401526120828185611a01565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906120b790830186611a01565b82810360608401526120c98186611a01565b905082810360808401526120dd81856116c0565b98975050505050505050565b6000602082840312156120fb57600080fd5b815161048f81611644565b600060033d111561211f5760046000803e5060005160e01c5b90565b600060443d10156121305790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561215f57505050505090565b82850191508151818111156121775750505050505090565b843d87010160208285010111156121915750505050505090565b6121a060208286010187611715565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161222b816017850160208801611690565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161225c816028840160208801611690565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906122a2908301846116c0565b979650505050505050565b60008160001904831182151516156122c7576122c7611e19565b500290565b6000816122db576122db611e19565b50600019019056fea26469706673582212209e33646a1ed2d51fcc749870e94aa69546c518fc5bfee43d37014ebc54dd767864736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061018d5760003560e01c8063754b377c116100de578063aed8c6bc11610097578063e37ffe7c11610071578063e37ffe7c146103aa578063e985e9c5146103cb578063f242432a146103de578063ff4468c4146103f157600080fd5b8063aed8c6bc14610371578063b3c1cb2114610384578063d547741f1461039757600080fd5b8063754b377c146103035780637ab4339d1461031d57806391d14854146103305780639b642de114610343578063a217fddf14610356578063a22cb4651461035e57600080fd5b80632f2ff15d1161014b57806344112ed81161012557806344112ed8146102985780634e1273f4146102bf578063710b3096146102df578063730cb7d5146102f257600080fd5b80632f2ff15d1461025f57806336568abe146102725780633e1f3c271461028557600080fd5b8062fdd58e1461019257806301ffc9a7146101b85780630e064366146101db5780630e89341c14610206578063248a9ca3146102265780632eb2c2d61461024a575b600080fd5b6101a56101a0366004611618565b610419565b6040519081526020015b60405180910390f35b6101cb6101c636600461165a565b610496565b60405190151581526020016101af565b6101ee6101e9366004611618565b6104a7565b6040516001600160a01b0390911681526020016101af565b610219610214366004611677565b61051d565b6040516101af91906116ec565b6101a5610234366004611677565b6000908152600160208190526040909120015490565b61025d610258366004611858565b6105b1565b005b61025d61026d366004611905565b610606565b61025d610280366004611905565b610631565b610219610293366004611618565b6106af565b6101a57fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa481565b6102d26102cd366004611935565b610729565b6040516101af9190611a3c565b61025d6102ed366004611a4f565b610852565b6005546001600160a01b03166101ee565b61030b600381565b60405160ff90911681526020016101af565b61025d61032b366004611aaa565b6108e4565b6101cb61033e366004611905565b6109f1565b61025d610351366004611af0565b610a1c565b6101a5600081565b61025d61036c366004611b2c565b610a30565b61030b61037f366004611b6e565b610a49565b61025d610392366004611b93565b610ac0565b61025d6103a5366004611905565b610aee565b6103bd6103b8366004611677565b610b14565b6040516101af929190611bb0565b6101cb6103d9366004611c2e565b610b93565b61025d6103ec366004611c5c565b610bae565b6104046103ff366004611618565b610bf3565b60405163ffffffff90911681526020016101af565b60055460405163461e4f1960e11b8152600481018390526001600160a01b0384811660248301526000921690638c3c9e3290604401602060405180830381865afa15801561046b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cc4565b9392505050565b60006104a182610c69565b92915050565b6005546040516363ed4d5360e11b8152600481018390526001600160a01b038481166024830152600092169063c7da9aa690604401602060405180830381865afa1580156104f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cdd565b60606004805461052c90611cfa565b80601f016020809104026020016040519081016040528092919081815260200182805461055890611cfa565b80156105a55780601f1061057a576101008083540402835291602001916105a5565b820191906000526020600020905b81548152906001019060200180831161058857829003601f168201915b50505050509050919050565b6001600160a01b0385163314806105cd57506105cd8533610b93565b6105f25760405162461bcd60e51b81526004016105e990611d34565b60405180910390fd5b6105ff8585858585610ca9565b5050505050565b6000828152600160208190526040909120015461062281610e97565b61062c8383610ea4565b505050565b6001600160a01b03811633146106a15760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105e9565b6106ab8282610f0f565b5050565b600554604051636d7fbb6760e01b8152600481018390526001600160a01b0384811660248301526060921690636d7fbb6790604401600060405180830381865afa158015610701573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261048f9190810190611d82565b6060815183511461078e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016105e9565b600083516001600160401b038111156107a9576107a96116ff565b6040519080825280602002602001820160405280156107d2578160200160208202803683370190505b50905060005b845181101561084a5761081d8582815181106107f6576107f6611e03565b602002602001015185838151811061081057610810611e03565b6020026020010151610419565b82828151811061082f5761082f611e03565b602090810291909101015261084381611e2f565b90506107d8565b509392505050565b7fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa461087c81610e97565b836001600160a01b0316856001600160a01b0316876001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6286866040516108d4929190918252602082015260400190565b60405180910390a4505050505050565b600054600390610100900460ff16158015610906575060005460ff8083169116105b6109695760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e9565b6000805461ffff191660ff8316176101001781556109869061051d565b5115806109925750303b155b156109ab576109a083610f76565b6109ab600083610ea4565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610a2781610e97565b6106ab82610f76565b6040516309a711b960e31b815260040160405180910390fd5b600554604051630e972f9160e41b81526004810184905260ff831660248201526000916001600160a01b03169063e972f91090604401602060405180830381865afa158015610a9c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611e48565b6000610acb81610e97565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526001602081905260409091200154610b0a81610e97565b61062c8383610f0f565b600554604051632b2bf81b60e11b81526004810183905260609182916001600160a01b0390911690635657f03690602401600060405180830381865afa158015610b62573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b8a9190810190611ed4565b91509150915091565b60006040516309a711b960e31b815260040160405180910390fd5b6001600160a01b038516331480610bca5750610bca8533610b93565b610be65760405162461bcd60e51b81526004016105e990611d34565b6105ff8585858585610f89565b6005546040516314067f8b60e01b8152600481018390526001600160a01b03848116602483015260009216906314067f8b90604401602060405180830381865afa158015610c45573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611f90565b60006001600160e01b03198216636cdb3d1360e11b1480610c9a57506001600160e01b031982166303a24d0760e21b145b806104a157506104a1826110c5565b8151835114610d0b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016105e9565b6001600160a01b038416610d315760405162461bcd60e51b81526004016105e990611fb6565b33610d40818787878787610a30565b60005b8451811015610e29576000858281518110610d6057610d60611e03565b602002602001015190506000858381518110610d7e57610d7e611e03565b60209081029190910181015160008481526002835260408082206001600160a01b038e168352909352919091205490915081811015610dcf5760405162461bcd60e51b81526004016105e990611ffb565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610e0e908490612045565b9250508190555050505080610e2290611e2f565b9050610d43565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610e7992919061205d565b60405180910390a4610e8f8187878787876110fa565b505050505050565b610ea1813361125e565b50565b610eae82826109f1565b6106ab5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b610f1982826109f1565b156106ab5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b80516106ab90600490602084019061156a565b6001600160a01b038416610faf5760405162461bcd60e51b81526004016105e990611fb6565b336000610fbb856112b7565b90506000610fc8856112b7565b9050610fd8838989858589610a30565b60008681526002602090815260408083206001600160a01b038c1684529091529020548581101561101b5760405162461bcd60e51b81526004016105e990611ffb565b60008781526002602090815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061105a908490612045565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46110ba848a8a8a8a8a611302565b505050505050505050565b60006001600160e01b03198216637965db0b60e01b14806104a157506301ffc9a760e01b6001600160e01b03198316146104a1565b6001600160a01b0384163b15610e8f5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061113e908990899088908890889060040161208b565b6020604051808303816000875af1925050508015611179575060408051601f3d908101601f19168201909252611176918101906120e9565b60015b61122557611185612106565b806308c379a0036111be5750611199612122565b806111a457506111c0565b8060405162461bcd60e51b81526004016105e991906116ec565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016105e9565b6001600160e01b0319811663bc197c8160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b50505050505050565b61126882826109f1565b6106ab57611275816113bd565b6112808360206113cf565b6040516020016112919291906121f3565b60408051601f198184030181529082905262461bcd60e51b82526105e9916004016116ec565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106112f1576112f1611e03565b602090810291909101015292915050565b6001600160a01b0384163b15610e8f5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906113469089908990889088908890600401612268565b6020604051808303816000875af1925050508015611381575060408051601f3d908101601f1916820190925261137e918101906120e9565b60015b61138d57611185612106565b6001600160e01b0319811663f23a6e6160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b60606104a16001600160a01b03831660145b606060006113de8360026122ad565b6113e9906002612045565b6001600160401b03811115611400576114006116ff565b6040519080825280601f01601f19166020018201604052801561142a576020820181803683370190505b509050600360fc1b8160008151811061144557611445611e03565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061147457611474611e03565b60200101906001600160f81b031916908160001a90535060006114988460026122ad565b6114a3906001612045565b90505b600181111561151b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106114d7576114d7611e03565b1a60f81b8282815181106114ed576114ed611e03565b60200101906001600160f81b031916908160001a90535060049490941c93611514816122cc565b90506114a6565b50831561048f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105e9565b82805461157690611cfa565b90600052602060002090601f01602090048101928261159857600085556115de565b82601f106115b157805160ff19168380011785556115de565b828001600101855582156115de579182015b828111156115de5782518255916020019190600101906115c3565b506115ea9291506115ee565b5090565b5b808211156115ea57600081556001016115ef565b6001600160a01b0381168114610ea157600080fd5b6000806040838503121561162b57600080fd5b823561163681611603565b946020939093013593505050565b6001600160e01b031981168114610ea157600080fd5b60006020828403121561166c57600080fd5b813561048f81611644565b60006020828403121561168957600080fd5b5035919050565b60005b838110156116ab578181015183820152602001611693565b838111156116ba576000848401525b50505050565b600081518084526116d8816020860160208601611690565b601f01601f19169290920160200192915050565b60208152600061048f60208301846116c0565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561173a5761173a6116ff565b6040525050565b60006001600160401b0382111561175a5761175a6116ff565b5060051b60200190565b600082601f83011261177557600080fd5b8135602061178282611741565b60405161178f8282611715565b83815260059390931b85018201928281019150868411156117af57600080fd5b8286015b848110156117ca57803583529183019183016117b3565b509695505050505050565b60006001600160401b038211156117ee576117ee6116ff565b50601f01601f191660200190565b600082601f83011261180d57600080fd5b8135611818816117d5565b6040516118258282611715565b82815285602084870101111561183a57600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a0868803121561187057600080fd5b853561187b81611603565b9450602086013561188b81611603565b935060408601356001600160401b03808211156118a757600080fd5b6118b389838a01611764565b945060608801359150808211156118c957600080fd5b6118d589838a01611764565b935060808801359150808211156118eb57600080fd5b506118f8888289016117fc565b9150509295509295909350565b6000806040838503121561191857600080fd5b82359150602083013561192a81611603565b809150509250929050565b6000806040838503121561194857600080fd5b82356001600160401b038082111561195f57600080fd5b818501915085601f83011261197357600080fd5b8135602061198082611741565b60405161198d8282611715565b83815260059390931b85018201928281019150898411156119ad57600080fd5b948201945b838610156119d45785356119c581611603565b825294820194908201906119b2565b965050860135925050808211156119ea57600080fd5b506119f785828601611764565b9150509250929050565b600081518084526020808501945080840160005b83811015611a3157815187529582019590820190600101611a15565b509495945050505050565b60208152600061048f6020830184611a01565b600080600080600060a08688031215611a6757600080fd5b8535611a7281611603565b94506020860135611a8281611603565b93506040860135611a9281611603565b94979396509394606081013594506080013592915050565b60008060408385031215611abd57600080fd5b82356001600160401b03811115611ad357600080fd5b611adf858286016117fc565b925050602083013561192a81611603565b600060208284031215611b0257600080fd5b81356001600160401b03811115611b1857600080fd5b611b24848285016117fc565b949350505050565b60008060408385031215611b3f57600080fd5b8235611b4a81611603565b91506020830135801515811461192a57600080fd5b60ff81168114610ea157600080fd5b60008060408385031215611b8157600080fd5b82359150602083013561192a81611b5f565b600060208284031215611ba557600080fd5b813561048f81611603565b604080825283519082018190526000906020906060840190828701845b82811015611be957815184529284019290840190600101611bcd565b5050508381038285015284518082528583019183019060005b81811015611c2157835160ff1683529284019291840191600101611c02565b5090979650505050505050565b60008060408385031215611c4157600080fd5b8235611c4c81611603565b9150602083013561192a81611603565b600080600080600060a08688031215611c7457600080fd5b8535611c7f81611603565b94506020860135611c8f81611603565b9350604086013592506060860135915060808601356001600160401b03811115611cb857600080fd5b6118f8888289016117fc565b600060208284031215611cd657600080fd5b5051919050565b600060208284031215611cef57600080fd5b815161048f81611603565b600181811c90821680611d0e57607f821691505b602082108103611d2e57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b600060208284031215611d9457600080fd5b81516001600160401b03811115611daa57600080fd5b8201601f81018413611dbb57600080fd5b8051611dc6816117d5565b604051611dd38282611715565b828152866020848601011115611de857600080fd5b611df9836020830160208701611690565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e4157611e41611e19565b5060010190565b600060208284031215611e5a57600080fd5b815161048f81611b5f565b600082601f830112611e7657600080fd5b81516020611e8382611741565b604051611e908282611715565b83815260059390931b8501820192828101915086841115611eb057600080fd5b8286015b848110156117ca578051611ec781611b5f565b8352918301918301611eb4565b60008060408385031215611ee757600080fd5b82516001600160401b0380821115611efe57600080fd5b818501915085601f830112611f1257600080fd5b81516020611f1f82611741565b604051611f2c8282611715565b83815260059390931b8501820192828101915089841115611f4c57600080fd5b948201945b83861015611f6a57855182529482019490820190611f51565b91880151919650909350505080821115611f8357600080fd5b506119f785828601611e65565b600060208284031215611fa257600080fd5b815163ffffffff8116811461048f57600080fd5b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6000821982111561205857612058611e19565b500190565b6040815260006120706040830185611a01565b82810360208401526120828185611a01565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906120b790830186611a01565b82810360608401526120c98186611a01565b905082810360808401526120dd81856116c0565b98975050505050505050565b6000602082840312156120fb57600080fd5b815161048f81611644565b600060033d111561211f5760046000803e5060005160e01c5b90565b600060443d10156121305790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561215f57505050505090565b82850191508151818111156121775750505050505090565b843d87010160208285010111156121915750505050505090565b6121a060208286010187611715565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161222b816017850160208801611690565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161225c816028840160208801611690565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906122a2908301846116c0565b979650505050505050565b60008160001904831182151516156122c7576122c7611e19565b500290565b6000816122db576122db611e19565b50600019019056fea26469706673582212209e33646a1ed2d51fcc749870e94aa69546c518fc5bfee43d37014ebc54dd767864736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "balanceOf(address,uint256)": { - "details": "Main function of the ERC1155 badge The balance of a user is equal to the value of the underlying attestation. attestationCollectionId == badgeId", - "params": { - "account": "Address to check badge balance (= value of attestation)", - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "balanceOfBatch(address[],uint256[])": { - "details": "See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length." - }, - "constructor": { - "details": "Constructor", - "params": { - "owner": "Owner of the contract, super admin, can setup roles and update the attestation registry", - "uri": "Uri for the metadata of badges" - } - }, - "getAttestationsRegistry()": { - "details": "Getter of the attestations registry" - }, - "getAttributeValueForBadge(uint256,uint8)": { - "details": "Getter of the value of a specific badge attribute", - "params": { - "id": "Badge Id to check (= attestationCollectionId)", - "index": "Index of the attribute" - } - }, - "getAttributesNamesAndValuesForBadge(uint256)": { - "details": "Getter of all badge attributes and their values for a specific badge", - "params": { - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "getBadgeExtraData(address,uint256)": { - "details": "Getter of the badge extra data (it can store nullifier and burnCount)", - "params": { - "account": "Address that holds the badge", - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "getBadgeIssuer(address,uint256)": { - "details": "Getter of the badge issuer", - "params": { - "account": "Address that holds the badge", - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "getBadgeTimestamp(address,uint256)": { - "details": "Getter of the badge timestamp", - "params": { - "account": "Address that holds the badge", - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "getRoleAdmin(bytes32)": { - "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." - }, - "grantRole(bytes32,address)": { - "details": "Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event." - }, - "hasRole(bytes32,address)": { - "details": "Returns `true` if `account` has been granted `role`." - }, - "initialize(string,address)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "owner": "Owner of the contract, super admin, can setup roles and update the attestation registry", - "uri": "Uri for the metadata of badges" - } - }, - "isApprovedForAll(address,address)": { - "details": "Reverts, this is a non transferable ERC115 contract" - }, - "renounceRole(bytes32,address)": { - "details": "Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event." - }, - "revokeRole(bytes32,address)": { - "details": "Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event." - }, - "safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)": { - "details": "See {IERC1155-safeBatchTransferFrom}." - }, - "safeTransferFrom(address,address,uint256,uint256,bytes)": { - "details": "See {IERC1155-safeTransferFrom}." - }, - "setApprovalForAll(address,bool)": { - "details": "Reverts, this is a non transferable ERC115 contract" - }, - "setAttestationsRegistry(address)": { - "details": "Set the attestations registry address. Can only be called by owner (default admin)", - "params": { - "attestationsRegistry": "new attestations registry address" - } - }, - "setUri(string)": { - "details": "Set the URI. Can only be called by owner (default admin)", - "params": { - "uri": "new attestations registry address" - } - }, - "supportsInterface(bytes4)": { - "details": "ERC165" - }, - "triggerTransferEvent(address,address,address,uint256,uint256)": { - "details": "Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)", - "params": { - "from": "address(0) if minting, address of the badge holder if burning", - "id": "badgeId for which to trigger the event", - "operator": "who is calling the TransferEvent", - "to": "address of the badge holder is minting, address(0) if burning", - "value": "minted/burned balance" - } - }, - "uri(uint256)": { - "details": "See {IERC1155MetadataURI-uri}. This implementation returns the same URI for *all* token types. It relies on the token type ID substitution mechanism https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. Clients calling this function must replace the `\\{id\\}` substring with the actual token type ID." - } - }, - "title": "Badges contract", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(string,address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations The associated attestations registry triggers TransferSingle events from this contract It allows badge \"shadow mints and burns\" to be caught by off-chain platforms For more information: https://badges.docs.sismo.io", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 24, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_roles", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 1231, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_balances", - "offset": 0, - "slot": "2", - "type": "t_mapping(t_uint256,t_mapping(t_address,t_uint256))" - }, - { - "astId": 1237, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_operatorApprovals", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_address,t_mapping(t_address,t_bool))" - }, - { - "astId": 1239, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_uri", - "offset": 0, - "slot": "4", - "type": "t_string_storage" - }, - { - "astId": 11990, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_attestationsRegistry", - "offset": 0, - "slot": "5", - "type": "t_contract(IAttestationsRegistry)12822" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(IAttestationsRegistry)12822": { - "encoding": "inplace", - "label": "contract IAttestationsRegistry", - "numberOfBytes": "20" - }, - "t_mapping(t_address,t_bool)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_address,t_mapping(t_address,t_bool))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(address => bool))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_bool)" - }, - "t_mapping(t_address,t_uint256)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => struct AccessControl.RoleData)", - "numberOfBytes": "32", - "value": "t_struct(RoleData)19_storage" - }, - "t_mapping(t_uint256,t_mapping(t_address,t_uint256))": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => mapping(address => uint256))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_uint256)" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(RoleData)19_storage": { - "encoding": "inplace", - "label": "struct AccessControl.RoleData", - "members": [ - { - "astId": 16, - "contract": "contracts/core/Badges.sol:Badges", - "label": "members", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_address,t_bool)" - }, - { - "astId": 18, - "contract": "contracts/core/Badges.sol:Badges", - "label": "adminRole", - "offset": 0, - "slot": "1", - "type": "t_bytes32" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/BadgesProxy.json b/deployments/goerli/BadgesProxy.json deleted file mode 100644 index a676b9f..0000000 --- a/deployments/goerli/BadgesProxy.json +++ /dev/null @@ -1,250 +0,0 @@ -{ - "address": "0xE06B14D5835925e1642d7216F4563a1273509F10", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0xc433408c7334929bc36b4d3b0abcf92efc5102a0e9ed32baaf94b5829f0c3b2f", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0xE06B14D5835925e1642d7216F4563a1273509F10", - "transactionIndex": 9, - "gasUsed": "701715", - "logsBloom": "0x00000004000200000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000020800000000000000000000000000020000000000000000000800000000800000000000000000000000000000000000000000000000000004000000000000000000000000000000800000000010000000000000000000000000000000000000000000001000000000100000000020000000000000000000000000000000000400400100000000000020000000000000000000000400000000000000000000000000000000008000000000", - "blockHash": "0xf1a0a518c8cb72af413076c75f44b1957e421a23585b2ffc3d55ae69027d9e10", - "transactionHash": "0xc433408c7334929bc36b4d3b0abcf92efc5102a0e9ed32baaf94b5829f0c3b2f", - "logs": [ - { - "transactionIndex": 9, - "blockNumber": 7711003, - "transactionHash": "0xc433408c7334929bc36b4d3b0abcf92efc5102a0e9ed32baaf94b5829f0c3b2f", - "address": "0xE06B14D5835925e1642d7216F4563a1273509F10", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000a8cca3a388098fe090b9e7986d0cf8712008e26f" - ], - "data": "0x", - "logIndex": 35, - "blockHash": "0xf1a0a518c8cb72af413076c75f44b1957e421a23585b2ffc3d55ae69027d9e10" - }, - { - "transactionIndex": 9, - "blockNumber": 7711003, - "transactionHash": "0xc433408c7334929bc36b4d3b0abcf92efc5102a0e9ed32baaf94b5829f0c3b2f", - "address": "0xE06B14D5835925e1642d7216F4563a1273509F10", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "data": "0x", - "logIndex": 36, - "blockHash": "0xf1a0a518c8cb72af413076c75f44b1957e421a23585b2ffc3d55ae69027d9e10" - }, - { - "transactionIndex": 9, - "blockNumber": 7711003, - "transactionHash": "0xc433408c7334929bc36b4d3b0abcf92efc5102a0e9ed32baaf94b5829f0c3b2f", - "address": "0xE06B14D5835925e1642d7216F4563a1273509F10", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000246e71bc2a257f4be9c7fad4664e6d7444844adc", - "logIndex": 37, - "blockHash": "0xf1a0a518c8cb72af413076c75f44b1957e421a23585b2ffc3d55ae69027d9e10" - } - ], - "blockNumber": 7711003, - "cumulativeGasUsed": "2240650", - "status": 1, - "byzantium": true - }, - "args": [ - "0xA8cca3a388098fE090b9e7986D0Cf8712008E26F", - "0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc", - "0x7ab4339d0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e000000000000000000000000000000000000000000000000000000000000003568747470733a2f2f6875622e73746167696e672e7a696b6965732e696f2f6261646765732f676f65726c692f7b69647d2e6a736f6e0000000000000000000000" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/goerli/CommitmentMapperRegistry.json b/deployments/goerli/CommitmentMapperRegistry.json deleted file mode 100644 index c9528ce..0000000 --- a/deployments/goerli/CommitmentMapperRegistry.json +++ /dev/null @@ -1,443 +0,0 @@ -{ - "address": "0x0844662f25817B735BC9B6d9D11995F1A6c4dCB1", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256[2]", - "name": "commitmentMapperEdDSAPubKey", - "type": "uint256[2]" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "pubKey", - "type": "uint256[2]" - } - ], - "name": "PubKeyNotValid", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newAddress", - "type": "address" - } - ], - "name": "UpdatedCommitmentMapperAddress", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256[2]", - "name": "newEdDSAPubKey", - "type": "uint256[2]" - } - ], - "name": "UpdatedCommitmentMapperEdDSAPubKey", - "type": "event" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getEdDSAPubKey", - "outputs": [ - { - "internalType": "uint256[2]", - "name": "", - "type": "uint256[2]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - }, - { - "internalType": "uint256[2]", - "name": "commitmentMapperEdDSAPubKey", - "type": "uint256[2]" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAddress", - "type": "address" - } - ], - "name": "updateCommitmentMapperAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "newEdDSAPubKey", - "type": "uint256[2]" - } - ], - "name": "updateCommitmentMapperEdDSAPubKey", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x2cc0a9eff1b76929d9a69edd728de110ec10d642c40a5fd643efaacc572281d2", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x995Df56e1E7CE6DA35AEA2bC69498829e82C4002", - "transactionIndex": 37, - "gasUsed": "520392", - "logsBloom": "0x00000000000200000000000000020000000000000000000000800000000000000000000000000000000080000000000000000000000000000000000004000000000000000000008000000000000400000001000000000000000000000000000000000000020000000000000000000800002000020000000004000000000000400000000000000000000000000000000000000000000080000000000000000000000000000000000000000000800400000000000000000000000000000000000000000004000000000000000000040000000000000000400000000000001020000000100000000000000000000000000000000000000000000000008000000000", - "blockHash": "0xe32ec60b954c466d4208a992af28c48d1c3e991ac6d4193e25be2f07c54fb7d0", - "transactionHash": "0x2cc0a9eff1b76929d9a69edd728de110ec10d642c40a5fd643efaacc572281d2", - "logs": [ - { - "transactionIndex": 37, - "blockNumber": 8080327, - "transactionHash": "0x2cc0a9eff1b76929d9a69edd728de110ec10d642c40a5fd643efaacc572281d2", - "address": "0x995Df56e1E7CE6DA35AEA2bC69498829e82C4002", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "data": "0x", - "logIndex": 90, - "blockHash": "0xe32ec60b954c466d4208a992af28c48d1c3e991ac6d4193e25be2f07c54fb7d0" - }, - { - "transactionIndex": 37, - "blockNumber": 8080327, - "transactionHash": "0x2cc0a9eff1b76929d9a69edd728de110ec10d642c40a5fd643efaacc572281d2", - "address": "0x995Df56e1E7CE6DA35AEA2bC69498829e82C4002", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954" - ], - "data": "0x", - "logIndex": 91, - "blockHash": "0xe32ec60b954c466d4208a992af28c48d1c3e991ac6d4193e25be2f07c54fb7d0" - }, - { - "transactionIndex": 37, - "blockNumber": 8080327, - "transactionHash": "0x2cc0a9eff1b76929d9a69edd728de110ec10d642c40a5fd643efaacc572281d2", - "address": "0x995Df56e1E7CE6DA35AEA2bC69498829e82C4002", - "topics": [ - "0x9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab15" - ], - "data": "0x1e468ad0fcde4edec429cd41eb28a0e78d4f31fa2c25172ef677468b2b38a9dc2b6e9a8e3b8ed419cca51e2e2ee7ae07d2902454deca17d7da7b00ae4a798add", - "logIndex": 92, - "blockHash": "0xe32ec60b954c466d4208a992af28c48d1c3e991ac6d4193e25be2f07c54fb7d0" - }, - { - "transactionIndex": 37, - "blockNumber": 8080327, - "transactionHash": "0x2cc0a9eff1b76929d9a69edd728de110ec10d642c40a5fd643efaacc572281d2", - "address": "0x995Df56e1E7CE6DA35AEA2bC69498829e82C4002", - "topics": [ - "0xa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f4" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "logIndex": 93, - "blockHash": "0xe32ec60b954c466d4208a992af28c48d1c3e991ac6d4193e25be2f07c54fb7d0" - }, - { - "transactionIndex": 37, - "blockNumber": 8080327, - "transactionHash": "0x2cc0a9eff1b76929d9a69edd728de110ec10d642c40a5fd643efaacc572281d2", - "address": "0x995Df56e1E7CE6DA35AEA2bC69498829e82C4002", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000002", - "logIndex": 94, - "blockHash": "0xe32ec60b954c466d4208a992af28c48d1c3e991ac6d4193e25be2f07c54fb7d0" - } - ], - "blockNumber": 8080327, - "cumulativeGasUsed": "11974448", - "status": 1, - "byzantium": true - }, - "args": [ - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954", - [ - "0x1e468ad0fcde4edec429cd41eb28a0e78d4f31fa2c25172ef677468b2b38a9dc", - "0x2b6e9a8e3b8ed419cca51e2e2ee7ae07d2902454deca17d7da7b00ae4a798add" - ], - "0x0000000000000000000000000000000000000000" - ], - "numDeployments": 4, - "solcInputHash": "24c70469fd559e01f6ff2a10472da9a6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentMapperEdDSAPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"pubKey\",\"type\":\"uint256[2]\"}],\"name\":\"PubKeyNotValid\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"UpdatedCommitmentMapperAddress\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256[2]\",\"name\":\"newEdDSAPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"UpdatedCommitmentMapperEdDSAPubKey\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEdDSAPubKey\",\"outputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"\",\"type\":\"uint256[2]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentMapperEdDSAPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"updateCommitmentMapperAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"newEdDSAPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"updateCommitmentMapperEdDSAPubKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"commitmentMapperAddress\":\"Address of the commitment mapper\",\"commitmentMapperEdDSAPubKey\":\"EdDSA public key of the commitment mapper\",\"owner\":\"Owner of the contract, can update public key and address\"}},\"getAddress()\":{\"details\":\"Getter of the address of the commitment mapper\"},\"getEdDSAPubKey()\":{\"details\":\"Getter of the EdDSA public key of the commitment mapper\"},\"initialize(address,uint256[2],address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"commitmentMapperAddress\":\"Address of the commitment mapper\",\"commitmentMapperEdDSAPubKey\":\"EdDSA public key of the commitment mapper\",\"ownerAddress\":\"Owner of the contract, can update public key and address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"updateCommitmentMapperAddress(address)\":{\"details\":\"Updates the address\",\"params\":{\"newAddress\":\"new address\"}},\"updateCommitmentMapperEdDSAPubKey(uint256[2])\":{\"details\":\"Updates the EdDSA public key\",\"params\":{\"newEdDSAPubKey\":\"new EdDSA pubic key\"}}},\"title\":\"Commitment Mapper Registry Contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address,uint256[2],address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"This contract stores information about the commitment mapper. Its ethereum address and its EdDSA public key For more information: https://commitment-mapper.docs.sismo.io*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":\"CommitmentMapperRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address ownerAddress,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0x1b6ab7a4ba266f3da2c7f6ba3de93e3ab89f389dbd6db14514b43cbdcbe9fe09\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0xcb419cf389baad6f38de28625718f64f551d2669339c1b4e1887e11d62484469\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b5060405162000abe38038062000abe833981016040819052620000349162000313565b6200003f3362000055565b6200004c838383620000b0565b505050620003ef565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600290610100900460ff16158015620000d3575060005460ff8083169116105b6200013b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff831617610100178155620001686000546201000090046001600160a01b031690565b6001600160a01b031614806200017d5750303b155b15620001a4576200018e8462000055565b6200019983620001eb565b620001a48262000237565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b620001fa600182600262000286565b507f9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab15816040516200022c9190620003bc565b60405180910390a150565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f4906020016200022c565b8260028101928215620002b7579160200282015b82811115620002b75782518255916020019190600101906200029a565b50620002c5929150620002c9565b5090565b5b80821115620002c55760008155600101620002ca565b80516001600160a01b0381168114620002f857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b6000806000608084860312156200032957600080fd5b6200033484620002e0565b9250602085603f8601126200034857600080fd5b604080519081016001600160401b03811182821017156200036d576200036d620002fd565b6040528060608701888111156200038357600080fd5b8388015b81811015620003a0578051835291840191840162000387565b50829550620003af81620002e0565b9450505050509250925092565b60408101818360005b6002811015620003e6578151835260209283019290910190600101620003c5565b50505092915050565b6106bf80620003ff6000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063727b2d5c11610066578063727b2d5c146100f4578063754b377c1461010757806378cf75d7146101215780638da5cb5b14610134578063f2fde38b1461014b57600080fd5b806338cc48311461009857806359a80d0d146100c25780637098a5f4146100d7578063715018a6146100ec575b600080fd5b6003546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100ca61015e565b6040516100b9919061053c565b6100ea6100e53660046105eb565b610198565b005b6100ea6101ac565b6100ea61010236600461062a565b6101c0565b61010f600281565b60405160ff90911681526020016100b9565b6100ea61012f366004610645565b6101d1565b6000546201000090046001600160a01b03166100a5565b6100ea61015936600461062a565b610303565b6101666104cb565b60408051808201918290529060019060029082845b81548152602001906001019080831161017b575050505050905090565b6101a0610379565b6101a9816103da565b50565b6101b4610379565b6101be6000610422565b565b6101c8610379565b6101a98161047d565b600054600290610100900460ff161580156101f3575060005460ff8083169116105b61025b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556102886000546001600160a01b03620100009091041690565b6001600160a01b0316148061029c5750303b155b156102bc576102aa84610422565b6102b3836103da565b6102bc8261047d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b61030b610379565b6001600160a01b0381166103705760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610252565b6101a981610422565b6000546001600160a01b03620100009091041633146101be5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610252565b6103e760018260026104e9565b507f9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab1581604051610417919061053c565b60405180910390a150565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f490602001610417565b60405180604001604052806002906020820280368337509192915050565b8260028101928215610517579160200282015b828111156105175782518255916020019190600101906104fc565b50610523929150610527565b5090565b5b808211156105235760008155600101610528565b60408101818360005b6002811015610564578151835260209283019290910190600101610545565b50505092915050565b600082601f83011261057e57600080fd5b6040516040810181811067ffffffffffffffff821117156105af57634e487b7160e01b600052604160045260246000fd5b80604052508060408401858111156105c657600080fd5b845b818110156105e05780358352602092830192016105c8565b509195945050505050565b6000604082840312156105fd57600080fd5b610607838361056d565b9392505050565b80356001600160a01b038116811461062557600080fd5b919050565b60006020828403121561063c57600080fd5b6106078261060e565b60008060006080848603121561065a57600080fd5b6106638461060e565b9250610672856020860161056d565b91506106806060850161060e565b9050925092509256fea2646970667358221220d4b69e1f79868deff972c669c62c01ccfa63a6b030214293debea10ed567f04f64736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063727b2d5c11610066578063727b2d5c146100f4578063754b377c1461010757806378cf75d7146101215780638da5cb5b14610134578063f2fde38b1461014b57600080fd5b806338cc48311461009857806359a80d0d146100c25780637098a5f4146100d7578063715018a6146100ec575b600080fd5b6003546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100ca61015e565b6040516100b9919061053c565b6100ea6100e53660046105eb565b610198565b005b6100ea6101ac565b6100ea61010236600461062a565b6101c0565b61010f600281565b60405160ff90911681526020016100b9565b6100ea61012f366004610645565b6101d1565b6000546201000090046001600160a01b03166100a5565b6100ea61015936600461062a565b610303565b6101666104cb565b60408051808201918290529060019060029082845b81548152602001906001019080831161017b575050505050905090565b6101a0610379565b6101a9816103da565b50565b6101b4610379565b6101be6000610422565b565b6101c8610379565b6101a98161047d565b600054600290610100900460ff161580156101f3575060005460ff8083169116105b61025b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556102886000546001600160a01b03620100009091041690565b6001600160a01b0316148061029c5750303b155b156102bc576102aa84610422565b6102b3836103da565b6102bc8261047d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b61030b610379565b6001600160a01b0381166103705760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610252565b6101a981610422565b6000546001600160a01b03620100009091041633146101be5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610252565b6103e760018260026104e9565b507f9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab1581604051610417919061053c565b60405180910390a150565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f490602001610417565b60405180604001604052806002906020820280368337509192915050565b8260028101928215610517579160200282015b828111156105175782518255916020019190600101906104fc565b50610523929150610527565b5090565b5b808211156105235760008155600101610528565b60408101818360005b6002811015610564578151835260209283019290910190600101610545565b50505092915050565b600082601f83011261057e57600080fd5b6040516040810181811067ffffffffffffffff821117156105af57634e487b7160e01b600052604160045260246000fd5b80604052508060408401858111156105c657600080fd5b845b818110156105e05780358352602092830192016105c8565b509195945050505050565b6000604082840312156105fd57600080fd5b610607838361056d565b9392505050565b80356001600160a01b038116811461062557600080fd5b919050565b60006020828403121561063c57600080fd5b6106078261060e565b60008060006080848603121561065a57600080fd5b6106638461060e565b9250610672856020860161056d565b91506106806060850161060e565b9050925092509256fea2646970667358221220d4b69e1f79868deff972c669c62c01ccfa63a6b030214293debea10ed567f04f64736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "constructor": { - "details": "Constructor", - "params": { - "commitmentMapperAddress": "Address of the commitment mapper", - "commitmentMapperEdDSAPubKey": "EdDSA public key of the commitment mapper", - "owner": "Owner of the contract, can update public key and address" - } - }, - "getAddress()": { - "details": "Getter of the address of the commitment mapper" - }, - "getEdDSAPubKey()": { - "details": "Getter of the EdDSA public key of the commitment mapper" - }, - "initialize(address,uint256[2],address)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "commitmentMapperAddress": "Address of the commitment mapper", - "commitmentMapperEdDSAPubKey": "EdDSA public key of the commitment mapper", - "ownerAddress": "Owner of the contract, can update public key and address" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "updateCommitmentMapperAddress(address)": { - "details": "Updates the address", - "params": { - "newAddress": "new address" - } - }, - "updateCommitmentMapperEdDSAPubKey(uint256[2])": { - "details": "Updates the EdDSA public key", - "params": { - "newEdDSAPubKey": "new EdDSA pubic key" - } - } - }, - "title": "Commitment Mapper Registry Contract", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(address,uint256[2],address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "This contract stores information about the commitment mapper. Its ethereum address and its EdDSA public key For more information: https://commitment-mapper.docs.sismo.io*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 396, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_owner", - "offset": 2, - "slot": "0", - "type": "t_address" - }, - { - "astId": 15766, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_commitmentMapperPubKey", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)2_storage" - }, - { - "astId": 15768, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_commitmentMapperAddress", - "offset": 0, - "slot": "3", - "type": "t_address" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)2_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[2]", - "numberOfBytes": "64" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/CommitmentMapperRegistryImplem.json b/deployments/goerli/CommitmentMapperRegistryImplem.json deleted file mode 100644 index ba42596..0000000 --- a/deployments/goerli/CommitmentMapperRegistryImplem.json +++ /dev/null @@ -1,443 +0,0 @@ -{ - "address": "0x995Df56e1E7CE6DA35AEA2bC69498829e82C4002", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256[2]", - "name": "commitmentMapperEdDSAPubKey", - "type": "uint256[2]" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "pubKey", - "type": "uint256[2]" - } - ], - "name": "PubKeyNotValid", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newAddress", - "type": "address" - } - ], - "name": "UpdatedCommitmentMapperAddress", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256[2]", - "name": "newEdDSAPubKey", - "type": "uint256[2]" - } - ], - "name": "UpdatedCommitmentMapperEdDSAPubKey", - "type": "event" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getEdDSAPubKey", - "outputs": [ - { - "internalType": "uint256[2]", - "name": "", - "type": "uint256[2]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - }, - { - "internalType": "uint256[2]", - "name": "commitmentMapperEdDSAPubKey", - "type": "uint256[2]" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAddress", - "type": "address" - } - ], - "name": "updateCommitmentMapperAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "newEdDSAPubKey", - "type": "uint256[2]" - } - ], - "name": "updateCommitmentMapperEdDSAPubKey", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x2cc0a9eff1b76929d9a69edd728de110ec10d642c40a5fd643efaacc572281d2", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x995Df56e1E7CE6DA35AEA2bC69498829e82C4002", - "transactionIndex": 37, - "gasUsed": "520392", - "logsBloom": "0x00000000000200000000000000020000000000000000000000800000000000000000000000000000000080000000000000000000000000000000000004000000000000000000008000000000000400000001000000000000000000000000000000000000020000000000000000000800002000020000000004000000000000400000000000000000000000000000000000000000000080000000000000000000000000000000000000000000800400000000000000000000000000000000000000000004000000000000000000040000000000000000400000000000001020000000100000000000000000000000000000000000000000000000008000000000", - "blockHash": "0xe32ec60b954c466d4208a992af28c48d1c3e991ac6d4193e25be2f07c54fb7d0", - "transactionHash": "0x2cc0a9eff1b76929d9a69edd728de110ec10d642c40a5fd643efaacc572281d2", - "logs": [ - { - "transactionIndex": 37, - "blockNumber": 8080327, - "transactionHash": "0x2cc0a9eff1b76929d9a69edd728de110ec10d642c40a5fd643efaacc572281d2", - "address": "0x995Df56e1E7CE6DA35AEA2bC69498829e82C4002", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "data": "0x", - "logIndex": 90, - "blockHash": "0xe32ec60b954c466d4208a992af28c48d1c3e991ac6d4193e25be2f07c54fb7d0" - }, - { - "transactionIndex": 37, - "blockNumber": 8080327, - "transactionHash": "0x2cc0a9eff1b76929d9a69edd728de110ec10d642c40a5fd643efaacc572281d2", - "address": "0x995Df56e1E7CE6DA35AEA2bC69498829e82C4002", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954" - ], - "data": "0x", - "logIndex": 91, - "blockHash": "0xe32ec60b954c466d4208a992af28c48d1c3e991ac6d4193e25be2f07c54fb7d0" - }, - { - "transactionIndex": 37, - "blockNumber": 8080327, - "transactionHash": "0x2cc0a9eff1b76929d9a69edd728de110ec10d642c40a5fd643efaacc572281d2", - "address": "0x995Df56e1E7CE6DA35AEA2bC69498829e82C4002", - "topics": [ - "0x9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab15" - ], - "data": "0x1e468ad0fcde4edec429cd41eb28a0e78d4f31fa2c25172ef677468b2b38a9dc2b6e9a8e3b8ed419cca51e2e2ee7ae07d2902454deca17d7da7b00ae4a798add", - "logIndex": 92, - "blockHash": "0xe32ec60b954c466d4208a992af28c48d1c3e991ac6d4193e25be2f07c54fb7d0" - }, - { - "transactionIndex": 37, - "blockNumber": 8080327, - "transactionHash": "0x2cc0a9eff1b76929d9a69edd728de110ec10d642c40a5fd643efaacc572281d2", - "address": "0x995Df56e1E7CE6DA35AEA2bC69498829e82C4002", - "topics": [ - "0xa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f4" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "logIndex": 93, - "blockHash": "0xe32ec60b954c466d4208a992af28c48d1c3e991ac6d4193e25be2f07c54fb7d0" - }, - { - "transactionIndex": 37, - "blockNumber": 8080327, - "transactionHash": "0x2cc0a9eff1b76929d9a69edd728de110ec10d642c40a5fd643efaacc572281d2", - "address": "0x995Df56e1E7CE6DA35AEA2bC69498829e82C4002", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000002", - "logIndex": 94, - "blockHash": "0xe32ec60b954c466d4208a992af28c48d1c3e991ac6d4193e25be2f07c54fb7d0" - } - ], - "blockNumber": 8080327, - "cumulativeGasUsed": "11974448", - "status": 1, - "byzantium": true - }, - "args": [ - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954", - [ - "0x1e468ad0fcde4edec429cd41eb28a0e78d4f31fa2c25172ef677468b2b38a9dc", - "0x2b6e9a8e3b8ed419cca51e2e2ee7ae07d2902454deca17d7da7b00ae4a798add" - ], - "0x0000000000000000000000000000000000000000" - ], - "numDeployments": 2, - "solcInputHash": "24c70469fd559e01f6ff2a10472da9a6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentMapperEdDSAPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"pubKey\",\"type\":\"uint256[2]\"}],\"name\":\"PubKeyNotValid\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"UpdatedCommitmentMapperAddress\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256[2]\",\"name\":\"newEdDSAPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"UpdatedCommitmentMapperEdDSAPubKey\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEdDSAPubKey\",\"outputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"\",\"type\":\"uint256[2]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentMapperEdDSAPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"updateCommitmentMapperAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"newEdDSAPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"updateCommitmentMapperEdDSAPubKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"commitmentMapperAddress\":\"Address of the commitment mapper\",\"commitmentMapperEdDSAPubKey\":\"EdDSA public key of the commitment mapper\",\"owner\":\"Owner of the contract, can update public key and address\"}},\"getAddress()\":{\"details\":\"Getter of the address of the commitment mapper\"},\"getEdDSAPubKey()\":{\"details\":\"Getter of the EdDSA public key of the commitment mapper\"},\"initialize(address,uint256[2],address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"commitmentMapperAddress\":\"Address of the commitment mapper\",\"commitmentMapperEdDSAPubKey\":\"EdDSA public key of the commitment mapper\",\"ownerAddress\":\"Owner of the contract, can update public key and address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"updateCommitmentMapperAddress(address)\":{\"details\":\"Updates the address\",\"params\":{\"newAddress\":\"new address\"}},\"updateCommitmentMapperEdDSAPubKey(uint256[2])\":{\"details\":\"Updates the EdDSA public key\",\"params\":{\"newEdDSAPubKey\":\"new EdDSA pubic key\"}}},\"title\":\"Commitment Mapper Registry Contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address,uint256[2],address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"This contract stores information about the commitment mapper. Its ethereum address and its EdDSA public key For more information: https://commitment-mapper.docs.sismo.io*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":\"CommitmentMapperRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address ownerAddress,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0x1b6ab7a4ba266f3da2c7f6ba3de93e3ab89f389dbd6db14514b43cbdcbe9fe09\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0xcb419cf389baad6f38de28625718f64f551d2669339c1b4e1887e11d62484469\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b5060405162000abe38038062000abe833981016040819052620000349162000313565b6200003f3362000055565b6200004c838383620000b0565b505050620003ef565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600290610100900460ff16158015620000d3575060005460ff8083169116105b6200013b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff831617610100178155620001686000546201000090046001600160a01b031690565b6001600160a01b031614806200017d5750303b155b15620001a4576200018e8462000055565b6200019983620001eb565b620001a48262000237565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b620001fa600182600262000286565b507f9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab15816040516200022c9190620003bc565b60405180910390a150565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f4906020016200022c565b8260028101928215620002b7579160200282015b82811115620002b75782518255916020019190600101906200029a565b50620002c5929150620002c9565b5090565b5b80821115620002c55760008155600101620002ca565b80516001600160a01b0381168114620002f857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b6000806000608084860312156200032957600080fd5b6200033484620002e0565b9250602085603f8601126200034857600080fd5b604080519081016001600160401b03811182821017156200036d576200036d620002fd565b6040528060608701888111156200038357600080fd5b8388015b81811015620003a0578051835291840191840162000387565b50829550620003af81620002e0565b9450505050509250925092565b60408101818360005b6002811015620003e6578151835260209283019290910190600101620003c5565b50505092915050565b6106bf80620003ff6000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063727b2d5c11610066578063727b2d5c146100f4578063754b377c1461010757806378cf75d7146101215780638da5cb5b14610134578063f2fde38b1461014b57600080fd5b806338cc48311461009857806359a80d0d146100c25780637098a5f4146100d7578063715018a6146100ec575b600080fd5b6003546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100ca61015e565b6040516100b9919061053c565b6100ea6100e53660046105eb565b610198565b005b6100ea6101ac565b6100ea61010236600461062a565b6101c0565b61010f600281565b60405160ff90911681526020016100b9565b6100ea61012f366004610645565b6101d1565b6000546201000090046001600160a01b03166100a5565b6100ea61015936600461062a565b610303565b6101666104cb565b60408051808201918290529060019060029082845b81548152602001906001019080831161017b575050505050905090565b6101a0610379565b6101a9816103da565b50565b6101b4610379565b6101be6000610422565b565b6101c8610379565b6101a98161047d565b600054600290610100900460ff161580156101f3575060005460ff8083169116105b61025b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556102886000546001600160a01b03620100009091041690565b6001600160a01b0316148061029c5750303b155b156102bc576102aa84610422565b6102b3836103da565b6102bc8261047d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b61030b610379565b6001600160a01b0381166103705760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610252565b6101a981610422565b6000546001600160a01b03620100009091041633146101be5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610252565b6103e760018260026104e9565b507f9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab1581604051610417919061053c565b60405180910390a150565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f490602001610417565b60405180604001604052806002906020820280368337509192915050565b8260028101928215610517579160200282015b828111156105175782518255916020019190600101906104fc565b50610523929150610527565b5090565b5b808211156105235760008155600101610528565b60408101818360005b6002811015610564578151835260209283019290910190600101610545565b50505092915050565b600082601f83011261057e57600080fd5b6040516040810181811067ffffffffffffffff821117156105af57634e487b7160e01b600052604160045260246000fd5b80604052508060408401858111156105c657600080fd5b845b818110156105e05780358352602092830192016105c8565b509195945050505050565b6000604082840312156105fd57600080fd5b610607838361056d565b9392505050565b80356001600160a01b038116811461062557600080fd5b919050565b60006020828403121561063c57600080fd5b6106078261060e565b60008060006080848603121561065a57600080fd5b6106638461060e565b9250610672856020860161056d565b91506106806060850161060e565b9050925092509256fea2646970667358221220d4b69e1f79868deff972c669c62c01ccfa63a6b030214293debea10ed567f04f64736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063727b2d5c11610066578063727b2d5c146100f4578063754b377c1461010757806378cf75d7146101215780638da5cb5b14610134578063f2fde38b1461014b57600080fd5b806338cc48311461009857806359a80d0d146100c25780637098a5f4146100d7578063715018a6146100ec575b600080fd5b6003546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100ca61015e565b6040516100b9919061053c565b6100ea6100e53660046105eb565b610198565b005b6100ea6101ac565b6100ea61010236600461062a565b6101c0565b61010f600281565b60405160ff90911681526020016100b9565b6100ea61012f366004610645565b6101d1565b6000546201000090046001600160a01b03166100a5565b6100ea61015936600461062a565b610303565b6101666104cb565b60408051808201918290529060019060029082845b81548152602001906001019080831161017b575050505050905090565b6101a0610379565b6101a9816103da565b50565b6101b4610379565b6101be6000610422565b565b6101c8610379565b6101a98161047d565b600054600290610100900460ff161580156101f3575060005460ff8083169116105b61025b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556102886000546001600160a01b03620100009091041690565b6001600160a01b0316148061029c5750303b155b156102bc576102aa84610422565b6102b3836103da565b6102bc8261047d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b61030b610379565b6001600160a01b0381166103705760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610252565b6101a981610422565b6000546001600160a01b03620100009091041633146101be5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610252565b6103e760018260026104e9565b507f9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab1581604051610417919061053c565b60405180910390a150565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f490602001610417565b60405180604001604052806002906020820280368337509192915050565b8260028101928215610517579160200282015b828111156105175782518255916020019190600101906104fc565b50610523929150610527565b5090565b5b808211156105235760008155600101610528565b60408101818360005b6002811015610564578151835260209283019290910190600101610545565b50505092915050565b600082601f83011261057e57600080fd5b6040516040810181811067ffffffffffffffff821117156105af57634e487b7160e01b600052604160045260246000fd5b80604052508060408401858111156105c657600080fd5b845b818110156105e05780358352602092830192016105c8565b509195945050505050565b6000604082840312156105fd57600080fd5b610607838361056d565b9392505050565b80356001600160a01b038116811461062557600080fd5b919050565b60006020828403121561063c57600080fd5b6106078261060e565b60008060006080848603121561065a57600080fd5b6106638461060e565b9250610672856020860161056d565b91506106806060850161060e565b9050925092509256fea2646970667358221220d4b69e1f79868deff972c669c62c01ccfa63a6b030214293debea10ed567f04f64736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "constructor": { - "details": "Constructor", - "params": { - "commitmentMapperAddress": "Address of the commitment mapper", - "commitmentMapperEdDSAPubKey": "EdDSA public key of the commitment mapper", - "owner": "Owner of the contract, can update public key and address" - } - }, - "getAddress()": { - "details": "Getter of the address of the commitment mapper" - }, - "getEdDSAPubKey()": { - "details": "Getter of the EdDSA public key of the commitment mapper" - }, - "initialize(address,uint256[2],address)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "commitmentMapperAddress": "Address of the commitment mapper", - "commitmentMapperEdDSAPubKey": "EdDSA public key of the commitment mapper", - "ownerAddress": "Owner of the contract, can update public key and address" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "updateCommitmentMapperAddress(address)": { - "details": "Updates the address", - "params": { - "newAddress": "new address" - } - }, - "updateCommitmentMapperEdDSAPubKey(uint256[2])": { - "details": "Updates the EdDSA public key", - "params": { - "newEdDSAPubKey": "new EdDSA pubic key" - } - } - }, - "title": "Commitment Mapper Registry Contract", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(address,uint256[2],address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "This contract stores information about the commitment mapper. Its ethereum address and its EdDSA public key For more information: https://commitment-mapper.docs.sismo.io*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 396, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_owner", - "offset": 2, - "slot": "0", - "type": "t_address" - }, - { - "astId": 15766, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_commitmentMapperPubKey", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)2_storage" - }, - { - "astId": 15768, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_commitmentMapperAddress", - "offset": 0, - "slot": "3", - "type": "t_address" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)2_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[2]", - "numberOfBytes": "64" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/CommitmentMapperRegistryProxy.json b/deployments/goerli/CommitmentMapperRegistryProxy.json deleted file mode 100644 index 685afc2..0000000 --- a/deployments/goerli/CommitmentMapperRegistryProxy.json +++ /dev/null @@ -1,273 +0,0 @@ -{ - "address": "0x0844662f25817B735BC9B6d9D11995F1A6c4dCB1", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0xa277fb514325684a71397c4b0b2af28460b92bff7511985a80e35d9ffb33506e", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x0844662f25817B735BC9B6d9D11995F1A6c4dCB1", - "transactionIndex": 34, - "gasUsed": "661445", - "logsBloom": "0x00000000000200000000000000000000400000000000000000800000000000000000000000000000000000000000000000000000000000000000000004000000000000000000008000000000000402000001000000000000000000000000000000004000020000000000000000000800000000800000000004000000000000400000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000008000000000000040000000000024000000000000000000000000000000000400400000000010000020000000100000000004000000000000000000000000000000000001008000000000", - "blockHash": "0xb9404bd8eb1e315c14120b16b0314a0cdd2cc39cf88f965bc235837ea54ed7b2", - "transactionHash": "0xa277fb514325684a71397c4b0b2af28460b92bff7511985a80e35d9ffb33506e", - "logs": [ - { - "transactionIndex": 34, - "blockNumber": 7711041, - "transactionHash": "0xa277fb514325684a71397c4b0b2af28460b92bff7511985a80e35d9ffb33506e", - "address": "0x0844662f25817B735BC9B6d9D11995F1A6c4dCB1", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x0000000000000000000000004d0a84e1ce9e3be6a7ae2f927e3453b266b6c97a" - ], - "data": "0x", - "logIndex": 129, - "blockHash": "0xb9404bd8eb1e315c14120b16b0314a0cdd2cc39cf88f965bc235837ea54ed7b2" - }, - { - "transactionIndex": 34, - "blockNumber": 7711041, - "transactionHash": "0xa277fb514325684a71397c4b0b2af28460b92bff7511985a80e35d9ffb33506e", - "address": "0x0844662f25817B735BC9B6d9D11995F1A6c4dCB1", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "data": "0x", - "logIndex": 130, - "blockHash": "0xb9404bd8eb1e315c14120b16b0314a0cdd2cc39cf88f965bc235837ea54ed7b2" - }, - { - "transactionIndex": 34, - "blockNumber": 7711041, - "transactionHash": "0xa277fb514325684a71397c4b0b2af28460b92bff7511985a80e35d9ffb33506e", - "address": "0x0844662f25817B735BC9B6d9D11995F1A6c4dCB1", - "topics": [ - "0x9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab15" - ], - "data": "0x1e468ad0fcde4edec429cd41eb28a0e78d4f31fa2c25172ef677468b2b38a9dc2b6e9a8e3b8ed419cca51e2e2ee7ae07d2902454deca17d7da7b00ae4a798add", - "logIndex": 131, - "blockHash": "0xb9404bd8eb1e315c14120b16b0314a0cdd2cc39cf88f965bc235837ea54ed7b2" - }, - { - "transactionIndex": 34, - "blockNumber": 7711041, - "transactionHash": "0xa277fb514325684a71397c4b0b2af28460b92bff7511985a80e35d9ffb33506e", - "address": "0x0844662f25817B735BC9B6d9D11995F1A6c4dCB1", - "topics": [ - "0xa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f4" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "logIndex": 132, - "blockHash": "0xb9404bd8eb1e315c14120b16b0314a0cdd2cc39cf88f965bc235837ea54ed7b2" - }, - { - "transactionIndex": 34, - "blockNumber": 7711041, - "transactionHash": "0xa277fb514325684a71397c4b0b2af28460b92bff7511985a80e35d9ffb33506e", - "address": "0x0844662f25817B735BC9B6d9D11995F1A6c4dCB1", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000246e71bc2a257f4be9c7fad4664e6d7444844adc", - "logIndex": 133, - "blockHash": "0xb9404bd8eb1e315c14120b16b0314a0cdd2cc39cf88f965bc235837ea54ed7b2" - } - ], - "blockNumber": 7711041, - "cumulativeGasUsed": "8710225", - "status": 1, - "byzantium": true - }, - "args": [ - "0x4d0A84e1Ce9E3Be6A7ae2F927E3453B266b6C97A", - "0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc", - "0x78cf75d7000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e1e468ad0fcde4edec429cd41eb28a0e78d4f31fa2c25172ef677468b2b38a9dc2b6e9a8e3b8ed419cca51e2e2ee7ae07d2902454deca17d7da7b00ae4a798add0000000000000000000000000000000000000000000000000000000000000000" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/goerli/Front.json b/deployments/goerli/Front.json deleted file mode 100644 index 671c79d..0000000 --- a/deployments/goerli/Front.json +++ /dev/null @@ -1,519 +0,0 @@ -{ - "address": "0xAa00539FCD89E113833a9fCb940F378aE1299e30", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "DifferentRequestsDestinations", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "name": "EarlyUserAttestationGenerated", - "type": "event" - }, - { - "inputs": [], - "name": "ATTESTATIONS_REGISTRY", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "EARLY_USER_BADGE_END_DATE", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "EARLY_USER_COLLECTION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "attesters", - "type": "address[]" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request[]", - "name": "requests", - "type": "tuple[]" - }, - { - "internalType": "bytes[]", - "name": "proofDataArray", - "type": "bytes[]" - } - ], - "name": "batchBuildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[][]", - "name": "", - "type": "tuple[][]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "attesters", - "type": "address[]" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request[]", - "name": "requests", - "type": "tuple[]" - }, - { - "internalType": "bytes[]", - "name": "proofDataArray", - "type": "bytes[]" - } - ], - "name": "batchGenerateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[][]", - "name": "", - "type": "tuple[][]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xba427cb5b20e9bc7c8a83b75ac9f9702c4725794e1d119a24b08611e4cf51ac5", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0xF53C678A27271dC11080cC3bb6FAb6291F3995d3", - "transactionIndex": 59, - "gasUsed": "954922", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x70ffd9219bfaff3c65becac6441bf166fb0806267815bf49ccc9fb9173388fb8", - "transactionHash": "0xba427cb5b20e9bc7c8a83b75ac9f9702c4725794e1d119a24b08611e4cf51ac5", - "logs": [], - "blockNumber": 7711014, - "cumulativeGasUsed": "28545741", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf85BA0afA375495eE625910Db61b6b1406756234" - ], - "numDeployments": 3, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"DifferentRequestsDestinations\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"EarlyUserAttestationGenerated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ATTESTATIONS_REGISTRY\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EARLY_USER_BADGE_END_DATE\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EARLY_USER_COLLECTION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"attesters\",\"type\":\"address[]\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request[]\",\"name\":\"requests\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"proofDataArray\",\"type\":\"bytes[]\"}],\"name\":\"batchBuildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[][]\",\"name\":\"\",\"type\":\"tuple[][]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"attesters\",\"type\":\"address[]\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request[]\",\"name\":\"requests\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"proofDataArray\",\"type\":\"bytes[]\"}],\"name\":\"batchGenerateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[][]\",\"name\":\"\",\"type\":\"tuple[][]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"batchBuildAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])\":{\"details\":\"build the attestations from multiple user requests. Forwards to the build function of targeted attester\",\"params\":{\"attesters\":\"Targeted attesters\",\"proofDataArray\":\"Data sent along the request to prove its validity\",\"requests\":\"User requests\"},\"returns\":{\"_0\":\"attestations Attestations that will be recorded\"}},\"batchGenerateAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])\":{\"details\":\"generate multiple attestations at once, to the same destination, generates an early user attestation\",\"params\":{\"attesters\":\"Attesters targeted by the attesters\",\"proofDataArray\":\"Data sent with each request\",\"requests\":\"Requests sent to attester\"}},\"buildAttestations(address,((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"build the attestations from a user request targeting a specific attester. Forwards to the build function of targeted attester\",\"params\":{\"attester\":\"Targeted attester\",\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that will be recorded\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"attestationsRegistryAddress\":\"Attestations registry contract address\"}},\"generateAttestations(address,((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Forward a request to an attester and generates an early user attestation\",\"params\":{\"attester\":\"Attester targeted by the request\",\"proofData\":\"Data provided to the attester to back the request\",\"request\":\"Request sent to the attester\"}}},\"title\":\"Front\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This is the Front contract of the Sismo protocol Behind a proxy, it routes attestations request to the targeted attester and can perform some actions This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference For more information: https://front.docs.sismo.io\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/Front.sol\":\"Front\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/core/Front.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {IFront} from './interfaces/IFront.sol';\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation} from './libs/Structs.sol';\\n\\n/**\\n * @title Front\\n * @author Sismo\\n * @notice This is the Front contract of the Sismo protocol\\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\\n\\n * For more information: https://front.docs.sismo.io\\n */\\ncontract Front is IFront {\\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\\n uint256 public constant EARLY_USER_COLLECTION = 0;\\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress Attestations registry contract address\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Forward a request to an attester and generates an early user attestation\\n * @param attester Attester targeted by the request\\n * @param request Request sent to the attester\\n * @param proofData Data provided to the attester to back the request\\n */\\n function generateAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n Attestation[] memory attestations = _forwardAttestationsGeneration(\\n attester,\\n request,\\n proofData\\n );\\n _generateEarlyUserAttestation(request.destination);\\n return attestations;\\n }\\n\\n /**\\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\\n * @param attesters Attesters targeted by the attesters\\n * @param requests Requests sent to attester\\n * @param proofDataArray Data sent with each request\\n */\\n function batchGenerateAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external override returns (Attestation[][] memory) {\\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\\n address destination = requests[0].destination;\\n for (uint256 i = 0; i < attesters.length; i++) {\\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\\n attestations[i] = _forwardAttestationsGeneration(\\n attesters[i],\\n requests[i],\\n proofDataArray[i]\\n );\\n }\\n _generateEarlyUserAttestation(destination);\\n return attestations;\\n }\\n\\n /**\\n * @dev build the attestations from a user request targeting a specific attester.\\n * Forwards to the build function of targeted attester\\n * @param attester Targeted attester\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external view override returns (Attestation[] memory) {\\n return _forwardAttestationsBuild(attester, request, proofData);\\n }\\n\\n /**\\n * @dev build the attestations from multiple user requests.\\n * Forwards to the build function of targeted attester\\n * @param attesters Targeted attesters\\n * @param requests User requests\\n * @param proofDataArray Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function batchBuildAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external view override returns (Attestation[][] memory) {\\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\\n\\n for (uint256 i = 0; i < attesters.length; i++) {\\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\\n }\\n return attestations;\\n }\\n\\n function _forwardAttestationsBuild(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) internal view returns (Attestation[] memory) {\\n return IAttester(attester).buildAttestations(request, proofData);\\n }\\n\\n function _forwardAttestationsGeneration(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) internal returns (Attestation[] memory) {\\n return IAttester(attester).generateAttestations(request, proofData);\\n }\\n\\n function _generateEarlyUserAttestation(address destination) internal {\\n uint32 currentTimestamp = uint32(block.timestamp);\\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\\n EARLY_USER_COLLECTION,\\n destination\\n );\\n\\n if (!alreadyHasAttestation) {\\n Attestation[] memory attestations = new Attestation[](1);\\n attestations[0] = Attestation(\\n EARLY_USER_COLLECTION,\\n destination,\\n address(this),\\n 1,\\n currentTimestamp,\\n 'With strong love from Sismo'\\n );\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n emit EarlyUserAttestationGenerated(destination);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3ea2112c22a36ff318873f1f015fa9e3b447e93d33464ae81b9bcd7d0f917621\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param attestations Attestations to be deleted\\n */\\n function deleteAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xb5e25bd7e0372c9973e582fb7fe96318c145831a5452d8c79eb848a7464b0297\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/interfaces/IFront.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\n\\n/**\\n * @title IFront\\n * @author Sismo\\n * @notice This is the interface of the Front Contract\\n */\\ninterface IFront {\\n error DifferentRequestsDestinations();\\n event EarlyUserAttestationGenerated(address destination);\\n\\n /**\\n * @dev Forward a request to an attester and generates an early user attestation\\n * @param attester Attester targeted by the request\\n * @param request Request sent to the attester\\n * @param proofData Data provided to the attester to back the request\\n */\\n function generateAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev generate multiple attestations at once, to the same destination\\n * @param attesters Attesters targeted by the attesters\\n * @param requests Requests sent to attester\\n * @param proofDataArray Data sent with each request\\n */\\n function batchGenerateAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external returns (Attestation[][] memory);\\n\\n /**\\n * @dev build the attestations from a user request targeting a specific attester.\\n * Forwards to the build function of targeted attester\\n * @param attester Targeted attester\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev build the attestations from multiple user requests.\\n * Forwards to the build function(s) of targeted attester(s)\\n * @param attesters Targeted attesters\\n * @param requests User requests\\n * @param proofDataArray Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function batchBuildAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external view returns (Attestation[][] memory);\\n}\\n\",\"keccak256\":\"0xfeab84e36830c432f91d0cbe1beb430331529829ce667a6371fbad47baa12191\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b506040516110e43803806110e483398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161104b610099600039600081816101020152818161051901526106bd015261104b6000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806389a504771161005b57806389a50477146100e7578063ac9d6541146100fd578063aebddc691461013c578063c0a92c911461014f57600080fd5b80630a60387d14610082578063369b88be146100a75780633ee490ce146100c7575b600080fd5b61008d6363226b0081565b60405163ffffffff90911681526020015b60405180910390f35b6100ba6100b5366004610805565b610162565b60405161009e91906108cf565b6100da6100d5366004610a0d565b61031d565b60405161009e9190610ab9565b6100ef600081565b60405190815260200161009e565b6101247f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161009e565b6100da61014a366004610a0d565b610350565b6100ba61015d366004610805565b61035e565b606060008667ffffffffffffffff81111561017f5761017f610b84565b6040519080825280602002602001820160405280156101b257816020015b606081526020019060019003908161019d5790505b5090506000868660008181106101ca576101ca610b9a565b90506020028101906101dc9190610bb0565b6101ed906040810190602001610bd0565b905060005b8881101561030757816001600160a01b031688888381811061021657610216610b9a565b90506020028101906102289190610bb0565b610239906040810190602001610bd0565b6001600160a01b0316146102605760405163f1b973df60e01b815260040160405180910390fd5b6102d78a8a8381811061027557610275610b9a565b905060200201602081019061028a9190610bd0565b89898481811061029c5761029c610b9a565b90506020028101906102ae9190610bb0565b8888858181106102c0576102c0610b9a565b90506020028101906102d29190610bf4565b610463565b8382815181106102e9576102e9610b9a565b602002602001018190525080806102ff90610c3b565b9150506101f2565b50610311816104dd565b50979650505050505050565b6060600061032d86868686610463565b90506103476103426040870160208801610bd0565b6104dd565b95945050505050565b606061034785858585610769565b606060008667ffffffffffffffff81111561037b5761037b610b84565b6040519080825280602002602001820160405280156103ae57816020015b60608152602001906001900390816103995790505b50905060005b87811015610311576104338989838181106103d1576103d1610b9a565b90506020020160208101906103e69190610bd0565b8888848181106103f8576103f8610b9a565b905060200281019061040a9190610bb0565b87878581811061041c5761041c610b9a565b905060200281019061042e9190610bf4565b610769565b82828151811061044557610445610b9a565b6020026020010181905250808061045b90610c3b565b9150506103b4565b60405163e60f999f60e01b81526060906001600160a01b0386169063e60f999f9061049690879087908790600401610c8b565b6000604051808303816000875af11580156104b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103479190810190610e9d565b426363226b0063ffffffff82161015610765576040516211023960e41b81526000600482018190526001600160a01b03848116602484015290917f0000000000000000000000000000000000000000000000000000000000000000909116906301102390906044016020604051808303816000875af1158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190610ff3565b90508061076357604080516001808252818301909252600091816020015b6105f76040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816105a65790505090506040518060c0016040528060008152602001856001600160a01b03168152602001306001600160a01b03168152602001600181526020018463ffffffff1681526020016040518060400160405280601b81526020017f57697468207374726f6e67206c6f76652066726f6d205369736d6f00000000008152508152508160008151811061069b5761069b610b9a565b602090810291909101015260405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106f2908490600401610ab9565b600060405180830381600087803b15801561070c57600080fd5b505af1158015610720573d6000803e3d6000fd5b50506040516001600160a01b03871681527f65566f56ce57729c92989973ff6ac5bdd213f57bf75d7248c4190d6d3634738e9250602001905060405180910390a1505b505b5050565b604051630af411a360e41b81526060906001600160a01b0386169063af411a309061079c90879087908790600401610c8b565b600060405180830381865afa1580156104b5573d6000803e3d6000fd5b60008083601f8401126107cb57600080fd5b50813567ffffffffffffffff8111156107e357600080fd5b6020830191508360208260051b85010111156107fe57600080fd5b9250929050565b6000806000806000806060878903121561081e57600080fd5b863567ffffffffffffffff8082111561083657600080fd5b6108428a838b016107b9565b9098509650602089013591508082111561085b57600080fd5b6108678a838b016107b9565b9096509450604089013591508082111561088057600080fd5b5061088d89828a016107b9565b979a9699509497509295939492505050565b60005b838110156108ba5781810151838201526020016108a2565b838111156108c9576000848401525b50505050565b60208152600060208201835180825260408401915060408160051b8501016020860160005b838110156109d957868303603f19018552815180518085526020918201918086019190600582901b87010160005b828110156109bf57601f1980898403018552855180518452602081015160018060a01b03808216602087015280604084015116604087015250506060810151606085015263ffffffff608082015116608085015260a0810151905060c060a085015280518060c086015261099d8160e087016020850161089f565b6020978801979690960195601f019091169290920160e0019150600101610922565b5060209889019890965094909401935050506001016108f4565b50909695505050505050565b6001600160a01b03811681146109fa57600080fd5b50565b8035610a08816109e5565b919050565b60008060008060608587031215610a2357600080fd5b8435610a2e816109e5565b9350602085013567ffffffffffffffff80821115610a4b57600080fd5b9086019060408289031215610a5f57600080fd5b90935060408601359080821115610a7557600080fd5b818701915087601f830112610a8957600080fd5b813581811115610a9857600080fd5b886020828501011115610aaa57600080fd5b95989497505060200194505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610b7657888303603f19018552815180518452878101516001600160a01b03908116898601528782015116878501526060808201519085015260808082015163ffffffff169085015260a09081015160c091850182905280519185018290529060e090610b5681838801858d0161089f565b96890196601f01601f191694909401909301925090860190600101610ae0565b509098975050505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008235603e19833603018112610bc657600080fd5b9190910192915050565b600060208284031215610be257600080fd5b8135610bed816109e5565b9392505050565b6000808335601e19843603018112610c0b57600080fd5b83018035915067ffffffffffffffff821115610c2657600080fd5b6020019150368190038213156107fe57600080fd5b600060018201610c5b57634e487b7160e01b600052601160045260246000fd5b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006040808352608083018635601e19883603018112610caa57600080fd5b87018035602080830167ffffffffffffffff80841115610cc957600080fd5b8360051b803603831315610cdc57600080fd5b878a018890529584905260a09589018601956000908a01607e1936889003015b86831015610d96578b8903609f190182528435818112610d1b57600080fd5b8801868101358a528a8101358a88015260608082013536839003603e19018112610d4457600080fd5b9091018b8101919088013586811115610d5c57600080fd5b803603831315610d6b57600080fd5b818d8d0152610d7d828d018285610c62565b9b50505094860194506001929092019190850190610cfc565b5050505050610da6818b016109fd565b6001600160a01b0381166060890152945086840381880152505050610dcc818688610c62565b979650505050505050565b60405160c0810167ffffffffffffffff81118282101715610dfa57610dfa610b84565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e2957610e29610b84565b604052919050565b600082601f830112610e4257600080fd5b815167ffffffffffffffff811115610e5c57610e5c610b84565b610e6f601f8201601f1916602001610e00565b818152846020838601011115610e8457600080fd5b610e9582602083016020870161089f565b949350505050565b60006020808385031215610eb057600080fd5b825167ffffffffffffffff80821115610ec857600080fd5b818501915085601f830112610edc57600080fd5b815181811115610eee57610eee610b84565b8060051b610efd858201610e00565b9182528381018501918581019089841115610f1757600080fd5b86860192505b83831015610fe657825185811115610f355760008081fd5b860160c0818c03601f1901811315610f4d5760008081fd5b610f55610dd7565b898301518152604080840151610f6a816109e5565b828c0152606084810151610f7d816109e5565b8083850152506080915081850151818401525060a08085015163ffffffff81168114610fa95760008081fd5b83830152928401519289841115610fc257600091508182fd5b610fd08f8d86880101610e31565b9083015250845250509186019190860190610f1d565b9998505050505050505050565b60006020828403121561100557600080fd5b81518015158114610bed57600080fdfea26469706673582212206eab9b350687ecccafd79868df619e95a4ffb1f38b3590296e186abb24b904f864736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806389a504771161005b57806389a50477146100e7578063ac9d6541146100fd578063aebddc691461013c578063c0a92c911461014f57600080fd5b80630a60387d14610082578063369b88be146100a75780633ee490ce146100c7575b600080fd5b61008d6363226b0081565b60405163ffffffff90911681526020015b60405180910390f35b6100ba6100b5366004610805565b610162565b60405161009e91906108cf565b6100da6100d5366004610a0d565b61031d565b60405161009e9190610ab9565b6100ef600081565b60405190815260200161009e565b6101247f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161009e565b6100da61014a366004610a0d565b610350565b6100ba61015d366004610805565b61035e565b606060008667ffffffffffffffff81111561017f5761017f610b84565b6040519080825280602002602001820160405280156101b257816020015b606081526020019060019003908161019d5790505b5090506000868660008181106101ca576101ca610b9a565b90506020028101906101dc9190610bb0565b6101ed906040810190602001610bd0565b905060005b8881101561030757816001600160a01b031688888381811061021657610216610b9a565b90506020028101906102289190610bb0565b610239906040810190602001610bd0565b6001600160a01b0316146102605760405163f1b973df60e01b815260040160405180910390fd5b6102d78a8a8381811061027557610275610b9a565b905060200201602081019061028a9190610bd0565b89898481811061029c5761029c610b9a565b90506020028101906102ae9190610bb0565b8888858181106102c0576102c0610b9a565b90506020028101906102d29190610bf4565b610463565b8382815181106102e9576102e9610b9a565b602002602001018190525080806102ff90610c3b565b9150506101f2565b50610311816104dd565b50979650505050505050565b6060600061032d86868686610463565b90506103476103426040870160208801610bd0565b6104dd565b95945050505050565b606061034785858585610769565b606060008667ffffffffffffffff81111561037b5761037b610b84565b6040519080825280602002602001820160405280156103ae57816020015b60608152602001906001900390816103995790505b50905060005b87811015610311576104338989838181106103d1576103d1610b9a565b90506020020160208101906103e69190610bd0565b8888848181106103f8576103f8610b9a565b905060200281019061040a9190610bb0565b87878581811061041c5761041c610b9a565b905060200281019061042e9190610bf4565b610769565b82828151811061044557610445610b9a565b6020026020010181905250808061045b90610c3b565b9150506103b4565b60405163e60f999f60e01b81526060906001600160a01b0386169063e60f999f9061049690879087908790600401610c8b565b6000604051808303816000875af11580156104b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103479190810190610e9d565b426363226b0063ffffffff82161015610765576040516211023960e41b81526000600482018190526001600160a01b03848116602484015290917f0000000000000000000000000000000000000000000000000000000000000000909116906301102390906044016020604051808303816000875af1158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190610ff3565b90508061076357604080516001808252818301909252600091816020015b6105f76040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816105a65790505090506040518060c0016040528060008152602001856001600160a01b03168152602001306001600160a01b03168152602001600181526020018463ffffffff1681526020016040518060400160405280601b81526020017f57697468207374726f6e67206c6f76652066726f6d205369736d6f00000000008152508152508160008151811061069b5761069b610b9a565b602090810291909101015260405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106f2908490600401610ab9565b600060405180830381600087803b15801561070c57600080fd5b505af1158015610720573d6000803e3d6000fd5b50506040516001600160a01b03871681527f65566f56ce57729c92989973ff6ac5bdd213f57bf75d7248c4190d6d3634738e9250602001905060405180910390a1505b505b5050565b604051630af411a360e41b81526060906001600160a01b0386169063af411a309061079c90879087908790600401610c8b565b600060405180830381865afa1580156104b5573d6000803e3d6000fd5b60008083601f8401126107cb57600080fd5b50813567ffffffffffffffff8111156107e357600080fd5b6020830191508360208260051b85010111156107fe57600080fd5b9250929050565b6000806000806000806060878903121561081e57600080fd5b863567ffffffffffffffff8082111561083657600080fd5b6108428a838b016107b9565b9098509650602089013591508082111561085b57600080fd5b6108678a838b016107b9565b9096509450604089013591508082111561088057600080fd5b5061088d89828a016107b9565b979a9699509497509295939492505050565b60005b838110156108ba5781810151838201526020016108a2565b838111156108c9576000848401525b50505050565b60208152600060208201835180825260408401915060408160051b8501016020860160005b838110156109d957868303603f19018552815180518085526020918201918086019190600582901b87010160005b828110156109bf57601f1980898403018552855180518452602081015160018060a01b03808216602087015280604084015116604087015250506060810151606085015263ffffffff608082015116608085015260a0810151905060c060a085015280518060c086015261099d8160e087016020850161089f565b6020978801979690960195601f019091169290920160e0019150600101610922565b5060209889019890965094909401935050506001016108f4565b50909695505050505050565b6001600160a01b03811681146109fa57600080fd5b50565b8035610a08816109e5565b919050565b60008060008060608587031215610a2357600080fd5b8435610a2e816109e5565b9350602085013567ffffffffffffffff80821115610a4b57600080fd5b9086019060408289031215610a5f57600080fd5b90935060408601359080821115610a7557600080fd5b818701915087601f830112610a8957600080fd5b813581811115610a9857600080fd5b886020828501011115610aaa57600080fd5b95989497505060200194505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610b7657888303603f19018552815180518452878101516001600160a01b03908116898601528782015116878501526060808201519085015260808082015163ffffffff169085015260a09081015160c091850182905280519185018290529060e090610b5681838801858d0161089f565b96890196601f01601f191694909401909301925090860190600101610ae0565b509098975050505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008235603e19833603018112610bc657600080fd5b9190910192915050565b600060208284031215610be257600080fd5b8135610bed816109e5565b9392505050565b6000808335601e19843603018112610c0b57600080fd5b83018035915067ffffffffffffffff821115610c2657600080fd5b6020019150368190038213156107fe57600080fd5b600060018201610c5b57634e487b7160e01b600052601160045260246000fd5b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006040808352608083018635601e19883603018112610caa57600080fd5b87018035602080830167ffffffffffffffff80841115610cc957600080fd5b8360051b803603831315610cdc57600080fd5b878a018890529584905260a09589018601956000908a01607e1936889003015b86831015610d96578b8903609f190182528435818112610d1b57600080fd5b8801868101358a528a8101358a88015260608082013536839003603e19018112610d4457600080fd5b9091018b8101919088013586811115610d5c57600080fd5b803603831315610d6b57600080fd5b818d8d0152610d7d828d018285610c62565b9b50505094860194506001929092019190850190610cfc565b5050505050610da6818b016109fd565b6001600160a01b0381166060890152945086840381880152505050610dcc818688610c62565b979650505050505050565b60405160c0810167ffffffffffffffff81118282101715610dfa57610dfa610b84565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e2957610e29610b84565b604052919050565b600082601f830112610e4257600080fd5b815167ffffffffffffffff811115610e5c57610e5c610b84565b610e6f601f8201601f1916602001610e00565b818152846020838601011115610e8457600080fd5b610e9582602083016020870161089f565b949350505050565b60006020808385031215610eb057600080fd5b825167ffffffffffffffff80821115610ec857600080fd5b818501915085601f830112610edc57600080fd5b815181811115610eee57610eee610b84565b8060051b610efd858201610e00565b9182528381018501918581019089841115610f1757600080fd5b86860192505b83831015610fe657825185811115610f355760008081fd5b860160c0818c03601f1901811315610f4d5760008081fd5b610f55610dd7565b898301518152604080840151610f6a816109e5565b828c0152606084810151610f7d816109e5565b8083850152506080915081850151818401525060a08085015163ffffffff81168114610fa95760008081fd5b83830152928401519289841115610fc257600091508182fd5b610fd08f8d86880101610e31565b9083015250845250509186019190860190610f1d565b9998505050505050505050565b60006020828403121561100557600080fd5b81518015158114610bed57600080fdfea26469706673582212206eab9b350687ecccafd79868df619e95a4ffb1f38b3590296e186abb24b904f864736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "batchBuildAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])": { - "details": "build the attestations from multiple user requests. Forwards to the build function of targeted attester", - "params": { - "attesters": "Targeted attesters", - "proofDataArray": "Data sent along the request to prove its validity", - "requests": "User requests" - }, - "returns": { - "_0": "attestations Attestations that will be recorded" - } - }, - "batchGenerateAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])": { - "details": "generate multiple attestations at once, to the same destination, generates an early user attestation", - "params": { - "attesters": "Attesters targeted by the attesters", - "proofDataArray": "Data sent with each request", - "requests": "Requests sent to attester" - } - }, - "buildAttestations(address,((uint256,uint256,bytes)[],address),bytes)": { - "details": "build the attestations from a user request targeting a specific attester. Forwards to the build function of targeted attester", - "params": { - "attester": "Targeted attester", - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that will be recorded" - } - }, - "constructor": { - "details": "Constructor", - "params": { - "attestationsRegistryAddress": "Attestations registry contract address" - } - }, - "generateAttestations(address,((uint256,uint256,bytes)[],address),bytes)": { - "details": "Forward a request to an attester and generates an early user attestation", - "params": { - "attester": "Attester targeted by the request", - "proofData": "Data provided to the attester to back the request", - "request": "Request sent to the attester" - } - } - }, - "title": "Front", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "This is the Front contract of the Sismo protocol Behind a proxy, it routes attestations request to the targeted attester and can perform some actions This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference For more information: https://front.docs.sismo.io", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/goerli/FrontImplem.json b/deployments/goerli/FrontImplem.json deleted file mode 100644 index 3252dc9..0000000 --- a/deployments/goerli/FrontImplem.json +++ /dev/null @@ -1,519 +0,0 @@ -{ - "address": "0xF53C678A27271dC11080cC3bb6FAb6291F3995d3", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "DifferentRequestsDestinations", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "name": "EarlyUserAttestationGenerated", - "type": "event" - }, - { - "inputs": [], - "name": "ATTESTATIONS_REGISTRY", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "EARLY_USER_BADGE_END_DATE", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "EARLY_USER_COLLECTION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "attesters", - "type": "address[]" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request[]", - "name": "requests", - "type": "tuple[]" - }, - { - "internalType": "bytes[]", - "name": "proofDataArray", - "type": "bytes[]" - } - ], - "name": "batchBuildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[][]", - "name": "", - "type": "tuple[][]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "attesters", - "type": "address[]" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request[]", - "name": "requests", - "type": "tuple[]" - }, - { - "internalType": "bytes[]", - "name": "proofDataArray", - "type": "bytes[]" - } - ], - "name": "batchGenerateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[][]", - "name": "", - "type": "tuple[][]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xba427cb5b20e9bc7c8a83b75ac9f9702c4725794e1d119a24b08611e4cf51ac5", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0xF53C678A27271dC11080cC3bb6FAb6291F3995d3", - "transactionIndex": 59, - "gasUsed": "954922", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x70ffd9219bfaff3c65becac6441bf166fb0806267815bf49ccc9fb9173388fb8", - "transactionHash": "0xba427cb5b20e9bc7c8a83b75ac9f9702c4725794e1d119a24b08611e4cf51ac5", - "logs": [], - "blockNumber": 7711014, - "cumulativeGasUsed": "28545741", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf85BA0afA375495eE625910Db61b6b1406756234" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"DifferentRequestsDestinations\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"EarlyUserAttestationGenerated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ATTESTATIONS_REGISTRY\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EARLY_USER_BADGE_END_DATE\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EARLY_USER_COLLECTION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"attesters\",\"type\":\"address[]\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request[]\",\"name\":\"requests\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"proofDataArray\",\"type\":\"bytes[]\"}],\"name\":\"batchBuildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[][]\",\"name\":\"\",\"type\":\"tuple[][]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"attesters\",\"type\":\"address[]\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request[]\",\"name\":\"requests\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"proofDataArray\",\"type\":\"bytes[]\"}],\"name\":\"batchGenerateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[][]\",\"name\":\"\",\"type\":\"tuple[][]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"batchBuildAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])\":{\"details\":\"build the attestations from multiple user requests. Forwards to the build function of targeted attester\",\"params\":{\"attesters\":\"Targeted attesters\",\"proofDataArray\":\"Data sent along the request to prove its validity\",\"requests\":\"User requests\"},\"returns\":{\"_0\":\"attestations Attestations that will be recorded\"}},\"batchGenerateAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])\":{\"details\":\"generate multiple attestations at once, to the same destination, generates an early user attestation\",\"params\":{\"attesters\":\"Attesters targeted by the attesters\",\"proofDataArray\":\"Data sent with each request\",\"requests\":\"Requests sent to attester\"}},\"buildAttestations(address,((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"build the attestations from a user request targeting a specific attester. Forwards to the build function of targeted attester\",\"params\":{\"attester\":\"Targeted attester\",\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that will be recorded\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"attestationsRegistryAddress\":\"Attestations registry contract address\"}},\"generateAttestations(address,((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Forward a request to an attester and generates an early user attestation\",\"params\":{\"attester\":\"Attester targeted by the request\",\"proofData\":\"Data provided to the attester to back the request\",\"request\":\"Request sent to the attester\"}}},\"title\":\"Front\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This is the Front contract of the Sismo protocol Behind a proxy, it routes attestations request to the targeted attester and can perform some actions This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference For more information: https://front.docs.sismo.io\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/Front.sol\":\"Front\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/core/Front.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {IFront} from './interfaces/IFront.sol';\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation} from './libs/Structs.sol';\\n\\n/**\\n * @title Front\\n * @author Sismo\\n * @notice This is the Front contract of the Sismo protocol\\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\\n\\n * For more information: https://front.docs.sismo.io\\n */\\ncontract Front is IFront {\\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\\n uint256 public constant EARLY_USER_COLLECTION = 0;\\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress Attestations registry contract address\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Forward a request to an attester and generates an early user attestation\\n * @param attester Attester targeted by the request\\n * @param request Request sent to the attester\\n * @param proofData Data provided to the attester to back the request\\n */\\n function generateAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n Attestation[] memory attestations = _forwardAttestationsGeneration(\\n attester,\\n request,\\n proofData\\n );\\n _generateEarlyUserAttestation(request.destination);\\n return attestations;\\n }\\n\\n /**\\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\\n * @param attesters Attesters targeted by the attesters\\n * @param requests Requests sent to attester\\n * @param proofDataArray Data sent with each request\\n */\\n function batchGenerateAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external override returns (Attestation[][] memory) {\\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\\n address destination = requests[0].destination;\\n for (uint256 i = 0; i < attesters.length; i++) {\\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\\n attestations[i] = _forwardAttestationsGeneration(\\n attesters[i],\\n requests[i],\\n proofDataArray[i]\\n );\\n }\\n _generateEarlyUserAttestation(destination);\\n return attestations;\\n }\\n\\n /**\\n * @dev build the attestations from a user request targeting a specific attester.\\n * Forwards to the build function of targeted attester\\n * @param attester Targeted attester\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external view override returns (Attestation[] memory) {\\n return _forwardAttestationsBuild(attester, request, proofData);\\n }\\n\\n /**\\n * @dev build the attestations from multiple user requests.\\n * Forwards to the build function of targeted attester\\n * @param attesters Targeted attesters\\n * @param requests User requests\\n * @param proofDataArray Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function batchBuildAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external view override returns (Attestation[][] memory) {\\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\\n\\n for (uint256 i = 0; i < attesters.length; i++) {\\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\\n }\\n return attestations;\\n }\\n\\n function _forwardAttestationsBuild(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) internal view returns (Attestation[] memory) {\\n return IAttester(attester).buildAttestations(request, proofData);\\n }\\n\\n function _forwardAttestationsGeneration(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) internal returns (Attestation[] memory) {\\n return IAttester(attester).generateAttestations(request, proofData);\\n }\\n\\n function _generateEarlyUserAttestation(address destination) internal {\\n uint32 currentTimestamp = uint32(block.timestamp);\\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\\n EARLY_USER_COLLECTION,\\n destination\\n );\\n\\n if (!alreadyHasAttestation) {\\n Attestation[] memory attestations = new Attestation[](1);\\n attestations[0] = Attestation(\\n EARLY_USER_COLLECTION,\\n destination,\\n address(this),\\n 1,\\n currentTimestamp,\\n 'With strong love from Sismo'\\n );\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n emit EarlyUserAttestationGenerated(destination);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3ea2112c22a36ff318873f1f015fa9e3b447e93d33464ae81b9bcd7d0f917621\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param attestations Attestations to be deleted\\n */\\n function deleteAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xb5e25bd7e0372c9973e582fb7fe96318c145831a5452d8c79eb848a7464b0297\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/interfaces/IFront.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\n\\n/**\\n * @title IFront\\n * @author Sismo\\n * @notice This is the interface of the Front Contract\\n */\\ninterface IFront {\\n error DifferentRequestsDestinations();\\n event EarlyUserAttestationGenerated(address destination);\\n\\n /**\\n * @dev Forward a request to an attester and generates an early user attestation\\n * @param attester Attester targeted by the request\\n * @param request Request sent to the attester\\n * @param proofData Data provided to the attester to back the request\\n */\\n function generateAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev generate multiple attestations at once, to the same destination\\n * @param attesters Attesters targeted by the attesters\\n * @param requests Requests sent to attester\\n * @param proofDataArray Data sent with each request\\n */\\n function batchGenerateAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external returns (Attestation[][] memory);\\n\\n /**\\n * @dev build the attestations from a user request targeting a specific attester.\\n * Forwards to the build function of targeted attester\\n * @param attester Targeted attester\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev build the attestations from multiple user requests.\\n * Forwards to the build function(s) of targeted attester(s)\\n * @param attesters Targeted attesters\\n * @param requests User requests\\n * @param proofDataArray Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function batchBuildAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external view returns (Attestation[][] memory);\\n}\\n\",\"keccak256\":\"0xfeab84e36830c432f91d0cbe1beb430331529829ce667a6371fbad47baa12191\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b506040516110e43803806110e483398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161104b610099600039600081816101020152818161051901526106bd015261104b6000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806389a504771161005b57806389a50477146100e7578063ac9d6541146100fd578063aebddc691461013c578063c0a92c911461014f57600080fd5b80630a60387d14610082578063369b88be146100a75780633ee490ce146100c7575b600080fd5b61008d6363226b0081565b60405163ffffffff90911681526020015b60405180910390f35b6100ba6100b5366004610805565b610162565b60405161009e91906108cf565b6100da6100d5366004610a0d565b61031d565b60405161009e9190610ab9565b6100ef600081565b60405190815260200161009e565b6101247f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161009e565b6100da61014a366004610a0d565b610350565b6100ba61015d366004610805565b61035e565b606060008667ffffffffffffffff81111561017f5761017f610b84565b6040519080825280602002602001820160405280156101b257816020015b606081526020019060019003908161019d5790505b5090506000868660008181106101ca576101ca610b9a565b90506020028101906101dc9190610bb0565b6101ed906040810190602001610bd0565b905060005b8881101561030757816001600160a01b031688888381811061021657610216610b9a565b90506020028101906102289190610bb0565b610239906040810190602001610bd0565b6001600160a01b0316146102605760405163f1b973df60e01b815260040160405180910390fd5b6102d78a8a8381811061027557610275610b9a565b905060200201602081019061028a9190610bd0565b89898481811061029c5761029c610b9a565b90506020028101906102ae9190610bb0565b8888858181106102c0576102c0610b9a565b90506020028101906102d29190610bf4565b610463565b8382815181106102e9576102e9610b9a565b602002602001018190525080806102ff90610c3b565b9150506101f2565b50610311816104dd565b50979650505050505050565b6060600061032d86868686610463565b90506103476103426040870160208801610bd0565b6104dd565b95945050505050565b606061034785858585610769565b606060008667ffffffffffffffff81111561037b5761037b610b84565b6040519080825280602002602001820160405280156103ae57816020015b60608152602001906001900390816103995790505b50905060005b87811015610311576104338989838181106103d1576103d1610b9a565b90506020020160208101906103e69190610bd0565b8888848181106103f8576103f8610b9a565b905060200281019061040a9190610bb0565b87878581811061041c5761041c610b9a565b905060200281019061042e9190610bf4565b610769565b82828151811061044557610445610b9a565b6020026020010181905250808061045b90610c3b565b9150506103b4565b60405163e60f999f60e01b81526060906001600160a01b0386169063e60f999f9061049690879087908790600401610c8b565b6000604051808303816000875af11580156104b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103479190810190610e9d565b426363226b0063ffffffff82161015610765576040516211023960e41b81526000600482018190526001600160a01b03848116602484015290917f0000000000000000000000000000000000000000000000000000000000000000909116906301102390906044016020604051808303816000875af1158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190610ff3565b90508061076357604080516001808252818301909252600091816020015b6105f76040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816105a65790505090506040518060c0016040528060008152602001856001600160a01b03168152602001306001600160a01b03168152602001600181526020018463ffffffff1681526020016040518060400160405280601b81526020017f57697468207374726f6e67206c6f76652066726f6d205369736d6f00000000008152508152508160008151811061069b5761069b610b9a565b602090810291909101015260405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106f2908490600401610ab9565b600060405180830381600087803b15801561070c57600080fd5b505af1158015610720573d6000803e3d6000fd5b50506040516001600160a01b03871681527f65566f56ce57729c92989973ff6ac5bdd213f57bf75d7248c4190d6d3634738e9250602001905060405180910390a1505b505b5050565b604051630af411a360e41b81526060906001600160a01b0386169063af411a309061079c90879087908790600401610c8b565b600060405180830381865afa1580156104b5573d6000803e3d6000fd5b60008083601f8401126107cb57600080fd5b50813567ffffffffffffffff8111156107e357600080fd5b6020830191508360208260051b85010111156107fe57600080fd5b9250929050565b6000806000806000806060878903121561081e57600080fd5b863567ffffffffffffffff8082111561083657600080fd5b6108428a838b016107b9565b9098509650602089013591508082111561085b57600080fd5b6108678a838b016107b9565b9096509450604089013591508082111561088057600080fd5b5061088d89828a016107b9565b979a9699509497509295939492505050565b60005b838110156108ba5781810151838201526020016108a2565b838111156108c9576000848401525b50505050565b60208152600060208201835180825260408401915060408160051b8501016020860160005b838110156109d957868303603f19018552815180518085526020918201918086019190600582901b87010160005b828110156109bf57601f1980898403018552855180518452602081015160018060a01b03808216602087015280604084015116604087015250506060810151606085015263ffffffff608082015116608085015260a0810151905060c060a085015280518060c086015261099d8160e087016020850161089f565b6020978801979690960195601f019091169290920160e0019150600101610922565b5060209889019890965094909401935050506001016108f4565b50909695505050505050565b6001600160a01b03811681146109fa57600080fd5b50565b8035610a08816109e5565b919050565b60008060008060608587031215610a2357600080fd5b8435610a2e816109e5565b9350602085013567ffffffffffffffff80821115610a4b57600080fd5b9086019060408289031215610a5f57600080fd5b90935060408601359080821115610a7557600080fd5b818701915087601f830112610a8957600080fd5b813581811115610a9857600080fd5b886020828501011115610aaa57600080fd5b95989497505060200194505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610b7657888303603f19018552815180518452878101516001600160a01b03908116898601528782015116878501526060808201519085015260808082015163ffffffff169085015260a09081015160c091850182905280519185018290529060e090610b5681838801858d0161089f565b96890196601f01601f191694909401909301925090860190600101610ae0565b509098975050505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008235603e19833603018112610bc657600080fd5b9190910192915050565b600060208284031215610be257600080fd5b8135610bed816109e5565b9392505050565b6000808335601e19843603018112610c0b57600080fd5b83018035915067ffffffffffffffff821115610c2657600080fd5b6020019150368190038213156107fe57600080fd5b600060018201610c5b57634e487b7160e01b600052601160045260246000fd5b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006040808352608083018635601e19883603018112610caa57600080fd5b87018035602080830167ffffffffffffffff80841115610cc957600080fd5b8360051b803603831315610cdc57600080fd5b878a018890529584905260a09589018601956000908a01607e1936889003015b86831015610d96578b8903609f190182528435818112610d1b57600080fd5b8801868101358a528a8101358a88015260608082013536839003603e19018112610d4457600080fd5b9091018b8101919088013586811115610d5c57600080fd5b803603831315610d6b57600080fd5b818d8d0152610d7d828d018285610c62565b9b50505094860194506001929092019190850190610cfc565b5050505050610da6818b016109fd565b6001600160a01b0381166060890152945086840381880152505050610dcc818688610c62565b979650505050505050565b60405160c0810167ffffffffffffffff81118282101715610dfa57610dfa610b84565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e2957610e29610b84565b604052919050565b600082601f830112610e4257600080fd5b815167ffffffffffffffff811115610e5c57610e5c610b84565b610e6f601f8201601f1916602001610e00565b818152846020838601011115610e8457600080fd5b610e9582602083016020870161089f565b949350505050565b60006020808385031215610eb057600080fd5b825167ffffffffffffffff80821115610ec857600080fd5b818501915085601f830112610edc57600080fd5b815181811115610eee57610eee610b84565b8060051b610efd858201610e00565b9182528381018501918581019089841115610f1757600080fd5b86860192505b83831015610fe657825185811115610f355760008081fd5b860160c0818c03601f1901811315610f4d5760008081fd5b610f55610dd7565b898301518152604080840151610f6a816109e5565b828c0152606084810151610f7d816109e5565b8083850152506080915081850151818401525060a08085015163ffffffff81168114610fa95760008081fd5b83830152928401519289841115610fc257600091508182fd5b610fd08f8d86880101610e31565b9083015250845250509186019190860190610f1d565b9998505050505050505050565b60006020828403121561100557600080fd5b81518015158114610bed57600080fdfea26469706673582212206eab9b350687ecccafd79868df619e95a4ffb1f38b3590296e186abb24b904f864736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806389a504771161005b57806389a50477146100e7578063ac9d6541146100fd578063aebddc691461013c578063c0a92c911461014f57600080fd5b80630a60387d14610082578063369b88be146100a75780633ee490ce146100c7575b600080fd5b61008d6363226b0081565b60405163ffffffff90911681526020015b60405180910390f35b6100ba6100b5366004610805565b610162565b60405161009e91906108cf565b6100da6100d5366004610a0d565b61031d565b60405161009e9190610ab9565b6100ef600081565b60405190815260200161009e565b6101247f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161009e565b6100da61014a366004610a0d565b610350565b6100ba61015d366004610805565b61035e565b606060008667ffffffffffffffff81111561017f5761017f610b84565b6040519080825280602002602001820160405280156101b257816020015b606081526020019060019003908161019d5790505b5090506000868660008181106101ca576101ca610b9a565b90506020028101906101dc9190610bb0565b6101ed906040810190602001610bd0565b905060005b8881101561030757816001600160a01b031688888381811061021657610216610b9a565b90506020028101906102289190610bb0565b610239906040810190602001610bd0565b6001600160a01b0316146102605760405163f1b973df60e01b815260040160405180910390fd5b6102d78a8a8381811061027557610275610b9a565b905060200201602081019061028a9190610bd0565b89898481811061029c5761029c610b9a565b90506020028101906102ae9190610bb0565b8888858181106102c0576102c0610b9a565b90506020028101906102d29190610bf4565b610463565b8382815181106102e9576102e9610b9a565b602002602001018190525080806102ff90610c3b565b9150506101f2565b50610311816104dd565b50979650505050505050565b6060600061032d86868686610463565b90506103476103426040870160208801610bd0565b6104dd565b95945050505050565b606061034785858585610769565b606060008667ffffffffffffffff81111561037b5761037b610b84565b6040519080825280602002602001820160405280156103ae57816020015b60608152602001906001900390816103995790505b50905060005b87811015610311576104338989838181106103d1576103d1610b9a565b90506020020160208101906103e69190610bd0565b8888848181106103f8576103f8610b9a565b905060200281019061040a9190610bb0565b87878581811061041c5761041c610b9a565b905060200281019061042e9190610bf4565b610769565b82828151811061044557610445610b9a565b6020026020010181905250808061045b90610c3b565b9150506103b4565b60405163e60f999f60e01b81526060906001600160a01b0386169063e60f999f9061049690879087908790600401610c8b565b6000604051808303816000875af11580156104b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103479190810190610e9d565b426363226b0063ffffffff82161015610765576040516211023960e41b81526000600482018190526001600160a01b03848116602484015290917f0000000000000000000000000000000000000000000000000000000000000000909116906301102390906044016020604051808303816000875af1158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190610ff3565b90508061076357604080516001808252818301909252600091816020015b6105f76040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816105a65790505090506040518060c0016040528060008152602001856001600160a01b03168152602001306001600160a01b03168152602001600181526020018463ffffffff1681526020016040518060400160405280601b81526020017f57697468207374726f6e67206c6f76652066726f6d205369736d6f00000000008152508152508160008151811061069b5761069b610b9a565b602090810291909101015260405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106f2908490600401610ab9565b600060405180830381600087803b15801561070c57600080fd5b505af1158015610720573d6000803e3d6000fd5b50506040516001600160a01b03871681527f65566f56ce57729c92989973ff6ac5bdd213f57bf75d7248c4190d6d3634738e9250602001905060405180910390a1505b505b5050565b604051630af411a360e41b81526060906001600160a01b0386169063af411a309061079c90879087908790600401610c8b565b600060405180830381865afa1580156104b5573d6000803e3d6000fd5b60008083601f8401126107cb57600080fd5b50813567ffffffffffffffff8111156107e357600080fd5b6020830191508360208260051b85010111156107fe57600080fd5b9250929050565b6000806000806000806060878903121561081e57600080fd5b863567ffffffffffffffff8082111561083657600080fd5b6108428a838b016107b9565b9098509650602089013591508082111561085b57600080fd5b6108678a838b016107b9565b9096509450604089013591508082111561088057600080fd5b5061088d89828a016107b9565b979a9699509497509295939492505050565b60005b838110156108ba5781810151838201526020016108a2565b838111156108c9576000848401525b50505050565b60208152600060208201835180825260408401915060408160051b8501016020860160005b838110156109d957868303603f19018552815180518085526020918201918086019190600582901b87010160005b828110156109bf57601f1980898403018552855180518452602081015160018060a01b03808216602087015280604084015116604087015250506060810151606085015263ffffffff608082015116608085015260a0810151905060c060a085015280518060c086015261099d8160e087016020850161089f565b6020978801979690960195601f019091169290920160e0019150600101610922565b5060209889019890965094909401935050506001016108f4565b50909695505050505050565b6001600160a01b03811681146109fa57600080fd5b50565b8035610a08816109e5565b919050565b60008060008060608587031215610a2357600080fd5b8435610a2e816109e5565b9350602085013567ffffffffffffffff80821115610a4b57600080fd5b9086019060408289031215610a5f57600080fd5b90935060408601359080821115610a7557600080fd5b818701915087601f830112610a8957600080fd5b813581811115610a9857600080fd5b886020828501011115610aaa57600080fd5b95989497505060200194505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610b7657888303603f19018552815180518452878101516001600160a01b03908116898601528782015116878501526060808201519085015260808082015163ffffffff169085015260a09081015160c091850182905280519185018290529060e090610b5681838801858d0161089f565b96890196601f01601f191694909401909301925090860190600101610ae0565b509098975050505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008235603e19833603018112610bc657600080fd5b9190910192915050565b600060208284031215610be257600080fd5b8135610bed816109e5565b9392505050565b6000808335601e19843603018112610c0b57600080fd5b83018035915067ffffffffffffffff821115610c2657600080fd5b6020019150368190038213156107fe57600080fd5b600060018201610c5b57634e487b7160e01b600052601160045260246000fd5b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006040808352608083018635601e19883603018112610caa57600080fd5b87018035602080830167ffffffffffffffff80841115610cc957600080fd5b8360051b803603831315610cdc57600080fd5b878a018890529584905260a09589018601956000908a01607e1936889003015b86831015610d96578b8903609f190182528435818112610d1b57600080fd5b8801868101358a528a8101358a88015260608082013536839003603e19018112610d4457600080fd5b9091018b8101919088013586811115610d5c57600080fd5b803603831315610d6b57600080fd5b818d8d0152610d7d828d018285610c62565b9b50505094860194506001929092019190850190610cfc565b5050505050610da6818b016109fd565b6001600160a01b0381166060890152945086840381880152505050610dcc818688610c62565b979650505050505050565b60405160c0810167ffffffffffffffff81118282101715610dfa57610dfa610b84565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e2957610e29610b84565b604052919050565b600082601f830112610e4257600080fd5b815167ffffffffffffffff811115610e5c57610e5c610b84565b610e6f601f8201601f1916602001610e00565b818152846020838601011115610e8457600080fd5b610e9582602083016020870161089f565b949350505050565b60006020808385031215610eb057600080fd5b825167ffffffffffffffff80821115610ec857600080fd5b818501915085601f830112610edc57600080fd5b815181811115610eee57610eee610b84565b8060051b610efd858201610e00565b9182528381018501918581019089841115610f1757600080fd5b86860192505b83831015610fe657825185811115610f355760008081fd5b860160c0818c03601f1901811315610f4d5760008081fd5b610f55610dd7565b898301518152604080840151610f6a816109e5565b828c0152606084810151610f7d816109e5565b8083850152506080915081850151818401525060a08085015163ffffffff81168114610fa95760008081fd5b83830152928401519289841115610fc257600091508182fd5b610fd08f8d86880101610e31565b9083015250845250509186019190860190610f1d565b9998505050505050505050565b60006020828403121561100557600080fd5b81518015158114610bed57600080fdfea26469706673582212206eab9b350687ecccafd79868df619e95a4ffb1f38b3590296e186abb24b904f864736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "batchBuildAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])": { - "details": "build the attestations from multiple user requests. Forwards to the build function of targeted attester", - "params": { - "attesters": "Targeted attesters", - "proofDataArray": "Data sent along the request to prove its validity", - "requests": "User requests" - }, - "returns": { - "_0": "attestations Attestations that will be recorded" - } - }, - "batchGenerateAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])": { - "details": "generate multiple attestations at once, to the same destination, generates an early user attestation", - "params": { - "attesters": "Attesters targeted by the attesters", - "proofDataArray": "Data sent with each request", - "requests": "Requests sent to attester" - } - }, - "buildAttestations(address,((uint256,uint256,bytes)[],address),bytes)": { - "details": "build the attestations from a user request targeting a specific attester. Forwards to the build function of targeted attester", - "params": { - "attester": "Targeted attester", - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that will be recorded" - } - }, - "constructor": { - "details": "Constructor", - "params": { - "attestationsRegistryAddress": "Attestations registry contract address" - } - }, - "generateAttestations(address,((uint256,uint256,bytes)[],address),bytes)": { - "details": "Forward a request to an attester and generates an early user attestation", - "params": { - "attester": "Attester targeted by the request", - "proofData": "Data provided to the attester to back the request", - "request": "Request sent to the attester" - } - } - }, - "title": "Front", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "This is the Front contract of the Sismo protocol Behind a proxy, it routes attestations request to the targeted attester and can perform some actions This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference For more information: https://front.docs.sismo.io", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/goerli/FrontProxy.json b/deployments/goerli/FrontProxy.json deleted file mode 100644 index e3748d7..0000000 --- a/deployments/goerli/FrontProxy.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "address": "0xAa00539FCD89E113833a9fCb940F378aE1299e30", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x5832bebdc965466198ce906a018b746a78a555e18b9c5e64f4a3bcbab8d61d8c", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0xAa00539FCD89E113833a9fCb940F378aE1299e30", - "transactionIndex": 0, - "gasUsed": "583384", - "logsBloom": "0x00000000000000000000000000000000400000000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000002000000000000000000000000000000000000000000000001000000000000000000000008800000040000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000400000000000000000000000000000000002000000000000000000000000000000000000000000000000000", - "blockHash": "0xcb23905d4392cf6333a66193546e55aed9da26cf7aa2d5d8ebbca227c63917e1", - "transactionHash": "0x5832bebdc965466198ce906a018b746a78a555e18b9c5e64f4a3bcbab8d61d8c", - "logs": [ - { - "transactionIndex": 0, - "blockNumber": 7711015, - "transactionHash": "0x5832bebdc965466198ce906a018b746a78a555e18b9c5e64f4a3bcbab8d61d8c", - "address": "0xAa00539FCD89E113833a9fCb940F378aE1299e30", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000f53c678a27271dc11080cc3bb6fab6291f3995d3" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0xcb23905d4392cf6333a66193546e55aed9da26cf7aa2d5d8ebbca227c63917e1" - }, - { - "transactionIndex": 0, - "blockNumber": 7711015, - "transactionHash": "0x5832bebdc965466198ce906a018b746a78a555e18b9c5e64f4a3bcbab8d61d8c", - "address": "0xAa00539FCD89E113833a9fCb940F378aE1299e30", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000246e71bc2a257f4be9c7fad4664e6d7444844adc", - "logIndex": 1, - "blockHash": "0xcb23905d4392cf6333a66193546e55aed9da26cf7aa2d5d8ebbca227c63917e1" - } - ], - "blockNumber": 7711015, - "cumulativeGasUsed": "583384", - "status": 1, - "byzantium": true - }, - "args": [ - "0xF53C678A27271dC11080cC3bb6FAb6291F3995d3", - "0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc", - "0x" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/goerli/FrontendLib.json b/deployments/goerli/FrontendLib.json deleted file mode 100644 index caec542..0000000 --- a/deployments/goerli/FrontendLib.json +++ /dev/null @@ -1,73 +0,0 @@ -{ - "address": "0x692B275E6f40E72eEacDE156daB73240B82Dd91f", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "hydraS1AccountboundAttester", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "nullifiers", - "type": "uint256[]" - } - ], - "name": "getHydraS1AccountboundAttesterDestinationOfNullifierBatch", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x0c70b9bbc73075e7af06d01b22624ed92488b30fcf8d356271e6ee8a88ebac31", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x692B275E6f40E72eEacDE156daB73240B82Dd91f", - "transactionIndex": 81, - "gasUsed": "224972", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x6e6ed8be2558c3e63a615ceb090c2b03384825adc95b8fa73c8f94e1d9b8f243", - "transactionHash": "0x0c70b9bbc73075e7af06d01b22624ed92488b30fcf8d356271e6ee8a88ebac31", - "logs": [], - "blockNumber": 8122905, - "cumulativeGasUsed": "14599329", - "status": 1, - "byzantium": true - }, - "args": [ - "0x89d80C9E65fd1aC8970B78A4F17E2e772030C1cB" - ], - "numDeployments": 1, - "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"hydraS1AccountboundAttester\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"nullifiers\",\"type\":\"uint256[]\"}],\"name\":\"getHydraS1AccountboundAttesterDestinationOfNullifierBatch\",\"outputs\":[{\"internalType\":\"address[]\",\"name\":\"\",\"type\":\"address[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/FrontendLib.sol\":\"FrontendLib\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [8609986746108439658545470593166889256314951959466775818870246174320018498804,\\n 6848251127850009101372611262053374737897586140140607384018397707035108265914],\\n [21367916863936594568281095443965096905143705300114190558130516981138584550504,\\n 13327705762185115653848159709412003423932761899188342359583872691135383932883]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 19965766170734310004645394427613286415565755728797065894668054116047682895204,\\n 6952067612339183672227137101423582097916038093373585908267153974352032944482\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 13987716160490730015463796942940452666334097189904948795214986996497499925899,\\n 5336810094802209074340875836312868429276540870324469349093948627126061524544\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 14931593253473978964215343699995811275378324235306358485461293343370969283966,\\n 564306919152089917957316877787764763278299990971316475606280877961553231205\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11591267743733991434114686002448165336885445656808796470854638278338319268343,\\n 11495219763417990955889652410266075210402006084183208750635660647824890013350\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 8183184532870222270700473518157259944911700429689031755853536692005688965081,\\n 9121077094104828462137861111631978599019724423614716723152060153405564278301\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 4314095526093128699362232919686741372014146055311239687202926853002748112330,\\n 11665330391505820654128458332883010598817535082070674418723503440883598640597\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 18925967077785550270509493111690046951994174908254476036944536825999614778001,\\n 4990629719417206796668074534812314525340851981015724652256935997545282642849\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x120f0b311a61cabc9d42ef740c19e5f20b4c8ba400d9a6378e33c76dd54f5c42\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\n\\nimport {IHydraS1AccountboundAttester} from './interfaces/IHydraS1AccountboundAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from '../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra-S1\\nimport {HydraS1SimpleAttester, IAttester, HydraS1Lib, HydraS1ProofData, HydraS1Claim} from './HydraS1SimpleAttester.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic.\\n * Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic.\\n * However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation.\\n * The _beforeRecordAttestations is also overriden to fit the Accountbound logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Nullified\\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\\n * While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier)\\n * We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation.\\n * We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation.\\n * Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier)\\n\\n * - Accountbound (opt-in, with cooldown period)\\n * The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group.\\n * Users can update their attestation's destination by providing a new Hydra-S1 ZK proof \\n * It means the attestation is bound to the source account, stored on an updatable destination account.\\n * When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional.\\n * A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred\\n * One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations.\\n \\n * - Renewable\\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew or update their attestations\\n **/\\n\\ncontract HydraS1AccountboundAttester is\\n IHydraS1AccountboundAttester,\\n HydraS1SimpleAttester,\\n Ownable\\n{\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n uint8 public constant IMPLEMENTATION_VERSION = 4;\\n\\n /*******************************************************\\n Storage layout:\\n 20 slots between HydraS1SimpleAttester and HydraS1AccountboundAttester\\n 1 currently used by Ownable\\n 19 place holders\\n 2O for config\\n 1 currently used\\n 19 place holders\\n 20 for logic\\n 2 currently used\\n 18 place holders\\n *******************************************************/\\n\\n // keeping some space for future config logics\\n uint256[19] private _placeHolderBeforeHydraS1Accountbound;\\n\\n // cooldown durations for each groupIndex\\n mapping(uint256 => uint32) internal _cooldownDurations;\\n\\n // keeping some space for future config logics\\n uint256[19] private _placeHoldersHydraS1AccountboundConfig;\\n\\n mapping(uint256 => uint32) internal _nullifiersCooldownStart;\\n mapping(uint256 => uint16) internal _nullifiersBurnCount;\\n\\n // keeping some space for future config logics\\n uint256[18] private _placeHoldersHydraS1AccountboundLogic;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first attestation collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last attestation collection in which the attester is supposed to record\\n * @param owner Address of attester's owner\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n address owner\\n )\\n HydraS1SimpleAttester(\\n attestationsRegistryAddress,\\n hydraS1VerifierAddress,\\n availableRootsRegistryAddress,\\n commitmentMapperAddress,\\n collectionIdFirst,\\n collectionIdLast\\n )\\n {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Returns the actual attestations constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark public input as well as snark proof\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual override(IAttester, HydraS1SimpleAttester) returns (Attestation[] memory) {\\n Attestation[] memory attestations = super.buildAttestations(request, proofData);\\n\\n uint256 nullifier = proofData._getNullifier();\\n attestations[0].extraData = abi.encode(\\n attestations[0].extraData, // nullifier, from HydraS1 Simple\\n _getNextBurnCount(nullifier, attestations[0].owner) // BurnCount\\n );\\n\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if nullifier already used, not a renewal, and nullifier on cooldown.\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n uint256 nullifier = proofData._getNullifier();\\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\\n\\n HydraS1Claim memory claim = request._claim();\\n\\n // check if the nullifier has already been used previously, if so it may be on cooldown\\n if (\\n previousNullifierDestination != address(0) &&\\n previousNullifierDestination != claim.destination\\n ) {\\n uint32 cooldownDuration = _getCooldownDurationForGroupIndex(claim.groupProperties.groupIndex);\\n if (cooldownDuration == 0) {\\n revert CooldownDurationNotSetForGroupIndex(claim.groupProperties.groupIndex);\\n }\\n if (_isOnCooldown(nullifier, cooldownDuration)) {\\n uint16 burnCount = _getNullifierBurnCount(nullifier);\\n revert NullifierOnCooldown(\\n nullifier,\\n previousNullifierDestination,\\n burnCount,\\n cooldownDuration\\n );\\n }\\n\\n // Delete the old Attestation linked to the nullifier before recording the new one (accountbound feature)\\n _deletePreviousAttestation(claim, previousNullifierDestination);\\n\\n _setNullifierOnCooldownAndIncrementBurnCount(nullifier);\\n }\\n _setDestinationForNullifier(nullifier, request.destination);\\n }\\n\\n /*******************************************************\\n LOGIC FUNCTIONS RELATED TO ACCOUNTBOUND FEATURE\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the burnCount of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16) {\\n return _getNullifierBurnCount(nullifier);\\n }\\n\\n /**\\n * @dev Getter, returns the cooldown start of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32) {\\n return _getNullifierCooldownStart(nullifier);\\n }\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external pure override(HydraS1SimpleAttester, IHydraS1AccountboundAttester) returns (uint256) {\\n (uint256 nullifier, ) = abi.decode(extraData, (uint256, uint16));\\n\\n return nullifier;\\n }\\n\\n /**\\n * @dev Returns the burn count for a given extraData\\n * @param extraData bytes where the burnCount is encoded\\n */\\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16) {\\n (, uint16 burnCount) = abi.decode(extraData, (uint256, uint16));\\n\\n return burnCount;\\n }\\n\\n /**\\n * @dev Checks if a nullifier is on cooldown\\n * @param nullifier user nullifier\\n * @param cooldownDuration waiting time before the user can change its badge destination\\n */\\n function _isOnCooldown(uint256 nullifier, uint32 cooldownDuration) internal view returns (bool) {\\n return _getNullifierCooldownStart(nullifier) + cooldownDuration > block.timestamp;\\n }\\n\\n /**\\n * @dev Delete the previous attestation created with this nullifier\\n * @param claim user claim\\n * @param previousNullifierDestination previous destination chosen for this user nullifier\\n */\\n function _deletePreviousAttestation(\\n HydraS1Claim memory claim,\\n address previousNullifierDestination\\n ) internal {\\n address[] memory attestationOwners = new address[](1);\\n uint256[] memory attestationCollectionIds = new uint256[](1);\\n\\n attestationOwners[0] = previousNullifierDestination;\\n attestationCollectionIds[0] = AUTHORIZED_COLLECTION_ID_FIRST + claim.groupProperties.groupIndex;\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n }\\n\\n function _setNullifierOnCooldownAndIncrementBurnCount(uint256 nullifier) internal {\\n _nullifiersCooldownStart[nullifier] = uint32(block.timestamp);\\n _nullifiersBurnCount[nullifier] += 1;\\n emit NullifierSetOnCooldown(nullifier, _nullifiersBurnCount[nullifier]);\\n }\\n\\n function _getNullifierCooldownStart(uint256 nullifier) internal view returns (uint32) {\\n return _nullifiersCooldownStart[nullifier];\\n }\\n\\n function _getNullifierBurnCount(uint256 nullifier) internal view returns (uint16) {\\n return _nullifiersBurnCount[nullifier];\\n }\\n\\n /**\\n * @dev returns burn count or burn count + 1 if new burn will happen\\n * @param nullifier user nullifier\\n * @param claimDestination destination referenced in the user claim\\n */\\n function _getNextBurnCount(\\n uint256 nullifier,\\n address claimDestination\\n ) public view virtual returns (uint16) {\\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\\n uint16 burnCount = _getNullifierBurnCount(nullifier);\\n // If the attestation is minted on a new destination address\\n // the burnCount that will be encoded in the extraData of the Attestation should be incremented\\n if (\\n previousNullifierDestination != address(0) && previousNullifierDestination != claimDestination\\n ) {\\n burnCount += 1;\\n }\\n return burnCount;\\n }\\n\\n /*******************************************************\\n GROUP CONFIGURATION LOGIC\\n *******************************************************/\\n\\n /**\\n * @dev Setter, sets the cooldown duration of a groupIndex\\n * @notice set to 0 to deactivate the accountbound feature for this group\\n * @param groupIndex internal collection id\\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\\n **/\\n function setCooldownDurationForGroupIndex(\\n uint256 groupIndex,\\n uint32 cooldownDuration\\n ) external onlyOwner {\\n _cooldownDurations[groupIndex] = cooldownDuration;\\n emit CooldownDurationSetForGroupIndex(groupIndex, cooldownDuration);\\n }\\n\\n /**\\n * @dev Getter, get the cooldown duration of a groupIndex\\n * @notice returns 0 when the accountbound feature is deactivated for this group\\n * @param groupIndex internal collection id\\n **/\\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32) {\\n return _getCooldownDurationForGroupIndex(groupIndex);\\n }\\n\\n // = 0 means that the accountbound feature is deactivated for this group\\n function _getCooldownDurationForGroupIndex(uint256 groupIndex) internal view returns (uint32) {\\n return _cooldownDurations[groupIndex];\\n }\\n}\\n\",\"keccak256\":\"0x4c391f4bbfdd1b22039fdc7b43f12d7933deca89cc6ae9e5a2b5afa8c427762c\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\\nimport {IHydraS1Base} from './base/IHydraS1Base.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Nullified\\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * nullifier = hash(sourceSecret, externalNullifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - Renewable\\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew their attestations\\n **/\\n\\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n /*******************************************************\\n Storage layout:\\n 20 slots for HydraS1\\n 1 slot used\\n 19 place holders\\n *******************************************************/\\n\\n mapping(uint256 => address) internal _nullifiersDestinations;\\n\\n // keeping some space for future\\n uint256[19] private _placeHoldersHydraS1Simple;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n uint256 nullifier = proofData._getNullifier();\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n abi.encode(nullifier)\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if nullifier already used and not a renewal (e.g destination different that last)\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n // we get the nullifier used from the snark input in the data provided\\n uint256 nullifier = proofData._getNullifier();\\n address currentDestination = _getDestinationOfNullifier(nullifier);\\n\\n if (currentDestination != address(0) && currentDestination != request.destination) {\\n revert NullifierUsed(nullifier);\\n }\\n\\n _setDestinationForNullifier(nullifier, request.destination);\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the external nullifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose externalNullifier = hash(attesterAddress, claim.GroupId)\\n * Creates one nullifier per group, per user and makes sure no collision with other attester's nullifiers\\n **/\\n function _getExternalNullifierOfClaim(\\n HydraS1Claim memory claim\\n ) internal view override returns (uint256) {\\n uint256 externalNullifier = _encodeInSnarkField(\\n address(this),\\n claim.groupProperties.groupIndex\\n );\\n return externalNullifier;\\n }\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external pure virtual override(IHydraS1Base, HydraS1Base) returns (uint256) {\\n return abi.decode(extraData, (uint256));\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getDestinationOfNullifier(uint256 nullifier) external view override returns (address) {\\n return _getDestinationOfNullifier(nullifier);\\n }\\n\\n function _setDestinationForNullifier(uint256 nullifier, address destination) internal virtual {\\n _nullifiersDestinations[nullifier] = destination;\\n emit NullifierDestinationUpdated(nullifier, destination);\\n }\\n\\n function _getDestinationOfNullifier(uint256 nullifier) internal view returns (address) {\\n return _nullifiersDestinations[nullifier];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x7bb2f154f8b33d4c536ebe7828baeb25853d9c288d85b75f0f9d4c3a8e01e735\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Attester} from '../../../core/Attester.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n *\\n */\\nabstract contract HydraS1Base is IHydraS1Base, Attester, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the nullifier from an attestation extraData\\n * @dev Getter of a nullifier encoded in extraData\\n * @notice Must be implemented by the inheriting contracts\\n * @param extraData extraData where nullifier can be encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external view virtual returns (uint256);\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the external nullifier from a user request\\n * so it can be checked against snark input\\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n *\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of external nullifiers\\n *\\n * Do they get one external nullifier per claim?\\n * Do they get 2 external nullifiers per claim?\\n * Do they get 1 external nullifier per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getExternalNullifierOfClaim(\\n HydraS1Claim memory claim\\n ) internal view virtual returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(\\n HydraS1Claim memory claim,\\n HydraS1ProofInput memory input\\n ) internal view virtual {\\n if (input.accountsTreeValue != claim.groupId) {\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n }\\n\\n if (input.isStrict == claim.groupProperties.isScore) {\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n }\\n\\n if (input.destination != claim.destination) {\\n revert DestinationMismatch(claim.destination, input.destination);\\n }\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot)) {\\n revert RegistryRootMismatch(input.registryRoot);\\n }\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n ) {\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n }\\n\\n uint256 externalNullifier = _getExternalNullifierOfClaim(claim);\\n\\n if (input.externalNullifier != externalNullifier) {\\n revert ExternalNullifierMismatch(externalNullifier, input.externalNullifier);\\n }\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(uint256 /*errorCode*/) {\\n revert InvalidGroth16Proof('');\\n } catch (bytes memory /*lowLevelData*/) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0x8614a04a2a58649b4434fab39ca30e3ff0d94d09998355dbd9fa5bf762b3c845\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Interface\\n * @author Sismo\\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n **/\\ninterface IHydraS1Base is IAttester {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error ExternalNullifierMismatch(uint256 expectedExternalNullifier, uint256 externalNullifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n function getNullifierFromExtraData(bytes memory extraData) external view returns (uint256);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x65b9966e5cf43975edb64c742057153058ee31bea1beadf4456577e9d5dbc76d\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1AccountboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from '././IHydraS1SimpleAttester.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Interface\\n * @author Sismo\\n * @notice Interface of the HydraS1AccountboundAttester contract which inherits from the errors, events and methods specific to the HydraS1SimpleAttester interface.\\n **/\\ninterface IHydraS1AccountboundAttester is IHydraS1SimpleAttester {\\n /**\\n * @dev Event emitted when the duration of the cooldown duration for a group index (internal collection id) has been set\\n * @param groupIndex internal collection id\\n * @param cooldownDuration the duration of the cooldown period\\n **/\\n event CooldownDurationSetForGroupIndex(uint256 indexed groupIndex, uint32 cooldownDuration);\\n\\n /**\\n * @dev Event emitted when the nullifier has been set on cooldown. This happens when the\\n * attestation destination of a nullifier has been changed\\n * @param nullifier user nullifier\\n * @param burnCount the number of times the attestation destination of a nullifier has been changed\\n **/\\n event NullifierSetOnCooldown(uint256 indexed nullifier, uint16 burnCount);\\n\\n /**\\n * @dev Error when the nullifier is on cooldown. The user have to wait the cooldownDuration\\n * before being able to change again the destination address.\\n **/\\n error NullifierOnCooldown(\\n uint256 nullifier,\\n address destination,\\n uint16 burnCount,\\n uint32 cooldownStart\\n );\\n\\n /**\\n * @dev Error when the cooldown duration for a given groupIndex is equal to zero.\\n * The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.\\n **/\\n error CooldownDurationNotSetForGroupIndex(uint256 groupIndex);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(bytes memory extraData) external pure returns (uint256);\\n\\n /**\\n * @dev Returns the burn count for a given extraData\\n * @param extraData bytes where the burnCount is encoded\\n */\\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16);\\n\\n /**\\n * @dev Getter, returns the cooldown start of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32);\\n\\n /**\\n * @dev Getter, returns the burnCount of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16);\\n\\n /**\\n * @dev Setter, sets the cooldown duration of a groupIndex\\n * @param groupIndex internal collection id\\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\\n **/\\n function setCooldownDurationForGroupIndex(uint256 groupIndex, uint32 cooldownDuration) external;\\n\\n /*/**\\n * @dev Getter, get the cooldown duration of a groupIndex\\n * @notice returns 0 when the accountbound feature is deactivated for this group\\n * @param groupIndex internal collection id\\n **/\\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32);\\n}\\n\",\"keccak256\":\"0x69293ce8ee200e3ce8b34478b5dde62d934e32c4f82d173314a4ed72731b3663\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Interface\\n * @author Sismo\\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\\n **/\\ninterface IHydraS1SimpleAttester is IHydraS1Base {\\n /**\\n * @dev Error when the nullifier is already used for a destination address\\n **/\\n error NullifierUsed(uint256 nullifier);\\n\\n /**\\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\\n **/\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n /**\\n * @dev Event emitted when the nullifier is associated to a destination address.\\n **/\\n event NullifierDestinationUpdated(uint256 nullifier, address newOwner);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getDestinationOfNullifier(uint256 nullifier) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x8222c187e8314c931121c7632965316f079322b076501a5443d3102a0891a8d5\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // externalNullifier\\n // nullifier\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 externalNullifier;\\n uint256 nullifier;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getNullifier(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(\\n HydraS1ProofData memory self\\n )\\n internal\\n pure\\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[10] memory)\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(\\n HydraS1ProofData memory self\\n ) internal pure returns (uint256[2] memory) {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(\\n HydraS1ProofData memory self\\n ) internal pure returns (uint256) {\\n return self.input[5];\\n }\\n\\n function _getNullifier(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getNullifier(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 nullifier = uint256(_getNullifier(snarkProofData));\\n return nullifier;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(\\n bytes memory encodedProperties\\n ) internal pure returns (uint256) {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0xa484f046e44f6c77177ba6f165573dc3ee90680a057dff7d3de46d67a29c462a\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n address[] memory attestationOwners = new address[](collectionIds.length);\\n\\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\\n\\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n // fetch attestations from the registry\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationOwners[i] = attestationsOwner;\\n attestationCollectionIds[i] = collectionIds[i];\\n\\n attestations[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestations, proofData);\\n\\n _beforeDeleteAttestations(attestations, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n\\n _afterDeleteAttestations(attestations, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestations[i]);\\n }\\n return attestations;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x7743f02ed07e1b40a2ff45f5a45b5fe87d765326cce3528676cbd36c3d08ba37\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0x2d5faf5df56dfe1294202e89180846a1d4a5f938699619ee73b60c7314a97dfe\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3467998cbdb82b0c64aa8627efc5893d2b369f73e66e5d1095305e4609593cc5\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address ownerAddress,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0x1b6ab7a4ba266f3da2c7f6ba3de93e3ab89f389dbd6db14514b43cbdcbe9fe09\",\"license\":\"MIT\"},\"contracts/periphery/utils/FrontendLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {HydraS1AccountboundAttester} from '../../attesters/hydra-s1/HydraS1AccountboundAttester.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\ncontract FrontendLib {\\n address private immutable _hydraS1AccountboundAttester;\\n\\n constructor(address hydraS1AccountboundAttester) {\\n _hydraS1AccountboundAttester = hydraS1AccountboundAttester;\\n }\\n\\n function getHydraS1AccountboundAttesterDestinationOfNullifierBatch(\\n uint256[] calldata nullifiers\\n ) external view returns (address[] memory) {\\n address[] memory destinations = new address[](nullifiers.length);\\n\\n for (uint256 i = 0; i < nullifiers.length; i++) {\\n destinations[i] = HydraS1AccountboundAttester(_hydraS1AccountboundAttester)\\n .getDestinationOfNullifier(nullifiers[i]);\\n }\\n\\n return destinations;\\n }\\n}\\n\",\"keccak256\":\"0xb806a4205e9adce561c01e5b0aaf7ee23589308fd7c660d1cd3c5aed05e1fc75\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5e882d3091e816f1286837eef92ae17737abf66fdeece1282b752f27ba18492b\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0xcb419cf389baad6f38de28625718f64f551d2669339c1b4e1887e11d62484469\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b5060405161039d38038061039d83398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161031361008a600039600060af01526103136000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063263c310314610030575b600080fd5b61004361003e366004610198565b610059565b604051610050919061020d565b60405180910390f35b606060008267ffffffffffffffff8111156100765761007661025a565b60405190808252806020026020018201604052801561009f578160200160208202803683370190505b50905060005b83811015610190577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663063599db8686848181106100ee576100ee610270565b905060200201356040518263ffffffff1660e01b815260040161011391815260200190565b602060405180830381865afa158015610130573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101549190610286565b82828151811061016657610166610270565b6001600160a01b039092166020928302919091019091015280610188816102b6565b9150506100a5565b509392505050565b600080602083850312156101ab57600080fd5b823567ffffffffffffffff808211156101c357600080fd5b818501915085601f8301126101d757600080fd5b8135818111156101e657600080fd5b8660208260051b85010111156101fb57600080fd5b60209290920196919550909350505050565b6020808252825182820181905260009190848201906040850190845b8181101561024e5783516001600160a01b031683529284019291840191600101610229565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60006020828403121561029857600080fd5b81516001600160a01b03811681146102af57600080fd5b9392505050565b6000600182016102d657634e487b7160e01b600052601160045260246000fd5b506001019056fea2646970667358221220463be86b8426e254f33e5e69d8fd5b72286b4caa30a89e9e8584061e169b17fb64736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063263c310314610030575b600080fd5b61004361003e366004610198565b610059565b604051610050919061020d565b60405180910390f35b606060008267ffffffffffffffff8111156100765761007661025a565b60405190808252806020026020018201604052801561009f578160200160208202803683370190505b50905060005b83811015610190577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663063599db8686848181106100ee576100ee610270565b905060200201356040518263ffffffff1660e01b815260040161011391815260200190565b602060405180830381865afa158015610130573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101549190610286565b82828151811061016657610166610270565b6001600160a01b039092166020928302919091019091015280610188816102b6565b9150506100a5565b509392505050565b600080602083850312156101ab57600080fd5b823567ffffffffffffffff808211156101c357600080fd5b818501915085601f8301126101d757600080fd5b8135818111156101e657600080fd5b8660208260051b85010111156101fb57600080fd5b60209290920196919550909350505050565b6020808252825182820181905260009190848201906040850190845b8181101561024e5783516001600160a01b031683529284019291840191600101610229565b50909695505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60006020828403121561029857600080fd5b81516001600160a01b03811681146102af57600080fd5b9392505050565b6000600182016102d657634e487b7160e01b600052601160045260246000fd5b506001019056fea2646970667358221220463be86b8426e254f33e5e69d8fd5b72286b4caa30a89e9e8584061e169b17fb64736f6c634300080e0033", - "devdoc": { - "kind": "dev", - "methods": {}, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/goerli/HydraS1AccountboundAttester.json b/deployments/goerli/HydraS1AccountboundAttester.json deleted file mode 100644 index f60fc61..0000000 --- a/deployments/goerli/HydraS1AccountboundAttester.json +++ /dev/null @@ -1,1378 +0,0 @@ -{ - "address": "0x89d80C9E65fd1aC8970B78A4F17E2e772030C1cB", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "hydraS1VerifierAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "availableRootsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "AccountsTreeValueMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "claimLength", - "type": "uint256" - } - ], - "name": "ClaimsLengthDifferentThanOne", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentMapperPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupIndex", - "type": "uint256" - } - ], - "name": "CooldownDurationNotSetForGroupIndex", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedExternalNullifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "externalNullifier", - "type": "uint256" - } - ], - "name": "ExternalNullifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - }, - { - "internalType": "uint16", - "name": "burnCount", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "cooldownStart", - "type": "uint32" - } - ], - "name": "NullifierOnCooldown", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - } - ], - "name": "NullifierUsed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "inputRoot", - "type": "uint256" - } - ], - "name": "RegistryRootMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "groupIndex", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "cooldownDuration", - "type": "uint32" - } - ], - "name": "CooldownDurationSetForGroupIndex", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "NullifierDestinationUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "burnCount", - "type": "uint16" - } - ], - "name": "NullifierSetOnCooldown", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "internalType": "address", - "name": "claimDestination", - "type": "address" - } - ], - "name": "_getNextBurnCount", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAvailableRootsRegistry", - "outputs": [ - { - "internalType": "contract IAvailableRootsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "name": "getBurnCountFromExtraData", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentMapperRegistry", - "outputs": [ - { - "internalType": "contract ICommitmentMapperRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupIndex", - "type": "uint256" - } - ], - "name": "getCooldownDurationForGroupIndex", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - } - ], - "name": "getDestinationOfNullifier", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - } - ], - "name": "getNullifierBurnCount", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - } - ], - "name": "getNullifierCooldownStart", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "name": "getNullifierFromExtraData", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract HydraS1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupIndex", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "cooldownDuration", - "type": "uint32" - } - ], - "name": "setCooldownDurationForGroupIndex", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x895248c28d056d5e4abe4414272929754e90e034ec00f3561556b9333ef326a5", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x5Ea50e074419FC193229D350474fE8878a800B7A", - "transactionIndex": 48, - "gasUsed": "2322582", - "logsBloom": "0x00000000000300000000000000020000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000020000000000000100000800002000000000000000000000000000400000000000000000000000000000000000000000000080000000000000000000000000000000000000000000800400000000000000000000000000000000000000000000000000000000000000040000000000000000400000000000000020000000000000000000000000000000000000000000000000000000008000000000", - "blockHash": "0x62cbc20f8640e90e3acdd959242fc69573a432f58dad7bd9506acfcc8a824b7e", - "transactionHash": "0x895248c28d056d5e4abe4414272929754e90e034ec00f3561556b9333ef326a5", - "logs": [ - { - "transactionIndex": 48, - "blockNumber": 8093127, - "transactionHash": "0x895248c28d056d5e4abe4414272929754e90e034ec00f3561556b9333ef326a5", - "address": "0x5Ea50e074419FC193229D350474fE8878a800B7A", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "data": "0x", - "logIndex": 116, - "blockHash": "0x62cbc20f8640e90e3acdd959242fc69573a432f58dad7bd9506acfcc8a824b7e" - }, - { - "transactionIndex": 48, - "blockNumber": 8093127, - "transactionHash": "0x895248c28d056d5e4abe4414272929754e90e034ec00f3561556b9333ef326a5", - "address": "0x5Ea50e074419FC193229D350474fE8878a800B7A", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954" - ], - "data": "0x", - "logIndex": 117, - "blockHash": "0x62cbc20f8640e90e3acdd959242fc69573a432f58dad7bd9506acfcc8a824b7e" - }, - { - "transactionIndex": 48, - "blockNumber": 8093127, - "transactionHash": "0x895248c28d056d5e4abe4414272929754e90e034ec00f3561556b9333ef326a5", - "address": "0x5Ea50e074419FC193229D350474fE8878a800B7A", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000004", - "logIndex": 118, - "blockHash": "0x62cbc20f8640e90e3acdd959242fc69573a432f58dad7bd9506acfcc8a824b7e" - } - ], - "blockNumber": 8093127, - "cumulativeGasUsed": "8897274", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf85BA0afA375495eE625910Db61b6b1406756234", - "0xe1bFE993cF8dB9a3214Cc77fD68194Ac534078b4", - "0xdDa4c8d2933dAA21Aac75B88fF59725725ba813F", - "0x0844662f25817B735BC9B6d9D11995F1A6c4dCB1", - "10000001", - "20000000", - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954" - ], - "numDeployments": 5, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"hydraS1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"availableRootsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"AccountsTreeValueMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimLength\",\"type\":\"uint256\"}],\"name\":\"ClaimsLengthDifferentThanOne\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentMapperPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"}],\"name\":\"CooldownDurationNotSetForGroupIndex\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedExternalNullifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"externalNullifier\",\"type\":\"uint256\"}],\"name\":\"ExternalNullifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"burnCount\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"cooldownStart\",\"type\":\"uint32\"}],\"name\":\"NullifierOnCooldown\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"NullifierUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inputRoot\",\"type\":\"uint256\"}],\"name\":\"RegistryRootMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"cooldownDuration\",\"type\":\"uint32\"}],\"name\":\"CooldownDurationSetForGroupIndex\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"NullifierDestinationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"burnCount\",\"type\":\"uint16\"}],\"name\":\"NullifierSetOnCooldown\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"claimDestination\",\"type\":\"address\"}],\"name\":\"_getNextBurnCount\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAvailableRootsRegistry\",\"outputs\":[{\"internalType\":\"contract IAvailableRootsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"getBurnCountFromExtraData\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentMapperRegistry\",\"outputs\":[{\"internalType\":\"contract ICommitmentMapperRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"}],\"name\":\"getCooldownDurationForGroupIndex\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfNullifier\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"getNullifierBurnCount\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"getNullifierCooldownStart\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"getNullifierFromExtraData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract HydraS1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"cooldownDuration\",\"type\":\"uint32\"}],\"name\":\"setCooldownDurationForGroupIndex\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"errors\":{\"CollectionIdOutOfBound(uint256)\":[{\"details\":\"Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST*\"}],\"CooldownDurationNotSetForGroupIndex(uint256)\":[{\"details\":\"Error when the cooldown duration for a given groupIndex is equal to zero. The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.*\"}],\"NullifierOnCooldown(uint256,address,uint16,uint32)\":[{\"details\":\"Error when the nullifier is on cooldown. The user have to wait the cooldownDuration before being able to change again the destination address.*\"}],\"NullifierUsed(uint256)\":[{\"details\":\"Error when the nullifier is already used for a destination address*\"}]},\"kind\":\"dev\",\"methods\":{\"_getNextBurnCount(uint256,address)\":{\"details\":\"returns burn count or burn count + 1 if new burn will happen\",\"params\":{\"claimDestination\":\"destination referenced in the user claim\",\"nullifier\":\"user nullifier\"}},\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns the actual attestations constructed from the user request\",\"params\":{\"proofData\":\"snark public input as well as snark proof\",\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"availableRootsRegistryAddress\":\"Registry storing the available groups for this attester (e.g roots of registry merkle trees)\",\"collectionIdFirst\":\"Id of the first attestation collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last attestation collection in which the attester is supposed to record\",\"commitmentMapperAddress\":\"commitment mapper's public key registry\",\"hydraS1VerifierAddress\":\"ZK Snark Hydra-S1 Verifier contract\",\"owner\":\"Address of attester's owner\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getAvailableRootsRegistry()\":{\"details\":\"Getter of Roots Registry Contract\"},\"getBurnCountFromExtraData(bytes)\":{\"details\":\"Returns the burn count for a given extraData\",\"params\":{\"extraData\":\"bytes where the burnCount is encoded\"}},\"getCommitmentMapperRegistry()\":{\"details\":\"Getter of Commitment Mapper Registry contract\"},\"getCooldownDurationForGroupIndex(uint256)\":{\"details\":\"Getter, get the cooldown duration of a groupIndex\",\"params\":{\"groupIndex\":\"internal collection id*\"}},\"getDestinationOfNullifier(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a nullifier\",\"params\":{\"nullifier\":\"nullifier used*\"}},\"getNullifierBurnCount(uint256)\":{\"details\":\"Getter, returns the burnCount of a nullifier\",\"params\":{\"nullifier\":\"nullifier used*\"}},\"getNullifierCooldownStart(uint256)\":{\"details\":\"Getter, returns the cooldown start of a nullifier\",\"params\":{\"nullifier\":\"nullifier used*\"}},\"getNullifierFromExtraData(bytes)\":{\"details\":\"returns the nullifier for a given extraData\",\"params\":{\"extraData\":\"bytes where the nullifier is encoded\"}},\"getVerifier()\":{\"details\":\"Getter of Hydra-S1 Verifier contract\"},\"initialize(address)\":{\"details\":\"Initialize function, to be called by the proxy delegating calls to this implementation\",\"params\":{\"ownerAddress\":\"Owner of the contract, has the right to authorize/unauthorize attestations issuers\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setCooldownDurationForGroupIndex(uint256,uint32)\":{\"details\":\"Setter, sets the cooldown duration of a groupIndex\",\"params\":{\"cooldownDuration\":\"cooldown duration we want to set for the groupIndex*\",\"groupIndex\":\"internal collection id\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Hydra-S1 Accountbound Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getCooldownDurationForGroupIndex(uint256)\":{\"notice\":\"returns 0 when the accountbound feature is deactivated for this group\"},\"initialize(address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"},\"setCooldownDurationForGroupIndex(uint256,uint32)\":{\"notice\":\"set to 0 to deactivate the accountbound feature for this group\"}},\"notice\":\"This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic. Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic. However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation. The _beforeRecordAttestations is also overriden to fit the Accountbound logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Nullified Each source account gets one nullifier per claim (i.e only one attestation per source account per claim) While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier) We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation. We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation. Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier) - Accountbound (opt-in, with cooldown period) The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group. Users can update their attestation's destination by providing a new Hydra-S1 ZK proof It means the attestation is bound to the source account, stored on an updatable destination account. When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional. A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations. - Renewable A nullifier can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol\":\"HydraS1AccountboundAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [8609986746108439658545470593166889256314951959466775818870246174320018498804,\\n 6848251127850009101372611262053374737897586140140607384018397707035108265914],\\n [21367916863936594568281095443965096905143705300114190558130516981138584550504,\\n 13327705762185115653848159709412003423932761899188342359583872691135383932883]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 19965766170734310004645394427613286415565755728797065894668054116047682895204,\\n 6952067612339183672227137101423582097916038093373585908267153974352032944482\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 13987716160490730015463796942940452666334097189904948795214986996497499925899,\\n 5336810094802209074340875836312868429276540870324469349093948627126061524544\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 14931593253473978964215343699995811275378324235306358485461293343370969283966,\\n 564306919152089917957316877787764763278299990971316475606280877961553231205\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11591267743733991434114686002448165336885445656808796470854638278338319268343,\\n 11495219763417990955889652410266075210402006084183208750635660647824890013350\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 8183184532870222270700473518157259944911700429689031755853536692005688965081,\\n 9121077094104828462137861111631978599019724423614716723152060153405564278301\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 4314095526093128699362232919686741372014146055311239687202926853002748112330,\\n 11665330391505820654128458332883010598817535082070674418723503440883598640597\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 18925967077785550270509493111690046951994174908254476036944536825999614778001,\\n 4990629719417206796668074534812314525340851981015724652256935997545282642849\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x120f0b311a61cabc9d42ef740c19e5f20b4c8ba400d9a6378e33c76dd54f5c42\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\n\\nimport {IHydraS1AccountboundAttester} from './interfaces/IHydraS1AccountboundAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from '../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra-S1\\nimport {HydraS1SimpleAttester, IAttester, HydraS1Lib, HydraS1ProofData, HydraS1Claim} from './HydraS1SimpleAttester.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic.\\n * Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic.\\n * However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation.\\n * The _beforeRecordAttestations is also overriden to fit the Accountbound logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Nullified\\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\\n * While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier)\\n * We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation.\\n * We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation.\\n * Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier)\\n\\n * - Accountbound (opt-in, with cooldown period)\\n * The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group.\\n * Users can update their attestation's destination by providing a new Hydra-S1 ZK proof \\n * It means the attestation is bound to the source account, stored on an updatable destination account.\\n * When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional.\\n * A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred\\n * One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations.\\n \\n * - Renewable\\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew or update their attestations\\n **/\\n\\ncontract HydraS1AccountboundAttester is\\n IHydraS1AccountboundAttester,\\n HydraS1SimpleAttester,\\n Ownable\\n{\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n uint8 public constant IMPLEMENTATION_VERSION = 4;\\n\\n /*******************************************************\\n Storage layout:\\n 20 slots between HydraS1SimpleAttester and HydraS1AccountboundAttester\\n 1 currently used by Ownable\\n 19 place holders\\n 2O for config\\n 1 currently used\\n 19 place holders\\n 20 for logic\\n 2 currently used\\n 18 place holders\\n *******************************************************/\\n\\n // keeping some space for future config logics\\n uint256[19] private _placeHolderBeforeHydraS1Accountbound;\\n\\n // cooldown durations for each groupIndex\\n mapping(uint256 => uint32) internal _cooldownDurations;\\n\\n // keeping some space for future config logics\\n uint256[19] private _placeHoldersHydraS1AccountboundConfig;\\n\\n mapping(uint256 => uint32) internal _nullifiersCooldownStart;\\n mapping(uint256 => uint16) internal _nullifiersBurnCount;\\n\\n // keeping some space for future config logics\\n uint256[18] private _placeHoldersHydraS1AccountboundLogic;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first attestation collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last attestation collection in which the attester is supposed to record\\n * @param owner Address of attester's owner\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n address owner\\n )\\n HydraS1SimpleAttester(\\n attestationsRegistryAddress,\\n hydraS1VerifierAddress,\\n availableRootsRegistryAddress,\\n commitmentMapperAddress,\\n collectionIdFirst,\\n collectionIdLast\\n )\\n {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Returns the actual attestations constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark public input as well as snark proof\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual override(IAttester, HydraS1SimpleAttester) returns (Attestation[] memory) {\\n Attestation[] memory attestations = super.buildAttestations(request, proofData);\\n\\n uint256 nullifier = proofData._getNullifier();\\n attestations[0].extraData = abi.encode(\\n attestations[0].extraData, // nullifier, from HydraS1 Simple\\n _getNextBurnCount(nullifier, attestations[0].owner) // BurnCount\\n );\\n\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if nullifier already used, not a renewal, and nullifier on cooldown.\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n uint256 nullifier = proofData._getNullifier();\\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\\n\\n HydraS1Claim memory claim = request._claim();\\n\\n // check if the nullifier has already been used previously, if so it may be on cooldown\\n if (\\n previousNullifierDestination != address(0) &&\\n previousNullifierDestination != claim.destination\\n ) {\\n uint32 cooldownDuration = _getCooldownDurationForGroupIndex(claim.groupProperties.groupIndex);\\n if (cooldownDuration == 0) {\\n revert CooldownDurationNotSetForGroupIndex(claim.groupProperties.groupIndex);\\n }\\n if (_isOnCooldown(nullifier, cooldownDuration)) {\\n uint16 burnCount = _getNullifierBurnCount(nullifier);\\n revert NullifierOnCooldown(\\n nullifier,\\n previousNullifierDestination,\\n burnCount,\\n cooldownDuration\\n );\\n }\\n\\n // Delete the old Attestation linked to the nullifier before recording the new one (accountbound feature)\\n _deletePreviousAttestation(claim, previousNullifierDestination);\\n\\n _setNullifierOnCooldownAndIncrementBurnCount(nullifier);\\n }\\n _setDestinationForNullifier(nullifier, request.destination);\\n }\\n\\n /*******************************************************\\n LOGIC FUNCTIONS RELATED TO ACCOUNTBOUND FEATURE\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the burnCount of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16) {\\n return _getNullifierBurnCount(nullifier);\\n }\\n\\n /**\\n * @dev Getter, returns the cooldown start of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32) {\\n return _getNullifierCooldownStart(nullifier);\\n }\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external pure override(HydraS1SimpleAttester, IHydraS1AccountboundAttester) returns (uint256) {\\n (uint256 nullifier, ) = abi.decode(extraData, (uint256, uint16));\\n\\n return nullifier;\\n }\\n\\n /**\\n * @dev Returns the burn count for a given extraData\\n * @param extraData bytes where the burnCount is encoded\\n */\\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16) {\\n (, uint16 burnCount) = abi.decode(extraData, (uint256, uint16));\\n\\n return burnCount;\\n }\\n\\n /**\\n * @dev Checks if a nullifier is on cooldown\\n * @param nullifier user nullifier\\n * @param cooldownDuration waiting time before the user can change its badge destination\\n */\\n function _isOnCooldown(uint256 nullifier, uint32 cooldownDuration) internal view returns (bool) {\\n return _getNullifierCooldownStart(nullifier) + cooldownDuration > block.timestamp;\\n }\\n\\n /**\\n * @dev Delete the previous attestation created with this nullifier\\n * @param claim user claim\\n * @param previousNullifierDestination previous destination chosen for this user nullifier\\n */\\n function _deletePreviousAttestation(\\n HydraS1Claim memory claim,\\n address previousNullifierDestination\\n ) internal {\\n address[] memory attestationOwners = new address[](1);\\n uint256[] memory attestationCollectionIds = new uint256[](1);\\n\\n attestationOwners[0] = previousNullifierDestination;\\n attestationCollectionIds[0] = AUTHORIZED_COLLECTION_ID_FIRST + claim.groupProperties.groupIndex;\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n }\\n\\n function _setNullifierOnCooldownAndIncrementBurnCount(uint256 nullifier) internal {\\n _nullifiersCooldownStart[nullifier] = uint32(block.timestamp);\\n _nullifiersBurnCount[nullifier] += 1;\\n emit NullifierSetOnCooldown(nullifier, _nullifiersBurnCount[nullifier]);\\n }\\n\\n function _getNullifierCooldownStart(uint256 nullifier) internal view returns (uint32) {\\n return _nullifiersCooldownStart[nullifier];\\n }\\n\\n function _getNullifierBurnCount(uint256 nullifier) internal view returns (uint16) {\\n return _nullifiersBurnCount[nullifier];\\n }\\n\\n /**\\n * @dev returns burn count or burn count + 1 if new burn will happen\\n * @param nullifier user nullifier\\n * @param claimDestination destination referenced in the user claim\\n */\\n function _getNextBurnCount(\\n uint256 nullifier,\\n address claimDestination\\n ) public view virtual returns (uint16) {\\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\\n uint16 burnCount = _getNullifierBurnCount(nullifier);\\n // If the attestation is minted on a new destination address\\n // the burnCount that will be encoded in the extraData of the Attestation should be incremented\\n if (\\n previousNullifierDestination != address(0) && previousNullifierDestination != claimDestination\\n ) {\\n burnCount += 1;\\n }\\n return burnCount;\\n }\\n\\n /*******************************************************\\n GROUP CONFIGURATION LOGIC\\n *******************************************************/\\n\\n /**\\n * @dev Setter, sets the cooldown duration of a groupIndex\\n * @notice set to 0 to deactivate the accountbound feature for this group\\n * @param groupIndex internal collection id\\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\\n **/\\n function setCooldownDurationForGroupIndex(\\n uint256 groupIndex,\\n uint32 cooldownDuration\\n ) external onlyOwner {\\n _cooldownDurations[groupIndex] = cooldownDuration;\\n emit CooldownDurationSetForGroupIndex(groupIndex, cooldownDuration);\\n }\\n\\n /**\\n * @dev Getter, get the cooldown duration of a groupIndex\\n * @notice returns 0 when the accountbound feature is deactivated for this group\\n * @param groupIndex internal collection id\\n **/\\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32) {\\n return _getCooldownDurationForGroupIndex(groupIndex);\\n }\\n\\n // = 0 means that the accountbound feature is deactivated for this group\\n function _getCooldownDurationForGroupIndex(uint256 groupIndex) internal view returns (uint32) {\\n return _cooldownDurations[groupIndex];\\n }\\n}\\n\",\"keccak256\":\"0x4c391f4bbfdd1b22039fdc7b43f12d7933deca89cc6ae9e5a2b5afa8c427762c\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\\nimport {IHydraS1Base} from './base/IHydraS1Base.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Nullified\\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * nullifier = hash(sourceSecret, externalNullifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - Renewable\\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew their attestations\\n **/\\n\\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n /*******************************************************\\n Storage layout:\\n 20 slots for HydraS1\\n 1 slot used\\n 19 place holders\\n *******************************************************/\\n\\n mapping(uint256 => address) internal _nullifiersDestinations;\\n\\n // keeping some space for future\\n uint256[19] private _placeHoldersHydraS1Simple;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n uint256 nullifier = proofData._getNullifier();\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n abi.encode(nullifier)\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if nullifier already used and not a renewal (e.g destination different that last)\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n // we get the nullifier used from the snark input in the data provided\\n uint256 nullifier = proofData._getNullifier();\\n address currentDestination = _getDestinationOfNullifier(nullifier);\\n\\n if (currentDestination != address(0) && currentDestination != request.destination) {\\n revert NullifierUsed(nullifier);\\n }\\n\\n _setDestinationForNullifier(nullifier, request.destination);\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the external nullifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose externalNullifier = hash(attesterAddress, claim.GroupId)\\n * Creates one nullifier per group, per user and makes sure no collision with other attester's nullifiers\\n **/\\n function _getExternalNullifierOfClaim(\\n HydraS1Claim memory claim\\n ) internal view override returns (uint256) {\\n uint256 externalNullifier = _encodeInSnarkField(\\n address(this),\\n claim.groupProperties.groupIndex\\n );\\n return externalNullifier;\\n }\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external pure virtual override(IHydraS1Base, HydraS1Base) returns (uint256) {\\n return abi.decode(extraData, (uint256));\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getDestinationOfNullifier(uint256 nullifier) external view override returns (address) {\\n return _getDestinationOfNullifier(nullifier);\\n }\\n\\n function _setDestinationForNullifier(uint256 nullifier, address destination) internal virtual {\\n _nullifiersDestinations[nullifier] = destination;\\n emit NullifierDestinationUpdated(nullifier, destination);\\n }\\n\\n function _getDestinationOfNullifier(uint256 nullifier) internal view returns (address) {\\n return _nullifiersDestinations[nullifier];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x7bb2f154f8b33d4c536ebe7828baeb25853d9c288d85b75f0f9d4c3a8e01e735\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Attester} from '../../../core/Attester.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n *\\n */\\nabstract contract HydraS1Base is IHydraS1Base, Attester, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the nullifier from an attestation extraData\\n * @dev Getter of a nullifier encoded in extraData\\n * @notice Must be implemented by the inheriting contracts\\n * @param extraData extraData where nullifier can be encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external view virtual returns (uint256);\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the external nullifier from a user request\\n * so it can be checked against snark input\\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n *\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of external nullifiers\\n *\\n * Do they get one external nullifier per claim?\\n * Do they get 2 external nullifiers per claim?\\n * Do they get 1 external nullifier per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getExternalNullifierOfClaim(\\n HydraS1Claim memory claim\\n ) internal view virtual returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(\\n HydraS1Claim memory claim,\\n HydraS1ProofInput memory input\\n ) internal view virtual {\\n if (input.accountsTreeValue != claim.groupId) {\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n }\\n\\n if (input.isStrict == claim.groupProperties.isScore) {\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n }\\n\\n if (input.destination != claim.destination) {\\n revert DestinationMismatch(claim.destination, input.destination);\\n }\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot)) {\\n revert RegistryRootMismatch(input.registryRoot);\\n }\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n ) {\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n }\\n\\n uint256 externalNullifier = _getExternalNullifierOfClaim(claim);\\n\\n if (input.externalNullifier != externalNullifier) {\\n revert ExternalNullifierMismatch(externalNullifier, input.externalNullifier);\\n }\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(uint256 /*errorCode*/) {\\n revert InvalidGroth16Proof('');\\n } catch (bytes memory /*lowLevelData*/) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0x8614a04a2a58649b4434fab39ca30e3ff0d94d09998355dbd9fa5bf762b3c845\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Interface\\n * @author Sismo\\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n **/\\ninterface IHydraS1Base is IAttester {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error ExternalNullifierMismatch(uint256 expectedExternalNullifier, uint256 externalNullifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n function getNullifierFromExtraData(bytes memory extraData) external view returns (uint256);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x65b9966e5cf43975edb64c742057153058ee31bea1beadf4456577e9d5dbc76d\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1AccountboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from '././IHydraS1SimpleAttester.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Interface\\n * @author Sismo\\n * @notice Interface of the HydraS1AccountboundAttester contract which inherits from the errors, events and methods specific to the HydraS1SimpleAttester interface.\\n **/\\ninterface IHydraS1AccountboundAttester is IHydraS1SimpleAttester {\\n /**\\n * @dev Event emitted when the duration of the cooldown duration for a group index (internal collection id) has been set\\n * @param groupIndex internal collection id\\n * @param cooldownDuration the duration of the cooldown period\\n **/\\n event CooldownDurationSetForGroupIndex(uint256 indexed groupIndex, uint32 cooldownDuration);\\n\\n /**\\n * @dev Event emitted when the nullifier has been set on cooldown. This happens when the\\n * attestation destination of a nullifier has been changed\\n * @param nullifier user nullifier\\n * @param burnCount the number of times the attestation destination of a nullifier has been changed\\n **/\\n event NullifierSetOnCooldown(uint256 indexed nullifier, uint16 burnCount);\\n\\n /**\\n * @dev Error when the nullifier is on cooldown. The user have to wait the cooldownDuration\\n * before being able to change again the destination address.\\n **/\\n error NullifierOnCooldown(\\n uint256 nullifier,\\n address destination,\\n uint16 burnCount,\\n uint32 cooldownStart\\n );\\n\\n /**\\n * @dev Error when the cooldown duration for a given groupIndex is equal to zero.\\n * The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.\\n **/\\n error CooldownDurationNotSetForGroupIndex(uint256 groupIndex);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(bytes memory extraData) external pure returns (uint256);\\n\\n /**\\n * @dev Returns the burn count for a given extraData\\n * @param extraData bytes where the burnCount is encoded\\n */\\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16);\\n\\n /**\\n * @dev Getter, returns the cooldown start of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32);\\n\\n /**\\n * @dev Getter, returns the burnCount of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16);\\n\\n /**\\n * @dev Setter, sets the cooldown duration of a groupIndex\\n * @param groupIndex internal collection id\\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\\n **/\\n function setCooldownDurationForGroupIndex(uint256 groupIndex, uint32 cooldownDuration) external;\\n\\n /*/**\\n * @dev Getter, get the cooldown duration of a groupIndex\\n * @notice returns 0 when the accountbound feature is deactivated for this group\\n * @param groupIndex internal collection id\\n **/\\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32);\\n}\\n\",\"keccak256\":\"0x69293ce8ee200e3ce8b34478b5dde62d934e32c4f82d173314a4ed72731b3663\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Interface\\n * @author Sismo\\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\\n **/\\ninterface IHydraS1SimpleAttester is IHydraS1Base {\\n /**\\n * @dev Error when the nullifier is already used for a destination address\\n **/\\n error NullifierUsed(uint256 nullifier);\\n\\n /**\\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\\n **/\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n /**\\n * @dev Event emitted when the nullifier is associated to a destination address.\\n **/\\n event NullifierDestinationUpdated(uint256 nullifier, address newOwner);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getDestinationOfNullifier(uint256 nullifier) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x8222c187e8314c931121c7632965316f079322b076501a5443d3102a0891a8d5\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // externalNullifier\\n // nullifier\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 externalNullifier;\\n uint256 nullifier;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getNullifier(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(\\n HydraS1ProofData memory self\\n )\\n internal\\n pure\\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[10] memory)\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(\\n HydraS1ProofData memory self\\n ) internal pure returns (uint256[2] memory) {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(\\n HydraS1ProofData memory self\\n ) internal pure returns (uint256) {\\n return self.input[5];\\n }\\n\\n function _getNullifier(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getNullifier(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 nullifier = uint256(_getNullifier(snarkProofData));\\n return nullifier;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(\\n bytes memory encodedProperties\\n ) internal pure returns (uint256) {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0xa484f046e44f6c77177ba6f165573dc3ee90680a057dff7d3de46d67a29c462a\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n address[] memory attestationOwners = new address[](collectionIds.length);\\n\\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\\n\\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n // fetch attestations from the registry\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationOwners[i] = attestationsOwner;\\n attestationCollectionIds[i] = collectionIds[i];\\n\\n attestations[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestations, proofData);\\n\\n _beforeDeleteAttestations(attestations, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n\\n _afterDeleteAttestations(attestations, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestations[i]);\\n }\\n return attestations;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x7743f02ed07e1b40a2ff45f5a45b5fe87d765326cce3528676cbd36c3d08ba37\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0x2d5faf5df56dfe1294202e89180846a1d4a5f938699619ee73b60c7314a97dfe\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3467998cbdb82b0c64aa8627efc5893d2b369f73e66e5d1095305e4609593cc5\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address ownerAddress,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0x1b6ab7a4ba266f3da2c7f6ba3de93e3ab89f389dbd6db14514b43cbdcbe9fe09\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5e882d3091e816f1286837eef92ae17737abf66fdeece1282b752f27ba18492b\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0xcb419cf389baad6f38de28625718f64f551d2669339c1b4e1887e11d62484469\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101406040523480156200001257600080fd5b5060405162002b2738038062002b2783398101604081905262000035916200020f565b6001600160a01b0387811660805286811660a05285811660e052841660c0526101008390526101208290526200006b3362000083565b6200007681620000d5565b5050505050505062000292565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054600490610100900460ff16158015620000f8575060005460ff8083169116105b620001605760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff831617610100178155620001876015546001600160a01b031690565b6001600160a01b031614806200019c5750303b155b15620001ad57620001ad8262000083565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b80516001600160a01b03811681146200020a57600080fd5b919050565b600080600080600080600060e0888a0312156200022b57600080fd5b6200023688620001f2565b96506200024660208901620001f2565b95506200025660408901620001f2565b94506200026660608901620001f2565b93506080880151925060a088015191506200028460c08901620001f2565b905092959891949750929550565b60805160a05160c05160e05161010051610120516127ff620003286000396000818161025e0152610d9201526000818161023701528181610d6a01526117200152600081816102dd01526112fa01526000818161017901526113960152600081816101f901526114f7015260008181610323015281816107820152818161096301528181610ae8015261177901526127ff6000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c80638b159099116100b8578063c4d66de81161007c578063c4d66de814610347578063c776adde1461035a578063ca1cc6461461036d578063e60f999f14610380578063f2fde38b14610393578063f7e420b3146103a657600080fd5b80638b159099146102a25780638da5cb5b146102ca578063918447af146102db578063af411a3014610301578063bfa665851461032157600080fd5b806346657fe91161010a57806346657fe9146101f7578063524a32481461021d57806354846d7a146102325780637000b05114610259578063715018a614610280578063754b377c1461028857600080fd5b8063063599db146101475780632254f98e14610177578063345dd9891461019d5780633800a4b9146101be5780633c4a9854146101e4575b600080fd5b61015a610155366004611bbf565b6103b9565b6040516001600160a01b0390911681526020015b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000061015a565b6101b06101ab366004611ce1565b6103d8565b60405190815260200161016e565b6101d16101cc366004611bbf565b6103f7565b60405161ffff909116815260200161016e565b6101d16101f2366004611ce1565b61040f565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61023061022b366004611d27565b61042e565b005b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b610230610494565b610290600481565b60405160ff909116815260200161016e565b6102b56102b0366004611bbf565b6104a8565b60405163ffffffff909116815260200161016e565b6015546001600160a01b031661015a565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61031461030f366004611d9f565b6104c2565b60405161016e9190611ec2565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b610230610355366004611f49565b610573565b610314610368366004611f66565b61068b565b6101d161037b366004612017565b610a46565b61031461038e366004611d9f565b610aaa565b6102306103a1366004611f49565b610bc6565b6102b56103b4366004611bbf565b610c3f565b6000818152600160205260408120546001600160a01b03165b92915050565b600080828060200190518101906103ef919061203c565b509392505050565b6000818152603e602052604081205461ffff166103d2565b60008082806020019051810190610426919061203c565b949350505050565b610436610c59565b600082815260296020908152604091829020805463ffffffff191663ffffffff8516908117909155915191825283917f893e2a4c394b497c1a2b041d18acc02d05deb2cc7ae3ea0f85d001aa93dff48b910160405180910390a25050565b61049c610c59565b6104a66000610cb3565b565b60008181526029602052604081205463ffffffff166103d2565b606060006104d1858585610d05565b905060006104df8585610e84565b9050816000815181106104f4576104f4612068565b602002602001015160a00151610528828460008151811061051757610517612068565b602002602001015160200151610a46565b60405160200161053992919061207e565b6040516020818303038152906040528260008151811061055b5761055b612068565b602090810291909101015160a0015250949350505050565b600054600490610100900460ff16158015610595575060005460ff8083169116105b6105fd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556106236015546001600160a01b031690565b6001600160a01b031614806106375750303b155b156106455761064582610cb3565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60606000856001600160401b038111156106a7576106a7611bd8565b6040519080825280602002602001820160405280156106d0578160200160208202803683370190505b5090506000866001600160401b038111156106ed576106ed611bd8565b604051908082528060200260200182016040528015610716578160200160208202803683370190505b5090506000876001600160401b0381111561073357610733611bd8565b60405190808252806020026020018201604052801561076c57816020015b610759611a9d565b8152602001906001900390816107515790505b50905060005b88811015610940576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106107c1576107c1612068565b905060200201358e6040518363ffffffff1660e01b81526004016107f89291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610815573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261083d91908101906120a4565b93509350935093508b88868151811061085857610858612068565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061088a5761088a612068565b905060200201358786815181106108a3576108a3612068565b6020026020010181815250506040518060c001604052808f8f888181106108cc576108cc612068565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061091e5761091e612068565b60200260200101819052505050505080806109389061216c565b915050610772565b5061094c818787610ea0565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061099a9086908690600401612185565b600060405180830381600087803b1580156109b457600080fd5b505af11580156109c8573d6000803e3d6000fd5b5050505060005b88811015610a39577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b828281518110610a0a57610a0a612068565b6020026020010151604051610a1f9190612209565b60405180910390a180610a318161216c565b9150506109cf565b5098975050505050505050565b600082815260016020908152604080832054603e9092528220546001600160a01b039091169061ffff168115801590610a915750836001600160a01b0316826001600160a01b031614155b1561042657610aa160018261221c565b95945050505050565b6060610ab7848484610eb9565b6000610ac48585856104c2565b9050610ad1858585610f01565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c09390610b1d908490600401611ec2565b600060405180830381600087803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b5050505060005b8151811015610bbd577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610b8e57610b8e612068565b6020026020010151604051610ba39190612209565b60405180910390a180610bb58161216c565b915050610b52565b50949350505050565b610bce610c59565b6001600160a01b038116610c335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b610c3c81610cb3565b50565b6000818152603d602052604081205463ffffffff166103d2565b6015546001600160a01b031633146104a65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105f4565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606000610d1a610d1586612242565b611057565b60408051600180825281830190925291925060009190816020015b610d3d611a9d565b815260200190600190039081610d35575050606083015151909150600090610d8e906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b90507f0000000000000000000000000000000000000000000000000000000000000000811115610dd457604051637bbf29e360e01b8152600481018290526024016105f4565b306000610de18888610e84565b90506040518060c0016040528084815260200186604001516001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff16815260200182604051602001610e4791815260200190565b60405160208183030381529060405281525084600081518110610e6c57610e6c612068565b60209081029190910101525091979650505050505050565b600080610e9383850185612439565b90506000610aa1826110dc565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ec782840184612439565b90506000610ed4826110f2565b90506000610ee4610d1587612242565b9050610ef0818361119c565b610ef9836114cd565b505050505050565b6000610f0d8383610e84565b6000818152600160205260408120549192506001600160a01b0390911690610f37610d1587612242565b90506001600160a01b03821615801590610f67575080604001516001600160a01b0316826001600160a01b031614155b1561103e576060810151516001600160801b031660009081526029602052604081205463ffffffff1690819003610fc35760608201515160405163065ef5f360e01b81526001600160801b0390911660048201526024016105f4565b610fcd848261166a565b15611029576000848152603e602052604081205461ffff16604051630d16862d60e11b8152600481018790526001600160a01b038616602482015261ffff8216604482015263ffffffff841660648201529091506084016105f4565b611033828461169a565b61103c846117e8565b505b610ef9836110526040890160208a01611f49565b61188f565b61105f611aeb565b6000826000015160008151811061107857611078612068565b6020026020010151905061108b816118ee565b600081604001518060200190518101906110a5919061251a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b602081015160009060065b602002015192915050565b6110fa611b4e565b60405180610120016040528061110f8461192e565b6001600160a01b031681526020016111268461193c565b81526020016111348461194b565b81526020016111428461195a565b8152602001611150846110dc565b815260200161115e84611969565b815260200161116c84611978565b81526020016111848460200151610120015160011490565b1515815260200161119484611987565b905292915050565b815160c0820151146111d157815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016105f4565b81606001516040015115158160e0015115150361121c57606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016105f4565b81604001516001600160a01b031681600001516001600160a01b03161461127057604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016105f4565b468160200151146112a3576020810151604051630432cec160e31b815246600482015260248101919091526044016105f4565b81602001518160a00151146112de57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016105f4565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015611349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136d9190612595565b61139257806040015160405163cbfe7bc360e01b81526004016105f491815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa1580156113f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141591906125b0565b80516101008401515191925014158061143c57506020808201516101008401519091015114155b15611486578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016105f4565b6000611491846119df565b9050808360600151146114c7576060830151604051630e6efbdd60e21b81526105f4918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946115309490939290919060040161262c565b602060405180830381865afa925050508015611569575060408051601f3d908101601f1916820190925261156691810190612595565b60015b61163f576115756126b0565b806308c379a0036115ae57506115896126cc565b8061159457506115ed565b8060405162dd577760e81b81526004016105f49190612755565b634e487b71036115ed576115c0612768565b906115cb57506115ed565b60405162dd577760e81b815260206004820152600060248201526044016105f4565b3d808015611617576040519150601f19603f3d011682016040523d82523d6000602084013e61161c565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016105f4565b806116665760405162dd577760e81b815260206004820152600060248201526044016105f4565b5050565b6000828152603d6020526040812054429061168c90849063ffffffff16612788565b63ffffffff16119392505050565b60408051600180825281830190925260009160208083019080368337505060408051600180825281830190925292935060009291506020808301908036833701905050905082826000815181106116f3576116f3612068565b6001600160a01b0390921660209283029190910190910152606084015151611744906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b8160008151811061175757611757612068565b602090810291909101015260405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af7906117b09085908590600401612185565b600060405180830381600087803b1580156117ca57600080fd5b505af11580156117de573d6000803e3d6000fd5b5050505050505050565b6000818152603d60209081526040808320805463ffffffff19164263ffffffff16179055603e909152812080546001929061182890849061ffff1661221c565b82546101009290920a61ffff8181021990931691831602179091556000838152603e60209081526040918290205491519190921681528392507f85183f8abad8891335fb845d2e6b4f84a9c7f7409f242f4e5ec138a84abffacf910160405180910390a250565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f0c5a122814a29e22d1363dacdd6f7c95345b70890f97e65eacb5565da28116ac910161067f565b60006118fd8260400151611a04565b825190915081146116665781516040516337e3d1ab60e01b81526105f4918391600401918252602082015260400190565b6020810151600090816110e7565b602081015160009060016110e7565b602081015160009060046110e7565b602081015160009060056110e7565b602081015160009060076110e7565b602081015160009060086110e7565b61198f611ba1565b604051806040016040528083602001516002600a81106119b1576119b1612068565b6020020151815260200183602001516003600a81106119d2576119d2612068565b6020020151905292915050565b6000806119fd308460600151600001516001600160801b0316611a39565b9392505050565b805160208201206000906103d2907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906127a7565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6119fd91906127a7565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b03168152602001611b49604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001611b495b60405180604001604052806002906020820280368337509192915050565b600060208284031215611bd157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b0382111715611c0d57611c0d611bd8565b60405250565b606081018181106001600160401b0382111715611c0d57611c0d611bd8565b601f8201601f191681016001600160401b0381118282101715611c5757611c57611bd8565b6040525050565b60006001600160401b03821115611c7757611c77611bd8565b50601f01601f191660200190565b600082601f830112611c9657600080fd5b8135611ca181611c5e565b604051611cae8282611c32565b828152856020848701011115611cc357600080fd5b82602086016020830137600092810160200192909252509392505050565b600060208284031215611cf357600080fd5b81356001600160401b03811115611d0957600080fd5b61042684828501611c85565b63ffffffff81168114610c3c57600080fd5b60008060408385031215611d3a57600080fd5b823591506020830135611d4c81611d15565b809150509250929050565b60008083601f840112611d6957600080fd5b5081356001600160401b03811115611d8057600080fd5b602083019150836020828501011115611d9857600080fd5b9250929050565b600080600060408486031215611db457600080fd5b83356001600160401b0380821115611dcb57600080fd5b9085019060408288031215611ddf57600080fd5b90935060208501359080821115611df557600080fd5b50611e0286828701611d57565b9497909650939450505050565b60005b83811015611e2a578181015183820152602001611e12565b838111156114c75750506000910152565b60008151808452611e53816020860160208601611e0f565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261042660c0850182611e3b565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611f1757603f19888603018452611f05858351611e67565b94509285019290850190600101611ee9565b5092979650505050505050565b6001600160a01b0381168114610c3c57600080fd5b8035611f4481611f24565b919050565b600060208284031215611f5b57600080fd5b81356119fd81611f24565b600080600080600060608688031215611f7e57600080fd5b85356001600160401b0380821115611f9557600080fd5b818801915088601f830112611fa957600080fd5b813581811115611fb857600080fd5b8960208260051b8501011115611fcd57600080fd5b60208301975080965050611fe360208901611f39565b94506040880135915080821115611ff957600080fd5b5061200688828901611d57565b969995985093965092949392505050565b6000806040838503121561202a57600080fd5b823591506020830135611d4c81611f24565b6000806040838503121561204f57600080fd5b82519150602083015161ffff81168114611d4c57600080fd5b634e487b7160e01b600052603260045260246000fd5b6040815260006120916040830185611e3b565b905061ffff831660208301529392505050565b600080600080608085870312156120ba57600080fd5b84516120c581611f24565b6020860151604087015191955093506120dd81611d15565b60608601519092506001600160401b038111156120f957600080fd5b8501601f8101871361210a57600080fd5b805161211581611c5e565b6040516121228282611c32565b82815289602084860101111561213757600080fd5b612148836020830160208701611e0f565b969995985093965050505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161217e5761217e612156565b5060010190565b604080825283519082018190526000906020906060840190828701845b828110156121c75781516001600160a01b0316845292840192908401906001016121a2565b5050508381038285015284518082528583019183019060005b818110156121fc578351835292840192918401916001016121e0565b5090979650505050505050565b6020815260006119fd6020830184611e67565b600061ffff80831681851680830382111561223957612239612156565b01949350505050565b6000604080833603121561225557600080fd5b805161226081611bee565b83356001600160401b038082111561227757600080fd5b9085019036601f83011261228a57600080fd5b813560208282111561229e5761229e611bd8565b8160051b86516122b083830182611c32565b928352848101820192828101368511156122c957600080fd5b83870192505b8483101561234d578235868111156122e75760008081fd5b8701606036829003601f19018113156123005760008081fd5b8a5161230b81611c13565b8287013581528b8301358188015290820135908882111561232c5760008081fd5b61233a368884860101611c85565b818d0152835250509183019183016122cf565b5086525061235c888201611f39565b90850152509195945050505050565b6000821982111561237e5761237e612156565b500190565b600082601f83011261239457600080fd5b6040516123a081611bee565b8060408401858111156123b257600080fd5b845b818110156123cc5780358352602092830192016123b4565b509195945050505050565b600082601f8301126123e857600080fd5b6040516101408082018281106001600160401b038211171561240c5761240c611bd8565b6040528301818582111561241f57600080fd5b845b828110156123cc578035825260209182019101612421565b600081830361024081121561244d57600080fd5b6040805161245a81611bee565b6101008084121561246a57600080fd5b8251935061247784611c13565b6124818787612383565b845286605f87011261249257600080fd5b825161249d81611bee565b8060c08801898111156124af57600080fd5b8589015b818110156124d4576124c58b82612383565b835260209092019186016124b3565b508260208801526124e58a82612383565b868801525050508382526124fb878288016123d7565b60208301525095945050505050565b80518015158114611f4457600080fd5b60006060828403121561252c57600080fd5b604051606081018181106001600160401b038211171561254e5761254e611bd8565b60405282516001600160801b038116811461256857600080fd5b8152602083015161257881611d15565b60208201526125896040840161250a565b60408201529392505050565b6000602082840312156125a757600080fd5b6119fd8261250a565b6000604082840312156125c257600080fd5b82601f8301126125d157600080fd5b6040516125dd81611bee565b8060408401858111156125ef57600080fd5b845b818110156123cc5780518352602092830192016125f1565b8060005b60028110156114c757815184526020938401939091019060010161260d565b610240810161263b8287612609565b60408083018660005b600281101561266b57612658838351612609565b9183019160209190910190600101612644565b5050505061267c60c0830185612609565b61010082018360005b600a8110156126a4578151835260209283019290910190600101612685565b50505095945050505050565b600060033d11156126c95760046000803e5060005160e01c5b90565b600060443d10156126da5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561270957505050505090565b82850191508151818111156127215750505050505090565b843d870101602082850101111561273b5750505050505090565b61274a60208286010187611c32565b509095945050505050565b6020815260006119fd6020830184611e3b565b60008060233d1115612784576020600460003e50506000516001905b9091565b600063ffffffff80831681851680830382111561223957612239612156565b6000826127c457634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220202a9a70b259c56940b27ba667618cafc46cd9a9f1eb7ea03e8803b68fee4b3964736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101425760003560e01c80638b159099116100b8578063c4d66de81161007c578063c4d66de814610347578063c776adde1461035a578063ca1cc6461461036d578063e60f999f14610380578063f2fde38b14610393578063f7e420b3146103a657600080fd5b80638b159099146102a25780638da5cb5b146102ca578063918447af146102db578063af411a3014610301578063bfa665851461032157600080fd5b806346657fe91161010a57806346657fe9146101f7578063524a32481461021d57806354846d7a146102325780637000b05114610259578063715018a614610280578063754b377c1461028857600080fd5b8063063599db146101475780632254f98e14610177578063345dd9891461019d5780633800a4b9146101be5780633c4a9854146101e4575b600080fd5b61015a610155366004611bbf565b6103b9565b6040516001600160a01b0390911681526020015b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000061015a565b6101b06101ab366004611ce1565b6103d8565b60405190815260200161016e565b6101d16101cc366004611bbf565b6103f7565b60405161ffff909116815260200161016e565b6101d16101f2366004611ce1565b61040f565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61023061022b366004611d27565b61042e565b005b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b610230610494565b610290600481565b60405160ff909116815260200161016e565b6102b56102b0366004611bbf565b6104a8565b60405163ffffffff909116815260200161016e565b6015546001600160a01b031661015a565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61031461030f366004611d9f565b6104c2565b60405161016e9190611ec2565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b610230610355366004611f49565b610573565b610314610368366004611f66565b61068b565b6101d161037b366004612017565b610a46565b61031461038e366004611d9f565b610aaa565b6102306103a1366004611f49565b610bc6565b6102b56103b4366004611bbf565b610c3f565b6000818152600160205260408120546001600160a01b03165b92915050565b600080828060200190518101906103ef919061203c565b509392505050565b6000818152603e602052604081205461ffff166103d2565b60008082806020019051810190610426919061203c565b949350505050565b610436610c59565b600082815260296020908152604091829020805463ffffffff191663ffffffff8516908117909155915191825283917f893e2a4c394b497c1a2b041d18acc02d05deb2cc7ae3ea0f85d001aa93dff48b910160405180910390a25050565b61049c610c59565b6104a66000610cb3565b565b60008181526029602052604081205463ffffffff166103d2565b606060006104d1858585610d05565b905060006104df8585610e84565b9050816000815181106104f4576104f4612068565b602002602001015160a00151610528828460008151811061051757610517612068565b602002602001015160200151610a46565b60405160200161053992919061207e565b6040516020818303038152906040528260008151811061055b5761055b612068565b602090810291909101015160a0015250949350505050565b600054600490610100900460ff16158015610595575060005460ff8083169116105b6105fd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556106236015546001600160a01b031690565b6001600160a01b031614806106375750303b155b156106455761064582610cb3565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60606000856001600160401b038111156106a7576106a7611bd8565b6040519080825280602002602001820160405280156106d0578160200160208202803683370190505b5090506000866001600160401b038111156106ed576106ed611bd8565b604051908082528060200260200182016040528015610716578160200160208202803683370190505b5090506000876001600160401b0381111561073357610733611bd8565b60405190808252806020026020018201604052801561076c57816020015b610759611a9d565b8152602001906001900390816107515790505b50905060005b88811015610940576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106107c1576107c1612068565b905060200201358e6040518363ffffffff1660e01b81526004016107f89291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610815573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261083d91908101906120a4565b93509350935093508b88868151811061085857610858612068565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061088a5761088a612068565b905060200201358786815181106108a3576108a3612068565b6020026020010181815250506040518060c001604052808f8f888181106108cc576108cc612068565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061091e5761091e612068565b60200260200101819052505050505080806109389061216c565b915050610772565b5061094c818787610ea0565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061099a9086908690600401612185565b600060405180830381600087803b1580156109b457600080fd5b505af11580156109c8573d6000803e3d6000fd5b5050505060005b88811015610a39577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b828281518110610a0a57610a0a612068565b6020026020010151604051610a1f9190612209565b60405180910390a180610a318161216c565b9150506109cf565b5098975050505050505050565b600082815260016020908152604080832054603e9092528220546001600160a01b039091169061ffff168115801590610a915750836001600160a01b0316826001600160a01b031614155b1561042657610aa160018261221c565b95945050505050565b6060610ab7848484610eb9565b6000610ac48585856104c2565b9050610ad1858585610f01565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c09390610b1d908490600401611ec2565b600060405180830381600087803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b5050505060005b8151811015610bbd577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610b8e57610b8e612068565b6020026020010151604051610ba39190612209565b60405180910390a180610bb58161216c565b915050610b52565b50949350505050565b610bce610c59565b6001600160a01b038116610c335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b610c3c81610cb3565b50565b6000818152603d602052604081205463ffffffff166103d2565b6015546001600160a01b031633146104a65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105f4565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606000610d1a610d1586612242565b611057565b60408051600180825281830190925291925060009190816020015b610d3d611a9d565b815260200190600190039081610d35575050606083015151909150600090610d8e906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b90507f0000000000000000000000000000000000000000000000000000000000000000811115610dd457604051637bbf29e360e01b8152600481018290526024016105f4565b306000610de18888610e84565b90506040518060c0016040528084815260200186604001516001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff16815260200182604051602001610e4791815260200190565b60405160208183030381529060405281525084600081518110610e6c57610e6c612068565b60209081029190910101525091979650505050505050565b600080610e9383850185612439565b90506000610aa1826110dc565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ec782840184612439565b90506000610ed4826110f2565b90506000610ee4610d1587612242565b9050610ef0818361119c565b610ef9836114cd565b505050505050565b6000610f0d8383610e84565b6000818152600160205260408120549192506001600160a01b0390911690610f37610d1587612242565b90506001600160a01b03821615801590610f67575080604001516001600160a01b0316826001600160a01b031614155b1561103e576060810151516001600160801b031660009081526029602052604081205463ffffffff1690819003610fc35760608201515160405163065ef5f360e01b81526001600160801b0390911660048201526024016105f4565b610fcd848261166a565b15611029576000848152603e602052604081205461ffff16604051630d16862d60e11b8152600481018790526001600160a01b038616602482015261ffff8216604482015263ffffffff841660648201529091506084016105f4565b611033828461169a565b61103c846117e8565b505b610ef9836110526040890160208a01611f49565b61188f565b61105f611aeb565b6000826000015160008151811061107857611078612068565b6020026020010151905061108b816118ee565b600081604001518060200190518101906110a5919061251a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b602081015160009060065b602002015192915050565b6110fa611b4e565b60405180610120016040528061110f8461192e565b6001600160a01b031681526020016111268461193c565b81526020016111348461194b565b81526020016111428461195a565b8152602001611150846110dc565b815260200161115e84611969565b815260200161116c84611978565b81526020016111848460200151610120015160011490565b1515815260200161119484611987565b905292915050565b815160c0820151146111d157815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016105f4565b81606001516040015115158160e0015115150361121c57606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016105f4565b81604001516001600160a01b031681600001516001600160a01b03161461127057604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016105f4565b468160200151146112a3576020810151604051630432cec160e31b815246600482015260248101919091526044016105f4565b81602001518160a00151146112de57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016105f4565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015611349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136d9190612595565b61139257806040015160405163cbfe7bc360e01b81526004016105f491815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa1580156113f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141591906125b0565b80516101008401515191925014158061143c57506020808201516101008401519091015114155b15611486578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016105f4565b6000611491846119df565b9050808360600151146114c7576060830151604051630e6efbdd60e21b81526105f4918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946115309490939290919060040161262c565b602060405180830381865afa925050508015611569575060408051601f3d908101601f1916820190925261156691810190612595565b60015b61163f576115756126b0565b806308c379a0036115ae57506115896126cc565b8061159457506115ed565b8060405162dd577760e81b81526004016105f49190612755565b634e487b71036115ed576115c0612768565b906115cb57506115ed565b60405162dd577760e81b815260206004820152600060248201526044016105f4565b3d808015611617576040519150601f19603f3d011682016040523d82523d6000602084013e61161c565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016105f4565b806116665760405162dd577760e81b815260206004820152600060248201526044016105f4565b5050565b6000828152603d6020526040812054429061168c90849063ffffffff16612788565b63ffffffff16119392505050565b60408051600180825281830190925260009160208083019080368337505060408051600180825281830190925292935060009291506020808301908036833701905050905082826000815181106116f3576116f3612068565b6001600160a01b0390921660209283029190910190910152606084015151611744906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b8160008151811061175757611757612068565b602090810291909101015260405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af7906117b09085908590600401612185565b600060405180830381600087803b1580156117ca57600080fd5b505af11580156117de573d6000803e3d6000fd5b5050505050505050565b6000818152603d60209081526040808320805463ffffffff19164263ffffffff16179055603e909152812080546001929061182890849061ffff1661221c565b82546101009290920a61ffff8181021990931691831602179091556000838152603e60209081526040918290205491519190921681528392507f85183f8abad8891335fb845d2e6b4f84a9c7f7409f242f4e5ec138a84abffacf910160405180910390a250565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f0c5a122814a29e22d1363dacdd6f7c95345b70890f97e65eacb5565da28116ac910161067f565b60006118fd8260400151611a04565b825190915081146116665781516040516337e3d1ab60e01b81526105f4918391600401918252602082015260400190565b6020810151600090816110e7565b602081015160009060016110e7565b602081015160009060046110e7565b602081015160009060056110e7565b602081015160009060076110e7565b602081015160009060086110e7565b61198f611ba1565b604051806040016040528083602001516002600a81106119b1576119b1612068565b6020020151815260200183602001516003600a81106119d2576119d2612068565b6020020151905292915050565b6000806119fd308460600151600001516001600160801b0316611a39565b9392505050565b805160208201206000906103d2907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906127a7565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6119fd91906127a7565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b03168152602001611b49604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001611b495b60405180604001604052806002906020820280368337509192915050565b600060208284031215611bd157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b0382111715611c0d57611c0d611bd8565b60405250565b606081018181106001600160401b0382111715611c0d57611c0d611bd8565b601f8201601f191681016001600160401b0381118282101715611c5757611c57611bd8565b6040525050565b60006001600160401b03821115611c7757611c77611bd8565b50601f01601f191660200190565b600082601f830112611c9657600080fd5b8135611ca181611c5e565b604051611cae8282611c32565b828152856020848701011115611cc357600080fd5b82602086016020830137600092810160200192909252509392505050565b600060208284031215611cf357600080fd5b81356001600160401b03811115611d0957600080fd5b61042684828501611c85565b63ffffffff81168114610c3c57600080fd5b60008060408385031215611d3a57600080fd5b823591506020830135611d4c81611d15565b809150509250929050565b60008083601f840112611d6957600080fd5b5081356001600160401b03811115611d8057600080fd5b602083019150836020828501011115611d9857600080fd5b9250929050565b600080600060408486031215611db457600080fd5b83356001600160401b0380821115611dcb57600080fd5b9085019060408288031215611ddf57600080fd5b90935060208501359080821115611df557600080fd5b50611e0286828701611d57565b9497909650939450505050565b60005b83811015611e2a578181015183820152602001611e12565b838111156114c75750506000910152565b60008151808452611e53816020860160208601611e0f565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261042660c0850182611e3b565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611f1757603f19888603018452611f05858351611e67565b94509285019290850190600101611ee9565b5092979650505050505050565b6001600160a01b0381168114610c3c57600080fd5b8035611f4481611f24565b919050565b600060208284031215611f5b57600080fd5b81356119fd81611f24565b600080600080600060608688031215611f7e57600080fd5b85356001600160401b0380821115611f9557600080fd5b818801915088601f830112611fa957600080fd5b813581811115611fb857600080fd5b8960208260051b8501011115611fcd57600080fd5b60208301975080965050611fe360208901611f39565b94506040880135915080821115611ff957600080fd5b5061200688828901611d57565b969995985093965092949392505050565b6000806040838503121561202a57600080fd5b823591506020830135611d4c81611f24565b6000806040838503121561204f57600080fd5b82519150602083015161ffff81168114611d4c57600080fd5b634e487b7160e01b600052603260045260246000fd5b6040815260006120916040830185611e3b565b905061ffff831660208301529392505050565b600080600080608085870312156120ba57600080fd5b84516120c581611f24565b6020860151604087015191955093506120dd81611d15565b60608601519092506001600160401b038111156120f957600080fd5b8501601f8101871361210a57600080fd5b805161211581611c5e565b6040516121228282611c32565b82815289602084860101111561213757600080fd5b612148836020830160208701611e0f565b969995985093965050505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161217e5761217e612156565b5060010190565b604080825283519082018190526000906020906060840190828701845b828110156121c75781516001600160a01b0316845292840192908401906001016121a2565b5050508381038285015284518082528583019183019060005b818110156121fc578351835292840192918401916001016121e0565b5090979650505050505050565b6020815260006119fd6020830184611e67565b600061ffff80831681851680830382111561223957612239612156565b01949350505050565b6000604080833603121561225557600080fd5b805161226081611bee565b83356001600160401b038082111561227757600080fd5b9085019036601f83011261228a57600080fd5b813560208282111561229e5761229e611bd8565b8160051b86516122b083830182611c32565b928352848101820192828101368511156122c957600080fd5b83870192505b8483101561234d578235868111156122e75760008081fd5b8701606036829003601f19018113156123005760008081fd5b8a5161230b81611c13565b8287013581528b8301358188015290820135908882111561232c5760008081fd5b61233a368884860101611c85565b818d0152835250509183019183016122cf565b5086525061235c888201611f39565b90850152509195945050505050565b6000821982111561237e5761237e612156565b500190565b600082601f83011261239457600080fd5b6040516123a081611bee565b8060408401858111156123b257600080fd5b845b818110156123cc5780358352602092830192016123b4565b509195945050505050565b600082601f8301126123e857600080fd5b6040516101408082018281106001600160401b038211171561240c5761240c611bd8565b6040528301818582111561241f57600080fd5b845b828110156123cc578035825260209182019101612421565b600081830361024081121561244d57600080fd5b6040805161245a81611bee565b6101008084121561246a57600080fd5b8251935061247784611c13565b6124818787612383565b845286605f87011261249257600080fd5b825161249d81611bee565b8060c08801898111156124af57600080fd5b8589015b818110156124d4576124c58b82612383565b835260209092019186016124b3565b508260208801526124e58a82612383565b868801525050508382526124fb878288016123d7565b60208301525095945050505050565b80518015158114611f4457600080fd5b60006060828403121561252c57600080fd5b604051606081018181106001600160401b038211171561254e5761254e611bd8565b60405282516001600160801b038116811461256857600080fd5b8152602083015161257881611d15565b60208201526125896040840161250a565b60408201529392505050565b6000602082840312156125a757600080fd5b6119fd8261250a565b6000604082840312156125c257600080fd5b82601f8301126125d157600080fd5b6040516125dd81611bee565b8060408401858111156125ef57600080fd5b845b818110156123cc5780518352602092830192016125f1565b8060005b60028110156114c757815184526020938401939091019060010161260d565b610240810161263b8287612609565b60408083018660005b600281101561266b57612658838351612609565b9183019160209190910190600101612644565b5050505061267c60c0830185612609565b61010082018360005b600a8110156126a4578151835260209283019290910190600101612685565b50505095945050505050565b600060033d11156126c95760046000803e5060005160e01c5b90565b600060443d10156126da5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561270957505050505090565b82850191508151818111156127215750505050505090565b843d870101602082850101111561273b5750505050505090565b61274a60208286010187611c32565b509095945050505050565b6020815260006119fd6020830184611e3b565b60008060233d1115612784576020600460003e50506000516001905b9091565b600063ffffffff80831681851680830382111561223957612239612156565b6000826127c457634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220202a9a70b259c56940b27ba667618cafc46cd9a9f1eb7ea03e8803b68fee4b3964736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "errors": { - "CollectionIdOutOfBound(uint256)": [ - { - "details": "Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST*" - } - ], - "CooldownDurationNotSetForGroupIndex(uint256)": [ - { - "details": "Error when the cooldown duration for a given groupIndex is equal to zero. The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.*" - } - ], - "NullifierOnCooldown(uint256,address,uint16,uint32)": [ - { - "details": "Error when the nullifier is on cooldown. The user have to wait the cooldownDuration before being able to change again the destination address.*" - } - ], - "NullifierUsed(uint256)": [ - { - "details": "Error when the nullifier is already used for a destination address*" - } - ] - }, - "kind": "dev", - "methods": { - "_getNextBurnCount(uint256,address)": { - "details": "returns burn count or burn count + 1 if new burn will happen", - "params": { - "claimDestination": "destination referenced in the user claim", - "nullifier": "user nullifier" - } - }, - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns the actual attestations constructed from the user request", - "params": { - "proofData": "snark public input as well as snark proof", - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "availableRootsRegistryAddress": "Registry storing the available groups for this attester (e.g roots of registry merkle trees)", - "collectionIdFirst": "Id of the first attestation collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last attestation collection in which the attester is supposed to record", - "commitmentMapperAddress": "commitment mapper's public key registry", - "hydraS1VerifierAddress": "ZK Snark Hydra-S1 Verifier contract", - "owner": "Address of attester's owner" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getAvailableRootsRegistry()": { - "details": "Getter of Roots Registry Contract" - }, - "getBurnCountFromExtraData(bytes)": { - "details": "Returns the burn count for a given extraData", - "params": { - "extraData": "bytes where the burnCount is encoded" - } - }, - "getCommitmentMapperRegistry()": { - "details": "Getter of Commitment Mapper Registry contract" - }, - "getCooldownDurationForGroupIndex(uint256)": { - "details": "Getter, get the cooldown duration of a groupIndex", - "params": { - "groupIndex": "internal collection id*" - } - }, - "getDestinationOfNullifier(uint256)": { - "details": "Getter, returns the last attestation destination of a nullifier", - "params": { - "nullifier": "nullifier used*" - } - }, - "getNullifierBurnCount(uint256)": { - "details": "Getter, returns the burnCount of a nullifier", - "params": { - "nullifier": "nullifier used*" - } - }, - "getNullifierCooldownStart(uint256)": { - "details": "Getter, returns the cooldown start of a nullifier", - "params": { - "nullifier": "nullifier used*" - } - }, - "getNullifierFromExtraData(bytes)": { - "details": "returns the nullifier for a given extraData", - "params": { - "extraData": "bytes where the nullifier is encoded" - } - }, - "getVerifier()": { - "details": "Getter of Hydra-S1 Verifier contract" - }, - "initialize(address)": { - "details": "Initialize function, to be called by the proxy delegating calls to this implementation", - "params": { - "ownerAddress": "Owner of the contract, has the right to authorize/unauthorize attestations issuers" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "setCooldownDurationForGroupIndex(uint256,uint32)": { - "details": "Setter, sets the cooldown duration of a groupIndex", - "params": { - "cooldownDuration": "cooldown duration we want to set for the groupIndex*", - "groupIndex": "internal collection id" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "title": "Hydra-S1 Accountbound Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "getCooldownDurationForGroupIndex(uint256)": { - "notice": "returns 0 when the accountbound feature is deactivated for this group" - }, - "initialize(address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - }, - "setCooldownDurationForGroupIndex(uint256,uint32)": { - "notice": "set to 0 to deactivate the accountbound feature for this group" - } - }, - "notice": "This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic. Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic. However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation. The _beforeRecordAttestations is also overriden to fit the Accountbound logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Nullified Each source account gets one nullifier per claim (i.e only one attestation per source account per claim) While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier) We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation. We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation. Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier) - Accountbound (opt-in, with cooldown period) The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group. Users can update their attestation's destination by providing a new Hydra-S1 ZK proof It means the attestation is bound to the source account, stored on an updatable destination account. When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional. A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations. - Renewable A nullifier can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8093, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_nullifiersDestinations", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_address)" - }, - { - "astId": 8097, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_placeHoldersHydraS1Simple", - "offset": 0, - "slot": "2", - "type": "t_array(t_uint256)19_storage" - }, - { - "astId": 396, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_owner", - "offset": 0, - "slot": "21", - "type": "t_address" - }, - { - "astId": 7520, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_placeHolderBeforeHydraS1Accountbound", - "offset": 0, - "slot": "22", - "type": "t_array(t_uint256)19_storage" - }, - { - "astId": 7524, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_cooldownDurations", - "offset": 0, - "slot": "41", - "type": "t_mapping(t_uint256,t_uint32)" - }, - { - "astId": 7528, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_placeHoldersHydraS1AccountboundConfig", - "offset": 0, - "slot": "42", - "type": "t_array(t_uint256)19_storage" - }, - { - "astId": 7532, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_nullifiersCooldownStart", - "offset": 0, - "slot": "61", - "type": "t_mapping(t_uint256,t_uint32)" - }, - { - "astId": 7536, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_nullifiersBurnCount", - "offset": 0, - "slot": "62", - "type": "t_mapping(t_uint256,t_uint16)" - }, - { - "astId": 7540, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_placeHoldersHydraS1AccountboundLogic", - "offset": 0, - "slot": "63", - "type": "t_array(t_uint256)18_storage" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)18_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[18]", - "numberOfBytes": "576" - }, - "t_array(t_uint256)19_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[19]", - "numberOfBytes": "608" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_address)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_mapping(t_uint256,t_uint16)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => uint16)", - "numberOfBytes": "32", - "value": "t_uint16" - }, - "t_mapping(t_uint256,t_uint32)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => uint32)", - "numberOfBytes": "32", - "value": "t_uint32" - }, - "t_uint16": { - "encoding": "inplace", - "label": "uint16", - "numberOfBytes": "2" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/HydraS1AccountboundAttesterImplem.json b/deployments/goerli/HydraS1AccountboundAttesterImplem.json deleted file mode 100644 index ad4548d..0000000 --- a/deployments/goerli/HydraS1AccountboundAttesterImplem.json +++ /dev/null @@ -1,1378 +0,0 @@ -{ - "address": "0x5Ea50e074419FC193229D350474fE8878a800B7A", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "hydraS1VerifierAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "availableRootsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "AccountsTreeValueMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "claimLength", - "type": "uint256" - } - ], - "name": "ClaimsLengthDifferentThanOne", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentMapperPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupIndex", - "type": "uint256" - } - ], - "name": "CooldownDurationNotSetForGroupIndex", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedExternalNullifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "externalNullifier", - "type": "uint256" - } - ], - "name": "ExternalNullifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - }, - { - "internalType": "uint16", - "name": "burnCount", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "cooldownStart", - "type": "uint32" - } - ], - "name": "NullifierOnCooldown", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - } - ], - "name": "NullifierUsed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "inputRoot", - "type": "uint256" - } - ], - "name": "RegistryRootMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "groupIndex", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "cooldownDuration", - "type": "uint32" - } - ], - "name": "CooldownDurationSetForGroupIndex", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "NullifierDestinationUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "burnCount", - "type": "uint16" - } - ], - "name": "NullifierSetOnCooldown", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "internalType": "address", - "name": "claimDestination", - "type": "address" - } - ], - "name": "_getNextBurnCount", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAvailableRootsRegistry", - "outputs": [ - { - "internalType": "contract IAvailableRootsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "name": "getBurnCountFromExtraData", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentMapperRegistry", - "outputs": [ - { - "internalType": "contract ICommitmentMapperRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupIndex", - "type": "uint256" - } - ], - "name": "getCooldownDurationForGroupIndex", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - } - ], - "name": "getDestinationOfNullifier", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - } - ], - "name": "getNullifierBurnCount", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - } - ], - "name": "getNullifierCooldownStart", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "name": "getNullifierFromExtraData", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract HydraS1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupIndex", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "cooldownDuration", - "type": "uint32" - } - ], - "name": "setCooldownDurationForGroupIndex", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x895248c28d056d5e4abe4414272929754e90e034ec00f3561556b9333ef326a5", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x5Ea50e074419FC193229D350474fE8878a800B7A", - "transactionIndex": 48, - "gasUsed": "2322582", - "logsBloom": "0x00000000000300000000000000020000000000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000003000000000000000000000000000000000000020000000000000100000800002000000000000000000000000000400000000000000000000000000000000000000000000080000000000000000000000000000000000000000000800400000000000000000000000000000000000000000000000000000000000000040000000000000000400000000000000020000000000000000000000000000000000000000000000000000000008000000000", - "blockHash": "0x62cbc20f8640e90e3acdd959242fc69573a432f58dad7bd9506acfcc8a824b7e", - "transactionHash": "0x895248c28d056d5e4abe4414272929754e90e034ec00f3561556b9333ef326a5", - "logs": [ - { - "transactionIndex": 48, - "blockNumber": 8093127, - "transactionHash": "0x895248c28d056d5e4abe4414272929754e90e034ec00f3561556b9333ef326a5", - "address": "0x5Ea50e074419FC193229D350474fE8878a800B7A", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "data": "0x", - "logIndex": 116, - "blockHash": "0x62cbc20f8640e90e3acdd959242fc69573a432f58dad7bd9506acfcc8a824b7e" - }, - { - "transactionIndex": 48, - "blockNumber": 8093127, - "transactionHash": "0x895248c28d056d5e4abe4414272929754e90e034ec00f3561556b9333ef326a5", - "address": "0x5Ea50e074419FC193229D350474fE8878a800B7A", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954" - ], - "data": "0x", - "logIndex": 117, - "blockHash": "0x62cbc20f8640e90e3acdd959242fc69573a432f58dad7bd9506acfcc8a824b7e" - }, - { - "transactionIndex": 48, - "blockNumber": 8093127, - "transactionHash": "0x895248c28d056d5e4abe4414272929754e90e034ec00f3561556b9333ef326a5", - "address": "0x5Ea50e074419FC193229D350474fE8878a800B7A", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000004", - "logIndex": 118, - "blockHash": "0x62cbc20f8640e90e3acdd959242fc69573a432f58dad7bd9506acfcc8a824b7e" - } - ], - "blockNumber": 8093127, - "cumulativeGasUsed": "8897274", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf85BA0afA375495eE625910Db61b6b1406756234", - "0xe1bFE993cF8dB9a3214Cc77fD68194Ac534078b4", - "0xdDa4c8d2933dAA21Aac75B88fF59725725ba813F", - "0x0844662f25817B735BC9B6d9D11995F1A6c4dCB1", - "10000001", - "20000000", - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954" - ], - "numDeployments": 3, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"hydraS1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"availableRootsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"AccountsTreeValueMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimLength\",\"type\":\"uint256\"}],\"name\":\"ClaimsLengthDifferentThanOne\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentMapperPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"}],\"name\":\"CooldownDurationNotSetForGroupIndex\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedExternalNullifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"externalNullifier\",\"type\":\"uint256\"}],\"name\":\"ExternalNullifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"burnCount\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"cooldownStart\",\"type\":\"uint32\"}],\"name\":\"NullifierOnCooldown\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"NullifierUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inputRoot\",\"type\":\"uint256\"}],\"name\":\"RegistryRootMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"cooldownDuration\",\"type\":\"uint32\"}],\"name\":\"CooldownDurationSetForGroupIndex\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"NullifierDestinationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"burnCount\",\"type\":\"uint16\"}],\"name\":\"NullifierSetOnCooldown\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"claimDestination\",\"type\":\"address\"}],\"name\":\"_getNextBurnCount\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAvailableRootsRegistry\",\"outputs\":[{\"internalType\":\"contract IAvailableRootsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"getBurnCountFromExtraData\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentMapperRegistry\",\"outputs\":[{\"internalType\":\"contract ICommitmentMapperRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"}],\"name\":\"getCooldownDurationForGroupIndex\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfNullifier\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"getNullifierBurnCount\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"getNullifierCooldownStart\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"getNullifierFromExtraData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract HydraS1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"cooldownDuration\",\"type\":\"uint32\"}],\"name\":\"setCooldownDurationForGroupIndex\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"errors\":{\"CollectionIdOutOfBound(uint256)\":[{\"details\":\"Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST*\"}],\"CooldownDurationNotSetForGroupIndex(uint256)\":[{\"details\":\"Error when the cooldown duration for a given groupIndex is equal to zero. The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.*\"}],\"NullifierOnCooldown(uint256,address,uint16,uint32)\":[{\"details\":\"Error when the nullifier is on cooldown. The user have to wait the cooldownDuration before being able to change again the destination address.*\"}],\"NullifierUsed(uint256)\":[{\"details\":\"Error when the nullifier is already used for a destination address*\"}]},\"kind\":\"dev\",\"methods\":{\"_getNextBurnCount(uint256,address)\":{\"details\":\"returns burn count or burn count + 1 if new burn will happen\",\"params\":{\"claimDestination\":\"destination referenced in the user claim\",\"nullifier\":\"user nullifier\"}},\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns the actual attestations constructed from the user request\",\"params\":{\"proofData\":\"snark public input as well as snark proof\",\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"availableRootsRegistryAddress\":\"Registry storing the available groups for this attester (e.g roots of registry merkle trees)\",\"collectionIdFirst\":\"Id of the first attestation collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last attestation collection in which the attester is supposed to record\",\"commitmentMapperAddress\":\"commitment mapper's public key registry\",\"hydraS1VerifierAddress\":\"ZK Snark Hydra-S1 Verifier contract\",\"owner\":\"Address of attester's owner\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getAvailableRootsRegistry()\":{\"details\":\"Getter of Roots Registry Contract\"},\"getBurnCountFromExtraData(bytes)\":{\"details\":\"Returns the burn count for a given extraData\",\"params\":{\"extraData\":\"bytes where the burnCount is encoded\"}},\"getCommitmentMapperRegistry()\":{\"details\":\"Getter of Commitment Mapper Registry contract\"},\"getCooldownDurationForGroupIndex(uint256)\":{\"details\":\"Getter, get the cooldown duration of a groupIndex\",\"params\":{\"groupIndex\":\"internal collection id*\"}},\"getDestinationOfNullifier(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a nullifier\",\"params\":{\"nullifier\":\"nullifier used*\"}},\"getNullifierBurnCount(uint256)\":{\"details\":\"Getter, returns the burnCount of a nullifier\",\"params\":{\"nullifier\":\"nullifier used*\"}},\"getNullifierCooldownStart(uint256)\":{\"details\":\"Getter, returns the cooldown start of a nullifier\",\"params\":{\"nullifier\":\"nullifier used*\"}},\"getNullifierFromExtraData(bytes)\":{\"details\":\"returns the nullifier for a given extraData\",\"params\":{\"extraData\":\"bytes where the nullifier is encoded\"}},\"getVerifier()\":{\"details\":\"Getter of Hydra-S1 Verifier contract\"},\"initialize(address)\":{\"details\":\"Initialize function, to be called by the proxy delegating calls to this implementation\",\"params\":{\"ownerAddress\":\"Owner of the contract, has the right to authorize/unauthorize attestations issuers\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setCooldownDurationForGroupIndex(uint256,uint32)\":{\"details\":\"Setter, sets the cooldown duration of a groupIndex\",\"params\":{\"cooldownDuration\":\"cooldown duration we want to set for the groupIndex*\",\"groupIndex\":\"internal collection id\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Hydra-S1 Accountbound Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getCooldownDurationForGroupIndex(uint256)\":{\"notice\":\"returns 0 when the accountbound feature is deactivated for this group\"},\"initialize(address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"},\"setCooldownDurationForGroupIndex(uint256,uint32)\":{\"notice\":\"set to 0 to deactivate the accountbound feature for this group\"}},\"notice\":\"This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic. Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic. However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation. The _beforeRecordAttestations is also overriden to fit the Accountbound logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Nullified Each source account gets one nullifier per claim (i.e only one attestation per source account per claim) While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier) We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation. We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation. Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier) - Accountbound (opt-in, with cooldown period) The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group. Users can update their attestation's destination by providing a new Hydra-S1 ZK proof It means the attestation is bound to the source account, stored on an updatable destination account. When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional. A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations. - Renewable A nullifier can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol\":\"HydraS1AccountboundAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [8609986746108439658545470593166889256314951959466775818870246174320018498804,\\n 6848251127850009101372611262053374737897586140140607384018397707035108265914],\\n [21367916863936594568281095443965096905143705300114190558130516981138584550504,\\n 13327705762185115653848159709412003423932761899188342359583872691135383932883]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 19965766170734310004645394427613286415565755728797065894668054116047682895204,\\n 6952067612339183672227137101423582097916038093373585908267153974352032944482\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 13987716160490730015463796942940452666334097189904948795214986996497499925899,\\n 5336810094802209074340875836312868429276540870324469349093948627126061524544\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 14931593253473978964215343699995811275378324235306358485461293343370969283966,\\n 564306919152089917957316877787764763278299990971316475606280877961553231205\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11591267743733991434114686002448165336885445656808796470854638278338319268343,\\n 11495219763417990955889652410266075210402006084183208750635660647824890013350\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 8183184532870222270700473518157259944911700429689031755853536692005688965081,\\n 9121077094104828462137861111631978599019724423614716723152060153405564278301\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 4314095526093128699362232919686741372014146055311239687202926853002748112330,\\n 11665330391505820654128458332883010598817535082070674418723503440883598640597\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 18925967077785550270509493111690046951994174908254476036944536825999614778001,\\n 4990629719417206796668074534812314525340851981015724652256935997545282642849\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x120f0b311a61cabc9d42ef740c19e5f20b4c8ba400d9a6378e33c76dd54f5c42\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\n\\nimport {IHydraS1AccountboundAttester} from './interfaces/IHydraS1AccountboundAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from '../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra-S1\\nimport {HydraS1SimpleAttester, IAttester, HydraS1Lib, HydraS1ProofData, HydraS1Claim} from './HydraS1SimpleAttester.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic.\\n * Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic.\\n * However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation.\\n * The _beforeRecordAttestations is also overriden to fit the Accountbound logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Nullified\\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\\n * While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier)\\n * We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation.\\n * We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation.\\n * Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier)\\n\\n * - Accountbound (opt-in, with cooldown period)\\n * The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group.\\n * Users can update their attestation's destination by providing a new Hydra-S1 ZK proof \\n * It means the attestation is bound to the source account, stored on an updatable destination account.\\n * When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional.\\n * A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred\\n * One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations.\\n \\n * - Renewable\\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew or update their attestations\\n **/\\n\\ncontract HydraS1AccountboundAttester is\\n IHydraS1AccountboundAttester,\\n HydraS1SimpleAttester,\\n Ownable\\n{\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n uint8 public constant IMPLEMENTATION_VERSION = 4;\\n\\n /*******************************************************\\n Storage layout:\\n 20 slots between HydraS1SimpleAttester and HydraS1AccountboundAttester\\n 1 currently used by Ownable\\n 19 place holders\\n 2O for config\\n 1 currently used\\n 19 place holders\\n 20 for logic\\n 2 currently used\\n 18 place holders\\n *******************************************************/\\n\\n // keeping some space for future config logics\\n uint256[19] private _placeHolderBeforeHydraS1Accountbound;\\n\\n // cooldown durations for each groupIndex\\n mapping(uint256 => uint32) internal _cooldownDurations;\\n\\n // keeping some space for future config logics\\n uint256[19] private _placeHoldersHydraS1AccountboundConfig;\\n\\n mapping(uint256 => uint32) internal _nullifiersCooldownStart;\\n mapping(uint256 => uint16) internal _nullifiersBurnCount;\\n\\n // keeping some space for future config logics\\n uint256[18] private _placeHoldersHydraS1AccountboundLogic;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first attestation collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last attestation collection in which the attester is supposed to record\\n * @param owner Address of attester's owner\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n address owner\\n )\\n HydraS1SimpleAttester(\\n attestationsRegistryAddress,\\n hydraS1VerifierAddress,\\n availableRootsRegistryAddress,\\n commitmentMapperAddress,\\n collectionIdFirst,\\n collectionIdLast\\n )\\n {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Returns the actual attestations constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark public input as well as snark proof\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual override(IAttester, HydraS1SimpleAttester) returns (Attestation[] memory) {\\n Attestation[] memory attestations = super.buildAttestations(request, proofData);\\n\\n uint256 nullifier = proofData._getNullifier();\\n attestations[0].extraData = abi.encode(\\n attestations[0].extraData, // nullifier, from HydraS1 Simple\\n _getNextBurnCount(nullifier, attestations[0].owner) // BurnCount\\n );\\n\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if nullifier already used, not a renewal, and nullifier on cooldown.\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n uint256 nullifier = proofData._getNullifier();\\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\\n\\n HydraS1Claim memory claim = request._claim();\\n\\n // check if the nullifier has already been used previously, if so it may be on cooldown\\n if (\\n previousNullifierDestination != address(0) &&\\n previousNullifierDestination != claim.destination\\n ) {\\n uint32 cooldownDuration = _getCooldownDurationForGroupIndex(claim.groupProperties.groupIndex);\\n if (cooldownDuration == 0) {\\n revert CooldownDurationNotSetForGroupIndex(claim.groupProperties.groupIndex);\\n }\\n if (_isOnCooldown(nullifier, cooldownDuration)) {\\n uint16 burnCount = _getNullifierBurnCount(nullifier);\\n revert NullifierOnCooldown(\\n nullifier,\\n previousNullifierDestination,\\n burnCount,\\n cooldownDuration\\n );\\n }\\n\\n // Delete the old Attestation linked to the nullifier before recording the new one (accountbound feature)\\n _deletePreviousAttestation(claim, previousNullifierDestination);\\n\\n _setNullifierOnCooldownAndIncrementBurnCount(nullifier);\\n }\\n _setDestinationForNullifier(nullifier, request.destination);\\n }\\n\\n /*******************************************************\\n LOGIC FUNCTIONS RELATED TO ACCOUNTBOUND FEATURE\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the burnCount of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16) {\\n return _getNullifierBurnCount(nullifier);\\n }\\n\\n /**\\n * @dev Getter, returns the cooldown start of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32) {\\n return _getNullifierCooldownStart(nullifier);\\n }\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external pure override(HydraS1SimpleAttester, IHydraS1AccountboundAttester) returns (uint256) {\\n (uint256 nullifier, ) = abi.decode(extraData, (uint256, uint16));\\n\\n return nullifier;\\n }\\n\\n /**\\n * @dev Returns the burn count for a given extraData\\n * @param extraData bytes where the burnCount is encoded\\n */\\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16) {\\n (, uint16 burnCount) = abi.decode(extraData, (uint256, uint16));\\n\\n return burnCount;\\n }\\n\\n /**\\n * @dev Checks if a nullifier is on cooldown\\n * @param nullifier user nullifier\\n * @param cooldownDuration waiting time before the user can change its badge destination\\n */\\n function _isOnCooldown(uint256 nullifier, uint32 cooldownDuration) internal view returns (bool) {\\n return _getNullifierCooldownStart(nullifier) + cooldownDuration > block.timestamp;\\n }\\n\\n /**\\n * @dev Delete the previous attestation created with this nullifier\\n * @param claim user claim\\n * @param previousNullifierDestination previous destination chosen for this user nullifier\\n */\\n function _deletePreviousAttestation(\\n HydraS1Claim memory claim,\\n address previousNullifierDestination\\n ) internal {\\n address[] memory attestationOwners = new address[](1);\\n uint256[] memory attestationCollectionIds = new uint256[](1);\\n\\n attestationOwners[0] = previousNullifierDestination;\\n attestationCollectionIds[0] = AUTHORIZED_COLLECTION_ID_FIRST + claim.groupProperties.groupIndex;\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n }\\n\\n function _setNullifierOnCooldownAndIncrementBurnCount(uint256 nullifier) internal {\\n _nullifiersCooldownStart[nullifier] = uint32(block.timestamp);\\n _nullifiersBurnCount[nullifier] += 1;\\n emit NullifierSetOnCooldown(nullifier, _nullifiersBurnCount[nullifier]);\\n }\\n\\n function _getNullifierCooldownStart(uint256 nullifier) internal view returns (uint32) {\\n return _nullifiersCooldownStart[nullifier];\\n }\\n\\n function _getNullifierBurnCount(uint256 nullifier) internal view returns (uint16) {\\n return _nullifiersBurnCount[nullifier];\\n }\\n\\n /**\\n * @dev returns burn count or burn count + 1 if new burn will happen\\n * @param nullifier user nullifier\\n * @param claimDestination destination referenced in the user claim\\n */\\n function _getNextBurnCount(\\n uint256 nullifier,\\n address claimDestination\\n ) public view virtual returns (uint16) {\\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\\n uint16 burnCount = _getNullifierBurnCount(nullifier);\\n // If the attestation is minted on a new destination address\\n // the burnCount that will be encoded in the extraData of the Attestation should be incremented\\n if (\\n previousNullifierDestination != address(0) && previousNullifierDestination != claimDestination\\n ) {\\n burnCount += 1;\\n }\\n return burnCount;\\n }\\n\\n /*******************************************************\\n GROUP CONFIGURATION LOGIC\\n *******************************************************/\\n\\n /**\\n * @dev Setter, sets the cooldown duration of a groupIndex\\n * @notice set to 0 to deactivate the accountbound feature for this group\\n * @param groupIndex internal collection id\\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\\n **/\\n function setCooldownDurationForGroupIndex(\\n uint256 groupIndex,\\n uint32 cooldownDuration\\n ) external onlyOwner {\\n _cooldownDurations[groupIndex] = cooldownDuration;\\n emit CooldownDurationSetForGroupIndex(groupIndex, cooldownDuration);\\n }\\n\\n /**\\n * @dev Getter, get the cooldown duration of a groupIndex\\n * @notice returns 0 when the accountbound feature is deactivated for this group\\n * @param groupIndex internal collection id\\n **/\\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32) {\\n return _getCooldownDurationForGroupIndex(groupIndex);\\n }\\n\\n // = 0 means that the accountbound feature is deactivated for this group\\n function _getCooldownDurationForGroupIndex(uint256 groupIndex) internal view returns (uint32) {\\n return _cooldownDurations[groupIndex];\\n }\\n}\\n\",\"keccak256\":\"0x4c391f4bbfdd1b22039fdc7b43f12d7933deca89cc6ae9e5a2b5afa8c427762c\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\\nimport {IHydraS1Base} from './base/IHydraS1Base.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Nullified\\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * nullifier = hash(sourceSecret, externalNullifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - Renewable\\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew their attestations\\n **/\\n\\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n /*******************************************************\\n Storage layout:\\n 20 slots for HydraS1\\n 1 slot used\\n 19 place holders\\n *******************************************************/\\n\\n mapping(uint256 => address) internal _nullifiersDestinations;\\n\\n // keeping some space for future\\n uint256[19] private _placeHoldersHydraS1Simple;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n uint256 nullifier = proofData._getNullifier();\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n abi.encode(nullifier)\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if nullifier already used and not a renewal (e.g destination different that last)\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n // we get the nullifier used from the snark input in the data provided\\n uint256 nullifier = proofData._getNullifier();\\n address currentDestination = _getDestinationOfNullifier(nullifier);\\n\\n if (currentDestination != address(0) && currentDestination != request.destination) {\\n revert NullifierUsed(nullifier);\\n }\\n\\n _setDestinationForNullifier(nullifier, request.destination);\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the external nullifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose externalNullifier = hash(attesterAddress, claim.GroupId)\\n * Creates one nullifier per group, per user and makes sure no collision with other attester's nullifiers\\n **/\\n function _getExternalNullifierOfClaim(\\n HydraS1Claim memory claim\\n ) internal view override returns (uint256) {\\n uint256 externalNullifier = _encodeInSnarkField(\\n address(this),\\n claim.groupProperties.groupIndex\\n );\\n return externalNullifier;\\n }\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external pure virtual override(IHydraS1Base, HydraS1Base) returns (uint256) {\\n return abi.decode(extraData, (uint256));\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getDestinationOfNullifier(uint256 nullifier) external view override returns (address) {\\n return _getDestinationOfNullifier(nullifier);\\n }\\n\\n function _setDestinationForNullifier(uint256 nullifier, address destination) internal virtual {\\n _nullifiersDestinations[nullifier] = destination;\\n emit NullifierDestinationUpdated(nullifier, destination);\\n }\\n\\n function _getDestinationOfNullifier(uint256 nullifier) internal view returns (address) {\\n return _nullifiersDestinations[nullifier];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x7bb2f154f8b33d4c536ebe7828baeb25853d9c288d85b75f0f9d4c3a8e01e735\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Attester} from '../../../core/Attester.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n *\\n */\\nabstract contract HydraS1Base is IHydraS1Base, Attester, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the nullifier from an attestation extraData\\n * @dev Getter of a nullifier encoded in extraData\\n * @notice Must be implemented by the inheriting contracts\\n * @param extraData extraData where nullifier can be encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external view virtual returns (uint256);\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the external nullifier from a user request\\n * so it can be checked against snark input\\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n *\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of external nullifiers\\n *\\n * Do they get one external nullifier per claim?\\n * Do they get 2 external nullifiers per claim?\\n * Do they get 1 external nullifier per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getExternalNullifierOfClaim(\\n HydraS1Claim memory claim\\n ) internal view virtual returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(\\n HydraS1Claim memory claim,\\n HydraS1ProofInput memory input\\n ) internal view virtual {\\n if (input.accountsTreeValue != claim.groupId) {\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n }\\n\\n if (input.isStrict == claim.groupProperties.isScore) {\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n }\\n\\n if (input.destination != claim.destination) {\\n revert DestinationMismatch(claim.destination, input.destination);\\n }\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot)) {\\n revert RegistryRootMismatch(input.registryRoot);\\n }\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n ) {\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n }\\n\\n uint256 externalNullifier = _getExternalNullifierOfClaim(claim);\\n\\n if (input.externalNullifier != externalNullifier) {\\n revert ExternalNullifierMismatch(externalNullifier, input.externalNullifier);\\n }\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(uint256 /*errorCode*/) {\\n revert InvalidGroth16Proof('');\\n } catch (bytes memory /*lowLevelData*/) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0x8614a04a2a58649b4434fab39ca30e3ff0d94d09998355dbd9fa5bf762b3c845\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Interface\\n * @author Sismo\\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n **/\\ninterface IHydraS1Base is IAttester {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error ExternalNullifierMismatch(uint256 expectedExternalNullifier, uint256 externalNullifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n function getNullifierFromExtraData(bytes memory extraData) external view returns (uint256);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x65b9966e5cf43975edb64c742057153058ee31bea1beadf4456577e9d5dbc76d\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1AccountboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from '././IHydraS1SimpleAttester.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Interface\\n * @author Sismo\\n * @notice Interface of the HydraS1AccountboundAttester contract which inherits from the errors, events and methods specific to the HydraS1SimpleAttester interface.\\n **/\\ninterface IHydraS1AccountboundAttester is IHydraS1SimpleAttester {\\n /**\\n * @dev Event emitted when the duration of the cooldown duration for a group index (internal collection id) has been set\\n * @param groupIndex internal collection id\\n * @param cooldownDuration the duration of the cooldown period\\n **/\\n event CooldownDurationSetForGroupIndex(uint256 indexed groupIndex, uint32 cooldownDuration);\\n\\n /**\\n * @dev Event emitted when the nullifier has been set on cooldown. This happens when the\\n * attestation destination of a nullifier has been changed\\n * @param nullifier user nullifier\\n * @param burnCount the number of times the attestation destination of a nullifier has been changed\\n **/\\n event NullifierSetOnCooldown(uint256 indexed nullifier, uint16 burnCount);\\n\\n /**\\n * @dev Error when the nullifier is on cooldown. The user have to wait the cooldownDuration\\n * before being able to change again the destination address.\\n **/\\n error NullifierOnCooldown(\\n uint256 nullifier,\\n address destination,\\n uint16 burnCount,\\n uint32 cooldownStart\\n );\\n\\n /**\\n * @dev Error when the cooldown duration for a given groupIndex is equal to zero.\\n * The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.\\n **/\\n error CooldownDurationNotSetForGroupIndex(uint256 groupIndex);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(bytes memory extraData) external pure returns (uint256);\\n\\n /**\\n * @dev Returns the burn count for a given extraData\\n * @param extraData bytes where the burnCount is encoded\\n */\\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16);\\n\\n /**\\n * @dev Getter, returns the cooldown start of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32);\\n\\n /**\\n * @dev Getter, returns the burnCount of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16);\\n\\n /**\\n * @dev Setter, sets the cooldown duration of a groupIndex\\n * @param groupIndex internal collection id\\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\\n **/\\n function setCooldownDurationForGroupIndex(uint256 groupIndex, uint32 cooldownDuration) external;\\n\\n /*/**\\n * @dev Getter, get the cooldown duration of a groupIndex\\n * @notice returns 0 when the accountbound feature is deactivated for this group\\n * @param groupIndex internal collection id\\n **/\\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32);\\n}\\n\",\"keccak256\":\"0x69293ce8ee200e3ce8b34478b5dde62d934e32c4f82d173314a4ed72731b3663\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Interface\\n * @author Sismo\\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\\n **/\\ninterface IHydraS1SimpleAttester is IHydraS1Base {\\n /**\\n * @dev Error when the nullifier is already used for a destination address\\n **/\\n error NullifierUsed(uint256 nullifier);\\n\\n /**\\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\\n **/\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n /**\\n * @dev Event emitted when the nullifier is associated to a destination address.\\n **/\\n event NullifierDestinationUpdated(uint256 nullifier, address newOwner);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getDestinationOfNullifier(uint256 nullifier) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x8222c187e8314c931121c7632965316f079322b076501a5443d3102a0891a8d5\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // externalNullifier\\n // nullifier\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 externalNullifier;\\n uint256 nullifier;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getNullifier(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(\\n HydraS1ProofData memory self\\n )\\n internal\\n pure\\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[10] memory)\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(\\n HydraS1ProofData memory self\\n ) internal pure returns (uint256[2] memory) {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(\\n HydraS1ProofData memory self\\n ) internal pure returns (uint256) {\\n return self.input[5];\\n }\\n\\n function _getNullifier(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getNullifier(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 nullifier = uint256(_getNullifier(snarkProofData));\\n return nullifier;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(\\n bytes memory encodedProperties\\n ) internal pure returns (uint256) {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0xa484f046e44f6c77177ba6f165573dc3ee90680a057dff7d3de46d67a29c462a\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n address[] memory attestationOwners = new address[](collectionIds.length);\\n\\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\\n\\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n // fetch attestations from the registry\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationOwners[i] = attestationsOwner;\\n attestationCollectionIds[i] = collectionIds[i];\\n\\n attestations[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestations, proofData);\\n\\n _beforeDeleteAttestations(attestations, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n\\n _afterDeleteAttestations(attestations, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestations[i]);\\n }\\n return attestations;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x7743f02ed07e1b40a2ff45f5a45b5fe87d765326cce3528676cbd36c3d08ba37\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0x2d5faf5df56dfe1294202e89180846a1d4a5f938699619ee73b60c7314a97dfe\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3467998cbdb82b0c64aa8627efc5893d2b369f73e66e5d1095305e4609593cc5\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address ownerAddress,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0x1b6ab7a4ba266f3da2c7f6ba3de93e3ab89f389dbd6db14514b43cbdcbe9fe09\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5e882d3091e816f1286837eef92ae17737abf66fdeece1282b752f27ba18492b\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0xcb419cf389baad6f38de28625718f64f551d2669339c1b4e1887e11d62484469\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101406040523480156200001257600080fd5b5060405162002b2738038062002b2783398101604081905262000035916200020f565b6001600160a01b0387811660805286811660a05285811660e052841660c0526101008390526101208290526200006b3362000083565b6200007681620000d5565b5050505050505062000292565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054600490610100900460ff16158015620000f8575060005460ff8083169116105b620001605760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff831617610100178155620001876015546001600160a01b031690565b6001600160a01b031614806200019c5750303b155b15620001ad57620001ad8262000083565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b80516001600160a01b03811681146200020a57600080fd5b919050565b600080600080600080600060e0888a0312156200022b57600080fd5b6200023688620001f2565b96506200024660208901620001f2565b95506200025660408901620001f2565b94506200026660608901620001f2565b93506080880151925060a088015191506200028460c08901620001f2565b905092959891949750929550565b60805160a05160c05160e05161010051610120516127ff620003286000396000818161025e0152610d9201526000818161023701528181610d6a01526117200152600081816102dd01526112fa01526000818161017901526113960152600081816101f901526114f7015260008181610323015281816107820152818161096301528181610ae8015261177901526127ff6000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c80638b159099116100b8578063c4d66de81161007c578063c4d66de814610347578063c776adde1461035a578063ca1cc6461461036d578063e60f999f14610380578063f2fde38b14610393578063f7e420b3146103a657600080fd5b80638b159099146102a25780638da5cb5b146102ca578063918447af146102db578063af411a3014610301578063bfa665851461032157600080fd5b806346657fe91161010a57806346657fe9146101f7578063524a32481461021d57806354846d7a146102325780637000b05114610259578063715018a614610280578063754b377c1461028857600080fd5b8063063599db146101475780632254f98e14610177578063345dd9891461019d5780633800a4b9146101be5780633c4a9854146101e4575b600080fd5b61015a610155366004611bbf565b6103b9565b6040516001600160a01b0390911681526020015b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000061015a565b6101b06101ab366004611ce1565b6103d8565b60405190815260200161016e565b6101d16101cc366004611bbf565b6103f7565b60405161ffff909116815260200161016e565b6101d16101f2366004611ce1565b61040f565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61023061022b366004611d27565b61042e565b005b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b610230610494565b610290600481565b60405160ff909116815260200161016e565b6102b56102b0366004611bbf565b6104a8565b60405163ffffffff909116815260200161016e565b6015546001600160a01b031661015a565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61031461030f366004611d9f565b6104c2565b60405161016e9190611ec2565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b610230610355366004611f49565b610573565b610314610368366004611f66565b61068b565b6101d161037b366004612017565b610a46565b61031461038e366004611d9f565b610aaa565b6102306103a1366004611f49565b610bc6565b6102b56103b4366004611bbf565b610c3f565b6000818152600160205260408120546001600160a01b03165b92915050565b600080828060200190518101906103ef919061203c565b509392505050565b6000818152603e602052604081205461ffff166103d2565b60008082806020019051810190610426919061203c565b949350505050565b610436610c59565b600082815260296020908152604091829020805463ffffffff191663ffffffff8516908117909155915191825283917f893e2a4c394b497c1a2b041d18acc02d05deb2cc7ae3ea0f85d001aa93dff48b910160405180910390a25050565b61049c610c59565b6104a66000610cb3565b565b60008181526029602052604081205463ffffffff166103d2565b606060006104d1858585610d05565b905060006104df8585610e84565b9050816000815181106104f4576104f4612068565b602002602001015160a00151610528828460008151811061051757610517612068565b602002602001015160200151610a46565b60405160200161053992919061207e565b6040516020818303038152906040528260008151811061055b5761055b612068565b602090810291909101015160a0015250949350505050565b600054600490610100900460ff16158015610595575060005460ff8083169116105b6105fd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556106236015546001600160a01b031690565b6001600160a01b031614806106375750303b155b156106455761064582610cb3565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60606000856001600160401b038111156106a7576106a7611bd8565b6040519080825280602002602001820160405280156106d0578160200160208202803683370190505b5090506000866001600160401b038111156106ed576106ed611bd8565b604051908082528060200260200182016040528015610716578160200160208202803683370190505b5090506000876001600160401b0381111561073357610733611bd8565b60405190808252806020026020018201604052801561076c57816020015b610759611a9d565b8152602001906001900390816107515790505b50905060005b88811015610940576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106107c1576107c1612068565b905060200201358e6040518363ffffffff1660e01b81526004016107f89291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610815573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261083d91908101906120a4565b93509350935093508b88868151811061085857610858612068565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061088a5761088a612068565b905060200201358786815181106108a3576108a3612068565b6020026020010181815250506040518060c001604052808f8f888181106108cc576108cc612068565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061091e5761091e612068565b60200260200101819052505050505080806109389061216c565b915050610772565b5061094c818787610ea0565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061099a9086908690600401612185565b600060405180830381600087803b1580156109b457600080fd5b505af11580156109c8573d6000803e3d6000fd5b5050505060005b88811015610a39577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b828281518110610a0a57610a0a612068565b6020026020010151604051610a1f9190612209565b60405180910390a180610a318161216c565b9150506109cf565b5098975050505050505050565b600082815260016020908152604080832054603e9092528220546001600160a01b039091169061ffff168115801590610a915750836001600160a01b0316826001600160a01b031614155b1561042657610aa160018261221c565b95945050505050565b6060610ab7848484610eb9565b6000610ac48585856104c2565b9050610ad1858585610f01565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c09390610b1d908490600401611ec2565b600060405180830381600087803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b5050505060005b8151811015610bbd577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610b8e57610b8e612068565b6020026020010151604051610ba39190612209565b60405180910390a180610bb58161216c565b915050610b52565b50949350505050565b610bce610c59565b6001600160a01b038116610c335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b610c3c81610cb3565b50565b6000818152603d602052604081205463ffffffff166103d2565b6015546001600160a01b031633146104a65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105f4565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606000610d1a610d1586612242565b611057565b60408051600180825281830190925291925060009190816020015b610d3d611a9d565b815260200190600190039081610d35575050606083015151909150600090610d8e906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b90507f0000000000000000000000000000000000000000000000000000000000000000811115610dd457604051637bbf29e360e01b8152600481018290526024016105f4565b306000610de18888610e84565b90506040518060c0016040528084815260200186604001516001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff16815260200182604051602001610e4791815260200190565b60405160208183030381529060405281525084600081518110610e6c57610e6c612068565b60209081029190910101525091979650505050505050565b600080610e9383850185612439565b90506000610aa1826110dc565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ec782840184612439565b90506000610ed4826110f2565b90506000610ee4610d1587612242565b9050610ef0818361119c565b610ef9836114cd565b505050505050565b6000610f0d8383610e84565b6000818152600160205260408120549192506001600160a01b0390911690610f37610d1587612242565b90506001600160a01b03821615801590610f67575080604001516001600160a01b0316826001600160a01b031614155b1561103e576060810151516001600160801b031660009081526029602052604081205463ffffffff1690819003610fc35760608201515160405163065ef5f360e01b81526001600160801b0390911660048201526024016105f4565b610fcd848261166a565b15611029576000848152603e602052604081205461ffff16604051630d16862d60e11b8152600481018790526001600160a01b038616602482015261ffff8216604482015263ffffffff841660648201529091506084016105f4565b611033828461169a565b61103c846117e8565b505b610ef9836110526040890160208a01611f49565b61188f565b61105f611aeb565b6000826000015160008151811061107857611078612068565b6020026020010151905061108b816118ee565b600081604001518060200190518101906110a5919061251a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b602081015160009060065b602002015192915050565b6110fa611b4e565b60405180610120016040528061110f8461192e565b6001600160a01b031681526020016111268461193c565b81526020016111348461194b565b81526020016111428461195a565b8152602001611150846110dc565b815260200161115e84611969565b815260200161116c84611978565b81526020016111848460200151610120015160011490565b1515815260200161119484611987565b905292915050565b815160c0820151146111d157815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016105f4565b81606001516040015115158160e0015115150361121c57606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016105f4565b81604001516001600160a01b031681600001516001600160a01b03161461127057604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016105f4565b468160200151146112a3576020810151604051630432cec160e31b815246600482015260248101919091526044016105f4565b81602001518160a00151146112de57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016105f4565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015611349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136d9190612595565b61139257806040015160405163cbfe7bc360e01b81526004016105f491815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa1580156113f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141591906125b0565b80516101008401515191925014158061143c57506020808201516101008401519091015114155b15611486578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016105f4565b6000611491846119df565b9050808360600151146114c7576060830151604051630e6efbdd60e21b81526105f4918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946115309490939290919060040161262c565b602060405180830381865afa925050508015611569575060408051601f3d908101601f1916820190925261156691810190612595565b60015b61163f576115756126b0565b806308c379a0036115ae57506115896126cc565b8061159457506115ed565b8060405162dd577760e81b81526004016105f49190612755565b634e487b71036115ed576115c0612768565b906115cb57506115ed565b60405162dd577760e81b815260206004820152600060248201526044016105f4565b3d808015611617576040519150601f19603f3d011682016040523d82523d6000602084013e61161c565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016105f4565b806116665760405162dd577760e81b815260206004820152600060248201526044016105f4565b5050565b6000828152603d6020526040812054429061168c90849063ffffffff16612788565b63ffffffff16119392505050565b60408051600180825281830190925260009160208083019080368337505060408051600180825281830190925292935060009291506020808301908036833701905050905082826000815181106116f3576116f3612068565b6001600160a01b0390921660209283029190910190910152606084015151611744906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b8160008151811061175757611757612068565b602090810291909101015260405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af7906117b09085908590600401612185565b600060405180830381600087803b1580156117ca57600080fd5b505af11580156117de573d6000803e3d6000fd5b5050505050505050565b6000818152603d60209081526040808320805463ffffffff19164263ffffffff16179055603e909152812080546001929061182890849061ffff1661221c565b82546101009290920a61ffff8181021990931691831602179091556000838152603e60209081526040918290205491519190921681528392507f85183f8abad8891335fb845d2e6b4f84a9c7f7409f242f4e5ec138a84abffacf910160405180910390a250565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f0c5a122814a29e22d1363dacdd6f7c95345b70890f97e65eacb5565da28116ac910161067f565b60006118fd8260400151611a04565b825190915081146116665781516040516337e3d1ab60e01b81526105f4918391600401918252602082015260400190565b6020810151600090816110e7565b602081015160009060016110e7565b602081015160009060046110e7565b602081015160009060056110e7565b602081015160009060076110e7565b602081015160009060086110e7565b61198f611ba1565b604051806040016040528083602001516002600a81106119b1576119b1612068565b6020020151815260200183602001516003600a81106119d2576119d2612068565b6020020151905292915050565b6000806119fd308460600151600001516001600160801b0316611a39565b9392505050565b805160208201206000906103d2907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906127a7565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6119fd91906127a7565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b03168152602001611b49604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001611b495b60405180604001604052806002906020820280368337509192915050565b600060208284031215611bd157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b0382111715611c0d57611c0d611bd8565b60405250565b606081018181106001600160401b0382111715611c0d57611c0d611bd8565b601f8201601f191681016001600160401b0381118282101715611c5757611c57611bd8565b6040525050565b60006001600160401b03821115611c7757611c77611bd8565b50601f01601f191660200190565b600082601f830112611c9657600080fd5b8135611ca181611c5e565b604051611cae8282611c32565b828152856020848701011115611cc357600080fd5b82602086016020830137600092810160200192909252509392505050565b600060208284031215611cf357600080fd5b81356001600160401b03811115611d0957600080fd5b61042684828501611c85565b63ffffffff81168114610c3c57600080fd5b60008060408385031215611d3a57600080fd5b823591506020830135611d4c81611d15565b809150509250929050565b60008083601f840112611d6957600080fd5b5081356001600160401b03811115611d8057600080fd5b602083019150836020828501011115611d9857600080fd5b9250929050565b600080600060408486031215611db457600080fd5b83356001600160401b0380821115611dcb57600080fd5b9085019060408288031215611ddf57600080fd5b90935060208501359080821115611df557600080fd5b50611e0286828701611d57565b9497909650939450505050565b60005b83811015611e2a578181015183820152602001611e12565b838111156114c75750506000910152565b60008151808452611e53816020860160208601611e0f565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261042660c0850182611e3b565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611f1757603f19888603018452611f05858351611e67565b94509285019290850190600101611ee9565b5092979650505050505050565b6001600160a01b0381168114610c3c57600080fd5b8035611f4481611f24565b919050565b600060208284031215611f5b57600080fd5b81356119fd81611f24565b600080600080600060608688031215611f7e57600080fd5b85356001600160401b0380821115611f9557600080fd5b818801915088601f830112611fa957600080fd5b813581811115611fb857600080fd5b8960208260051b8501011115611fcd57600080fd5b60208301975080965050611fe360208901611f39565b94506040880135915080821115611ff957600080fd5b5061200688828901611d57565b969995985093965092949392505050565b6000806040838503121561202a57600080fd5b823591506020830135611d4c81611f24565b6000806040838503121561204f57600080fd5b82519150602083015161ffff81168114611d4c57600080fd5b634e487b7160e01b600052603260045260246000fd5b6040815260006120916040830185611e3b565b905061ffff831660208301529392505050565b600080600080608085870312156120ba57600080fd5b84516120c581611f24565b6020860151604087015191955093506120dd81611d15565b60608601519092506001600160401b038111156120f957600080fd5b8501601f8101871361210a57600080fd5b805161211581611c5e565b6040516121228282611c32565b82815289602084860101111561213757600080fd5b612148836020830160208701611e0f565b969995985093965050505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161217e5761217e612156565b5060010190565b604080825283519082018190526000906020906060840190828701845b828110156121c75781516001600160a01b0316845292840192908401906001016121a2565b5050508381038285015284518082528583019183019060005b818110156121fc578351835292840192918401916001016121e0565b5090979650505050505050565b6020815260006119fd6020830184611e67565b600061ffff80831681851680830382111561223957612239612156565b01949350505050565b6000604080833603121561225557600080fd5b805161226081611bee565b83356001600160401b038082111561227757600080fd5b9085019036601f83011261228a57600080fd5b813560208282111561229e5761229e611bd8565b8160051b86516122b083830182611c32565b928352848101820192828101368511156122c957600080fd5b83870192505b8483101561234d578235868111156122e75760008081fd5b8701606036829003601f19018113156123005760008081fd5b8a5161230b81611c13565b8287013581528b8301358188015290820135908882111561232c5760008081fd5b61233a368884860101611c85565b818d0152835250509183019183016122cf565b5086525061235c888201611f39565b90850152509195945050505050565b6000821982111561237e5761237e612156565b500190565b600082601f83011261239457600080fd5b6040516123a081611bee565b8060408401858111156123b257600080fd5b845b818110156123cc5780358352602092830192016123b4565b509195945050505050565b600082601f8301126123e857600080fd5b6040516101408082018281106001600160401b038211171561240c5761240c611bd8565b6040528301818582111561241f57600080fd5b845b828110156123cc578035825260209182019101612421565b600081830361024081121561244d57600080fd5b6040805161245a81611bee565b6101008084121561246a57600080fd5b8251935061247784611c13565b6124818787612383565b845286605f87011261249257600080fd5b825161249d81611bee565b8060c08801898111156124af57600080fd5b8589015b818110156124d4576124c58b82612383565b835260209092019186016124b3565b508260208801526124e58a82612383565b868801525050508382526124fb878288016123d7565b60208301525095945050505050565b80518015158114611f4457600080fd5b60006060828403121561252c57600080fd5b604051606081018181106001600160401b038211171561254e5761254e611bd8565b60405282516001600160801b038116811461256857600080fd5b8152602083015161257881611d15565b60208201526125896040840161250a565b60408201529392505050565b6000602082840312156125a757600080fd5b6119fd8261250a565b6000604082840312156125c257600080fd5b82601f8301126125d157600080fd5b6040516125dd81611bee565b8060408401858111156125ef57600080fd5b845b818110156123cc5780518352602092830192016125f1565b8060005b60028110156114c757815184526020938401939091019060010161260d565b610240810161263b8287612609565b60408083018660005b600281101561266b57612658838351612609565b9183019160209190910190600101612644565b5050505061267c60c0830185612609565b61010082018360005b600a8110156126a4578151835260209283019290910190600101612685565b50505095945050505050565b600060033d11156126c95760046000803e5060005160e01c5b90565b600060443d10156126da5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561270957505050505090565b82850191508151818111156127215750505050505090565b843d870101602082850101111561273b5750505050505090565b61274a60208286010187611c32565b509095945050505050565b6020815260006119fd6020830184611e3b565b60008060233d1115612784576020600460003e50506000516001905b9091565b600063ffffffff80831681851680830382111561223957612239612156565b6000826127c457634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220202a9a70b259c56940b27ba667618cafc46cd9a9f1eb7ea03e8803b68fee4b3964736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101425760003560e01c80638b159099116100b8578063c4d66de81161007c578063c4d66de814610347578063c776adde1461035a578063ca1cc6461461036d578063e60f999f14610380578063f2fde38b14610393578063f7e420b3146103a657600080fd5b80638b159099146102a25780638da5cb5b146102ca578063918447af146102db578063af411a3014610301578063bfa665851461032157600080fd5b806346657fe91161010a57806346657fe9146101f7578063524a32481461021d57806354846d7a146102325780637000b05114610259578063715018a614610280578063754b377c1461028857600080fd5b8063063599db146101475780632254f98e14610177578063345dd9891461019d5780633800a4b9146101be5780633c4a9854146101e4575b600080fd5b61015a610155366004611bbf565b6103b9565b6040516001600160a01b0390911681526020015b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000061015a565b6101b06101ab366004611ce1565b6103d8565b60405190815260200161016e565b6101d16101cc366004611bbf565b6103f7565b60405161ffff909116815260200161016e565b6101d16101f2366004611ce1565b61040f565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61023061022b366004611d27565b61042e565b005b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b610230610494565b610290600481565b60405160ff909116815260200161016e565b6102b56102b0366004611bbf565b6104a8565b60405163ffffffff909116815260200161016e565b6015546001600160a01b031661015a565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61031461030f366004611d9f565b6104c2565b60405161016e9190611ec2565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b610230610355366004611f49565b610573565b610314610368366004611f66565b61068b565b6101d161037b366004612017565b610a46565b61031461038e366004611d9f565b610aaa565b6102306103a1366004611f49565b610bc6565b6102b56103b4366004611bbf565b610c3f565b6000818152600160205260408120546001600160a01b03165b92915050565b600080828060200190518101906103ef919061203c565b509392505050565b6000818152603e602052604081205461ffff166103d2565b60008082806020019051810190610426919061203c565b949350505050565b610436610c59565b600082815260296020908152604091829020805463ffffffff191663ffffffff8516908117909155915191825283917f893e2a4c394b497c1a2b041d18acc02d05deb2cc7ae3ea0f85d001aa93dff48b910160405180910390a25050565b61049c610c59565b6104a66000610cb3565b565b60008181526029602052604081205463ffffffff166103d2565b606060006104d1858585610d05565b905060006104df8585610e84565b9050816000815181106104f4576104f4612068565b602002602001015160a00151610528828460008151811061051757610517612068565b602002602001015160200151610a46565b60405160200161053992919061207e565b6040516020818303038152906040528260008151811061055b5761055b612068565b602090810291909101015160a0015250949350505050565b600054600490610100900460ff16158015610595575060005460ff8083169116105b6105fd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556106236015546001600160a01b031690565b6001600160a01b031614806106375750303b155b156106455761064582610cb3565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60606000856001600160401b038111156106a7576106a7611bd8565b6040519080825280602002602001820160405280156106d0578160200160208202803683370190505b5090506000866001600160401b038111156106ed576106ed611bd8565b604051908082528060200260200182016040528015610716578160200160208202803683370190505b5090506000876001600160401b0381111561073357610733611bd8565b60405190808252806020026020018201604052801561076c57816020015b610759611a9d565b8152602001906001900390816107515790505b50905060005b88811015610940576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106107c1576107c1612068565b905060200201358e6040518363ffffffff1660e01b81526004016107f89291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610815573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261083d91908101906120a4565b93509350935093508b88868151811061085857610858612068565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061088a5761088a612068565b905060200201358786815181106108a3576108a3612068565b6020026020010181815250506040518060c001604052808f8f888181106108cc576108cc612068565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061091e5761091e612068565b60200260200101819052505050505080806109389061216c565b915050610772565b5061094c818787610ea0565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061099a9086908690600401612185565b600060405180830381600087803b1580156109b457600080fd5b505af11580156109c8573d6000803e3d6000fd5b5050505060005b88811015610a39577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b828281518110610a0a57610a0a612068565b6020026020010151604051610a1f9190612209565b60405180910390a180610a318161216c565b9150506109cf565b5098975050505050505050565b600082815260016020908152604080832054603e9092528220546001600160a01b039091169061ffff168115801590610a915750836001600160a01b0316826001600160a01b031614155b1561042657610aa160018261221c565b95945050505050565b6060610ab7848484610eb9565b6000610ac48585856104c2565b9050610ad1858585610f01565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c09390610b1d908490600401611ec2565b600060405180830381600087803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b5050505060005b8151811015610bbd577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610b8e57610b8e612068565b6020026020010151604051610ba39190612209565b60405180910390a180610bb58161216c565b915050610b52565b50949350505050565b610bce610c59565b6001600160a01b038116610c335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b610c3c81610cb3565b50565b6000818152603d602052604081205463ffffffff166103d2565b6015546001600160a01b031633146104a65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105f4565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606000610d1a610d1586612242565b611057565b60408051600180825281830190925291925060009190816020015b610d3d611a9d565b815260200190600190039081610d35575050606083015151909150600090610d8e906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b90507f0000000000000000000000000000000000000000000000000000000000000000811115610dd457604051637bbf29e360e01b8152600481018290526024016105f4565b306000610de18888610e84565b90506040518060c0016040528084815260200186604001516001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff16815260200182604051602001610e4791815260200190565b60405160208183030381529060405281525084600081518110610e6c57610e6c612068565b60209081029190910101525091979650505050505050565b600080610e9383850185612439565b90506000610aa1826110dc565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ec782840184612439565b90506000610ed4826110f2565b90506000610ee4610d1587612242565b9050610ef0818361119c565b610ef9836114cd565b505050505050565b6000610f0d8383610e84565b6000818152600160205260408120549192506001600160a01b0390911690610f37610d1587612242565b90506001600160a01b03821615801590610f67575080604001516001600160a01b0316826001600160a01b031614155b1561103e576060810151516001600160801b031660009081526029602052604081205463ffffffff1690819003610fc35760608201515160405163065ef5f360e01b81526001600160801b0390911660048201526024016105f4565b610fcd848261166a565b15611029576000848152603e602052604081205461ffff16604051630d16862d60e11b8152600481018790526001600160a01b038616602482015261ffff8216604482015263ffffffff841660648201529091506084016105f4565b611033828461169a565b61103c846117e8565b505b610ef9836110526040890160208a01611f49565b61188f565b61105f611aeb565b6000826000015160008151811061107857611078612068565b6020026020010151905061108b816118ee565b600081604001518060200190518101906110a5919061251a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b602081015160009060065b602002015192915050565b6110fa611b4e565b60405180610120016040528061110f8461192e565b6001600160a01b031681526020016111268461193c565b81526020016111348461194b565b81526020016111428461195a565b8152602001611150846110dc565b815260200161115e84611969565b815260200161116c84611978565b81526020016111848460200151610120015160011490565b1515815260200161119484611987565b905292915050565b815160c0820151146111d157815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016105f4565b81606001516040015115158160e0015115150361121c57606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016105f4565b81604001516001600160a01b031681600001516001600160a01b03161461127057604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016105f4565b468160200151146112a3576020810151604051630432cec160e31b815246600482015260248101919091526044016105f4565b81602001518160a00151146112de57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016105f4565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015611349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136d9190612595565b61139257806040015160405163cbfe7bc360e01b81526004016105f491815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa1580156113f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141591906125b0565b80516101008401515191925014158061143c57506020808201516101008401519091015114155b15611486578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016105f4565b6000611491846119df565b9050808360600151146114c7576060830151604051630e6efbdd60e21b81526105f4918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946115309490939290919060040161262c565b602060405180830381865afa925050508015611569575060408051601f3d908101601f1916820190925261156691810190612595565b60015b61163f576115756126b0565b806308c379a0036115ae57506115896126cc565b8061159457506115ed565b8060405162dd577760e81b81526004016105f49190612755565b634e487b71036115ed576115c0612768565b906115cb57506115ed565b60405162dd577760e81b815260206004820152600060248201526044016105f4565b3d808015611617576040519150601f19603f3d011682016040523d82523d6000602084013e61161c565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016105f4565b806116665760405162dd577760e81b815260206004820152600060248201526044016105f4565b5050565b6000828152603d6020526040812054429061168c90849063ffffffff16612788565b63ffffffff16119392505050565b60408051600180825281830190925260009160208083019080368337505060408051600180825281830190925292935060009291506020808301908036833701905050905082826000815181106116f3576116f3612068565b6001600160a01b0390921660209283029190910190910152606084015151611744906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b8160008151811061175757611757612068565b602090810291909101015260405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af7906117b09085908590600401612185565b600060405180830381600087803b1580156117ca57600080fd5b505af11580156117de573d6000803e3d6000fd5b5050505050505050565b6000818152603d60209081526040808320805463ffffffff19164263ffffffff16179055603e909152812080546001929061182890849061ffff1661221c565b82546101009290920a61ffff8181021990931691831602179091556000838152603e60209081526040918290205491519190921681528392507f85183f8abad8891335fb845d2e6b4f84a9c7f7409f242f4e5ec138a84abffacf910160405180910390a250565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f0c5a122814a29e22d1363dacdd6f7c95345b70890f97e65eacb5565da28116ac910161067f565b60006118fd8260400151611a04565b825190915081146116665781516040516337e3d1ab60e01b81526105f4918391600401918252602082015260400190565b6020810151600090816110e7565b602081015160009060016110e7565b602081015160009060046110e7565b602081015160009060056110e7565b602081015160009060076110e7565b602081015160009060086110e7565b61198f611ba1565b604051806040016040528083602001516002600a81106119b1576119b1612068565b6020020151815260200183602001516003600a81106119d2576119d2612068565b6020020151905292915050565b6000806119fd308460600151600001516001600160801b0316611a39565b9392505050565b805160208201206000906103d2907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906127a7565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6119fd91906127a7565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b03168152602001611b49604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001611b495b60405180604001604052806002906020820280368337509192915050565b600060208284031215611bd157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b0382111715611c0d57611c0d611bd8565b60405250565b606081018181106001600160401b0382111715611c0d57611c0d611bd8565b601f8201601f191681016001600160401b0381118282101715611c5757611c57611bd8565b6040525050565b60006001600160401b03821115611c7757611c77611bd8565b50601f01601f191660200190565b600082601f830112611c9657600080fd5b8135611ca181611c5e565b604051611cae8282611c32565b828152856020848701011115611cc357600080fd5b82602086016020830137600092810160200192909252509392505050565b600060208284031215611cf357600080fd5b81356001600160401b03811115611d0957600080fd5b61042684828501611c85565b63ffffffff81168114610c3c57600080fd5b60008060408385031215611d3a57600080fd5b823591506020830135611d4c81611d15565b809150509250929050565b60008083601f840112611d6957600080fd5b5081356001600160401b03811115611d8057600080fd5b602083019150836020828501011115611d9857600080fd5b9250929050565b600080600060408486031215611db457600080fd5b83356001600160401b0380821115611dcb57600080fd5b9085019060408288031215611ddf57600080fd5b90935060208501359080821115611df557600080fd5b50611e0286828701611d57565b9497909650939450505050565b60005b83811015611e2a578181015183820152602001611e12565b838111156114c75750506000910152565b60008151808452611e53816020860160208601611e0f565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261042660c0850182611e3b565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611f1757603f19888603018452611f05858351611e67565b94509285019290850190600101611ee9565b5092979650505050505050565b6001600160a01b0381168114610c3c57600080fd5b8035611f4481611f24565b919050565b600060208284031215611f5b57600080fd5b81356119fd81611f24565b600080600080600060608688031215611f7e57600080fd5b85356001600160401b0380821115611f9557600080fd5b818801915088601f830112611fa957600080fd5b813581811115611fb857600080fd5b8960208260051b8501011115611fcd57600080fd5b60208301975080965050611fe360208901611f39565b94506040880135915080821115611ff957600080fd5b5061200688828901611d57565b969995985093965092949392505050565b6000806040838503121561202a57600080fd5b823591506020830135611d4c81611f24565b6000806040838503121561204f57600080fd5b82519150602083015161ffff81168114611d4c57600080fd5b634e487b7160e01b600052603260045260246000fd5b6040815260006120916040830185611e3b565b905061ffff831660208301529392505050565b600080600080608085870312156120ba57600080fd5b84516120c581611f24565b6020860151604087015191955093506120dd81611d15565b60608601519092506001600160401b038111156120f957600080fd5b8501601f8101871361210a57600080fd5b805161211581611c5e565b6040516121228282611c32565b82815289602084860101111561213757600080fd5b612148836020830160208701611e0f565b969995985093965050505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161217e5761217e612156565b5060010190565b604080825283519082018190526000906020906060840190828701845b828110156121c75781516001600160a01b0316845292840192908401906001016121a2565b5050508381038285015284518082528583019183019060005b818110156121fc578351835292840192918401916001016121e0565b5090979650505050505050565b6020815260006119fd6020830184611e67565b600061ffff80831681851680830382111561223957612239612156565b01949350505050565b6000604080833603121561225557600080fd5b805161226081611bee565b83356001600160401b038082111561227757600080fd5b9085019036601f83011261228a57600080fd5b813560208282111561229e5761229e611bd8565b8160051b86516122b083830182611c32565b928352848101820192828101368511156122c957600080fd5b83870192505b8483101561234d578235868111156122e75760008081fd5b8701606036829003601f19018113156123005760008081fd5b8a5161230b81611c13565b8287013581528b8301358188015290820135908882111561232c5760008081fd5b61233a368884860101611c85565b818d0152835250509183019183016122cf565b5086525061235c888201611f39565b90850152509195945050505050565b6000821982111561237e5761237e612156565b500190565b600082601f83011261239457600080fd5b6040516123a081611bee565b8060408401858111156123b257600080fd5b845b818110156123cc5780358352602092830192016123b4565b509195945050505050565b600082601f8301126123e857600080fd5b6040516101408082018281106001600160401b038211171561240c5761240c611bd8565b6040528301818582111561241f57600080fd5b845b828110156123cc578035825260209182019101612421565b600081830361024081121561244d57600080fd5b6040805161245a81611bee565b6101008084121561246a57600080fd5b8251935061247784611c13565b6124818787612383565b845286605f87011261249257600080fd5b825161249d81611bee565b8060c08801898111156124af57600080fd5b8589015b818110156124d4576124c58b82612383565b835260209092019186016124b3565b508260208801526124e58a82612383565b868801525050508382526124fb878288016123d7565b60208301525095945050505050565b80518015158114611f4457600080fd5b60006060828403121561252c57600080fd5b604051606081018181106001600160401b038211171561254e5761254e611bd8565b60405282516001600160801b038116811461256857600080fd5b8152602083015161257881611d15565b60208201526125896040840161250a565b60408201529392505050565b6000602082840312156125a757600080fd5b6119fd8261250a565b6000604082840312156125c257600080fd5b82601f8301126125d157600080fd5b6040516125dd81611bee565b8060408401858111156125ef57600080fd5b845b818110156123cc5780518352602092830192016125f1565b8060005b60028110156114c757815184526020938401939091019060010161260d565b610240810161263b8287612609565b60408083018660005b600281101561266b57612658838351612609565b9183019160209190910190600101612644565b5050505061267c60c0830185612609565b61010082018360005b600a8110156126a4578151835260209283019290910190600101612685565b50505095945050505050565b600060033d11156126c95760046000803e5060005160e01c5b90565b600060443d10156126da5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561270957505050505090565b82850191508151818111156127215750505050505090565b843d870101602082850101111561273b5750505050505090565b61274a60208286010187611c32565b509095945050505050565b6020815260006119fd6020830184611e3b565b60008060233d1115612784576020600460003e50506000516001905b9091565b600063ffffffff80831681851680830382111561223957612239612156565b6000826127c457634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220202a9a70b259c56940b27ba667618cafc46cd9a9f1eb7ea03e8803b68fee4b3964736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "errors": { - "CollectionIdOutOfBound(uint256)": [ - { - "details": "Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST*" - } - ], - "CooldownDurationNotSetForGroupIndex(uint256)": [ - { - "details": "Error when the cooldown duration for a given groupIndex is equal to zero. The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.*" - } - ], - "NullifierOnCooldown(uint256,address,uint16,uint32)": [ - { - "details": "Error when the nullifier is on cooldown. The user have to wait the cooldownDuration before being able to change again the destination address.*" - } - ], - "NullifierUsed(uint256)": [ - { - "details": "Error when the nullifier is already used for a destination address*" - } - ] - }, - "kind": "dev", - "methods": { - "_getNextBurnCount(uint256,address)": { - "details": "returns burn count or burn count + 1 if new burn will happen", - "params": { - "claimDestination": "destination referenced in the user claim", - "nullifier": "user nullifier" - } - }, - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns the actual attestations constructed from the user request", - "params": { - "proofData": "snark public input as well as snark proof", - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "availableRootsRegistryAddress": "Registry storing the available groups for this attester (e.g roots of registry merkle trees)", - "collectionIdFirst": "Id of the first attestation collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last attestation collection in which the attester is supposed to record", - "commitmentMapperAddress": "commitment mapper's public key registry", - "hydraS1VerifierAddress": "ZK Snark Hydra-S1 Verifier contract", - "owner": "Address of attester's owner" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getAvailableRootsRegistry()": { - "details": "Getter of Roots Registry Contract" - }, - "getBurnCountFromExtraData(bytes)": { - "details": "Returns the burn count for a given extraData", - "params": { - "extraData": "bytes where the burnCount is encoded" - } - }, - "getCommitmentMapperRegistry()": { - "details": "Getter of Commitment Mapper Registry contract" - }, - "getCooldownDurationForGroupIndex(uint256)": { - "details": "Getter, get the cooldown duration of a groupIndex", - "params": { - "groupIndex": "internal collection id*" - } - }, - "getDestinationOfNullifier(uint256)": { - "details": "Getter, returns the last attestation destination of a nullifier", - "params": { - "nullifier": "nullifier used*" - } - }, - "getNullifierBurnCount(uint256)": { - "details": "Getter, returns the burnCount of a nullifier", - "params": { - "nullifier": "nullifier used*" - } - }, - "getNullifierCooldownStart(uint256)": { - "details": "Getter, returns the cooldown start of a nullifier", - "params": { - "nullifier": "nullifier used*" - } - }, - "getNullifierFromExtraData(bytes)": { - "details": "returns the nullifier for a given extraData", - "params": { - "extraData": "bytes where the nullifier is encoded" - } - }, - "getVerifier()": { - "details": "Getter of Hydra-S1 Verifier contract" - }, - "initialize(address)": { - "details": "Initialize function, to be called by the proxy delegating calls to this implementation", - "params": { - "ownerAddress": "Owner of the contract, has the right to authorize/unauthorize attestations issuers" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "setCooldownDurationForGroupIndex(uint256,uint32)": { - "details": "Setter, sets the cooldown duration of a groupIndex", - "params": { - "cooldownDuration": "cooldown duration we want to set for the groupIndex*", - "groupIndex": "internal collection id" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "title": "Hydra-S1 Accountbound Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "getCooldownDurationForGroupIndex(uint256)": { - "notice": "returns 0 when the accountbound feature is deactivated for this group" - }, - "initialize(address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - }, - "setCooldownDurationForGroupIndex(uint256,uint32)": { - "notice": "set to 0 to deactivate the accountbound feature for this group" - } - }, - "notice": "This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic. Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic. However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation. The _beforeRecordAttestations is also overriden to fit the Accountbound logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Nullified Each source account gets one nullifier per claim (i.e only one attestation per source account per claim) While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier) We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation. We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation. Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier) - Accountbound (opt-in, with cooldown period) The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group. Users can update their attestation's destination by providing a new Hydra-S1 ZK proof It means the attestation is bound to the source account, stored on an updatable destination account. When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional. A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations. - Renewable A nullifier can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8093, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_nullifiersDestinations", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_address)" - }, - { - "astId": 8097, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_placeHoldersHydraS1Simple", - "offset": 0, - "slot": "2", - "type": "t_array(t_uint256)19_storage" - }, - { - "astId": 396, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_owner", - "offset": 0, - "slot": "21", - "type": "t_address" - }, - { - "astId": 7520, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_placeHolderBeforeHydraS1Accountbound", - "offset": 0, - "slot": "22", - "type": "t_array(t_uint256)19_storage" - }, - { - "astId": 7524, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_cooldownDurations", - "offset": 0, - "slot": "41", - "type": "t_mapping(t_uint256,t_uint32)" - }, - { - "astId": 7528, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_placeHoldersHydraS1AccountboundConfig", - "offset": 0, - "slot": "42", - "type": "t_array(t_uint256)19_storage" - }, - { - "astId": 7532, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_nullifiersCooldownStart", - "offset": 0, - "slot": "61", - "type": "t_mapping(t_uint256,t_uint32)" - }, - { - "astId": 7536, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_nullifiersBurnCount", - "offset": 0, - "slot": "62", - "type": "t_mapping(t_uint256,t_uint16)" - }, - { - "astId": 7540, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_placeHoldersHydraS1AccountboundLogic", - "offset": 0, - "slot": "63", - "type": "t_array(t_uint256)18_storage" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)18_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[18]", - "numberOfBytes": "576" - }, - "t_array(t_uint256)19_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[19]", - "numberOfBytes": "608" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_address)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_mapping(t_uint256,t_uint16)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => uint16)", - "numberOfBytes": "32", - "value": "t_uint16" - }, - "t_mapping(t_uint256,t_uint32)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => uint32)", - "numberOfBytes": "32", - "value": "t_uint32" - }, - "t_uint16": { - "encoding": "inplace", - "label": "uint16", - "numberOfBytes": "2" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/HydraS1AccountboundAttesterProxy.json b/deployments/goerli/HydraS1AccountboundAttesterProxy.json deleted file mode 100644 index 0577614..0000000 --- a/deployments/goerli/HydraS1AccountboundAttesterProxy.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "address": "0x12e69A9b08709324d64c5AEaF4169b03B6199c6C", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0xb52877608cf50001aa27a8b343b44ba978995db8a0f65b06c4e0c781820cbe1c", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x12e69A9b08709324d64c5AEaF4169b03B6199c6C", - "transactionIndex": 13, - "gasUsed": "583384", - "logsBloom": "0x00000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000080000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000200000000000000000008000000001020000000000000000001000000000000000400000000000000000000000000100000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x39230dfbf6a3d9bfa9252d4ce7b2060cb369b856b25b934615166788a299c1d9", - "transactionHash": "0xb52877608cf50001aa27a8b343b44ba978995db8a0f65b06c4e0c781820cbe1c", - "logs": [ - { - "transactionIndex": 13, - "blockNumber": 7711097, - "transactionHash": "0xb52877608cf50001aa27a8b343b44ba978995db8a0f65b06c4e0c781820cbe1c", - "address": "0x12e69A9b08709324d64c5AEaF4169b03B6199c6C", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000bd11cd5c77222dd51b270880f6a4148a8e5a6cb0" - ], - "data": "0x", - "logIndex": 44, - "blockHash": "0x39230dfbf6a3d9bfa9252d4ce7b2060cb369b856b25b934615166788a299c1d9" - }, - { - "transactionIndex": 13, - "blockNumber": 7711097, - "transactionHash": "0xb52877608cf50001aa27a8b343b44ba978995db8a0f65b06c4e0c781820cbe1c", - "address": "0x12e69A9b08709324d64c5AEaF4169b03B6199c6C", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000246e71bc2a257f4be9c7fad4664e6d7444844adc", - "logIndex": 45, - "blockHash": "0x39230dfbf6a3d9bfa9252d4ce7b2060cb369b856b25b934615166788a299c1d9" - } - ], - "blockNumber": 7711097, - "cumulativeGasUsed": "5491531", - "status": 1, - "byzantium": true - }, - "args": [ - "0xbd11CD5C77222DD51B270880F6A4148a8e5A6cB0", - "0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc", - "0x" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/goerli/HydraS1SimpleAttester.json b/deployments/goerli/HydraS1SimpleAttester.json deleted file mode 100644 index 39b25ce..0000000 --- a/deployments/goerli/HydraS1SimpleAttester.json +++ /dev/null @@ -1,850 +0,0 @@ -{ - "address": "0x89d80C9E65fd1aC8970B78A4F17E2e772030C1cB", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "hydraS1VerifierAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "availableRootsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "AccountsTreeValueMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "claimLength", - "type": "uint256" - } - ], - "name": "ClaimsLengthDifferentThanOne", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentMapperPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "inputRoot", - "type": "uint256" - } - ], - "name": "RegistryRootMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedTicketIdentifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ticketIdentifier", - "type": "uint256" - } - ], - "name": "TicketIdentifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "TicketUsed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "TicketDestinationUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAvailableRootsRegistry", - "outputs": [ - { - "internalType": "contract IAvailableRootsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentMapperRegistry", - "outputs": [ - { - "internalType": "contract ICommitmentMapperRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getDestinationOfTicket", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract HydraS1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x18e91745b28392de78ed1384b69e2cdd9885c2e435ee3da71e642aa777240dd6", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x70244BaA5F927c8d4cCF08CaDf1Ea1Ee5fD77946", - "transactionIndex": 158, - "gasUsed": "1708910", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x2eb47de08441cdb3bcdd893c2ec8a24038f45483334766d562d1a5bf4202b842", - "transactionHash": "0x18e91745b28392de78ed1384b69e2cdd9885c2e435ee3da71e642aa777240dd6", - "logs": [], - "blockNumber": 7831849, - "cumulativeGasUsed": "28884439", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf85BA0afA375495eE625910Db61b6b1406756234", - "0x522018b86645F597626aa127EfC22D55a5c79F11", - "0xdDa4c8d2933dAA21Aac75B88fF59725725ba813F", - "0x0844662f25817B735BC9B6d9D11995F1A6c4dCB1", - "10000001", - "20000000" - ], - "numDeployments": 4, - "solcInputHash": "c7c67c4a1ddf53de4ef76f8a114dfc39", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"hydraS1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"availableRootsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"AccountsTreeValueMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimLength\",\"type\":\"uint256\"}],\"name\":\"ClaimsLengthDifferentThanOne\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentMapperPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inputRoot\",\"type\":\"uint256\"}],\"name\":\"RegistryRootMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"TicketUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAvailableRootsRegistry\",\"outputs\":[{\"internalType\":\"contract IAvailableRootsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentMapperRegistry\",\"outputs\":[{\"internalType\":\"contract ICommitmentMapperRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract HydraS1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"errors\":{\"CollectionIdOutOfBound(uint256)\":[{\"details\":\"Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST*\"}],\"TicketUsed(uint256)\":[{\"details\":\"Error when the userTicket (or nullifierHash) is already used for a destination address*\"}]},\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns attestations that will be recorded, constructed from the user request\",\"params\":{\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"availableRootsRegistryAddress\":\"Registry storing the available groups for this attester (e.g roots of registry merkle trees)\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentMapperAddress\":\"commitment mapper's public key registry\",\"hydraS1VerifierAddress\":\"ZK Snark Hydra-S1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getAvailableRootsRegistry()\":{\"details\":\"Getter of Roots Registry Contract\"},\"getCommitmentMapperRegistry()\":{\"details\":\"Getter of Commitment Mapper Registry contract\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Hydra-S1 Verifier contract\"}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"}},\"title\":\"Hydra-S1 Simple Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew their attestations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":\"HydraS1SimpleAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() initializer {}\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\\n // contract may have been reentered.\\n require(_initializing ? _isConstructor() : !_initialized, \\\"Initializable: contract is already initialized\\\");\\n\\n bool isTopLevelCall = !_initializing;\\n if (isTopLevelCall) {\\n _initializing = true;\\n _initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n _initializing = false;\\n }\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} modifier, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n function _isConstructor() private view returns (bool) {\\n return !Address.isContract(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x4823752b07b8ea4ca971b217e39457930e7cb103c2c91e2a29729e5ca907e4f0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\\n 546002182798634190282541153661423157791776194062719045593389981526666716416\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x70c0b7d96ff1b90538938a4cb2d8086b3aabb4febf1e36cb3f470bfe0b4a9e89\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - Renewable\\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew their attestations\\n **/\\n\\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base, Attester {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n mapping(uint256 => address) internal _ticketsDestinations;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(Request calldata request, bytes calldata)\\n public\\n view\\n virtual\\n override(IAttester, Attester)\\n returns (Attestation[] memory)\\n {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n ''\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used and not a renewal (e.g destination different that last)\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n // we get the ticket used from the snark input in the data provided\\n uint256 userTicket = proofData._getTicket();\\n address currentDestination = _getDestinationOfTicket(userTicket);\\n\\n if (currentDestination != address(0) && currentDestination != request.destination) {\\n revert TicketUsed(userTicket);\\n }\\n\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n override\\n returns (uint256)\\n {\\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\\n return ticketIdentifier;\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _ticketsDestinations[userTicket] = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _ticketsDestinations[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x4e58a7c2e28a705f0a4af77ec4145f504aa68cdbc263ac077ebc4c50b9086f11\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n **/\\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n virtual\\n returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\\n internal\\n view\\n virtual\\n {\\n if (input.accountsTreeValue != claim.groupId)\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\\n revert RegistryRootMismatch(input.registryRoot);\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n )\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(\\n uint256 /*errorCode*/\\n ) {\\n revert InvalidGroth16Proof('');\\n } catch (\\n bytes memory /*lowLevelData*/\\n ) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0xdcc036e3178c26e71c5dfdb601f09139ce8919db220acdbb2ad2bad6cc5c4857\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Interface\\n * @author Sismo\\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n **/\\ninterface IHydraS1Base {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x33e77f2249293295d1ef95a4d979cad95719bacb216c467f685bdc0b08908bea\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Interface\\n * @author Sismo\\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\\n **/\\ninterface IHydraS1SimpleAttester is IHydraS1Base, IAttester {\\n /**\\n * @dev Error when the userTicket (or nullifierHash) is already used for a destination address\\n **/\\n error TicketUsed(uint256 userTicket);\\n\\n /**\\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\\n **/\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n /**\\n * @dev Event emitted when the userTicket (or nullifierHash) is associated to a destination address.\\n **/\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xc8bc2a17b743f7cc8b71d0c1c08cc7973639eb7d1593a14b1cd67b41eb78a632\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // ticketIdentifier\\n // ticket\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (\\n uint256[2] memory,\\n uint256[2][2] memory,\\n uint256[2] memory,\\n uint256[10] memory\\n )\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256[2] memory)\\n {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256)\\n {\\n return self.input[5];\\n }\\n\\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\\n internal\\n pure\\n returns (uint256)\\n {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x596225970aabbc4edb989ee640867c76944e797bfafe5e06dcf37b973480b957\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n override\\n returns (Attestation[] memory)\\n {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n address[] memory attestationOwners = new address[](collectionIds.length);\\n\\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\\n\\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n // fetch attestations from the registry\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationOwners[i] = attestationsOwner;\\n attestationCollectionIds[i] = collectionIds[i];\\n\\n attestations[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestations, proofData);\\n\\n _beforeDeleteAttestations(attestations, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n\\n _afterDeleteAttestations(attestations, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestations[i]);\\n }\\n return attestations;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n}\\n\",\"keccak256\":\"0xcab4865f46f442ae11ea0689f63eb7fa0763fcfe86522aa67521a548171cb8e0\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xcf79a817ec578f5b4d8f23853dd8df0e3b1acfbff2b5a01601fd9a7315862ec9\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) public initializer {\\n _transferOwnership(owner);\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9329ecaf60ffe978c8ab4360e0a8f9bd36e2549e89d672dd39ae80f9a562f9a9\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public initializer {\\n _transferOwnership(owner);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0xacb5347ee1a0e8dc25a1ce3e6fbb427db646e833ff8508909454cad7950418d4\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x87f5035b58936a8458a22f3cf1b3865bd798813310d86af41af74680978c97c8\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0x8d6298b442dde99ee5a9cc989ada6ea808383a08b1e9bb1d4c2b58adc01eec69\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101406040523480156200001257600080fd5b5060405162001f6038038062001f60833981016040819052620000359162000081565b6001600160a01b0394851660805292841660c05290831660a0529190921660e0526101005261012052620000f0565b80516001600160a01b03811681146200007c57600080fd5b919050565b60008060008060008060c087890312156200009b57600080fd5b620000a68762000064565b9550620000b66020880162000064565b9450620000c66040880162000064565b9350620000d66060880162000064565b92506080870151915060a087015190509295509295509295565b60805160a05160c05160e0516101005161012051611dea620001766000396000818161015501526102b501526000818161010d015261028d0152600081816101bf015281816104860152818161066701526107880152600081816101790152610c3301526000818160a50152610ccf01526000818160e40152610e300152611dea6000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063918447af11610066578063918447af14610177578063af411a301461019d578063bfa66585146101bd578063c776adde146101e3578063e60f999f146101f657600080fd5b80632254f98e146100a357806346657fe9146100e257806354846d7a1461010857806363e4afc21461013d5780637000b05114610150575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100d9565b6100c561014b3660046112d1565b610209565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101ab366004611332565b610228565b6040516100d9919061145d565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101f13660046114e4565b61038f565b6101b0610204366004611332565b61074a565b6000818152600160205260408120546001600160a01b03165b92915050565b6060600061023d61023886611642565b610866565b60408051600180825281830190925291925060009190816020015b6102606111af565b8152602001906001900390816102585750506060830151519091506000906102b1906001600160801b03167f00000000000000000000000000000000000000000000000000000000000000006117d1565b90507f00000000000000000000000000000000000000000000000000000000000000008111156102fc57604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b031681526020018560200151815260200185606001516020015163ffffffff1681526020016040518060200160405280600081525081525083600081518110610378576103786117e9565b602090810291909101015250909695505050505050565b60606000856001600160401b038111156103ab576103ab611595565b6040519080825280602002602001820160405280156103d4578160200160208202803683370190505b5090506000866001600160401b038111156103f1576103f1611595565b60405190808252806020026020018201604052801561041a578160200160208202803683370190505b5090506000876001600160401b0381111561043757610437611595565b60405190808252806020026020018201604052801561047057816020015b61045d6111af565b8152602001906001900390816104555790505b50905060005b88811015610644576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106104c5576104c56117e9565b905060200201358e6040518363ffffffff1660e01b81526004016104fc9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610519573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105419190810190611813565b93509350935093508b88868151811061055c5761055c6117e9565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061058e5761058e6117e9565b905060200201358786815181106105a7576105a76117e9565b6020026020010181815250506040518060c001604052808f8f888181106105d0576105d06117e9565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff16815260200182815250868681518110610622576106226117e9565b602002602001018190525050505050808061063c906118c2565b915050610476565b506106508187876108eb565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061069e90869086906004016118db565b600060405180830381600087803b1580156106b857600080fd5b505af11580156106cc573d6000803e3d6000fd5b5050505060005b8881101561073d577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070e5761070e6117e9565b6020026020010151604051610723919061195f565b60405180910390a180610735816118c2565b9150506106d3565b5098975050505050505050565b6060610757848484610904565b6000610764858585610228565b905061077185858561094c565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107bd90849060040161145d565b600060405180830381600087803b1580156107d757600080fd5b505af11580156107eb573d6000803e3d6000fd5b5050505060005b815181101561085d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061082e5761082e6117e9565b6020026020010151604051610843919061195f565b60405180910390a180610855816118c2565b9150506107f2565b50949350505050565b61086e6111fd565b60008260000151600081518110610887576108876117e9565b6020026020010151905061089a816109e7565b600081604001518060200190518101906108b49190611982565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b600061091282840184611ab1565b9050600061091f82610a2b565b9050600061092f61023887611642565b905061093b8183610ad5565b61094483610e06565b505050505050565b60006109588383610f9f565b6000818152600160205260409020549091506001600160a01b031680158015906109a3575061098d6040860160208701611b82565b6001600160a01b0316816001600160a01b031614155b156109c457604051631f5d53e360e01b8152600481018390526024016102f3565b6109dd826109d86040880160208901611b82565b610fc4565b5050505050565b50565b60006109f6826040015161102a565b82519091508114610a275781516040516337e3d1ab60e01b81526102f3918391600401918252602082015260400190565b5050565b610a33611260565b604051806101200160405280610a488461105f565b6001600160a01b03168152602001610a5f84611074565b8152602001610a6d84611083565b8152602001610a7b84611092565b8152602001610a89846110a1565b8152602001610a97846110b0565b8152602001610aa5846110bf565b8152602001610abd8460200151610120015160011490565b15158152602001610acd846110ce565b905292915050565b815160c082015114610b0a57815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016102f3565b81606001516040015115158160e00151151503610b5557606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016102f3565b81604001516001600160a01b031681600001516001600160a01b031614610ba957604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016102f3565b46816020015114610bdc576020810151604051630432cec160e31b815246600482015260248101919091526044016102f3565b81602001518160a0015114610c1757602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016102f3565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610c82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca69190611b9f565b610ccb57806040015160405163cbfe7bc360e01b81526004016102f391815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610d2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4e9190611bba565b805161010084015151919250141580610d7557506020808201516101008401519091015114155b15610dbf578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016102f3565b6000610dca84611126565b905080836060015114610e005760608301516040516377bb6d2760e11b81526102f3918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f694610e6994909392909190600401611c36565b602060405180830381865afa925050508015610ea2575060408051601f3d908101601f19168201909252610e9f91810190611b9f565b60015b610f7857610eae611cba565b806308c379a003610ee75750610ec2611cd6565b80610ecd5750610f26565b8060405162dd577760e81b81526004016102f39190611d5f565b634e487b7103610f2657610ef9611d72565b90610f045750610f26565b60405162dd577760e81b815260206004820152600060248201526044016102f3565b3d808015610f50576040519150601f19603f3d011682016040523d82523d6000602084013e610f55565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016102f3565b80610a275760405162dd577760e81b815260206004820152600060248201526044016102f3565b600080610fae83850185611ab1565b90506000610fbb826110a1565b95945050505050565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b80516020820120600090610222907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611d92565b6020810151600090815b602002015192915050565b60208101516000906001611069565b60208101516000906004611069565b60208101516000906005611069565b60208101516000906006611069565b60208101516000906007611069565b60208101516000906008611069565b6110d66112b3565b604051806040016040528083602001516002600a81106110f8576110f86117e9565b6020020151815260200183602001516003600a8110611119576111196117e9565b6020020151905292915050565b600080611144308460600151600001516001600160801b031661114b565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6111449190611d92565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b0316815260200161125b604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815260200161125b5b60405180604001604052806002906020820280368337509192915050565b6000602082840312156112e357600080fd5b5035919050565b60008083601f8401126112fc57600080fd5b5081356001600160401b0381111561131357600080fd5b60208301915083602082850101111561132b57600080fd5b9250929050565b60008060006040848603121561134757600080fd5b83356001600160401b038082111561135e57600080fd5b908501906040828803121561137257600080fd5b9093506020850135908082111561138857600080fd5b50611395868287016112ea565b9497909650939450505050565b60005b838110156113bd5781810151838201526020016113a5565b83811115610e005750506000910152565b600081518084526113e68160208601602086016113a2565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261145560c08501826113ce565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156114b257603f198886030184526114a08583516113fa565b94509285019290850190600101611484565b5092979650505050505050565b6001600160a01b03811681146109e457600080fd5b80356114df816114bf565b919050565b6000806000806000606086880312156114fc57600080fd5b85356001600160401b038082111561151357600080fd5b818801915088601f83011261152757600080fd5b81358181111561153657600080fd5b8960208260051b850101111561154b57600080fd5b60208301975080965050611561602089016114d4565b9450604088013591508082111561157757600080fd5b50611584888289016112ea565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b03821117156115ca576115ca611595565b60405250565b606081018181106001600160401b03821117156115ca576115ca611595565b601f8201601f191681016001600160401b038111828210171561161457611614611595565b6040525050565b60006001600160401b0382111561163457611634611595565b50601f01601f191660200190565b6000604080833603121561165557600080fd5b8051611660816115ab565b83356001600160401b038082111561167757600080fd5b9085019036601f83011261168a57600080fd5b813560208282111561169e5761169e611595565b8160051b86516116b0838301826115ef565b928352848101820192828101368511156116c957600080fd5b83870192505b8483101561179d578235868111156116e75760008081fd5b8701606036829003601f19018113156117005760008081fd5b8a5161170b816115d0565b8287013581528b8301358188015290820135908882111561172c5760008081fd5b9181019136603f84011261174257600091508182fd5b8683013591506117518261161b565b8c5161175d82826115ef565b838152368e85870101111561177457600091508182fd5b838e86018a830137600093810189019390935250808c01919091528252509183019183016116cf565b508652506117ac8882016114d4565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b600082198211156117e4576117e46117bb565b500190565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff811681146114df57600080fd5b6000806000806080858703121561182957600080fd5b8451611834816114bf565b6020860151909450925061184a604086016117ff565b915060608501516001600160401b0381111561186557600080fd5b8501601f8101871361187657600080fd5b80516118818161161b565b60405161188e82826115ef565b8281528960208486010111156118a357600080fd5b6118b48360208301602087016113a2565b969995985093965050505050565b6000600182016118d4576118d46117bb565b5060010190565b604080825283519082018190526000906020906060840190828701845b8281101561191d5781516001600160a01b0316845292840192908401906001016118f8565b5050508381038285015284518082528583019183019060005b8181101561195257835183529284019291840191600101611936565b5090979650505050505050565b60208152600061114460208301846113fa565b805180151581146114df57600080fd5b60006060828403121561199457600080fd5b604051606081018181106001600160401b03821117156119b6576119b6611595565b60405282516001600160801b03811681146119d057600080fd5b81526119de602084016117ff565b60208201526119ef60408401611972565b60408201529392505050565b600082601f830112611a0c57600080fd5b604051611a18816115ab565b806040840185811115611a2a57600080fd5b845b81811015611a44578035835260209283019201611a2c565b509195945050505050565b600082601f830112611a6057600080fd5b6040516101408082018281106001600160401b0382111715611a8457611a84611595565b60405283018185821115611a9757600080fd5b845b82811015611a44578035825260209182019101611a99565b6000818303610240811215611ac557600080fd5b60408051611ad2816115ab565b61010080841215611ae257600080fd5b82519350611aef846115d0565b611af987876119fb565b845286605f870112611b0a57600080fd5b8251611b15816115ab565b8060c0880189811115611b2757600080fd5b8589015b81811015611b4c57611b3d8b826119fb565b83526020909201918601611b2b565b50826020880152611b5d8a826119fb565b86880152505050838252611b7387828801611a4f565b60208301525095945050505050565b600060208284031215611b9457600080fd5b8135611144816114bf565b600060208284031215611bb157600080fd5b61114482611972565b600060408284031215611bcc57600080fd5b82601f830112611bdb57600080fd5b604051611be7816115ab565b806040840185811115611bf957600080fd5b845b81811015611a44578051835260209283019201611bfb565b8060005b6002811015610e00578151845260209384019390910190600101611c17565b6102408101611c458287611c13565b60408083018660005b6002811015611c7557611c62838351611c13565b9183019160209190910190600101611c4e565b50505050611c8660c0830185611c13565b61010082018360005b600a811015611cae578151835260209283019290910190600101611c8f565b50505095945050505050565b600060033d1115611cd35760046000803e5060005160e01c5b90565b600060443d1015611ce45790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611d1357505050505090565b8285019150815181811115611d2b5750505050505090565b843d8701016020828501011115611d455750505050505090565b611d54602082860101876115ef565b509095945050505050565b60208152600061114460208301846113ce565b60008060233d1115611d8e576020600460003e50506000516001905b9091565b600082611daf57634e487b7160e01b600052601260045260246000fd5b50069056fea26469706673582212206f25f22d1700579027a3b154c953a64f2dd7c5743b363da74b5173ab9c3e655764736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063918447af11610066578063918447af14610177578063af411a301461019d578063bfa66585146101bd578063c776adde146101e3578063e60f999f146101f657600080fd5b80632254f98e146100a357806346657fe9146100e257806354846d7a1461010857806363e4afc21461013d5780637000b05114610150575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100d9565b6100c561014b3660046112d1565b610209565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101ab366004611332565b610228565b6040516100d9919061145d565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101f13660046114e4565b61038f565b6101b0610204366004611332565b61074a565b6000818152600160205260408120546001600160a01b03165b92915050565b6060600061023d61023886611642565b610866565b60408051600180825281830190925291925060009190816020015b6102606111af565b8152602001906001900390816102585750506060830151519091506000906102b1906001600160801b03167f00000000000000000000000000000000000000000000000000000000000000006117d1565b90507f00000000000000000000000000000000000000000000000000000000000000008111156102fc57604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b031681526020018560200151815260200185606001516020015163ffffffff1681526020016040518060200160405280600081525081525083600081518110610378576103786117e9565b602090810291909101015250909695505050505050565b60606000856001600160401b038111156103ab576103ab611595565b6040519080825280602002602001820160405280156103d4578160200160208202803683370190505b5090506000866001600160401b038111156103f1576103f1611595565b60405190808252806020026020018201604052801561041a578160200160208202803683370190505b5090506000876001600160401b0381111561043757610437611595565b60405190808252806020026020018201604052801561047057816020015b61045d6111af565b8152602001906001900390816104555790505b50905060005b88811015610644576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106104c5576104c56117e9565b905060200201358e6040518363ffffffff1660e01b81526004016104fc9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610519573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105419190810190611813565b93509350935093508b88868151811061055c5761055c6117e9565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061058e5761058e6117e9565b905060200201358786815181106105a7576105a76117e9565b6020026020010181815250506040518060c001604052808f8f888181106105d0576105d06117e9565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff16815260200182815250868681518110610622576106226117e9565b602002602001018190525050505050808061063c906118c2565b915050610476565b506106508187876108eb565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061069e90869086906004016118db565b600060405180830381600087803b1580156106b857600080fd5b505af11580156106cc573d6000803e3d6000fd5b5050505060005b8881101561073d577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070e5761070e6117e9565b6020026020010151604051610723919061195f565b60405180910390a180610735816118c2565b9150506106d3565b5098975050505050505050565b6060610757848484610904565b6000610764858585610228565b905061077185858561094c565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107bd90849060040161145d565b600060405180830381600087803b1580156107d757600080fd5b505af11580156107eb573d6000803e3d6000fd5b5050505060005b815181101561085d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061082e5761082e6117e9565b6020026020010151604051610843919061195f565b60405180910390a180610855816118c2565b9150506107f2565b50949350505050565b61086e6111fd565b60008260000151600081518110610887576108876117e9565b6020026020010151905061089a816109e7565b600081604001518060200190518101906108b49190611982565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b600061091282840184611ab1565b9050600061091f82610a2b565b9050600061092f61023887611642565b905061093b8183610ad5565b61094483610e06565b505050505050565b60006109588383610f9f565b6000818152600160205260409020549091506001600160a01b031680158015906109a3575061098d6040860160208701611b82565b6001600160a01b0316816001600160a01b031614155b156109c457604051631f5d53e360e01b8152600481018390526024016102f3565b6109dd826109d86040880160208901611b82565b610fc4565b5050505050565b50565b60006109f6826040015161102a565b82519091508114610a275781516040516337e3d1ab60e01b81526102f3918391600401918252602082015260400190565b5050565b610a33611260565b604051806101200160405280610a488461105f565b6001600160a01b03168152602001610a5f84611074565b8152602001610a6d84611083565b8152602001610a7b84611092565b8152602001610a89846110a1565b8152602001610a97846110b0565b8152602001610aa5846110bf565b8152602001610abd8460200151610120015160011490565b15158152602001610acd846110ce565b905292915050565b815160c082015114610b0a57815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016102f3565b81606001516040015115158160e00151151503610b5557606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016102f3565b81604001516001600160a01b031681600001516001600160a01b031614610ba957604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016102f3565b46816020015114610bdc576020810151604051630432cec160e31b815246600482015260248101919091526044016102f3565b81602001518160a0015114610c1757602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016102f3565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610c82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca69190611b9f565b610ccb57806040015160405163cbfe7bc360e01b81526004016102f391815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610d2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4e9190611bba565b805161010084015151919250141580610d7557506020808201516101008401519091015114155b15610dbf578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016102f3565b6000610dca84611126565b905080836060015114610e005760608301516040516377bb6d2760e11b81526102f3918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f694610e6994909392909190600401611c36565b602060405180830381865afa925050508015610ea2575060408051601f3d908101601f19168201909252610e9f91810190611b9f565b60015b610f7857610eae611cba565b806308c379a003610ee75750610ec2611cd6565b80610ecd5750610f26565b8060405162dd577760e81b81526004016102f39190611d5f565b634e487b7103610f2657610ef9611d72565b90610f045750610f26565b60405162dd577760e81b815260206004820152600060248201526044016102f3565b3d808015610f50576040519150601f19603f3d011682016040523d82523d6000602084013e610f55565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016102f3565b80610a275760405162dd577760e81b815260206004820152600060248201526044016102f3565b600080610fae83850185611ab1565b90506000610fbb826110a1565b95945050505050565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b80516020820120600090610222907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611d92565b6020810151600090815b602002015192915050565b60208101516000906001611069565b60208101516000906004611069565b60208101516000906005611069565b60208101516000906006611069565b60208101516000906007611069565b60208101516000906008611069565b6110d66112b3565b604051806040016040528083602001516002600a81106110f8576110f86117e9565b6020020151815260200183602001516003600a8110611119576111196117e9565b6020020151905292915050565b600080611144308460600151600001516001600160801b031661114b565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6111449190611d92565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b0316815260200161125b604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815260200161125b5b60405180604001604052806002906020820280368337509192915050565b6000602082840312156112e357600080fd5b5035919050565b60008083601f8401126112fc57600080fd5b5081356001600160401b0381111561131357600080fd5b60208301915083602082850101111561132b57600080fd5b9250929050565b60008060006040848603121561134757600080fd5b83356001600160401b038082111561135e57600080fd5b908501906040828803121561137257600080fd5b9093506020850135908082111561138857600080fd5b50611395868287016112ea565b9497909650939450505050565b60005b838110156113bd5781810151838201526020016113a5565b83811115610e005750506000910152565b600081518084526113e68160208601602086016113a2565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261145560c08501826113ce565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156114b257603f198886030184526114a08583516113fa565b94509285019290850190600101611484565b5092979650505050505050565b6001600160a01b03811681146109e457600080fd5b80356114df816114bf565b919050565b6000806000806000606086880312156114fc57600080fd5b85356001600160401b038082111561151357600080fd5b818801915088601f83011261152757600080fd5b81358181111561153657600080fd5b8960208260051b850101111561154b57600080fd5b60208301975080965050611561602089016114d4565b9450604088013591508082111561157757600080fd5b50611584888289016112ea565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b03821117156115ca576115ca611595565b60405250565b606081018181106001600160401b03821117156115ca576115ca611595565b601f8201601f191681016001600160401b038111828210171561161457611614611595565b6040525050565b60006001600160401b0382111561163457611634611595565b50601f01601f191660200190565b6000604080833603121561165557600080fd5b8051611660816115ab565b83356001600160401b038082111561167757600080fd5b9085019036601f83011261168a57600080fd5b813560208282111561169e5761169e611595565b8160051b86516116b0838301826115ef565b928352848101820192828101368511156116c957600080fd5b83870192505b8483101561179d578235868111156116e75760008081fd5b8701606036829003601f19018113156117005760008081fd5b8a5161170b816115d0565b8287013581528b8301358188015290820135908882111561172c5760008081fd5b9181019136603f84011261174257600091508182fd5b8683013591506117518261161b565b8c5161175d82826115ef565b838152368e85870101111561177457600091508182fd5b838e86018a830137600093810189019390935250808c01919091528252509183019183016116cf565b508652506117ac8882016114d4565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b600082198211156117e4576117e46117bb565b500190565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff811681146114df57600080fd5b6000806000806080858703121561182957600080fd5b8451611834816114bf565b6020860151909450925061184a604086016117ff565b915060608501516001600160401b0381111561186557600080fd5b8501601f8101871361187657600080fd5b80516118818161161b565b60405161188e82826115ef565b8281528960208486010111156118a357600080fd5b6118b48360208301602087016113a2565b969995985093965050505050565b6000600182016118d4576118d46117bb565b5060010190565b604080825283519082018190526000906020906060840190828701845b8281101561191d5781516001600160a01b0316845292840192908401906001016118f8565b5050508381038285015284518082528583019183019060005b8181101561195257835183529284019291840191600101611936565b5090979650505050505050565b60208152600061114460208301846113fa565b805180151581146114df57600080fd5b60006060828403121561199457600080fd5b604051606081018181106001600160401b03821117156119b6576119b6611595565b60405282516001600160801b03811681146119d057600080fd5b81526119de602084016117ff565b60208201526119ef60408401611972565b60408201529392505050565b600082601f830112611a0c57600080fd5b604051611a18816115ab565b806040840185811115611a2a57600080fd5b845b81811015611a44578035835260209283019201611a2c565b509195945050505050565b600082601f830112611a6057600080fd5b6040516101408082018281106001600160401b0382111715611a8457611a84611595565b60405283018185821115611a9757600080fd5b845b82811015611a44578035825260209182019101611a99565b6000818303610240811215611ac557600080fd5b60408051611ad2816115ab565b61010080841215611ae257600080fd5b82519350611aef846115d0565b611af987876119fb565b845286605f870112611b0a57600080fd5b8251611b15816115ab565b8060c0880189811115611b2757600080fd5b8589015b81811015611b4c57611b3d8b826119fb565b83526020909201918601611b2b565b50826020880152611b5d8a826119fb565b86880152505050838252611b7387828801611a4f565b60208301525095945050505050565b600060208284031215611b9457600080fd5b8135611144816114bf565b600060208284031215611bb157600080fd5b61114482611972565b600060408284031215611bcc57600080fd5b82601f830112611bdb57600080fd5b604051611be7816115ab565b806040840185811115611bf957600080fd5b845b81811015611a44578051835260209283019201611bfb565b8060005b6002811015610e00578151845260209384019390910190600101611c17565b6102408101611c458287611c13565b60408083018660005b6002811015611c7557611c62838351611c13565b9183019160209190910190600101611c4e565b50505050611c8660c0830185611c13565b61010082018360005b600a811015611cae578151835260209283019290910190600101611c8f565b50505095945050505050565b600060033d1115611cd35760046000803e5060005160e01c5b90565b600060443d1015611ce45790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611d1357505050505090565b8285019150815181811115611d2b5750505050505090565b843d8701016020828501011115611d455750505050505090565b611d54602082860101876115ef565b509095945050505050565b60208152600061114460208301846113ce565b60008060233d1115611d8e576020600460003e50506000516001905b9091565b600082611daf57634e487b7160e01b600052601260045260246000fd5b50069056fea26469706673582212206f25f22d1700579027a3b154c953a64f2dd7c5743b363da74b5173ab9c3e655764736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "errors": { - "CollectionIdOutOfBound(uint256)": [ - { - "details": "Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST*" - } - ], - "TicketUsed(uint256)": [ - { - "details": "Error when the userTicket (or nullifierHash) is already used for a destination address*" - } - ] - }, - "kind": "dev", - "methods": { - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns attestations that will be recorded, constructed from the user request", - "params": { - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "availableRootsRegistryAddress": "Registry storing the available groups for this attester (e.g roots of registry merkle trees)", - "collectionIdFirst": "Id of the first collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last collection in which the attester is supposed to record", - "commitmentMapperAddress": "commitment mapper's public key registry", - "hydraS1VerifierAddress": "ZK Snark Hydra-S1 Verifier contract" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getAvailableRootsRegistry()": { - "details": "Getter of Roots Registry Contract" - }, - "getCommitmentMapperRegistry()": { - "details": "Getter of Commitment Mapper Registry contract" - }, - "getDestinationOfTicket(uint256)": { - "details": "Getter, returns the last attestation destination of a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getVerifier()": { - "details": "Getter of Hydra-S1 Verifier contract" - } - }, - "stateVariables": { - "AUTHORIZED_COLLECTION_ID_FIRST": { - "details": "Getter returns of the first collection in which the attester is supposed to record*" - }, - "AUTHORIZED_COLLECTION_ID_LAST": { - "details": "Getter returns of the last collection in which the attester is supposed to record*" - } - }, - "title": "Hydra-S1 Simple Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew their attestations*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 936, - "contract": "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol:HydraS1SimpleAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 939, - "contract": "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol:HydraS1SimpleAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 6335, - "contract": "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol:HydraS1SimpleAttester", - "label": "_ticketsDestinations", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_address)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_address)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/HydraS1SimpleAttesterImplem.json b/deployments/goerli/HydraS1SimpleAttesterImplem.json deleted file mode 100644 index f3d99f1..0000000 --- a/deployments/goerli/HydraS1SimpleAttesterImplem.json +++ /dev/null @@ -1,838 +0,0 @@ -{ - "address": "0x29B05083395ebb07A86b454E8e51D91C7E8776E1", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "hydraS1VerifierAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "availableRootsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "AccountsTreeValueMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "claimLength", - "type": "uint256" - } - ], - "name": "ClaimsLengthDifferentThanOne", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentMapperPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "inputRoot", - "type": "uint256" - } - ], - "name": "RegistryRootMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedTicketIdentifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ticketIdentifier", - "type": "uint256" - } - ], - "name": "TicketIdentifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "TicketUsed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "TicketDestinationUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAvailableRootsRegistry", - "outputs": [ - { - "internalType": "contract IAvailableRootsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentMapperRegistry", - "outputs": [ - { - "internalType": "contract ICommitmentMapperRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getDestinationOfTicket", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract HydraS1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xd168762bcfc1bcb2d22cd7f929e3bfd53334e46620f1c8de489969b1a29f49a4", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x29B05083395ebb07A86b454E8e51D91C7E8776E1", - "transactionIndex": 16, - "gasUsed": "1609554", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x0ab20b052808345871276d1ddd4871192325017bc4e49fcd057848d26824a65d", - "transactionHash": "0xd168762bcfc1bcb2d22cd7f929e3bfd53334e46620f1c8de489969b1a29f49a4", - "logs": [], - "blockNumber": 7711091, - "cumulativeGasUsed": "3477623", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf85BA0afA375495eE625910Db61b6b1406756234", - "0x522018b86645F597626aa127EfC22D55a5c79F11", - "0xdDa4c8d2933dAA21Aac75B88fF59725725ba813F", - "0x0844662f25817B735BC9B6d9D11995F1A6c4dCB1", - "10000001", - "20000000" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"hydraS1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"availableRootsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"AccountsTreeValueMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimLength\",\"type\":\"uint256\"}],\"name\":\"ClaimsLengthDifferentThanOne\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentMapperPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inputRoot\",\"type\":\"uint256\"}],\"name\":\"RegistryRootMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"TicketUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAvailableRootsRegistry\",\"outputs\":[{\"internalType\":\"contract IAvailableRootsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentMapperRegistry\",\"outputs\":[{\"internalType\":\"contract ICommitmentMapperRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract HydraS1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns attestations that will be recorded, constructed from the user request\",\"params\":{\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"availableRootsRegistryAddress\":\"Registry storing the available groups for this attester (e.g roots of registry merkle trees)\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentMapperAddress\":\"commitment mapper's public key registry\",\"hydraS1VerifierAddress\":\"ZK Snark Hydra-S1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getAvailableRootsRegistry()\":{\"details\":\"Getter of Roots Registry Contract\"},\"getCommitmentMapperRegistry()\":{\"details\":\"Getter of Commitment Mapper Registry contract\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Hydra-S1 Verifier contract\"}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"}},\"title\":\"Hydra-S1 Simple Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew their attestations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":\"HydraS1SimpleAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() initializer {}\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\\n // contract may have been reentered.\\n require(_initializing ? _isConstructor() : !_initialized, \\\"Initializable: contract is already initialized\\\");\\n\\n bool isTopLevelCall = !_initializing;\\n if (isTopLevelCall) {\\n _initializing = true;\\n _initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n _initializing = false;\\n }\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} modifier, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n function _isConstructor() private view returns (bool) {\\n return !Address.isContract(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x4823752b07b8ea4ca971b217e39457930e7cb103c2c91e2a29729e5ca907e4f0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\\n 546002182798634190282541153661423157791776194062719045593389981526666716416\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x70c0b7d96ff1b90538938a4cb2d8086b3aabb4febf1e36cb3f470bfe0b4a9e89\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - Renewable\\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew their attestations\\n **/\\n\\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base, Attester {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n mapping(uint256 => address) internal _ticketsDestinations;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(Request calldata request, bytes calldata)\\n public\\n view\\n virtual\\n override(IAttester, Attester)\\n returns (Attestation[] memory)\\n {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n ''\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used and not a renewal (e.g destination different that last)\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n // we get the ticket used from the snark input in the data provided\\n uint256 userTicket = proofData._getTicket();\\n address currentDestination = _getDestinationOfTicket(userTicket);\\n\\n if (currentDestination != address(0) && currentDestination != request.destination) {\\n revert TicketUsed(userTicket);\\n }\\n\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n override\\n returns (uint256)\\n {\\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\\n return ticketIdentifier;\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _ticketsDestinations[userTicket] = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _ticketsDestinations[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x4e58a7c2e28a705f0a4af77ec4145f504aa68cdbc263ac077ebc4c50b9086f11\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n \\n \\n **/\\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n virtual\\n returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\\n internal\\n view\\n virtual\\n {\\n if (input.accountsTreeValue != claim.groupId)\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\\n revert RegistryRootMismatch(input.registryRoot);\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n )\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(\\n uint256 /*errorCode*/\\n ) {\\n revert InvalidGroth16Proof('');\\n } catch (\\n bytes memory /*lowLevelData*/\\n ) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0x02708884237382835cd3d3514fdc3603409ce5ea1dc7255a7ceea07dff417c34\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n// todo: explain well what is specific to this attester\\ninterface IHydraS1Base {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x73cff4dcd9c30857859721ea2897be8bb7087c0122f4587acdaa79d8ec0a728d\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n// todo: explain well what is specific to this attester\\ninterface IHydraS1SimpleAttester is IHydraS1Base, IAttester {\\n error TicketUsed(uint256 userTicket);\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xa773e565f9a9ae1b6139779f80e04bf8391ee40e7f2673c785814d1317894259\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // ticketIdentifier\\n // ticket\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (\\n uint256[2] memory,\\n uint256[2][2] memory,\\n uint256[2] memory,\\n uint256[10] memory\\n )\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256[2] memory)\\n {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256)\\n {\\n return self.input[5];\\n }\\n\\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\\n internal\\n pure\\n returns (uint256)\\n {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x596225970aabbc4edb989ee640867c76944e797bfafe5e06dcf37b973480b957\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n override\\n returns (Attestation[] memory)\\n {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // fetch attestations from the registry\\n Attestation[] memory attestationsToDelete;\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationsToDelete[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestationsToDelete, proofData);\\n\\n _beforeDeleteAttestations(attestationsToDelete, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationsToDelete);\\n\\n _afterDeleteAttestations(attestationsToDelete, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestationsToDelete[i]);\\n }\\n return attestationsToDelete;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n}\\n\",\"keccak256\":\"0x37683c6752d4dc911459084eb191c1045f3bf34e2143f3db3d298a66c971a106\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param attestations Attestations to be deleted\\n */\\n function deleteAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xb5e25bd7e0372c9973e582fb7fe96318c145831a5452d8c79eb848a7464b0297\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) public initializer {\\n _transferOwnership(owner);\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9329ecaf60ffe978c8ab4360e0a8f9bd36e2549e89d672dd39ae80f9a562f9a9\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public initializer {\\n _transferOwnership(owner);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0xacb5347ee1a0e8dc25a1ce3e6fbb427db646e833ff8508909454cad7950418d4\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x87f5035b58936a8458a22f3cf1b3865bd798813310d86af41af74680978c97c8\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0x8d6298b442dde99ee5a9cc989ada6ea808383a08b1e9bb1d4c2b58adc01eec69\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101406040523480156200001257600080fd5b5060405162001d9438038062001d94833981016040819052620000359162000081565b6001600160a01b0394851660805292841660c05290831660a0529190921660e0526101005261012052620000f0565b80516001600160a01b03811681146200007c57600080fd5b919050565b60008060008060008060c087890312156200009b57600080fd5b620000a68762000064565b9550620000b66020880162000064565b9450620000c66040880162000064565b9350620000d66060880162000064565b92506080870151915060a087015190509295509295509295565b60805160a05160c05160e0516101005161012051611c1e620001766000396000818161015501526102fe01526000818161010d01526102d60152600081816101bf015281816103ee0152818161056501526106820152600081816101790152610b2d01526000818160a50152610bc901526000818160e40152610d2a0152611c1e6000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063918447af11610066578063918447af14610177578063af411a301461019d578063bfa66585146101bd578063c776adde146101e3578063e60f999f146101f657600080fd5b80632254f98e146100a357806346657fe9146100e257806354846d7a1461010857806363e4afc21461013d5780637000b05114610150575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100d9565b6100c561014b36600461117d565b610209565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101ab3660046111df565b610228565b6040516100d9919061130b565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101f1366004611392565b6103d8565b6101b06102043660046111df565b610644565b6000818152600160205260408120546001600160a01b03165b92915050565b6060600061023d610238866114f5565b610760565b60408051600180825281830190925291925060009190816020015b6102a96040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816102585750506060830151519091506000906102fa906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611685565b90507f000000000000000000000000000000000000000000000000000000000000000081111561034557604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b031681526020018560200151815260200185606001516020015163ffffffff16815260200160405180602001604052806000815250815250836000815181106103c1576103c161169d565b602090810291909101015250909695505050505050565b60608060005b86811015610542576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78d8d8881811061042d5761042d61169d565b905060200201358c6040518363ffffffff1660e01b81526004016104649291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610481573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104a991908101906116c7565b93509350935093506040518060c001604052808d8d888181106104ce576104ce61169d565b9050602002013581526020018b6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff168152602001828152508686815181106105205761052061169d565b602002602001018190525050505050808061053a90611777565b9150506103de565b5061054e8185856107e5565b6040516373e4ca1b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e7c994369061059a90849060040161130b565b600060405180830381600087803b1580156105b457600080fd5b505af11580156105c8573d6000803e3d6000fd5b5050505060005b86811015610639577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061060a5761060a61169d565b602002602001015160405161061f9190611790565b60405180910390a18061063181611777565b9150506105cf565b509695505050505050565b60606106518484846107fe565b600061065e858585610228565b905061066b858585610846565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106b790849060040161130b565b600060405180830381600087803b1580156106d157600080fd5b505af11580156106e5573d6000803e3d6000fd5b5050505060005b8151811015610757577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc8282815181106107285761072861169d565b602002602001015160405161073d9190611790565b60405180910390a18061074f81611777565b9150506106ec565b50949350505050565b6107686110a9565b600082600001516000815181106107815761078161169d565b60200260200101519050610794816108e1565b600081604001518060200190518101906107ae91906117b3565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b600061080c828401846118e4565b9050600061081982610925565b90506000610829610238876114f5565b905061083581836109cf565b61083e83610d00565b505050505050565b60006108528383610e99565b6000818152600160205260409020549091506001600160a01b0316801580159061089d575061088760408601602087016119b5565b6001600160a01b0316816001600160a01b031614155b156108be57604051631f5d53e360e01b81526004810183905260240161033c565b6108d7826108d260408801602089016119b5565b610ebe565b5050505050565b50565b60006108f08260400151610f24565b825190915081146109215781516040516337e3d1ab60e01b815261033c918391600401918252602082015260400190565b5050565b61092d61110c565b60405180610120016040528061094284610f59565b6001600160a01b0316815260200161095984610f6e565b815260200161096784610f7d565b815260200161097584610f8c565b815260200161098384610f9b565b815260200161099184610faa565b815260200161099f84610fb9565b81526020016109b78460200151610120015160011490565b151581526020016109c784610fc8565b905292915050565b815160c082015114610a0457815160c082015160405163fe405c7760e01b81526004810192909252602482015260440161033c565b81606001516040015115158160e00151151503610a4f57606082015160409081015160e08301519151634629f1b560e11b81529015156004820152901515602482015260440161033c565b81604001516001600160a01b031681600001516001600160a01b031614610aa357604082810151825191516370a8d99b60e11b81526001600160a01b0391821660048201529116602482015260440161033c565b46816020015114610ad6576020810151604051630432cec160e31b8152466004820152602481019190915260440161033c565b81602001518160a0015114610b1157602082015160a0820151604051630626ade360e41b81526004810192909252602482015260440161033c565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610b7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba091906119d2565b610bc557806040015160405163cbfe7bc360e01b815260040161033c91815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610c24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4891906119ed565b805161010084015151919250141580610c6f57506020808201516101008401519091015114155b15610cb9578051602080830151610100850151805192015160405163318d812b60e01b8152600481019490945260248401919091526044830191909152606482015260840161033c565b6000610cc484611020565b905080836060015114610cfa5760608301516040516377bb6d2760e11b815261033c918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f694610d6394909392909190600401611a69565b602060405180830381865afa925050508015610d9c575060408051601f3d908101601f19168201909252610d99918101906119d2565b60015b610e7257610da8611aed565b806308c379a003610de15750610dbc611b09565b80610dc75750610e20565b8060405162dd577760e81b815260040161033c9190611b93565b634e487b7103610e2057610df3611ba6565b90610dfe5750610e20565b60405162dd577760e81b8152602060048201526000602482015260440161033c565b3d808015610e4a576040519150601f19603f3d011682016040523d82523d6000602084013e610e4f565b606091505b5060405162dd577760e81b8152602060048201526000602482015260440161033c565b806109215760405162dd577760e81b8152602060048201526000602482015260440161033c565b600080610ea8838501856118e4565b90506000610eb582610f9b565b95945050505050565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b80516020820120600090610222907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611bc6565b6020810151600090815b602002015192915050565b60208101516000906001610f63565b60208101516000906004610f63565b60208101516000906005610f63565b60208101516000906006610f63565b60208101516000906007610f63565b60208101516000906008610f63565b610fd061115f565b604051806040016040528083602001516002600a8110610ff257610ff261169d565b6020020151815260200183602001516003600a81106110135761101361169d565b6020020151905292915050565b60008061103e308460600151600001516001600160801b0316611045565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c61103e9190611bc6565b6040518060800160405280600081526020016000815260200160006001600160a01b03168152602001611107604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016111075b60405180604001604052806002906020820280368337509192915050565b60006020828403121561118f57600080fd5b5035919050565b60008083601f8401126111a857600080fd5b50813567ffffffffffffffff8111156111c057600080fd5b6020830191508360208285010111156111d857600080fd5b9250929050565b6000806000604084860312156111f457600080fd5b833567ffffffffffffffff8082111561120c57600080fd5b908501906040828803121561122057600080fd5b9093506020850135908082111561123657600080fd5b5061124386828701611196565b9497909650939450505050565b60005b8381101561126b578181015183820152602001611253565b83811115610cfa5750506000910152565b60008151808452611294816020860160208601611250565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261130360c085018261127c565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561136057603f1988860301845261134e8583516112a8565b94509285019290850190600101611332565b5092979650505050505050565b6001600160a01b03811681146108de57600080fd5b803561138d8161136d565b919050565b6000806000806000606086880312156113aa57600080fd5b853567ffffffffffffffff808211156113c257600080fd5b818801915088601f8301126113d657600080fd5b8135818111156113e557600080fd5b8960208260051b85010111156113fa57600080fd5b6020830197508096505061141060208901611382565b9450604088013591508082111561142657600080fd5b5061143388828901611196565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b6040810181811067ffffffffffffffff8211171561147a5761147a611444565b60405250565b6060810181811067ffffffffffffffff8211171561147a5761147a611444565b601f8201601f1916810167ffffffffffffffff811182821017156114c6576114c6611444565b6040525050565b600067ffffffffffffffff8211156114e7576114e7611444565b50601f01601f191660200190565b6000604080833603121561150857600080fd5b80516115138161145a565b833567ffffffffffffffff8082111561152b57600080fd5b9085019036601f83011261153e57600080fd5b813560208282111561155257611552611444565b8160051b8651611564838301826114a0565b9283528481018201928281013685111561157d57600080fd5b83870192505b848310156116515782358681111561159b5760008081fd5b8701606036829003601f19018113156115b45760008081fd5b8a516115bf81611480565b8287013581528b830135818801529082013590888211156115e05760008081fd5b9181019136603f8401126115f657600091508182fd5b868301359150611605826114cd565b8c5161161182826114a0565b838152368e85870101111561162857600091508182fd5b838e86018a830137600093810189019390935250808c0191909152825250918301918301611583565b50865250611660888201611382565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b600082198211156116985761169861166f565b500190565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff8116811461138d57600080fd5b600080600080608085870312156116dd57600080fd5b84516116e88161136d565b602086015190945092506116fe604086016116b3565b9150606085015167ffffffffffffffff81111561171a57600080fd5b8501601f8101871361172b57600080fd5b8051611736816114cd565b60405161174382826114a0565b82815289602084860101111561175857600080fd5b611769836020830160208701611250565b969995985093965050505050565b6000600182016117895761178961166f565b5060010190565b60208152600061103e60208301846112a8565b8051801515811461138d57600080fd5b6000606082840312156117c557600080fd5b6040516060810181811067ffffffffffffffff821117156117e8576117e8611444565b60405282516001600160801b038116811461180257600080fd5b8152611810602084016116b3565b6020820152611821604084016117a3565b60408201529392505050565b600082601f83011261183e57600080fd5b60405161184a8161145a565b80604084018581111561185c57600080fd5b845b8181101561187657803583526020928301920161185e565b509195945050505050565b600082601f83011261189257600080fd5b60405161014080820182811067ffffffffffffffff821117156118b7576118b7611444565b604052830181858211156118ca57600080fd5b845b828110156118765780358252602091820191016118cc565b60008183036102408112156118f857600080fd5b604080516119058161145a565b6101008084121561191557600080fd5b8251935061192284611480565b61192c878761182d565b845286605f87011261193d57600080fd5b82516119488161145a565b8060c088018981111561195a57600080fd5b8589015b8181101561197f576119708b8261182d565b8352602090920191860161195e565b508260208801526119908a8261182d565b868801525050508382526119a687828801611881565b60208301525095945050505050565b6000602082840312156119c757600080fd5b813561103e8161136d565b6000602082840312156119e457600080fd5b61103e826117a3565b6000604082840312156119ff57600080fd5b82601f830112611a0e57600080fd5b604051611a1a8161145a565b806040840185811115611a2c57600080fd5b845b81811015611876578051835260209283019201611a2e565b8060005b6002811015610cfa578151845260209384019390910190600101611a4a565b6102408101611a788287611a46565b60408083018660005b6002811015611aa857611a95838351611a46565b9183019160209190910190600101611a81565b50505050611ab960c0830185611a46565b61010082018360005b600a811015611ae1578151835260209283019290910190600101611ac2565b50505095945050505050565b600060033d1115611b065760046000803e5060005160e01c5b90565b600060443d1015611b175790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611b4757505050505090565b8285019150815181811115611b5f5750505050505090565b843d8701016020828501011115611b795750505050505090565b611b88602082860101876114a0565b509095945050505050565b60208152600061103e602083018461127c565b60008060233d1115611bc2576020600460003e50506000516001905b9091565b600082611be357634e487b7160e01b600052601260045260246000fd5b50069056fea26469706673582212200880771dc9a12d1ab8ee0aef209d3ee36ccccf3e7ad67d67ca8565a13c73569a64736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063918447af11610066578063918447af14610177578063af411a301461019d578063bfa66585146101bd578063c776adde146101e3578063e60f999f146101f657600080fd5b80632254f98e146100a357806346657fe9146100e257806354846d7a1461010857806363e4afc21461013d5780637000b05114610150575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100d9565b6100c561014b36600461117d565b610209565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101ab3660046111df565b610228565b6040516100d9919061130b565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101f1366004611392565b6103d8565b6101b06102043660046111df565b610644565b6000818152600160205260408120546001600160a01b03165b92915050565b6060600061023d610238866114f5565b610760565b60408051600180825281830190925291925060009190816020015b6102a96040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816102585750506060830151519091506000906102fa906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611685565b90507f000000000000000000000000000000000000000000000000000000000000000081111561034557604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b031681526020018560200151815260200185606001516020015163ffffffff16815260200160405180602001604052806000815250815250836000815181106103c1576103c161169d565b602090810291909101015250909695505050505050565b60608060005b86811015610542576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78d8d8881811061042d5761042d61169d565b905060200201358c6040518363ffffffff1660e01b81526004016104649291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610481573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104a991908101906116c7565b93509350935093506040518060c001604052808d8d888181106104ce576104ce61169d565b9050602002013581526020018b6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff168152602001828152508686815181106105205761052061169d565b602002602001018190525050505050808061053a90611777565b9150506103de565b5061054e8185856107e5565b6040516373e4ca1b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e7c994369061059a90849060040161130b565b600060405180830381600087803b1580156105b457600080fd5b505af11580156105c8573d6000803e3d6000fd5b5050505060005b86811015610639577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061060a5761060a61169d565b602002602001015160405161061f9190611790565b60405180910390a18061063181611777565b9150506105cf565b509695505050505050565b60606106518484846107fe565b600061065e858585610228565b905061066b858585610846565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106b790849060040161130b565b600060405180830381600087803b1580156106d157600080fd5b505af11580156106e5573d6000803e3d6000fd5b5050505060005b8151811015610757577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc8282815181106107285761072861169d565b602002602001015160405161073d9190611790565b60405180910390a18061074f81611777565b9150506106ec565b50949350505050565b6107686110a9565b600082600001516000815181106107815761078161169d565b60200260200101519050610794816108e1565b600081604001518060200190518101906107ae91906117b3565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b600061080c828401846118e4565b9050600061081982610925565b90506000610829610238876114f5565b905061083581836109cf565b61083e83610d00565b505050505050565b60006108528383610e99565b6000818152600160205260409020549091506001600160a01b0316801580159061089d575061088760408601602087016119b5565b6001600160a01b0316816001600160a01b031614155b156108be57604051631f5d53e360e01b81526004810183905260240161033c565b6108d7826108d260408801602089016119b5565b610ebe565b5050505050565b50565b60006108f08260400151610f24565b825190915081146109215781516040516337e3d1ab60e01b815261033c918391600401918252602082015260400190565b5050565b61092d61110c565b60405180610120016040528061094284610f59565b6001600160a01b0316815260200161095984610f6e565b815260200161096784610f7d565b815260200161097584610f8c565b815260200161098384610f9b565b815260200161099184610faa565b815260200161099f84610fb9565b81526020016109b78460200151610120015160011490565b151581526020016109c784610fc8565b905292915050565b815160c082015114610a0457815160c082015160405163fe405c7760e01b81526004810192909252602482015260440161033c565b81606001516040015115158160e00151151503610a4f57606082015160409081015160e08301519151634629f1b560e11b81529015156004820152901515602482015260440161033c565b81604001516001600160a01b031681600001516001600160a01b031614610aa357604082810151825191516370a8d99b60e11b81526001600160a01b0391821660048201529116602482015260440161033c565b46816020015114610ad6576020810151604051630432cec160e31b8152466004820152602481019190915260440161033c565b81602001518160a0015114610b1157602082015160a0820151604051630626ade360e41b81526004810192909252602482015260440161033c565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610b7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba091906119d2565b610bc557806040015160405163cbfe7bc360e01b815260040161033c91815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610c24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4891906119ed565b805161010084015151919250141580610c6f57506020808201516101008401519091015114155b15610cb9578051602080830151610100850151805192015160405163318d812b60e01b8152600481019490945260248401919091526044830191909152606482015260840161033c565b6000610cc484611020565b905080836060015114610cfa5760608301516040516377bb6d2760e11b815261033c918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f694610d6394909392909190600401611a69565b602060405180830381865afa925050508015610d9c575060408051601f3d908101601f19168201909252610d99918101906119d2565b60015b610e7257610da8611aed565b806308c379a003610de15750610dbc611b09565b80610dc75750610e20565b8060405162dd577760e81b815260040161033c9190611b93565b634e487b7103610e2057610df3611ba6565b90610dfe5750610e20565b60405162dd577760e81b8152602060048201526000602482015260440161033c565b3d808015610e4a576040519150601f19603f3d011682016040523d82523d6000602084013e610e4f565b606091505b5060405162dd577760e81b8152602060048201526000602482015260440161033c565b806109215760405162dd577760e81b8152602060048201526000602482015260440161033c565b600080610ea8838501856118e4565b90506000610eb582610f9b565b95945050505050565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b80516020820120600090610222907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611bc6565b6020810151600090815b602002015192915050565b60208101516000906001610f63565b60208101516000906004610f63565b60208101516000906005610f63565b60208101516000906006610f63565b60208101516000906007610f63565b60208101516000906008610f63565b610fd061115f565b604051806040016040528083602001516002600a8110610ff257610ff261169d565b6020020151815260200183602001516003600a81106110135761101361169d565b6020020151905292915050565b60008061103e308460600151600001516001600160801b0316611045565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c61103e9190611bc6565b6040518060800160405280600081526020016000815260200160006001600160a01b03168152602001611107604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016111075b60405180604001604052806002906020820280368337509192915050565b60006020828403121561118f57600080fd5b5035919050565b60008083601f8401126111a857600080fd5b50813567ffffffffffffffff8111156111c057600080fd5b6020830191508360208285010111156111d857600080fd5b9250929050565b6000806000604084860312156111f457600080fd5b833567ffffffffffffffff8082111561120c57600080fd5b908501906040828803121561122057600080fd5b9093506020850135908082111561123657600080fd5b5061124386828701611196565b9497909650939450505050565b60005b8381101561126b578181015183820152602001611253565b83811115610cfa5750506000910152565b60008151808452611294816020860160208601611250565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261130360c085018261127c565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561136057603f1988860301845261134e8583516112a8565b94509285019290850190600101611332565b5092979650505050505050565b6001600160a01b03811681146108de57600080fd5b803561138d8161136d565b919050565b6000806000806000606086880312156113aa57600080fd5b853567ffffffffffffffff808211156113c257600080fd5b818801915088601f8301126113d657600080fd5b8135818111156113e557600080fd5b8960208260051b85010111156113fa57600080fd5b6020830197508096505061141060208901611382565b9450604088013591508082111561142657600080fd5b5061143388828901611196565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b6040810181811067ffffffffffffffff8211171561147a5761147a611444565b60405250565b6060810181811067ffffffffffffffff8211171561147a5761147a611444565b601f8201601f1916810167ffffffffffffffff811182821017156114c6576114c6611444565b6040525050565b600067ffffffffffffffff8211156114e7576114e7611444565b50601f01601f191660200190565b6000604080833603121561150857600080fd5b80516115138161145a565b833567ffffffffffffffff8082111561152b57600080fd5b9085019036601f83011261153e57600080fd5b813560208282111561155257611552611444565b8160051b8651611564838301826114a0565b9283528481018201928281013685111561157d57600080fd5b83870192505b848310156116515782358681111561159b5760008081fd5b8701606036829003601f19018113156115b45760008081fd5b8a516115bf81611480565b8287013581528b830135818801529082013590888211156115e05760008081fd5b9181019136603f8401126115f657600091508182fd5b868301359150611605826114cd565b8c5161161182826114a0565b838152368e85870101111561162857600091508182fd5b838e86018a830137600093810189019390935250808c0191909152825250918301918301611583565b50865250611660888201611382565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b600082198211156116985761169861166f565b500190565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff8116811461138d57600080fd5b600080600080608085870312156116dd57600080fd5b84516116e88161136d565b602086015190945092506116fe604086016116b3565b9150606085015167ffffffffffffffff81111561171a57600080fd5b8501601f8101871361172b57600080fd5b8051611736816114cd565b60405161174382826114a0565b82815289602084860101111561175857600080fd5b611769836020830160208701611250565b969995985093965050505050565b6000600182016117895761178961166f565b5060010190565b60208152600061103e60208301846112a8565b8051801515811461138d57600080fd5b6000606082840312156117c557600080fd5b6040516060810181811067ffffffffffffffff821117156117e8576117e8611444565b60405282516001600160801b038116811461180257600080fd5b8152611810602084016116b3565b6020820152611821604084016117a3565b60408201529392505050565b600082601f83011261183e57600080fd5b60405161184a8161145a565b80604084018581111561185c57600080fd5b845b8181101561187657803583526020928301920161185e565b509195945050505050565b600082601f83011261189257600080fd5b60405161014080820182811067ffffffffffffffff821117156118b7576118b7611444565b604052830181858211156118ca57600080fd5b845b828110156118765780358252602091820191016118cc565b60008183036102408112156118f857600080fd5b604080516119058161145a565b6101008084121561191557600080fd5b8251935061192284611480565b61192c878761182d565b845286605f87011261193d57600080fd5b82516119488161145a565b8060c088018981111561195a57600080fd5b8589015b8181101561197f576119708b8261182d565b8352602090920191860161195e565b508260208801526119908a8261182d565b868801525050508382526119a687828801611881565b60208301525095945050505050565b6000602082840312156119c757600080fd5b813561103e8161136d565b6000602082840312156119e457600080fd5b61103e826117a3565b6000604082840312156119ff57600080fd5b82601f830112611a0e57600080fd5b604051611a1a8161145a565b806040840185811115611a2c57600080fd5b845b81811015611876578051835260209283019201611a2e565b8060005b6002811015610cfa578151845260209384019390910190600101611a4a565b6102408101611a788287611a46565b60408083018660005b6002811015611aa857611a95838351611a46565b9183019160209190910190600101611a81565b50505050611ab960c0830185611a46565b61010082018360005b600a811015611ae1578151835260209283019290910190600101611ac2565b50505095945050505050565b600060033d1115611b065760046000803e5060005160e01c5b90565b600060443d1015611b175790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611b4757505050505090565b8285019150815181811115611b5f5750505050505090565b843d8701016020828501011115611b795750505050505090565b611b88602082860101876114a0565b509095945050505050565b60208152600061103e602083018461127c565b60008060233d1115611bc2576020600460003e50506000516001905b9091565b600082611be357634e487b7160e01b600052601260045260246000fd5b50069056fea26469706673582212200880771dc9a12d1ab8ee0aef209d3ee36ccccf3e7ad67d67ca8565a13c73569a64736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns attestations that will be recorded, constructed from the user request", - "params": { - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "availableRootsRegistryAddress": "Registry storing the available groups for this attester (e.g roots of registry merkle trees)", - "collectionIdFirst": "Id of the first collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last collection in which the attester is supposed to record", - "commitmentMapperAddress": "commitment mapper's public key registry", - "hydraS1VerifierAddress": "ZK Snark Hydra-S1 Verifier contract" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getAvailableRootsRegistry()": { - "details": "Getter of Roots Registry Contract" - }, - "getCommitmentMapperRegistry()": { - "details": "Getter of Commitment Mapper Registry contract" - }, - "getDestinationOfTicket(uint256)": { - "details": "Getter, returns the last attestation destination of a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getVerifier()": { - "details": "Getter of Hydra-S1 Verifier contract" - } - }, - "stateVariables": { - "AUTHORIZED_COLLECTION_ID_FIRST": { - "details": "Getter returns of the first collection in which the attester is supposed to record*" - }, - "AUTHORIZED_COLLECTION_ID_LAST": { - "details": "Getter returns of the last collection in which the attester is supposed to record*" - } - }, - "title": "Hydra-S1 Simple Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew their attestations*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 936, - "contract": "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol:HydraS1SimpleAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 939, - "contract": "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol:HydraS1SimpleAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 6335, - "contract": "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol:HydraS1SimpleAttester", - "label": "_ticketsDestinations", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_address)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_address)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/HydraS1SimpleAttesterImplemV2.json b/deployments/goerli/HydraS1SimpleAttesterImplemV2.json deleted file mode 100644 index bdb1e1f..0000000 --- a/deployments/goerli/HydraS1SimpleAttesterImplemV2.json +++ /dev/null @@ -1,838 +0,0 @@ -{ - "address": "0x8d099b40413F51835B0760EEC1Dc43dB53597691", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "hydraS1VerifierAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "availableRootsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "AccountsTreeValueMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "claimLength", - "type": "uint256" - } - ], - "name": "ClaimsLengthDifferentThanOne", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentMapperPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "inputRoot", - "type": "uint256" - } - ], - "name": "RegistryRootMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedTicketIdentifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ticketIdentifier", - "type": "uint256" - } - ], - "name": "TicketIdentifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "TicketUsed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "TicketDestinationUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAvailableRootsRegistry", - "outputs": [ - { - "internalType": "contract IAvailableRootsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentMapperRegistry", - "outputs": [ - { - "internalType": "contract ICommitmentMapperRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getDestinationOfTicket", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract HydraS1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xb259a921879e582801e2dddff9afa8efd8f0a91c1a42130aee4e41e0bb779f9e", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x8d099b40413F51835B0760EEC1Dc43dB53597691", - "transactionIndex": 110, - "gasUsed": "1708922", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x20c8179d1c0fa28a8f717fcbbf65c0509ff963b1de1f41bc93ffd121149939e2", - "transactionHash": "0xb259a921879e582801e2dddff9afa8efd8f0a91c1a42130aee4e41e0bb779f9e", - "logs": [], - "blockNumber": 7827082, - "cumulativeGasUsed": "29327366", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf85BA0afA375495eE625910Db61b6b1406756234", - "0x522018b86645F597626aa127EfC22D55a5c79F11", - "0xdDa4c8d2933dAA21Aac75B88fF59725725ba813F", - "0x0844662f25817B735BC9B6d9D11995F1A6c4dCB1", - "10000001", - "20000000" - ], - "numDeployments": 1, - "solcInputHash": "7e84cd39af8dda1388150d22fc6a7983", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"hydraS1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"availableRootsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"AccountsTreeValueMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimLength\",\"type\":\"uint256\"}],\"name\":\"ClaimsLengthDifferentThanOne\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentMapperPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inputRoot\",\"type\":\"uint256\"}],\"name\":\"RegistryRootMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"TicketUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAvailableRootsRegistry\",\"outputs\":[{\"internalType\":\"contract IAvailableRootsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentMapperRegistry\",\"outputs\":[{\"internalType\":\"contract ICommitmentMapperRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract HydraS1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns attestations that will be recorded, constructed from the user request\",\"params\":{\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"availableRootsRegistryAddress\":\"Registry storing the available groups for this attester (e.g roots of registry merkle trees)\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentMapperAddress\":\"commitment mapper's public key registry\",\"hydraS1VerifierAddress\":\"ZK Snark Hydra-S1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getAvailableRootsRegistry()\":{\"details\":\"Getter of Roots Registry Contract\"},\"getCommitmentMapperRegistry()\":{\"details\":\"Getter of Commitment Mapper Registry contract\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Hydra-S1 Verifier contract\"}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"}},\"title\":\"Hydra-S1 Simple Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew their attestations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":\"HydraS1SimpleAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() initializer {}\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\\n // contract may have been reentered.\\n require(_initializing ? _isConstructor() : !_initialized, \\\"Initializable: contract is already initialized\\\");\\n\\n bool isTopLevelCall = !_initializing;\\n if (isTopLevelCall) {\\n _initializing = true;\\n _initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n _initializing = false;\\n }\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} modifier, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n function _isConstructor() private view returns (bool) {\\n return !Address.isContract(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x4823752b07b8ea4ca971b217e39457930e7cb103c2c91e2a29729e5ca907e4f0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\\n 546002182798634190282541153661423157791776194062719045593389981526666716416\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x70c0b7d96ff1b90538938a4cb2d8086b3aabb4febf1e36cb3f470bfe0b4a9e89\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - Renewable\\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew their attestations\\n **/\\n\\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base, Attester {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n mapping(uint256 => address) internal _ticketsDestinations;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(Request calldata request, bytes calldata)\\n public\\n view\\n virtual\\n override(IAttester, Attester)\\n returns (Attestation[] memory)\\n {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n ''\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used and not a renewal (e.g destination different that last)\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n // we get the ticket used from the snark input in the data provided\\n uint256 userTicket = proofData._getTicket();\\n address currentDestination = _getDestinationOfTicket(userTicket);\\n\\n if (currentDestination != address(0) && currentDestination != request.destination) {\\n revert TicketUsed(userTicket);\\n }\\n\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n override\\n returns (uint256)\\n {\\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\\n return ticketIdentifier;\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _ticketsDestinations[userTicket] = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _ticketsDestinations[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x4e58a7c2e28a705f0a4af77ec4145f504aa68cdbc263ac077ebc4c50b9086f11\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n \\n \\n **/\\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n virtual\\n returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\\n internal\\n view\\n virtual\\n {\\n if (input.accountsTreeValue != claim.groupId)\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\\n revert RegistryRootMismatch(input.registryRoot);\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n )\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(\\n uint256 /*errorCode*/\\n ) {\\n revert InvalidGroth16Proof('');\\n } catch (\\n bytes memory /*lowLevelData*/\\n ) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0x02708884237382835cd3d3514fdc3603409ce5ea1dc7255a7ceea07dff417c34\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n// todo: explain well what is specific to this attester\\ninterface IHydraS1Base {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x73cff4dcd9c30857859721ea2897be8bb7087c0122f4587acdaa79d8ec0a728d\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n// todo: explain well what is specific to this attester\\ninterface IHydraS1SimpleAttester is IHydraS1Base, IAttester {\\n error TicketUsed(uint256 userTicket);\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xa773e565f9a9ae1b6139779f80e04bf8391ee40e7f2673c785814d1317894259\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // ticketIdentifier\\n // ticket\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (\\n uint256[2] memory,\\n uint256[2][2] memory,\\n uint256[2] memory,\\n uint256[10] memory\\n )\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256[2] memory)\\n {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256)\\n {\\n return self.input[5];\\n }\\n\\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\\n internal\\n pure\\n returns (uint256)\\n {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x596225970aabbc4edb989ee640867c76944e797bfafe5e06dcf37b973480b957\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n override\\n returns (Attestation[] memory)\\n {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n address[] memory attestationOwners = new address[](collectionIds.length);\\n\\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\\n\\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n // fetch attestations from the registry\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationOwners[i] = attestationsOwner;\\n attestationCollectionIds[i] = collectionIds[i];\\n\\n attestations[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestations, proofData);\\n\\n _beforeDeleteAttestations(attestations, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n\\n _afterDeleteAttestations(attestations, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestations[i]);\\n }\\n return attestations;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n}\\n\",\"keccak256\":\"0xcab4865f46f442ae11ea0689f63eb7fa0763fcfe86522aa67521a548171cb8e0\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xcf79a817ec578f5b4d8f23853dd8df0e3b1acfbff2b5a01601fd9a7315862ec9\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) public initializer {\\n _transferOwnership(owner);\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9329ecaf60ffe978c8ab4360e0a8f9bd36e2549e89d672dd39ae80f9a562f9a9\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public initializer {\\n _transferOwnership(owner);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0xacb5347ee1a0e8dc25a1ce3e6fbb427db646e833ff8508909454cad7950418d4\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x87f5035b58936a8458a22f3cf1b3865bd798813310d86af41af74680978c97c8\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0x8d6298b442dde99ee5a9cc989ada6ea808383a08b1e9bb1d4c2b58adc01eec69\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101406040523480156200001257600080fd5b5060405162001f6038038062001f60833981016040819052620000359162000081565b6001600160a01b0394851660805292841660c05290831660a0529190921660e0526101005261012052620000f0565b80516001600160a01b03811681146200007c57600080fd5b919050565b60008060008060008060c087890312156200009b57600080fd5b620000a68762000064565b9550620000b66020880162000064565b9450620000c66040880162000064565b9350620000d66060880162000064565b92506080870151915060a087015190509295509295509295565b60805160a05160c05160e0516101005161012051611dea620001766000396000818161015501526102b501526000818161010d015261028d0152600081816101bf015281816104860152818161066701526107880152600081816101790152610c3301526000818160a50152610ccf01526000818160e40152610e300152611dea6000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063918447af11610066578063918447af14610177578063af411a301461019d578063bfa66585146101bd578063c776adde146101e3578063e60f999f146101f657600080fd5b80632254f98e146100a357806346657fe9146100e257806354846d7a1461010857806363e4afc21461013d5780637000b05114610150575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100d9565b6100c561014b3660046112d1565b610209565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101ab366004611332565b610228565b6040516100d9919061145d565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101f13660046114e4565b61038f565b6101b0610204366004611332565b61074a565b6000818152600160205260408120546001600160a01b03165b92915050565b6060600061023d61023886611642565b610866565b60408051600180825281830190925291925060009190816020015b6102606111af565b8152602001906001900390816102585750506060830151519091506000906102b1906001600160801b03167f00000000000000000000000000000000000000000000000000000000000000006117d1565b90507f00000000000000000000000000000000000000000000000000000000000000008111156102fc57604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b031681526020018560200151815260200185606001516020015163ffffffff1681526020016040518060200160405280600081525081525083600081518110610378576103786117e9565b602090810291909101015250909695505050505050565b60606000856001600160401b038111156103ab576103ab611595565b6040519080825280602002602001820160405280156103d4578160200160208202803683370190505b5090506000866001600160401b038111156103f1576103f1611595565b60405190808252806020026020018201604052801561041a578160200160208202803683370190505b5090506000876001600160401b0381111561043757610437611595565b60405190808252806020026020018201604052801561047057816020015b61045d6111af565b8152602001906001900390816104555790505b50905060005b88811015610644576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106104c5576104c56117e9565b905060200201358e6040518363ffffffff1660e01b81526004016104fc9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610519573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105419190810190611813565b93509350935093508b88868151811061055c5761055c6117e9565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061058e5761058e6117e9565b905060200201358786815181106105a7576105a76117e9565b6020026020010181815250506040518060c001604052808f8f888181106105d0576105d06117e9565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff16815260200182815250868681518110610622576106226117e9565b602002602001018190525050505050808061063c906118c2565b915050610476565b506106508187876108eb565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061069e90869086906004016118db565b600060405180830381600087803b1580156106b857600080fd5b505af11580156106cc573d6000803e3d6000fd5b5050505060005b8881101561073d577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070e5761070e6117e9565b6020026020010151604051610723919061195f565b60405180910390a180610735816118c2565b9150506106d3565b5098975050505050505050565b6060610757848484610904565b6000610764858585610228565b905061077185858561094c565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107bd90849060040161145d565b600060405180830381600087803b1580156107d757600080fd5b505af11580156107eb573d6000803e3d6000fd5b5050505060005b815181101561085d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061082e5761082e6117e9565b6020026020010151604051610843919061195f565b60405180910390a180610855816118c2565b9150506107f2565b50949350505050565b61086e6111fd565b60008260000151600081518110610887576108876117e9565b6020026020010151905061089a816109e7565b600081604001518060200190518101906108b49190611982565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b600061091282840184611ab1565b9050600061091f82610a2b565b9050600061092f61023887611642565b905061093b8183610ad5565b61094483610e06565b505050505050565b60006109588383610f9f565b6000818152600160205260409020549091506001600160a01b031680158015906109a3575061098d6040860160208701611b82565b6001600160a01b0316816001600160a01b031614155b156109c457604051631f5d53e360e01b8152600481018390526024016102f3565b6109dd826109d86040880160208901611b82565b610fc4565b5050505050565b50565b60006109f6826040015161102a565b82519091508114610a275781516040516337e3d1ab60e01b81526102f3918391600401918252602082015260400190565b5050565b610a33611260565b604051806101200160405280610a488461105f565b6001600160a01b03168152602001610a5f84611074565b8152602001610a6d84611083565b8152602001610a7b84611092565b8152602001610a89846110a1565b8152602001610a97846110b0565b8152602001610aa5846110bf565b8152602001610abd8460200151610120015160011490565b15158152602001610acd846110ce565b905292915050565b815160c082015114610b0a57815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016102f3565b81606001516040015115158160e00151151503610b5557606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016102f3565b81604001516001600160a01b031681600001516001600160a01b031614610ba957604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016102f3565b46816020015114610bdc576020810151604051630432cec160e31b815246600482015260248101919091526044016102f3565b81602001518160a0015114610c1757602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016102f3565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610c82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca69190611b9f565b610ccb57806040015160405163cbfe7bc360e01b81526004016102f391815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610d2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4e9190611bba565b805161010084015151919250141580610d7557506020808201516101008401519091015114155b15610dbf578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016102f3565b6000610dca84611126565b905080836060015114610e005760608301516040516377bb6d2760e11b81526102f3918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f694610e6994909392909190600401611c36565b602060405180830381865afa925050508015610ea2575060408051601f3d908101601f19168201909252610e9f91810190611b9f565b60015b610f7857610eae611cba565b806308c379a003610ee75750610ec2611cd6565b80610ecd5750610f26565b8060405162dd577760e81b81526004016102f39190611d5f565b634e487b7103610f2657610ef9611d72565b90610f045750610f26565b60405162dd577760e81b815260206004820152600060248201526044016102f3565b3d808015610f50576040519150601f19603f3d011682016040523d82523d6000602084013e610f55565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016102f3565b80610a275760405162dd577760e81b815260206004820152600060248201526044016102f3565b600080610fae83850185611ab1565b90506000610fbb826110a1565b95945050505050565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b80516020820120600090610222907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611d92565b6020810151600090815b602002015192915050565b60208101516000906001611069565b60208101516000906004611069565b60208101516000906005611069565b60208101516000906006611069565b60208101516000906007611069565b60208101516000906008611069565b6110d66112b3565b604051806040016040528083602001516002600a81106110f8576110f86117e9565b6020020151815260200183602001516003600a8110611119576111196117e9565b6020020151905292915050565b600080611144308460600151600001516001600160801b031661114b565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6111449190611d92565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b0316815260200161125b604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815260200161125b5b60405180604001604052806002906020820280368337509192915050565b6000602082840312156112e357600080fd5b5035919050565b60008083601f8401126112fc57600080fd5b5081356001600160401b0381111561131357600080fd5b60208301915083602082850101111561132b57600080fd5b9250929050565b60008060006040848603121561134757600080fd5b83356001600160401b038082111561135e57600080fd5b908501906040828803121561137257600080fd5b9093506020850135908082111561138857600080fd5b50611395868287016112ea565b9497909650939450505050565b60005b838110156113bd5781810151838201526020016113a5565b83811115610e005750506000910152565b600081518084526113e68160208601602086016113a2565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261145560c08501826113ce565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156114b257603f198886030184526114a08583516113fa565b94509285019290850190600101611484565b5092979650505050505050565b6001600160a01b03811681146109e457600080fd5b80356114df816114bf565b919050565b6000806000806000606086880312156114fc57600080fd5b85356001600160401b038082111561151357600080fd5b818801915088601f83011261152757600080fd5b81358181111561153657600080fd5b8960208260051b850101111561154b57600080fd5b60208301975080965050611561602089016114d4565b9450604088013591508082111561157757600080fd5b50611584888289016112ea565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b03821117156115ca576115ca611595565b60405250565b606081018181106001600160401b03821117156115ca576115ca611595565b601f8201601f191681016001600160401b038111828210171561161457611614611595565b6040525050565b60006001600160401b0382111561163457611634611595565b50601f01601f191660200190565b6000604080833603121561165557600080fd5b8051611660816115ab565b83356001600160401b038082111561167757600080fd5b9085019036601f83011261168a57600080fd5b813560208282111561169e5761169e611595565b8160051b86516116b0838301826115ef565b928352848101820192828101368511156116c957600080fd5b83870192505b8483101561179d578235868111156116e75760008081fd5b8701606036829003601f19018113156117005760008081fd5b8a5161170b816115d0565b8287013581528b8301358188015290820135908882111561172c5760008081fd5b9181019136603f84011261174257600091508182fd5b8683013591506117518261161b565b8c5161175d82826115ef565b838152368e85870101111561177457600091508182fd5b838e86018a830137600093810189019390935250808c01919091528252509183019183016116cf565b508652506117ac8882016114d4565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b600082198211156117e4576117e46117bb565b500190565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff811681146114df57600080fd5b6000806000806080858703121561182957600080fd5b8451611834816114bf565b6020860151909450925061184a604086016117ff565b915060608501516001600160401b0381111561186557600080fd5b8501601f8101871361187657600080fd5b80516118818161161b565b60405161188e82826115ef565b8281528960208486010111156118a357600080fd5b6118b48360208301602087016113a2565b969995985093965050505050565b6000600182016118d4576118d46117bb565b5060010190565b604080825283519082018190526000906020906060840190828701845b8281101561191d5781516001600160a01b0316845292840192908401906001016118f8565b5050508381038285015284518082528583019183019060005b8181101561195257835183529284019291840191600101611936565b5090979650505050505050565b60208152600061114460208301846113fa565b805180151581146114df57600080fd5b60006060828403121561199457600080fd5b604051606081018181106001600160401b03821117156119b6576119b6611595565b60405282516001600160801b03811681146119d057600080fd5b81526119de602084016117ff565b60208201526119ef60408401611972565b60408201529392505050565b600082601f830112611a0c57600080fd5b604051611a18816115ab565b806040840185811115611a2a57600080fd5b845b81811015611a44578035835260209283019201611a2c565b509195945050505050565b600082601f830112611a6057600080fd5b6040516101408082018281106001600160401b0382111715611a8457611a84611595565b60405283018185821115611a9757600080fd5b845b82811015611a44578035825260209182019101611a99565b6000818303610240811215611ac557600080fd5b60408051611ad2816115ab565b61010080841215611ae257600080fd5b82519350611aef846115d0565b611af987876119fb565b845286605f870112611b0a57600080fd5b8251611b15816115ab565b8060c0880189811115611b2757600080fd5b8589015b81811015611b4c57611b3d8b826119fb565b83526020909201918601611b2b565b50826020880152611b5d8a826119fb565b86880152505050838252611b7387828801611a4f565b60208301525095945050505050565b600060208284031215611b9457600080fd5b8135611144816114bf565b600060208284031215611bb157600080fd5b61114482611972565b600060408284031215611bcc57600080fd5b82601f830112611bdb57600080fd5b604051611be7816115ab565b806040840185811115611bf957600080fd5b845b81811015611a44578051835260209283019201611bfb565b8060005b6002811015610e00578151845260209384019390910190600101611c17565b6102408101611c458287611c13565b60408083018660005b6002811015611c7557611c62838351611c13565b9183019160209190910190600101611c4e565b50505050611c8660c0830185611c13565b61010082018360005b600a811015611cae578151835260209283019290910190600101611c8f565b50505095945050505050565b600060033d1115611cd35760046000803e5060005160e01c5b90565b600060443d1015611ce45790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611d1357505050505090565b8285019150815181811115611d2b5750505050505090565b843d8701016020828501011115611d455750505050505090565b611d54602082860101876115ef565b509095945050505050565b60208152600061114460208301846113ce565b60008060233d1115611d8e576020600460003e50506000516001905b9091565b600082611daf57634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220aed0a4280215dfec1130b2141d94f98012a349cf6ba3f0a91515939430c60d4064736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063918447af11610066578063918447af14610177578063af411a301461019d578063bfa66585146101bd578063c776adde146101e3578063e60f999f146101f657600080fd5b80632254f98e146100a357806346657fe9146100e257806354846d7a1461010857806363e4afc21461013d5780637000b05114610150575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100d9565b6100c561014b3660046112d1565b610209565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101ab366004611332565b610228565b6040516100d9919061145d565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101f13660046114e4565b61038f565b6101b0610204366004611332565b61074a565b6000818152600160205260408120546001600160a01b03165b92915050565b6060600061023d61023886611642565b610866565b60408051600180825281830190925291925060009190816020015b6102606111af565b8152602001906001900390816102585750506060830151519091506000906102b1906001600160801b03167f00000000000000000000000000000000000000000000000000000000000000006117d1565b90507f00000000000000000000000000000000000000000000000000000000000000008111156102fc57604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b031681526020018560200151815260200185606001516020015163ffffffff1681526020016040518060200160405280600081525081525083600081518110610378576103786117e9565b602090810291909101015250909695505050505050565b60606000856001600160401b038111156103ab576103ab611595565b6040519080825280602002602001820160405280156103d4578160200160208202803683370190505b5090506000866001600160401b038111156103f1576103f1611595565b60405190808252806020026020018201604052801561041a578160200160208202803683370190505b5090506000876001600160401b0381111561043757610437611595565b60405190808252806020026020018201604052801561047057816020015b61045d6111af565b8152602001906001900390816104555790505b50905060005b88811015610644576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106104c5576104c56117e9565b905060200201358e6040518363ffffffff1660e01b81526004016104fc9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610519573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105419190810190611813565b93509350935093508b88868151811061055c5761055c6117e9565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061058e5761058e6117e9565b905060200201358786815181106105a7576105a76117e9565b6020026020010181815250506040518060c001604052808f8f888181106105d0576105d06117e9565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff16815260200182815250868681518110610622576106226117e9565b602002602001018190525050505050808061063c906118c2565b915050610476565b506106508187876108eb565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061069e90869086906004016118db565b600060405180830381600087803b1580156106b857600080fd5b505af11580156106cc573d6000803e3d6000fd5b5050505060005b8881101561073d577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070e5761070e6117e9565b6020026020010151604051610723919061195f565b60405180910390a180610735816118c2565b9150506106d3565b5098975050505050505050565b6060610757848484610904565b6000610764858585610228565b905061077185858561094c565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107bd90849060040161145d565b600060405180830381600087803b1580156107d757600080fd5b505af11580156107eb573d6000803e3d6000fd5b5050505060005b815181101561085d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061082e5761082e6117e9565b6020026020010151604051610843919061195f565b60405180910390a180610855816118c2565b9150506107f2565b50949350505050565b61086e6111fd565b60008260000151600081518110610887576108876117e9565b6020026020010151905061089a816109e7565b600081604001518060200190518101906108b49190611982565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b600061091282840184611ab1565b9050600061091f82610a2b565b9050600061092f61023887611642565b905061093b8183610ad5565b61094483610e06565b505050505050565b60006109588383610f9f565b6000818152600160205260409020549091506001600160a01b031680158015906109a3575061098d6040860160208701611b82565b6001600160a01b0316816001600160a01b031614155b156109c457604051631f5d53e360e01b8152600481018390526024016102f3565b6109dd826109d86040880160208901611b82565b610fc4565b5050505050565b50565b60006109f6826040015161102a565b82519091508114610a275781516040516337e3d1ab60e01b81526102f3918391600401918252602082015260400190565b5050565b610a33611260565b604051806101200160405280610a488461105f565b6001600160a01b03168152602001610a5f84611074565b8152602001610a6d84611083565b8152602001610a7b84611092565b8152602001610a89846110a1565b8152602001610a97846110b0565b8152602001610aa5846110bf565b8152602001610abd8460200151610120015160011490565b15158152602001610acd846110ce565b905292915050565b815160c082015114610b0a57815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016102f3565b81606001516040015115158160e00151151503610b5557606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016102f3565b81604001516001600160a01b031681600001516001600160a01b031614610ba957604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016102f3565b46816020015114610bdc576020810151604051630432cec160e31b815246600482015260248101919091526044016102f3565b81602001518160a0015114610c1757602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016102f3565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610c82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca69190611b9f565b610ccb57806040015160405163cbfe7bc360e01b81526004016102f391815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610d2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4e9190611bba565b805161010084015151919250141580610d7557506020808201516101008401519091015114155b15610dbf578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016102f3565b6000610dca84611126565b905080836060015114610e005760608301516040516377bb6d2760e11b81526102f3918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f694610e6994909392909190600401611c36565b602060405180830381865afa925050508015610ea2575060408051601f3d908101601f19168201909252610e9f91810190611b9f565b60015b610f7857610eae611cba565b806308c379a003610ee75750610ec2611cd6565b80610ecd5750610f26565b8060405162dd577760e81b81526004016102f39190611d5f565b634e487b7103610f2657610ef9611d72565b90610f045750610f26565b60405162dd577760e81b815260206004820152600060248201526044016102f3565b3d808015610f50576040519150601f19603f3d011682016040523d82523d6000602084013e610f55565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016102f3565b80610a275760405162dd577760e81b815260206004820152600060248201526044016102f3565b600080610fae83850185611ab1565b90506000610fbb826110a1565b95945050505050565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b80516020820120600090610222907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611d92565b6020810151600090815b602002015192915050565b60208101516000906001611069565b60208101516000906004611069565b60208101516000906005611069565b60208101516000906006611069565b60208101516000906007611069565b60208101516000906008611069565b6110d66112b3565b604051806040016040528083602001516002600a81106110f8576110f86117e9565b6020020151815260200183602001516003600a8110611119576111196117e9565b6020020151905292915050565b600080611144308460600151600001516001600160801b031661114b565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6111449190611d92565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b0316815260200161125b604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815260200161125b5b60405180604001604052806002906020820280368337509192915050565b6000602082840312156112e357600080fd5b5035919050565b60008083601f8401126112fc57600080fd5b5081356001600160401b0381111561131357600080fd5b60208301915083602082850101111561132b57600080fd5b9250929050565b60008060006040848603121561134757600080fd5b83356001600160401b038082111561135e57600080fd5b908501906040828803121561137257600080fd5b9093506020850135908082111561138857600080fd5b50611395868287016112ea565b9497909650939450505050565b60005b838110156113bd5781810151838201526020016113a5565b83811115610e005750506000910152565b600081518084526113e68160208601602086016113a2565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261145560c08501826113ce565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156114b257603f198886030184526114a08583516113fa565b94509285019290850190600101611484565b5092979650505050505050565b6001600160a01b03811681146109e457600080fd5b80356114df816114bf565b919050565b6000806000806000606086880312156114fc57600080fd5b85356001600160401b038082111561151357600080fd5b818801915088601f83011261152757600080fd5b81358181111561153657600080fd5b8960208260051b850101111561154b57600080fd5b60208301975080965050611561602089016114d4565b9450604088013591508082111561157757600080fd5b50611584888289016112ea565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b03821117156115ca576115ca611595565b60405250565b606081018181106001600160401b03821117156115ca576115ca611595565b601f8201601f191681016001600160401b038111828210171561161457611614611595565b6040525050565b60006001600160401b0382111561163457611634611595565b50601f01601f191660200190565b6000604080833603121561165557600080fd5b8051611660816115ab565b83356001600160401b038082111561167757600080fd5b9085019036601f83011261168a57600080fd5b813560208282111561169e5761169e611595565b8160051b86516116b0838301826115ef565b928352848101820192828101368511156116c957600080fd5b83870192505b8483101561179d578235868111156116e75760008081fd5b8701606036829003601f19018113156117005760008081fd5b8a5161170b816115d0565b8287013581528b8301358188015290820135908882111561172c5760008081fd5b9181019136603f84011261174257600091508182fd5b8683013591506117518261161b565b8c5161175d82826115ef565b838152368e85870101111561177457600091508182fd5b838e86018a830137600093810189019390935250808c01919091528252509183019183016116cf565b508652506117ac8882016114d4565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b600082198211156117e4576117e46117bb565b500190565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff811681146114df57600080fd5b6000806000806080858703121561182957600080fd5b8451611834816114bf565b6020860151909450925061184a604086016117ff565b915060608501516001600160401b0381111561186557600080fd5b8501601f8101871361187657600080fd5b80516118818161161b565b60405161188e82826115ef565b8281528960208486010111156118a357600080fd5b6118b48360208301602087016113a2565b969995985093965050505050565b6000600182016118d4576118d46117bb565b5060010190565b604080825283519082018190526000906020906060840190828701845b8281101561191d5781516001600160a01b0316845292840192908401906001016118f8565b5050508381038285015284518082528583019183019060005b8181101561195257835183529284019291840191600101611936565b5090979650505050505050565b60208152600061114460208301846113fa565b805180151581146114df57600080fd5b60006060828403121561199457600080fd5b604051606081018181106001600160401b03821117156119b6576119b6611595565b60405282516001600160801b03811681146119d057600080fd5b81526119de602084016117ff565b60208201526119ef60408401611972565b60408201529392505050565b600082601f830112611a0c57600080fd5b604051611a18816115ab565b806040840185811115611a2a57600080fd5b845b81811015611a44578035835260209283019201611a2c565b509195945050505050565b600082601f830112611a6057600080fd5b6040516101408082018281106001600160401b0382111715611a8457611a84611595565b60405283018185821115611a9757600080fd5b845b82811015611a44578035825260209182019101611a99565b6000818303610240811215611ac557600080fd5b60408051611ad2816115ab565b61010080841215611ae257600080fd5b82519350611aef846115d0565b611af987876119fb565b845286605f870112611b0a57600080fd5b8251611b15816115ab565b8060c0880189811115611b2757600080fd5b8589015b81811015611b4c57611b3d8b826119fb565b83526020909201918601611b2b565b50826020880152611b5d8a826119fb565b86880152505050838252611b7387828801611a4f565b60208301525095945050505050565b600060208284031215611b9457600080fd5b8135611144816114bf565b600060208284031215611bb157600080fd5b61114482611972565b600060408284031215611bcc57600080fd5b82601f830112611bdb57600080fd5b604051611be7816115ab565b806040840185811115611bf957600080fd5b845b81811015611a44578051835260209283019201611bfb565b8060005b6002811015610e00578151845260209384019390910190600101611c17565b6102408101611c458287611c13565b60408083018660005b6002811015611c7557611c62838351611c13565b9183019160209190910190600101611c4e565b50505050611c8660c0830185611c13565b61010082018360005b600a811015611cae578151835260209283019290910190600101611c8f565b50505095945050505050565b600060033d1115611cd35760046000803e5060005160e01c5b90565b600060443d1015611ce45790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611d1357505050505090565b8285019150815181811115611d2b5750505050505090565b843d8701016020828501011115611d455750505050505090565b611d54602082860101876115ef565b509095945050505050565b60208152600061114460208301846113ce565b60008060233d1115611d8e576020600460003e50506000516001905b9091565b600082611daf57634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220aed0a4280215dfec1130b2141d94f98012a349cf6ba3f0a91515939430c60d4064736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns attestations that will be recorded, constructed from the user request", - "params": { - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "availableRootsRegistryAddress": "Registry storing the available groups for this attester (e.g roots of registry merkle trees)", - "collectionIdFirst": "Id of the first collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last collection in which the attester is supposed to record", - "commitmentMapperAddress": "commitment mapper's public key registry", - "hydraS1VerifierAddress": "ZK Snark Hydra-S1 Verifier contract" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getAvailableRootsRegistry()": { - "details": "Getter of Roots Registry Contract" - }, - "getCommitmentMapperRegistry()": { - "details": "Getter of Commitment Mapper Registry contract" - }, - "getDestinationOfTicket(uint256)": { - "details": "Getter, returns the last attestation destination of a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getVerifier()": { - "details": "Getter of Hydra-S1 Verifier contract" - } - }, - "stateVariables": { - "AUTHORIZED_COLLECTION_ID_FIRST": { - "details": "Getter returns of the first collection in which the attester is supposed to record*" - }, - "AUTHORIZED_COLLECTION_ID_LAST": { - "details": "Getter returns of the last collection in which the attester is supposed to record*" - } - }, - "title": "Hydra-S1 Simple Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew their attestations*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 936, - "contract": "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol:HydraS1SimpleAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 939, - "contract": "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol:HydraS1SimpleAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 6335, - "contract": "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol:HydraS1SimpleAttester", - "label": "_ticketsDestinations", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_address)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_address)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/HydraS1SimpleAttesterImplemV3.json b/deployments/goerli/HydraS1SimpleAttesterImplemV3.json deleted file mode 100644 index 7c178dd..0000000 --- a/deployments/goerli/HydraS1SimpleAttesterImplemV3.json +++ /dev/null @@ -1,850 +0,0 @@ -{ - "address": "0x70244BaA5F927c8d4cCF08CaDf1Ea1Ee5fD77946", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "hydraS1VerifierAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "availableRootsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "AccountsTreeValueMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "claimLength", - "type": "uint256" - } - ], - "name": "ClaimsLengthDifferentThanOne", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentMapperPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "inputRoot", - "type": "uint256" - } - ], - "name": "RegistryRootMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedTicketIdentifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ticketIdentifier", - "type": "uint256" - } - ], - "name": "TicketIdentifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "TicketUsed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "TicketDestinationUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAvailableRootsRegistry", - "outputs": [ - { - "internalType": "contract IAvailableRootsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentMapperRegistry", - "outputs": [ - { - "internalType": "contract ICommitmentMapperRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getDestinationOfTicket", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract HydraS1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x18e91745b28392de78ed1384b69e2cdd9885c2e435ee3da71e642aa777240dd6", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x70244BaA5F927c8d4cCF08CaDf1Ea1Ee5fD77946", - "transactionIndex": 158, - "gasUsed": "1708910", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x2eb47de08441cdb3bcdd893c2ec8a24038f45483334766d562d1a5bf4202b842", - "transactionHash": "0x18e91745b28392de78ed1384b69e2cdd9885c2e435ee3da71e642aa777240dd6", - "logs": [], - "blockNumber": 7831849, - "cumulativeGasUsed": "28884439", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf85BA0afA375495eE625910Db61b6b1406756234", - "0x522018b86645F597626aa127EfC22D55a5c79F11", - "0xdDa4c8d2933dAA21Aac75B88fF59725725ba813F", - "0x0844662f25817B735BC9B6d9D11995F1A6c4dCB1", - "10000001", - "20000000" - ], - "numDeployments": 1, - "solcInputHash": "c7c67c4a1ddf53de4ef76f8a114dfc39", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"hydraS1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"availableRootsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"AccountsTreeValueMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimLength\",\"type\":\"uint256\"}],\"name\":\"ClaimsLengthDifferentThanOne\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentMapperPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inputRoot\",\"type\":\"uint256\"}],\"name\":\"RegistryRootMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"TicketUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAvailableRootsRegistry\",\"outputs\":[{\"internalType\":\"contract IAvailableRootsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentMapperRegistry\",\"outputs\":[{\"internalType\":\"contract ICommitmentMapperRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract HydraS1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"errors\":{\"CollectionIdOutOfBound(uint256)\":[{\"details\":\"Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST*\"}],\"TicketUsed(uint256)\":[{\"details\":\"Error when the userTicket (or nullifierHash) is already used for a destination address*\"}]},\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns attestations that will be recorded, constructed from the user request\",\"params\":{\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"availableRootsRegistryAddress\":\"Registry storing the available groups for this attester (e.g roots of registry merkle trees)\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentMapperAddress\":\"commitment mapper's public key registry\",\"hydraS1VerifierAddress\":\"ZK Snark Hydra-S1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getAvailableRootsRegistry()\":{\"details\":\"Getter of Roots Registry Contract\"},\"getCommitmentMapperRegistry()\":{\"details\":\"Getter of Commitment Mapper Registry contract\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Hydra-S1 Verifier contract\"}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"}},\"title\":\"Hydra-S1 Simple Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew their attestations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":\"HydraS1SimpleAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() initializer {}\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\\n // contract may have been reentered.\\n require(_initializing ? _isConstructor() : !_initialized, \\\"Initializable: contract is already initialized\\\");\\n\\n bool isTopLevelCall = !_initializing;\\n if (isTopLevelCall) {\\n _initializing = true;\\n _initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n _initializing = false;\\n }\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} modifier, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n function _isConstructor() private view returns (bool) {\\n return !Address.isContract(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x4823752b07b8ea4ca971b217e39457930e7cb103c2c91e2a29729e5ca907e4f0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\\n 546002182798634190282541153661423157791776194062719045593389981526666716416\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x70c0b7d96ff1b90538938a4cb2d8086b3aabb4febf1e36cb3f470bfe0b4a9e89\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - Renewable\\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew their attestations\\n **/\\n\\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base, Attester {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n mapping(uint256 => address) internal _ticketsDestinations;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(Request calldata request, bytes calldata)\\n public\\n view\\n virtual\\n override(IAttester, Attester)\\n returns (Attestation[] memory)\\n {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n ''\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used and not a renewal (e.g destination different that last)\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n // we get the ticket used from the snark input in the data provided\\n uint256 userTicket = proofData._getTicket();\\n address currentDestination = _getDestinationOfTicket(userTicket);\\n\\n if (currentDestination != address(0) && currentDestination != request.destination) {\\n revert TicketUsed(userTicket);\\n }\\n\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n override\\n returns (uint256)\\n {\\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\\n return ticketIdentifier;\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _ticketsDestinations[userTicket] = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _ticketsDestinations[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x4e58a7c2e28a705f0a4af77ec4145f504aa68cdbc263ac077ebc4c50b9086f11\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n **/\\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n virtual\\n returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\\n internal\\n view\\n virtual\\n {\\n if (input.accountsTreeValue != claim.groupId)\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\\n revert RegistryRootMismatch(input.registryRoot);\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n )\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(\\n uint256 /*errorCode*/\\n ) {\\n revert InvalidGroth16Proof('');\\n } catch (\\n bytes memory /*lowLevelData*/\\n ) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0xdcc036e3178c26e71c5dfdb601f09139ce8919db220acdbb2ad2bad6cc5c4857\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Interface\\n * @author Sismo\\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n **/\\ninterface IHydraS1Base {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x33e77f2249293295d1ef95a4d979cad95719bacb216c467f685bdc0b08908bea\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Interface\\n * @author Sismo\\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\\n **/\\ninterface IHydraS1SimpleAttester is IHydraS1Base, IAttester {\\n /**\\n * @dev Error when the userTicket (or nullifierHash) is already used for a destination address\\n **/\\n error TicketUsed(uint256 userTicket);\\n\\n /**\\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\\n **/\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n /**\\n * @dev Event emitted when the userTicket (or nullifierHash) is associated to a destination address.\\n **/\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xc8bc2a17b743f7cc8b71d0c1c08cc7973639eb7d1593a14b1cd67b41eb78a632\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // ticketIdentifier\\n // ticket\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (\\n uint256[2] memory,\\n uint256[2][2] memory,\\n uint256[2] memory,\\n uint256[10] memory\\n )\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256[2] memory)\\n {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256)\\n {\\n return self.input[5];\\n }\\n\\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\\n internal\\n pure\\n returns (uint256)\\n {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x596225970aabbc4edb989ee640867c76944e797bfafe5e06dcf37b973480b957\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n override\\n returns (Attestation[] memory)\\n {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n address[] memory attestationOwners = new address[](collectionIds.length);\\n\\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\\n\\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n // fetch attestations from the registry\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationOwners[i] = attestationsOwner;\\n attestationCollectionIds[i] = collectionIds[i];\\n\\n attestations[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestations, proofData);\\n\\n _beforeDeleteAttestations(attestations, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n\\n _afterDeleteAttestations(attestations, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestations[i]);\\n }\\n return attestations;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n}\\n\",\"keccak256\":\"0xcab4865f46f442ae11ea0689f63eb7fa0763fcfe86522aa67521a548171cb8e0\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xcf79a817ec578f5b4d8f23853dd8df0e3b1acfbff2b5a01601fd9a7315862ec9\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) public initializer {\\n _transferOwnership(owner);\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9329ecaf60ffe978c8ab4360e0a8f9bd36e2549e89d672dd39ae80f9a562f9a9\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public initializer {\\n _transferOwnership(owner);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0xacb5347ee1a0e8dc25a1ce3e6fbb427db646e833ff8508909454cad7950418d4\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x87f5035b58936a8458a22f3cf1b3865bd798813310d86af41af74680978c97c8\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0x8d6298b442dde99ee5a9cc989ada6ea808383a08b1e9bb1d4c2b58adc01eec69\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101406040523480156200001257600080fd5b5060405162001f6038038062001f60833981016040819052620000359162000081565b6001600160a01b0394851660805292841660c05290831660a0529190921660e0526101005261012052620000f0565b80516001600160a01b03811681146200007c57600080fd5b919050565b60008060008060008060c087890312156200009b57600080fd5b620000a68762000064565b9550620000b66020880162000064565b9450620000c66040880162000064565b9350620000d66060880162000064565b92506080870151915060a087015190509295509295509295565b60805160a05160c05160e0516101005161012051611dea620001766000396000818161015501526102b501526000818161010d015261028d0152600081816101bf015281816104860152818161066701526107880152600081816101790152610c3301526000818160a50152610ccf01526000818160e40152610e300152611dea6000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063918447af11610066578063918447af14610177578063af411a301461019d578063bfa66585146101bd578063c776adde146101e3578063e60f999f146101f657600080fd5b80632254f98e146100a357806346657fe9146100e257806354846d7a1461010857806363e4afc21461013d5780637000b05114610150575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100d9565b6100c561014b3660046112d1565b610209565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101ab366004611332565b610228565b6040516100d9919061145d565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101f13660046114e4565b61038f565b6101b0610204366004611332565b61074a565b6000818152600160205260408120546001600160a01b03165b92915050565b6060600061023d61023886611642565b610866565b60408051600180825281830190925291925060009190816020015b6102606111af565b8152602001906001900390816102585750506060830151519091506000906102b1906001600160801b03167f00000000000000000000000000000000000000000000000000000000000000006117d1565b90507f00000000000000000000000000000000000000000000000000000000000000008111156102fc57604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b031681526020018560200151815260200185606001516020015163ffffffff1681526020016040518060200160405280600081525081525083600081518110610378576103786117e9565b602090810291909101015250909695505050505050565b60606000856001600160401b038111156103ab576103ab611595565b6040519080825280602002602001820160405280156103d4578160200160208202803683370190505b5090506000866001600160401b038111156103f1576103f1611595565b60405190808252806020026020018201604052801561041a578160200160208202803683370190505b5090506000876001600160401b0381111561043757610437611595565b60405190808252806020026020018201604052801561047057816020015b61045d6111af565b8152602001906001900390816104555790505b50905060005b88811015610644576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106104c5576104c56117e9565b905060200201358e6040518363ffffffff1660e01b81526004016104fc9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610519573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105419190810190611813565b93509350935093508b88868151811061055c5761055c6117e9565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061058e5761058e6117e9565b905060200201358786815181106105a7576105a76117e9565b6020026020010181815250506040518060c001604052808f8f888181106105d0576105d06117e9565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff16815260200182815250868681518110610622576106226117e9565b602002602001018190525050505050808061063c906118c2565b915050610476565b506106508187876108eb565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061069e90869086906004016118db565b600060405180830381600087803b1580156106b857600080fd5b505af11580156106cc573d6000803e3d6000fd5b5050505060005b8881101561073d577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070e5761070e6117e9565b6020026020010151604051610723919061195f565b60405180910390a180610735816118c2565b9150506106d3565b5098975050505050505050565b6060610757848484610904565b6000610764858585610228565b905061077185858561094c565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107bd90849060040161145d565b600060405180830381600087803b1580156107d757600080fd5b505af11580156107eb573d6000803e3d6000fd5b5050505060005b815181101561085d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061082e5761082e6117e9565b6020026020010151604051610843919061195f565b60405180910390a180610855816118c2565b9150506107f2565b50949350505050565b61086e6111fd565b60008260000151600081518110610887576108876117e9565b6020026020010151905061089a816109e7565b600081604001518060200190518101906108b49190611982565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b600061091282840184611ab1565b9050600061091f82610a2b565b9050600061092f61023887611642565b905061093b8183610ad5565b61094483610e06565b505050505050565b60006109588383610f9f565b6000818152600160205260409020549091506001600160a01b031680158015906109a3575061098d6040860160208701611b82565b6001600160a01b0316816001600160a01b031614155b156109c457604051631f5d53e360e01b8152600481018390526024016102f3565b6109dd826109d86040880160208901611b82565b610fc4565b5050505050565b50565b60006109f6826040015161102a565b82519091508114610a275781516040516337e3d1ab60e01b81526102f3918391600401918252602082015260400190565b5050565b610a33611260565b604051806101200160405280610a488461105f565b6001600160a01b03168152602001610a5f84611074565b8152602001610a6d84611083565b8152602001610a7b84611092565b8152602001610a89846110a1565b8152602001610a97846110b0565b8152602001610aa5846110bf565b8152602001610abd8460200151610120015160011490565b15158152602001610acd846110ce565b905292915050565b815160c082015114610b0a57815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016102f3565b81606001516040015115158160e00151151503610b5557606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016102f3565b81604001516001600160a01b031681600001516001600160a01b031614610ba957604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016102f3565b46816020015114610bdc576020810151604051630432cec160e31b815246600482015260248101919091526044016102f3565b81602001518160a0015114610c1757602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016102f3565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610c82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca69190611b9f565b610ccb57806040015160405163cbfe7bc360e01b81526004016102f391815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610d2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4e9190611bba565b805161010084015151919250141580610d7557506020808201516101008401519091015114155b15610dbf578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016102f3565b6000610dca84611126565b905080836060015114610e005760608301516040516377bb6d2760e11b81526102f3918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f694610e6994909392909190600401611c36565b602060405180830381865afa925050508015610ea2575060408051601f3d908101601f19168201909252610e9f91810190611b9f565b60015b610f7857610eae611cba565b806308c379a003610ee75750610ec2611cd6565b80610ecd5750610f26565b8060405162dd577760e81b81526004016102f39190611d5f565b634e487b7103610f2657610ef9611d72565b90610f045750610f26565b60405162dd577760e81b815260206004820152600060248201526044016102f3565b3d808015610f50576040519150601f19603f3d011682016040523d82523d6000602084013e610f55565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016102f3565b80610a275760405162dd577760e81b815260206004820152600060248201526044016102f3565b600080610fae83850185611ab1565b90506000610fbb826110a1565b95945050505050565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b80516020820120600090610222907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611d92565b6020810151600090815b602002015192915050565b60208101516000906001611069565b60208101516000906004611069565b60208101516000906005611069565b60208101516000906006611069565b60208101516000906007611069565b60208101516000906008611069565b6110d66112b3565b604051806040016040528083602001516002600a81106110f8576110f86117e9565b6020020151815260200183602001516003600a8110611119576111196117e9565b6020020151905292915050565b600080611144308460600151600001516001600160801b031661114b565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6111449190611d92565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b0316815260200161125b604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815260200161125b5b60405180604001604052806002906020820280368337509192915050565b6000602082840312156112e357600080fd5b5035919050565b60008083601f8401126112fc57600080fd5b5081356001600160401b0381111561131357600080fd5b60208301915083602082850101111561132b57600080fd5b9250929050565b60008060006040848603121561134757600080fd5b83356001600160401b038082111561135e57600080fd5b908501906040828803121561137257600080fd5b9093506020850135908082111561138857600080fd5b50611395868287016112ea565b9497909650939450505050565b60005b838110156113bd5781810151838201526020016113a5565b83811115610e005750506000910152565b600081518084526113e68160208601602086016113a2565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261145560c08501826113ce565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156114b257603f198886030184526114a08583516113fa565b94509285019290850190600101611484565b5092979650505050505050565b6001600160a01b03811681146109e457600080fd5b80356114df816114bf565b919050565b6000806000806000606086880312156114fc57600080fd5b85356001600160401b038082111561151357600080fd5b818801915088601f83011261152757600080fd5b81358181111561153657600080fd5b8960208260051b850101111561154b57600080fd5b60208301975080965050611561602089016114d4565b9450604088013591508082111561157757600080fd5b50611584888289016112ea565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b03821117156115ca576115ca611595565b60405250565b606081018181106001600160401b03821117156115ca576115ca611595565b601f8201601f191681016001600160401b038111828210171561161457611614611595565b6040525050565b60006001600160401b0382111561163457611634611595565b50601f01601f191660200190565b6000604080833603121561165557600080fd5b8051611660816115ab565b83356001600160401b038082111561167757600080fd5b9085019036601f83011261168a57600080fd5b813560208282111561169e5761169e611595565b8160051b86516116b0838301826115ef565b928352848101820192828101368511156116c957600080fd5b83870192505b8483101561179d578235868111156116e75760008081fd5b8701606036829003601f19018113156117005760008081fd5b8a5161170b816115d0565b8287013581528b8301358188015290820135908882111561172c5760008081fd5b9181019136603f84011261174257600091508182fd5b8683013591506117518261161b565b8c5161175d82826115ef565b838152368e85870101111561177457600091508182fd5b838e86018a830137600093810189019390935250808c01919091528252509183019183016116cf565b508652506117ac8882016114d4565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b600082198211156117e4576117e46117bb565b500190565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff811681146114df57600080fd5b6000806000806080858703121561182957600080fd5b8451611834816114bf565b6020860151909450925061184a604086016117ff565b915060608501516001600160401b0381111561186557600080fd5b8501601f8101871361187657600080fd5b80516118818161161b565b60405161188e82826115ef565b8281528960208486010111156118a357600080fd5b6118b48360208301602087016113a2565b969995985093965050505050565b6000600182016118d4576118d46117bb565b5060010190565b604080825283519082018190526000906020906060840190828701845b8281101561191d5781516001600160a01b0316845292840192908401906001016118f8565b5050508381038285015284518082528583019183019060005b8181101561195257835183529284019291840191600101611936565b5090979650505050505050565b60208152600061114460208301846113fa565b805180151581146114df57600080fd5b60006060828403121561199457600080fd5b604051606081018181106001600160401b03821117156119b6576119b6611595565b60405282516001600160801b03811681146119d057600080fd5b81526119de602084016117ff565b60208201526119ef60408401611972565b60408201529392505050565b600082601f830112611a0c57600080fd5b604051611a18816115ab565b806040840185811115611a2a57600080fd5b845b81811015611a44578035835260209283019201611a2c565b509195945050505050565b600082601f830112611a6057600080fd5b6040516101408082018281106001600160401b0382111715611a8457611a84611595565b60405283018185821115611a9757600080fd5b845b82811015611a44578035825260209182019101611a99565b6000818303610240811215611ac557600080fd5b60408051611ad2816115ab565b61010080841215611ae257600080fd5b82519350611aef846115d0565b611af987876119fb565b845286605f870112611b0a57600080fd5b8251611b15816115ab565b8060c0880189811115611b2757600080fd5b8589015b81811015611b4c57611b3d8b826119fb565b83526020909201918601611b2b565b50826020880152611b5d8a826119fb565b86880152505050838252611b7387828801611a4f565b60208301525095945050505050565b600060208284031215611b9457600080fd5b8135611144816114bf565b600060208284031215611bb157600080fd5b61114482611972565b600060408284031215611bcc57600080fd5b82601f830112611bdb57600080fd5b604051611be7816115ab565b806040840185811115611bf957600080fd5b845b81811015611a44578051835260209283019201611bfb565b8060005b6002811015610e00578151845260209384019390910190600101611c17565b6102408101611c458287611c13565b60408083018660005b6002811015611c7557611c62838351611c13565b9183019160209190910190600101611c4e565b50505050611c8660c0830185611c13565b61010082018360005b600a811015611cae578151835260209283019290910190600101611c8f565b50505095945050505050565b600060033d1115611cd35760046000803e5060005160e01c5b90565b600060443d1015611ce45790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611d1357505050505090565b8285019150815181811115611d2b5750505050505090565b843d8701016020828501011115611d455750505050505090565b611d54602082860101876115ef565b509095945050505050565b60208152600061114460208301846113ce565b60008060233d1115611d8e576020600460003e50506000516001905b9091565b600082611daf57634e487b7160e01b600052601260045260246000fd5b50069056fea26469706673582212206f25f22d1700579027a3b154c953a64f2dd7c5743b363da74b5173ab9c3e655764736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063918447af11610066578063918447af14610177578063af411a301461019d578063bfa66585146101bd578063c776adde146101e3578063e60f999f146101f657600080fd5b80632254f98e146100a357806346657fe9146100e257806354846d7a1461010857806363e4afc21461013d5780637000b05114610150575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100d9565b6100c561014b3660046112d1565b610209565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101ab366004611332565b610228565b6040516100d9919061145d565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101f13660046114e4565b61038f565b6101b0610204366004611332565b61074a565b6000818152600160205260408120546001600160a01b03165b92915050565b6060600061023d61023886611642565b610866565b60408051600180825281830190925291925060009190816020015b6102606111af565b8152602001906001900390816102585750506060830151519091506000906102b1906001600160801b03167f00000000000000000000000000000000000000000000000000000000000000006117d1565b90507f00000000000000000000000000000000000000000000000000000000000000008111156102fc57604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b031681526020018560200151815260200185606001516020015163ffffffff1681526020016040518060200160405280600081525081525083600081518110610378576103786117e9565b602090810291909101015250909695505050505050565b60606000856001600160401b038111156103ab576103ab611595565b6040519080825280602002602001820160405280156103d4578160200160208202803683370190505b5090506000866001600160401b038111156103f1576103f1611595565b60405190808252806020026020018201604052801561041a578160200160208202803683370190505b5090506000876001600160401b0381111561043757610437611595565b60405190808252806020026020018201604052801561047057816020015b61045d6111af565b8152602001906001900390816104555790505b50905060005b88811015610644576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106104c5576104c56117e9565b905060200201358e6040518363ffffffff1660e01b81526004016104fc9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610519573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105419190810190611813565b93509350935093508b88868151811061055c5761055c6117e9565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061058e5761058e6117e9565b905060200201358786815181106105a7576105a76117e9565b6020026020010181815250506040518060c001604052808f8f888181106105d0576105d06117e9565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff16815260200182815250868681518110610622576106226117e9565b602002602001018190525050505050808061063c906118c2565b915050610476565b506106508187876108eb565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061069e90869086906004016118db565b600060405180830381600087803b1580156106b857600080fd5b505af11580156106cc573d6000803e3d6000fd5b5050505060005b8881101561073d577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070e5761070e6117e9565b6020026020010151604051610723919061195f565b60405180910390a180610735816118c2565b9150506106d3565b5098975050505050505050565b6060610757848484610904565b6000610764858585610228565b905061077185858561094c565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107bd90849060040161145d565b600060405180830381600087803b1580156107d757600080fd5b505af11580156107eb573d6000803e3d6000fd5b5050505060005b815181101561085d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061082e5761082e6117e9565b6020026020010151604051610843919061195f565b60405180910390a180610855816118c2565b9150506107f2565b50949350505050565b61086e6111fd565b60008260000151600081518110610887576108876117e9565b6020026020010151905061089a816109e7565b600081604001518060200190518101906108b49190611982565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b600061091282840184611ab1565b9050600061091f82610a2b565b9050600061092f61023887611642565b905061093b8183610ad5565b61094483610e06565b505050505050565b60006109588383610f9f565b6000818152600160205260409020549091506001600160a01b031680158015906109a3575061098d6040860160208701611b82565b6001600160a01b0316816001600160a01b031614155b156109c457604051631f5d53e360e01b8152600481018390526024016102f3565b6109dd826109d86040880160208901611b82565b610fc4565b5050505050565b50565b60006109f6826040015161102a565b82519091508114610a275781516040516337e3d1ab60e01b81526102f3918391600401918252602082015260400190565b5050565b610a33611260565b604051806101200160405280610a488461105f565b6001600160a01b03168152602001610a5f84611074565b8152602001610a6d84611083565b8152602001610a7b84611092565b8152602001610a89846110a1565b8152602001610a97846110b0565b8152602001610aa5846110bf565b8152602001610abd8460200151610120015160011490565b15158152602001610acd846110ce565b905292915050565b815160c082015114610b0a57815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016102f3565b81606001516040015115158160e00151151503610b5557606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016102f3565b81604001516001600160a01b031681600001516001600160a01b031614610ba957604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016102f3565b46816020015114610bdc576020810151604051630432cec160e31b815246600482015260248101919091526044016102f3565b81602001518160a0015114610c1757602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016102f3565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610c82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca69190611b9f565b610ccb57806040015160405163cbfe7bc360e01b81526004016102f391815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610d2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4e9190611bba565b805161010084015151919250141580610d7557506020808201516101008401519091015114155b15610dbf578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016102f3565b6000610dca84611126565b905080836060015114610e005760608301516040516377bb6d2760e11b81526102f3918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f694610e6994909392909190600401611c36565b602060405180830381865afa925050508015610ea2575060408051601f3d908101601f19168201909252610e9f91810190611b9f565b60015b610f7857610eae611cba565b806308c379a003610ee75750610ec2611cd6565b80610ecd5750610f26565b8060405162dd577760e81b81526004016102f39190611d5f565b634e487b7103610f2657610ef9611d72565b90610f045750610f26565b60405162dd577760e81b815260206004820152600060248201526044016102f3565b3d808015610f50576040519150601f19603f3d011682016040523d82523d6000602084013e610f55565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016102f3565b80610a275760405162dd577760e81b815260206004820152600060248201526044016102f3565b600080610fae83850185611ab1565b90506000610fbb826110a1565b95945050505050565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b80516020820120600090610222907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611d92565b6020810151600090815b602002015192915050565b60208101516000906001611069565b60208101516000906004611069565b60208101516000906005611069565b60208101516000906006611069565b60208101516000906007611069565b60208101516000906008611069565b6110d66112b3565b604051806040016040528083602001516002600a81106110f8576110f86117e9565b6020020151815260200183602001516003600a8110611119576111196117e9565b6020020151905292915050565b600080611144308460600151600001516001600160801b031661114b565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6111449190611d92565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b0316815260200161125b604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815260200161125b5b60405180604001604052806002906020820280368337509192915050565b6000602082840312156112e357600080fd5b5035919050565b60008083601f8401126112fc57600080fd5b5081356001600160401b0381111561131357600080fd5b60208301915083602082850101111561132b57600080fd5b9250929050565b60008060006040848603121561134757600080fd5b83356001600160401b038082111561135e57600080fd5b908501906040828803121561137257600080fd5b9093506020850135908082111561138857600080fd5b50611395868287016112ea565b9497909650939450505050565b60005b838110156113bd5781810151838201526020016113a5565b83811115610e005750506000910152565b600081518084526113e68160208601602086016113a2565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261145560c08501826113ce565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156114b257603f198886030184526114a08583516113fa565b94509285019290850190600101611484565b5092979650505050505050565b6001600160a01b03811681146109e457600080fd5b80356114df816114bf565b919050565b6000806000806000606086880312156114fc57600080fd5b85356001600160401b038082111561151357600080fd5b818801915088601f83011261152757600080fd5b81358181111561153657600080fd5b8960208260051b850101111561154b57600080fd5b60208301975080965050611561602089016114d4565b9450604088013591508082111561157757600080fd5b50611584888289016112ea565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b03821117156115ca576115ca611595565b60405250565b606081018181106001600160401b03821117156115ca576115ca611595565b601f8201601f191681016001600160401b038111828210171561161457611614611595565b6040525050565b60006001600160401b0382111561163457611634611595565b50601f01601f191660200190565b6000604080833603121561165557600080fd5b8051611660816115ab565b83356001600160401b038082111561167757600080fd5b9085019036601f83011261168a57600080fd5b813560208282111561169e5761169e611595565b8160051b86516116b0838301826115ef565b928352848101820192828101368511156116c957600080fd5b83870192505b8483101561179d578235868111156116e75760008081fd5b8701606036829003601f19018113156117005760008081fd5b8a5161170b816115d0565b8287013581528b8301358188015290820135908882111561172c5760008081fd5b9181019136603f84011261174257600091508182fd5b8683013591506117518261161b565b8c5161175d82826115ef565b838152368e85870101111561177457600091508182fd5b838e86018a830137600093810189019390935250808c01919091528252509183019183016116cf565b508652506117ac8882016114d4565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b600082198211156117e4576117e46117bb565b500190565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff811681146114df57600080fd5b6000806000806080858703121561182957600080fd5b8451611834816114bf565b6020860151909450925061184a604086016117ff565b915060608501516001600160401b0381111561186557600080fd5b8501601f8101871361187657600080fd5b80516118818161161b565b60405161188e82826115ef565b8281528960208486010111156118a357600080fd5b6118b48360208301602087016113a2565b969995985093965050505050565b6000600182016118d4576118d46117bb565b5060010190565b604080825283519082018190526000906020906060840190828701845b8281101561191d5781516001600160a01b0316845292840192908401906001016118f8565b5050508381038285015284518082528583019183019060005b8181101561195257835183529284019291840191600101611936565b5090979650505050505050565b60208152600061114460208301846113fa565b805180151581146114df57600080fd5b60006060828403121561199457600080fd5b604051606081018181106001600160401b03821117156119b6576119b6611595565b60405282516001600160801b03811681146119d057600080fd5b81526119de602084016117ff565b60208201526119ef60408401611972565b60408201529392505050565b600082601f830112611a0c57600080fd5b604051611a18816115ab565b806040840185811115611a2a57600080fd5b845b81811015611a44578035835260209283019201611a2c565b509195945050505050565b600082601f830112611a6057600080fd5b6040516101408082018281106001600160401b0382111715611a8457611a84611595565b60405283018185821115611a9757600080fd5b845b82811015611a44578035825260209182019101611a99565b6000818303610240811215611ac557600080fd5b60408051611ad2816115ab565b61010080841215611ae257600080fd5b82519350611aef846115d0565b611af987876119fb565b845286605f870112611b0a57600080fd5b8251611b15816115ab565b8060c0880189811115611b2757600080fd5b8589015b81811015611b4c57611b3d8b826119fb565b83526020909201918601611b2b565b50826020880152611b5d8a826119fb565b86880152505050838252611b7387828801611a4f565b60208301525095945050505050565b600060208284031215611b9457600080fd5b8135611144816114bf565b600060208284031215611bb157600080fd5b61114482611972565b600060408284031215611bcc57600080fd5b82601f830112611bdb57600080fd5b604051611be7816115ab565b806040840185811115611bf957600080fd5b845b81811015611a44578051835260209283019201611bfb565b8060005b6002811015610e00578151845260209384019390910190600101611c17565b6102408101611c458287611c13565b60408083018660005b6002811015611c7557611c62838351611c13565b9183019160209190910190600101611c4e565b50505050611c8660c0830185611c13565b61010082018360005b600a811015611cae578151835260209283019290910190600101611c8f565b50505095945050505050565b600060033d1115611cd35760046000803e5060005160e01c5b90565b600060443d1015611ce45790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611d1357505050505090565b8285019150815181811115611d2b5750505050505090565b843d8701016020828501011115611d455750505050505090565b611d54602082860101876115ef565b509095945050505050565b60208152600061114460208301846113ce565b60008060233d1115611d8e576020600460003e50506000516001905b9091565b600082611daf57634e487b7160e01b600052601260045260246000fd5b50069056fea26469706673582212206f25f22d1700579027a3b154c953a64f2dd7c5743b363da74b5173ab9c3e655764736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "errors": { - "CollectionIdOutOfBound(uint256)": [ - { - "details": "Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST*" - } - ], - "TicketUsed(uint256)": [ - { - "details": "Error when the userTicket (or nullifierHash) is already used for a destination address*" - } - ] - }, - "kind": "dev", - "methods": { - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns attestations that will be recorded, constructed from the user request", - "params": { - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "availableRootsRegistryAddress": "Registry storing the available groups for this attester (e.g roots of registry merkle trees)", - "collectionIdFirst": "Id of the first collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last collection in which the attester is supposed to record", - "commitmentMapperAddress": "commitment mapper's public key registry", - "hydraS1VerifierAddress": "ZK Snark Hydra-S1 Verifier contract" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getAvailableRootsRegistry()": { - "details": "Getter of Roots Registry Contract" - }, - "getCommitmentMapperRegistry()": { - "details": "Getter of Commitment Mapper Registry contract" - }, - "getDestinationOfTicket(uint256)": { - "details": "Getter, returns the last attestation destination of a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getVerifier()": { - "details": "Getter of Hydra-S1 Verifier contract" - } - }, - "stateVariables": { - "AUTHORIZED_COLLECTION_ID_FIRST": { - "details": "Getter returns of the first collection in which the attester is supposed to record*" - }, - "AUTHORIZED_COLLECTION_ID_LAST": { - "details": "Getter returns of the last collection in which the attester is supposed to record*" - } - }, - "title": "Hydra-S1 Simple Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew their attestations*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 936, - "contract": "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol:HydraS1SimpleAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 939, - "contract": "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol:HydraS1SimpleAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 6335, - "contract": "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol:HydraS1SimpleAttester", - "label": "_ticketsDestinations", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_address)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_address)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/HydraS1SimpleAttesterProxy.json b/deployments/goerli/HydraS1SimpleAttesterProxy.json deleted file mode 100644 index 999d1bc..0000000 --- a/deployments/goerli/HydraS1SimpleAttesterProxy.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "address": "0x89d80C9E65fd1aC8970B78A4F17E2e772030C1cB", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x855c043e8c8eff0f3085587aae293b54e07326ab5822e00064395427a7cc97e9", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x89d80C9E65fd1aC8970B78A4F17E2e772030C1cB", - "transactionIndex": 23, - "gasUsed": "583384", - "logsBloom": "0x00000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000001000000200000000800000000000000000000010000000000000000000000000000000000000000040000000000000000000800000000000000000000000000000000000000000000000000008000000000000000000000020000000000000000000000000000000000400000000000000000000000000000000000000002000000000000000000000000000000000000000000000", - "blockHash": "0x68625216cdf10f3869724d402586b7d80054482aa7deba0692529a82bd12e078", - "transactionHash": "0x855c043e8c8eff0f3085587aae293b54e07326ab5822e00064395427a7cc97e9", - "logs": [ - { - "transactionIndex": 23, - "blockNumber": 7711093, - "transactionHash": "0x855c043e8c8eff0f3085587aae293b54e07326ab5822e00064395427a7cc97e9", - "address": "0x89d80C9E65fd1aC8970B78A4F17E2e772030C1cB", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x00000000000000000000000029b05083395ebb07a86b454e8e51d91c7e8776e1" - ], - "data": "0x", - "logIndex": 85, - "blockHash": "0x68625216cdf10f3869724d402586b7d80054482aa7deba0692529a82bd12e078" - }, - { - "transactionIndex": 23, - "blockNumber": 7711093, - "transactionHash": "0x855c043e8c8eff0f3085587aae293b54e07326ab5822e00064395427a7cc97e9", - "address": "0x89d80C9E65fd1aC8970B78A4F17E2e772030C1cB", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000246e71bc2a257f4be9c7fad4664e6d7444844adc", - "logIndex": 86, - "blockHash": "0x68625216cdf10f3869724d402586b7d80054482aa7deba0692529a82bd12e078" - } - ], - "blockNumber": 7711093, - "cumulativeGasUsed": "6838255", - "status": 1, - "byzantium": true - }, - "args": [ - "0x29B05083395ebb07A86b454E8e51D91C7E8776E1", - "0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc", - "0x" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/goerli/HydraS1SoulboundAttester.json b/deployments/goerli/HydraS1SoulboundAttester.json deleted file mode 100644 index fe3a2ac..0000000 --- a/deployments/goerli/HydraS1SoulboundAttester.json +++ /dev/null @@ -1,1003 +0,0 @@ -{ - "address": "0x12e69A9b08709324d64c5AEaF4169b03B6199c6C", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "hydraS1VerifierAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "availableRootsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "soulboundCooldownDuration", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "AccountsTreeValueMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "claimLength", - "type": "uint256" - } - ], - "name": "ClaimsLengthDifferentThanOne", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentMapperPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "NotAttestationOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "inputRoot", - "type": "uint256" - } - ], - "name": "RegistryRootMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "ticketData", - "type": "uint256" - } - ], - "name": "TicketFrozen", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedTicketIdentifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ticketIdentifier", - "type": "uint256" - } - ], - "name": "TicketIdentifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "destination", - "type": "address" - }, - { - "internalType": "uint32", - "name": "cooldownStart", - "type": "uint32" - } - ], - "internalType": "struct IHydraS1SoulboundAttester.TicketData", - "name": "ticketData", - "type": "tuple" - } - ], - "name": "TicketUsedAndOnCooldown", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "TicketDestinationUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - } - ], - "name": "TicketSetOnCooldown", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "SOULBOUND_COOLDOWN_DURATION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAvailableRootsRegistry", - "outputs": [ - { - "internalType": "contract IAvailableRootsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentMapperRegistry", - "outputs": [ - { - "internalType": "contract ICommitmentMapperRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getDestinationOfTicket", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getTicketData", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "destination", - "type": "address" - }, - { - "internalType": "uint32", - "name": "cooldownStart", - "type": "uint32" - } - ], - "internalType": "struct IHydraS1SoulboundAttester.TicketData", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract HydraS1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "isTicketOnCooldown", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xaa3d5ac08d453d7e72ac285af59e4ee28ef08ec758735b4e5c3611081a2b93ca", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0xbd11CD5C77222DD51B270880F6A4148a8e5A6cB0", - "transactionIndex": 6, - "gasUsed": "1821131", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x81596a8b0a080b95f877cc557962fe6e917c1ad7f32c15302a718169a5dd182f", - "transactionHash": "0xaa3d5ac08d453d7e72ac285af59e4ee28ef08ec758735b4e5c3611081a2b93ca", - "logs": [], - "blockNumber": 7711096, - "cumulativeGasUsed": "2819339", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf85BA0afA375495eE625910Db61b6b1406756234", - "0x522018b86645F597626aa127EfC22D55a5c79F11", - "0xdDa4c8d2933dAA21Aac75B88fF59725725ba813F", - "0x0844662f25817B735BC9B6d9D11995F1A6c4dCB1", - "20000001", - "30000000", - "295200" - ], - "numDeployments": 2, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"hydraS1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"availableRootsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"soulboundCooldownDuration\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"AccountsTreeValueMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimLength\",\"type\":\"uint256\"}],\"name\":\"ClaimsLengthDifferentThanOne\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentMapperPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"NotAttestationOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inputRoot\",\"type\":\"uint256\"}],\"name\":\"RegistryRootMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"ticketData\",\"type\":\"uint256\"}],\"name\":\"TicketFrozen\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"cooldownStart\",\"type\":\"uint32\"}],\"internalType\":\"struct IHydraS1SoulboundAttester.TicketData\",\"name\":\"ticketData\",\"type\":\"tuple\"}],\"name\":\"TicketUsedAndOnCooldown\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"}],\"name\":\"TicketSetOnCooldown\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SOULBOUND_COOLDOWN_DURATION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAvailableRootsRegistry\",\"outputs\":[{\"internalType\":\"contract IAvailableRootsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentMapperRegistry\",\"outputs\":[{\"internalType\":\"contract ICommitmentMapperRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getTicketData\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"cooldownStart\",\"type\":\"uint32\"}],\"internalType\":\"struct IHydraS1SoulboundAttester.TicketData\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract HydraS1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"isTicketOnCooldown\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns the actual attestations constructed from the user request\",\"params\":{\"proofData\":\"snark public input as well as snark proof\",\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"availableRootsRegistryAddress\":\"Registry storing the available groups for this attester (e.g roots of registry merkle trees)\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentMapperAddress\":\"commitment mapper's public key registry\",\"hydraS1VerifierAddress\":\"ZK Snark Hydra-S1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getAvailableRootsRegistry()\":{\"details\":\"Getter of Roots Registry Contract\"},\"getCommitmentMapperRegistry()\":{\"details\":\"Getter of Commitment Mapper Registry contract\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getTicketData(uint256)\":{\"details\":\"Getter, returns the data linked to a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Hydra-S1 Verifier contract\"},\"isTicketOnCooldown(uint256)\":{\"details\":\"returns whether a ticket is on cooldown or not\",\"params\":{\"userTicket\":\"ticket used*\"}}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"},\"SOULBOUND_COOLDOWN_DURATION\":{\"details\":\"Getter returns of the duration of the cooldown period after having used a ticket*\"}},\"title\":\"Hydra-S1 Soulbound Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - SoulBound (with cooldown period) A user can chose to delete attestations or generate attestation to a new destination. When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional User will need to wait until the end of the cooldown period before being able to delete or switch destination again One can however know that the former and the new destinations were created using the same userTicket - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol\":\"HydraS1SoulboundAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() initializer {}\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\\n // contract may have been reentered.\\n require(_initializing ? _isConstructor() : !_initialized, \\\"Initializable: contract is already initialized\\\");\\n\\n bool isTopLevelCall = !_initializing;\\n if (isTopLevelCall) {\\n _initializing = true;\\n _initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n _initializing = false;\\n }\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} modifier, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n function _isConstructor() private view returns (bool) {\\n return !Address.isContract(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x4823752b07b8ea4ca971b217e39457930e7cb103c2c91e2a29729e5ca907e4f0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\\n 546002182798634190282541153661423157791776194062719045593389981526666716416\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x70c0b7d96ff1b90538938a4cb2d8086b3aabb4febf1e36cb3f470bfe0b4a9e89\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n \\n \\n **/\\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n virtual\\n returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\\n internal\\n view\\n virtual\\n {\\n if (input.accountsTreeValue != claim.groupId)\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\\n revert RegistryRootMismatch(input.registryRoot);\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n )\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(\\n uint256 /*errorCode*/\\n ) {\\n revert InvalidGroth16Proof('');\\n } catch (\\n bytes memory /*lowLevelData*/\\n ) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0x02708884237382835cd3d3514fdc3603409ce5ea1dc7255a7ceea07dff417c34\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n// todo: explain well what is specific to this attester\\ninterface IHydraS1Base {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x73cff4dcd9c30857859721ea2897be8bb7087c0122f4587acdaa79d8ec0a728d\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SoulboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n// todo: explain well what is specific to this attester\\ninterface IHydraS1SoulboundAttester is IHydraS1Base, IAttester {\\n struct TicketData {\\n address destination;\\n uint32 cooldownStart;\\n }\\n error NotAttestationOwner(uint256 ticket, address sender);\\n error TicketFrozen(uint256 ticketData);\\n error TicketUsedAndOnCooldown(TicketData ticketData);\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n event TicketSetOnCooldown(uint256 ticket);\\n\\n /**\\n * @dev returns whether a ticket is on cooldown or not\\n * @param userTicket ticket used\\n **/\\n function isTicketOnCooldown(uint256 userTicket) external view returns (bool);\\n\\n /**\\n * @dev Getter, returns the data linked to a ticket\\n * @param userTicket ticket used\\n **/\\n function getTicketData(uint256 userTicket) external view returns (TicketData memory);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the duration of the cooldown period after having used a ticket\\n **/\\n function SOULBOUND_COOLDOWN_DURATION() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x253a424fda33fca3de3fabd731e4a4f5d48af14bcd9d7c66302113268fd3a9f5\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // ticketIdentifier\\n // ticket\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (\\n uint256[2] memory,\\n uint256[2][2] memory,\\n uint256[2] memory,\\n uint256[10] memory\\n )\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256[2] memory)\\n {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256)\\n {\\n return self.input[5];\\n }\\n\\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\\n internal\\n pure\\n returns (uint256)\\n {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x596225970aabbc4edb989ee640867c76944e797bfafe5e06dcf37b973480b957\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SoulboundAttester} from '../interfaces/IHydraS1SoulboundAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from '../../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from '../base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Soulbound Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - SoulBound (with cooldown period)\\n * A user can chose to delete attestations or generate attestation to a new destination.\\n * When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional\\n * User will need to wait until the end of the cooldown period before being able to delete or switch destination again\\n * One can however know that the former and the new destinations were created using the same userTicket\\n \\n * - Renewable\\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew or update their attestations\\n **/\\ncontract HydraS1SoulboundAttester is IHydraS1SoulboundAttester, HydraS1Base, Attester {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n uint256 public immutable SOULBOUND_COOLDOWN_DURATION;\\n\\n mapping(uint256 => TicketData) internal _userTicketsData;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n uint256 soulboundCooldownDuration\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n SOULBOUND_COOLDOWN_DURATION = soulboundCooldownDuration;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user attestations request is invalid\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark proof backing the claim\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Throws if user attestations deletion request is not made by its owner\\n * @param attestations attestations to delete\\n */\\n function _verifyAttestationsDeletionRequest(Attestation[] memory attestations, bytes calldata)\\n internal\\n view\\n override\\n {\\n for (uint256 i = 0; i < attestations.length; i++) {\\n uint256 userTicket = abi.decode(attestations[0].extraData, (uint256));\\n if (_userTicketsData[userTicket].destination != msg.sender)\\n revert NotAttestationOwner(userTicket, msg.sender);\\n }\\n }\\n\\n /**\\n * @dev Returns the actual attestations constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark public input as well as snark proof\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n override(IAttester, Attester)\\n returns (Attestation[] memory)\\n {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n // The issuer of attestations is the attester\\n address issuer = address(this);\\n // user sends the ticket as input in the data\\n uint256 userTicket = proofData._getTicket();\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n request.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n abi.encode(userTicket)\\n );\\n\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used, not a renewal, and ticket on cooldown.\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n uint256 userTicket = proofData._getTicket();\\n TicketData memory userTicketData = _userTicketsData[userTicket];\\n\\n if (\\n userTicketData.destination != address(0) && userTicketData.destination != request.destination\\n ) {\\n if (_isOnCooldown(userTicketData)) revert TicketUsedAndOnCooldown(userTicketData);\\n _setTicketOnCooldown(userTicket);\\n }\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n override\\n {\\n // we retrieve the ticketUsed from attestations extraData\\n for (uint256 i = 0; i < attestations.length; i++) {\\n uint256 userTicket = abi.decode(attestations[i].extraData, (uint256));\\n if (_isOnCooldown(_userTicketsData[userTicket]) == true) revert TicketFrozen(userTicket);\\n _userTicketsData[userTicket].destination = address(0);\\n }\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n override\\n returns (uint256)\\n {\\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\\n return ticketIdentifier;\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n /**\\n * @dev Getter, returns the data linked to a ticket\\n * @param userTicket ticket used\\n **/\\n function getTicketData(uint256 userTicket) external view override returns (TicketData memory) {\\n return _getTicketData(userTicket);\\n }\\n\\n /**\\n * @dev returns whether a ticket is on cooldown or not\\n * @param userTicket ticket used\\n **/\\n function isTicketOnCooldown(uint256 userTicket) external view override returns (bool) {\\n return _isOnCooldown(_getTicketData(userTicket));\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _userTicketsData[userTicket].destination = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _setTicketOnCooldown(uint256 userTicket) internal {\\n _userTicketsData[userTicket].cooldownStart = uint32(block.timestamp);\\n emit TicketSetOnCooldown(userTicket);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _userTicketsData[userTicket].destination;\\n }\\n\\n function _isOnCooldown(TicketData memory userTicketData) internal view returns (bool) {\\n return userTicketData.cooldownStart + SOULBOUND_COOLDOWN_DURATION < block.timestamp;\\n }\\n\\n function _getTicketData(uint256 userTicket) internal view returns (TicketData memory) {\\n return _userTicketsData[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0xe72642edf2eecc2886aae203d09ac63f5515a1e51f0ad85b9da410aa59db6261\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n override\\n returns (Attestation[] memory)\\n {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // fetch attestations from the registry\\n Attestation[] memory attestationsToDelete;\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationsToDelete[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestationsToDelete, proofData);\\n\\n _beforeDeleteAttestations(attestationsToDelete, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationsToDelete);\\n\\n _afterDeleteAttestations(attestationsToDelete, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestationsToDelete[i]);\\n }\\n return attestationsToDelete;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n}\\n\",\"keccak256\":\"0x37683c6752d4dc911459084eb191c1045f3bf34e2143f3db3d298a66c971a106\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param attestations Attestations to be deleted\\n */\\n function deleteAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xb5e25bd7e0372c9973e582fb7fe96318c145831a5452d8c79eb848a7464b0297\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) public initializer {\\n _transferOwnership(owner);\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9329ecaf60ffe978c8ab4360e0a8f9bd36e2549e89d672dd39ae80f9a562f9a9\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public initializer {\\n _transferOwnership(owner);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0xacb5347ee1a0e8dc25a1ce3e6fbb427db646e833ff8508909454cad7950418d4\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x87f5035b58936a8458a22f3cf1b3865bd798813310d86af41af74680978c97c8\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0x8d6298b442dde99ee5a9cc989ada6ea808383a08b1e9bb1d4c2b58adc01eec69\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101606040523480156200001257600080fd5b506040516200218c3803806200218c833981016040819052620000359162000088565b6001600160a01b0395861660805293851660c05291841660a0529390921660e05261010092909252610120526101405262000102565b80516001600160a01b03811681146200008357600080fd5b919050565b600080600080600080600060e0888a031215620000a457600080fd5b620000af886200006b565b9650620000bf602089016200006b565b9550620000cf604089016200006b565b9450620000df606089016200006b565b93506080880151925060a0880151915060c0880151905092959891949750929550565b60805160a05160c05160e051610100516101205161014051611ff16200019b6000396000818161013e01526108d30152600081816101ad01526103c901526000818161017301526103a101526000818161023a015281816104e40152818161066601526107a00152600081816101d10152610ec701526000818160d60152610f6301526000818161011501526110be0152611ff16000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063918447af1161008c578063bfa6658511610066578063bfa6658514610238578063c776adde1461025e578063d9895e6a14610271578063e60f999f146102ae57600080fd5b8063918447af146101cf57806392cf369d146101f5578063af411a301461021857600080fd5b80632254f98e146100d457806346657fe9146101135780634e5cf9331461013957806354846d7a1461016e57806363e4afc2146101955780637000b051146101a8575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161010a565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b6100f66101a3366004611537565b6102c1565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b610208610203366004611537565b6102e0565b604051901515815260200161010a565b61022b610226366004611599565b6102f3565b60405161010a91906116c5565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b61022b61026c36600461174c565b6104ce565b61028461027f366004611537565b610745565b6040805182516001600160a01b0316815260209283015163ffffffff16928101929092520161010a565b61022b6102bc366004611599565b610762565b6000818152600160205260408120546001600160a01b03165b92915050565b60006102da6102ee8361087e565b6108ce565b60606000610308610303866118af565b61090e565b60408051600180825281830190925291925060009190816020015b6103746040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816103235750506060830151519091506000906103c5906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611a3f565b90507f000000000000000000000000000000000000000000000000000000000000000081111561041057604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b30600061041d8888610993565b90506040518060c001604052808481526020018a60200160208101906104439190611a57565b6001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff1681526020018260405160200161049191815260200190565b604051602081830303815290604052815250846000815181106104b6576104b6611a74565b60209081029190910101525091979650505050505050565b60608060005b86811015610638576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78d8d8881811061052357610523611a74565b905060200201358c6040518363ffffffff1660e01b815260040161055a9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610577573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261059f9190810190611a9e565b93509350935093506040518060c001604052808d8d888181106105c4576105c4611a74565b9050602002013581526020018b6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061061657610616611a74565b602002602001018190525050505050808061063090611b4e565b9150506104d4565b506106448185856109b8565b61064f818585610a53565b6040516373e4ca1b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e7c994369061069b9084906004016116c5565b600060405180830381600087803b1580156106b557600080fd5b505af11580156106c9573d6000803e3d6000fd5b5050505060005b8681101561073a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070b5761070b611a74565b60200260200101516040516107209190611b67565b60405180910390a18061073281611b4e565b9150506106d0565b509695505050505050565b60408051808201909152600080825260208201526102da8261087e565b606061076f848484610b29565b600061077c8585856102f3565b9050610789858585610b71565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107d59084906004016116c5565b600060405180830381600087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b5050505060005b8151811015610875577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061084657610846611a74565b602002602001015160405161085b9190611b67565b60405180910390a18061086d81611b4e565b91505061080a565b50949350505050565b6040805180820190915260008082526020820152506000908152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff169082015290565b6000427f0000000000000000000000000000000000000000000000000000000000000000836020015163ffffffff166109079190611a3f565b1092915050565b610916611463565b6000826000015160008151811061092f5761092f611a74565b6020026020010151905061094281610c65565b6000816040015180602001905181019061095c9190611b8a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b6000806109a283850185611cbb565b905060006109af82610ca9565b95945050505050565b60005b8351811015610a4d576000846000815181106109d9576109d9611a74565b602002602001015160a001518060200190518101906109f89190611d8c565b6000818152600160205260409020549091506001600160a01b03163314610a3a5760405162f8a2bf60e81b815260048101829052336024820152604401610407565b5080610a4581611b4e565b9150506109bb565b50505050565b60005b8351811015610a4d576000848281518110610a7357610a73611a74565b602002602001015160a00151806020019051810190610a929190611d8c565b6000818152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff1690820152909150610ad6906108ce565b1515600103610afb57604051632fcfdde360e11b815260048101829052602401610407565b600090815260016020526040902080546001600160a01b031916905580610b2181611b4e565b915050610a56565b6000610b3782840184611cbb565b90506000610b4482610cbf565b90506000610b54610303876118af565b9050610b608183610d69565b610b6983611094565b505050505050565b6000610b7d8383610993565b6000818152600160209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910463ffffffff16918301919091529192509015801590610bf15750610bd76040860160208701611a57565b6001600160a01b031681600001516001600160a01b031614155b15610c4257610bff816108ce565b15610c3957604051633f8ffaa560e01b815281516001600160a01b03166004820152602082015163ffffffff166024820152604401610407565b610c428261122d565b610c5b82610c566040880160208901611a57565b61128e565b5050505050565b50565b6000610c7482604001516112f4565b82519091508114610ca55781516040516337e3d1ab60e01b8152610407918391600401918252602082015260400190565b5050565b602081015160009060065b602002015192915050565b610cc76114c6565b604051806101200160405280610cdc84611329565b6001600160a01b03168152602001610cf384611337565b8152602001610d0184611346565b8152602001610d0f84611355565b8152602001610d1d84610ca9565b8152602001610d2b84611364565b8152602001610d3984611373565b8152602001610d518460200151610120015160011490565b15158152602001610d6184611382565b905292915050565b815160c082015114610d9e57815160c082015160405163fe405c7760e01b815260048101929092526024820152604401610407565b81606001516040015115158160e00151151503610de957606082015160409081015160e08301519151634629f1b560e11b815290151560048201529015156024820152604401610407565b81604001516001600160a01b031681600001516001600160a01b031614610e3d57604082810151825191516370a8d99b60e11b81526001600160a01b03918216600482015291166024820152604401610407565b46816020015114610e70576020810151604051630432cec160e31b81524660048201526024810191909152604401610407565b81602001518160a0015114610eab57602082015160a0820151604051630626ade360e41b815260048101929092526024820152604401610407565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a9190611da5565b610f5f57806040015160405163cbfe7bc360e01b815260040161040791815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe29190611dc0565b80516101008401515191925014158061100957506020808201516101008401519091015114155b15611053578051602080830151610100850151805192015160405163318d812b60e01b81526004810194909452602484019190915260448301919091526064820152608401610407565b600061105e846113da565b905080836060015114610a4d5760608301516040516377bb6d2760e11b8152610407918391600401918252602082015260400190565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946110f794909392909190600401611e3c565b602060405180830381865afa925050508015611130575060408051601f3d908101601f1916820190925261112d91810190611da5565b60015b6112065761113c611ec0565b806308c379a0036111755750611150611edc565b8061115b57506111b4565b8060405162dd577760e81b81526004016104079190611f66565b634e487b71036111b457611187611f79565b9061119257506111b4565b60405162dd577760e81b81526020600482015260006024820152604401610407565b3d8080156111de576040519150601f19603f3d011682016040523d82523d6000602084013e6111e3565b606091505b5060405162dd577760e81b81526020600482015260006024820152604401610407565b80610ca55760405162dd577760e81b81526020600482015260006024820152604401610407565b600081815260016020908152604091829020805463ffffffff60a01b1916600160a01b4263ffffffff160217905590518281527f49ab97b1dc68eafe79e6e7f8ff996d00259888e84cb401cf9ec8d39adf7ab196910160405180910390a150565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102da907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611f99565b602081015160009081610cb4565b60208101516000906001610cb4565b60208101516000906004610cb4565b60208101516000906005610cb4565b60208101516000906007610cb4565b60208101516000906008610cb4565b61138a611519565b604051806040016040528083602001516002600a81106113ac576113ac611a74565b6020020151815260200183602001516003600a81106113cd576113cd611a74565b6020020151905292915050565b6000806113f8308460600151600001516001600160801b03166113ff565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113f89190611f99565b6040518060800160405280600081526020016000815260200160006001600160a01b031681526020016114c1604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114c15b60405180604001604052806002906020820280368337509192915050565b60006020828403121561154957600080fd5b5035919050565b60008083601f84011261156257600080fd5b50813567ffffffffffffffff81111561157a57600080fd5b60208301915083602082850101111561159257600080fd5b9250929050565b6000806000604084860312156115ae57600080fd5b833567ffffffffffffffff808211156115c657600080fd5b90850190604082880312156115da57600080fd5b909350602085013590808211156115f057600080fd5b506115fd86828701611550565b9497909650939450505050565b60005b8381101561162557818101518382015260200161160d565b83811115610a4d5750506000910152565b6000815180845261164e81602086016020860161160a565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a08501526116bd60c0850182611636565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561171a57603f19888603018452611708858351611662565b945092850192908501906001016116ec565b5092979650505050505050565b6001600160a01b0381168114610c6257600080fd5b803561174781611727565b919050565b60008060008060006060868803121561176457600080fd5b853567ffffffffffffffff8082111561177c57600080fd5b818801915088601f83011261179057600080fd5b81358181111561179f57600080fd5b8960208260051b85010111156117b457600080fd5b602083019750809650506117ca6020890161173c565b945060408801359150808211156117e057600080fd5b506117ed88828901611550565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b6040810181811067ffffffffffffffff82111715611834576118346117fe565b60405250565b6060810181811067ffffffffffffffff82111715611834576118346117fe565b601f8201601f1916810167ffffffffffffffff81118282101715611880576118806117fe565b6040525050565b600067ffffffffffffffff8211156118a1576118a16117fe565b50601f01601f191660200190565b600060408083360312156118c257600080fd5b80516118cd81611814565b833567ffffffffffffffff808211156118e557600080fd5b9085019036601f8301126118f857600080fd5b813560208282111561190c5761190c6117fe565b8160051b865161191e8383018261185a565b9283528481018201928281013685111561193757600080fd5b83870192505b84831015611a0b578235868111156119555760008081fd5b8701606036829003601f190181131561196e5760008081fd5b8a516119798161183a565b8287013581528b8301358188015290820135908882111561199a5760008081fd5b9181019136603f8401126119b057600091508182fd5b8683013591506119bf82611887565b8c516119cb828261185a565b838152368e8587010111156119e257600091508182fd5b838e86018a830137600093810189019390935250808c019190915282525091830191830161193d565b50865250611a1a88820161173c565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611a5257611a52611a29565b500190565b600060208284031215611a6957600080fd5b81356113f881611727565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff8116811461174757600080fd5b60008060008060808587031215611ab457600080fd5b8451611abf81611727565b60208601519094509250611ad560408601611a8a565b9150606085015167ffffffffffffffff811115611af157600080fd5b8501601f81018713611b0257600080fd5b8051611b0d81611887565b604051611b1a828261185a565b828152896020848601011115611b2f57600080fd5b611b4083602083016020870161160a565b969995985093965050505050565b600060018201611b6057611b60611a29565b5060010190565b6020815260006113f86020830184611662565b8051801515811461174757600080fd5b600060608284031215611b9c57600080fd5b6040516060810181811067ffffffffffffffff82111715611bbf57611bbf6117fe565b60405282516001600160801b0381168114611bd957600080fd5b8152611be760208401611a8a565b6020820152611bf860408401611b7a565b60408201529392505050565b600082601f830112611c1557600080fd5b604051611c2181611814565b806040840185811115611c3357600080fd5b845b81811015611c4d578035835260209283019201611c35565b509195945050505050565b600082601f830112611c6957600080fd5b60405161014080820182811067ffffffffffffffff82111715611c8e57611c8e6117fe565b60405283018185821115611ca157600080fd5b845b82811015611c4d578035825260209182019101611ca3565b6000818303610240811215611ccf57600080fd5b60408051611cdc81611814565b61010080841215611cec57600080fd5b82519350611cf98461183a565b611d038787611c04565b845286605f870112611d1457600080fd5b8251611d1f81611814565b8060c0880189811115611d3157600080fd5b8589015b81811015611d5657611d478b82611c04565b83526020909201918601611d35565b50826020880152611d678a82611c04565b86880152505050838252611d7d87828801611c58565b60208301525095945050505050565b600060208284031215611d9e57600080fd5b5051919050565b600060208284031215611db757600080fd5b6113f882611b7a565b600060408284031215611dd257600080fd5b82601f830112611de157600080fd5b604051611ded81611814565b806040840185811115611dff57600080fd5b845b81811015611c4d578051835260209283019201611e01565b8060005b6002811015610a4d578151845260209384019390910190600101611e1d565b6102408101611e4b8287611e19565b60408083018660005b6002811015611e7b57611e68838351611e19565b9183019160209190910190600101611e54565b50505050611e8c60c0830185611e19565b61010082018360005b600a811015611eb4578151835260209283019290910190600101611e95565b50505095945050505050565b600060033d1115611ed95760046000803e5060005160e01c5b90565b600060443d1015611eea5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611f1a57505050505090565b8285019150815181811115611f325750505050505090565b843d8701016020828501011115611f4c5750505050505090565b611f5b6020828601018761185a565b509095945050505050565b6020815260006113f86020830184611636565b60008060233d1115611f95576020600460003e50506000516001905b9091565b600082611fb657634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220f1374674d2143dc1e1f8e0666c58769f2e4bc209220c094f513f5b717a358ad464736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063918447af1161008c578063bfa6658511610066578063bfa6658514610238578063c776adde1461025e578063d9895e6a14610271578063e60f999f146102ae57600080fd5b8063918447af146101cf57806392cf369d146101f5578063af411a301461021857600080fd5b80632254f98e146100d457806346657fe9146101135780634e5cf9331461013957806354846d7a1461016e57806363e4afc2146101955780637000b051146101a8575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161010a565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b6100f66101a3366004611537565b6102c1565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b610208610203366004611537565b6102e0565b604051901515815260200161010a565b61022b610226366004611599565b6102f3565b60405161010a91906116c5565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b61022b61026c36600461174c565b6104ce565b61028461027f366004611537565b610745565b6040805182516001600160a01b0316815260209283015163ffffffff16928101929092520161010a565b61022b6102bc366004611599565b610762565b6000818152600160205260408120546001600160a01b03165b92915050565b60006102da6102ee8361087e565b6108ce565b60606000610308610303866118af565b61090e565b60408051600180825281830190925291925060009190816020015b6103746040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816103235750506060830151519091506000906103c5906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611a3f565b90507f000000000000000000000000000000000000000000000000000000000000000081111561041057604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b30600061041d8888610993565b90506040518060c001604052808481526020018a60200160208101906104439190611a57565b6001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff1681526020018260405160200161049191815260200190565b604051602081830303815290604052815250846000815181106104b6576104b6611a74565b60209081029190910101525091979650505050505050565b60608060005b86811015610638576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78d8d8881811061052357610523611a74565b905060200201358c6040518363ffffffff1660e01b815260040161055a9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610577573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261059f9190810190611a9e565b93509350935093506040518060c001604052808d8d888181106105c4576105c4611a74565b9050602002013581526020018b6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061061657610616611a74565b602002602001018190525050505050808061063090611b4e565b9150506104d4565b506106448185856109b8565b61064f818585610a53565b6040516373e4ca1b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e7c994369061069b9084906004016116c5565b600060405180830381600087803b1580156106b557600080fd5b505af11580156106c9573d6000803e3d6000fd5b5050505060005b8681101561073a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070b5761070b611a74565b60200260200101516040516107209190611b67565b60405180910390a18061073281611b4e565b9150506106d0565b509695505050505050565b60408051808201909152600080825260208201526102da8261087e565b606061076f848484610b29565b600061077c8585856102f3565b9050610789858585610b71565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107d59084906004016116c5565b600060405180830381600087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b5050505060005b8151811015610875577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061084657610846611a74565b602002602001015160405161085b9190611b67565b60405180910390a18061086d81611b4e565b91505061080a565b50949350505050565b6040805180820190915260008082526020820152506000908152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff169082015290565b6000427f0000000000000000000000000000000000000000000000000000000000000000836020015163ffffffff166109079190611a3f565b1092915050565b610916611463565b6000826000015160008151811061092f5761092f611a74565b6020026020010151905061094281610c65565b6000816040015180602001905181019061095c9190611b8a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b6000806109a283850185611cbb565b905060006109af82610ca9565b95945050505050565b60005b8351811015610a4d576000846000815181106109d9576109d9611a74565b602002602001015160a001518060200190518101906109f89190611d8c565b6000818152600160205260409020549091506001600160a01b03163314610a3a5760405162f8a2bf60e81b815260048101829052336024820152604401610407565b5080610a4581611b4e565b9150506109bb565b50505050565b60005b8351811015610a4d576000848281518110610a7357610a73611a74565b602002602001015160a00151806020019051810190610a929190611d8c565b6000818152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff1690820152909150610ad6906108ce565b1515600103610afb57604051632fcfdde360e11b815260048101829052602401610407565b600090815260016020526040902080546001600160a01b031916905580610b2181611b4e565b915050610a56565b6000610b3782840184611cbb565b90506000610b4482610cbf565b90506000610b54610303876118af565b9050610b608183610d69565b610b6983611094565b505050505050565b6000610b7d8383610993565b6000818152600160209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910463ffffffff16918301919091529192509015801590610bf15750610bd76040860160208701611a57565b6001600160a01b031681600001516001600160a01b031614155b15610c4257610bff816108ce565b15610c3957604051633f8ffaa560e01b815281516001600160a01b03166004820152602082015163ffffffff166024820152604401610407565b610c428261122d565b610c5b82610c566040880160208901611a57565b61128e565b5050505050565b50565b6000610c7482604001516112f4565b82519091508114610ca55781516040516337e3d1ab60e01b8152610407918391600401918252602082015260400190565b5050565b602081015160009060065b602002015192915050565b610cc76114c6565b604051806101200160405280610cdc84611329565b6001600160a01b03168152602001610cf384611337565b8152602001610d0184611346565b8152602001610d0f84611355565b8152602001610d1d84610ca9565b8152602001610d2b84611364565b8152602001610d3984611373565b8152602001610d518460200151610120015160011490565b15158152602001610d6184611382565b905292915050565b815160c082015114610d9e57815160c082015160405163fe405c7760e01b815260048101929092526024820152604401610407565b81606001516040015115158160e00151151503610de957606082015160409081015160e08301519151634629f1b560e11b815290151560048201529015156024820152604401610407565b81604001516001600160a01b031681600001516001600160a01b031614610e3d57604082810151825191516370a8d99b60e11b81526001600160a01b03918216600482015291166024820152604401610407565b46816020015114610e70576020810151604051630432cec160e31b81524660048201526024810191909152604401610407565b81602001518160a0015114610eab57602082015160a0820151604051630626ade360e41b815260048101929092526024820152604401610407565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a9190611da5565b610f5f57806040015160405163cbfe7bc360e01b815260040161040791815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe29190611dc0565b80516101008401515191925014158061100957506020808201516101008401519091015114155b15611053578051602080830151610100850151805192015160405163318d812b60e01b81526004810194909452602484019190915260448301919091526064820152608401610407565b600061105e846113da565b905080836060015114610a4d5760608301516040516377bb6d2760e11b8152610407918391600401918252602082015260400190565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946110f794909392909190600401611e3c565b602060405180830381865afa925050508015611130575060408051601f3d908101601f1916820190925261112d91810190611da5565b60015b6112065761113c611ec0565b806308c379a0036111755750611150611edc565b8061115b57506111b4565b8060405162dd577760e81b81526004016104079190611f66565b634e487b71036111b457611187611f79565b9061119257506111b4565b60405162dd577760e81b81526020600482015260006024820152604401610407565b3d8080156111de576040519150601f19603f3d011682016040523d82523d6000602084013e6111e3565b606091505b5060405162dd577760e81b81526020600482015260006024820152604401610407565b80610ca55760405162dd577760e81b81526020600482015260006024820152604401610407565b600081815260016020908152604091829020805463ffffffff60a01b1916600160a01b4263ffffffff160217905590518281527f49ab97b1dc68eafe79e6e7f8ff996d00259888e84cb401cf9ec8d39adf7ab196910160405180910390a150565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102da907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611f99565b602081015160009081610cb4565b60208101516000906001610cb4565b60208101516000906004610cb4565b60208101516000906005610cb4565b60208101516000906007610cb4565b60208101516000906008610cb4565b61138a611519565b604051806040016040528083602001516002600a81106113ac576113ac611a74565b6020020151815260200183602001516003600a81106113cd576113cd611a74565b6020020151905292915050565b6000806113f8308460600151600001516001600160801b03166113ff565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113f89190611f99565b6040518060800160405280600081526020016000815260200160006001600160a01b031681526020016114c1604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114c15b60405180604001604052806002906020820280368337509192915050565b60006020828403121561154957600080fd5b5035919050565b60008083601f84011261156257600080fd5b50813567ffffffffffffffff81111561157a57600080fd5b60208301915083602082850101111561159257600080fd5b9250929050565b6000806000604084860312156115ae57600080fd5b833567ffffffffffffffff808211156115c657600080fd5b90850190604082880312156115da57600080fd5b909350602085013590808211156115f057600080fd5b506115fd86828701611550565b9497909650939450505050565b60005b8381101561162557818101518382015260200161160d565b83811115610a4d5750506000910152565b6000815180845261164e81602086016020860161160a565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a08501526116bd60c0850182611636565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561171a57603f19888603018452611708858351611662565b945092850192908501906001016116ec565b5092979650505050505050565b6001600160a01b0381168114610c6257600080fd5b803561174781611727565b919050565b60008060008060006060868803121561176457600080fd5b853567ffffffffffffffff8082111561177c57600080fd5b818801915088601f83011261179057600080fd5b81358181111561179f57600080fd5b8960208260051b85010111156117b457600080fd5b602083019750809650506117ca6020890161173c565b945060408801359150808211156117e057600080fd5b506117ed88828901611550565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b6040810181811067ffffffffffffffff82111715611834576118346117fe565b60405250565b6060810181811067ffffffffffffffff82111715611834576118346117fe565b601f8201601f1916810167ffffffffffffffff81118282101715611880576118806117fe565b6040525050565b600067ffffffffffffffff8211156118a1576118a16117fe565b50601f01601f191660200190565b600060408083360312156118c257600080fd5b80516118cd81611814565b833567ffffffffffffffff808211156118e557600080fd5b9085019036601f8301126118f857600080fd5b813560208282111561190c5761190c6117fe565b8160051b865161191e8383018261185a565b9283528481018201928281013685111561193757600080fd5b83870192505b84831015611a0b578235868111156119555760008081fd5b8701606036829003601f190181131561196e5760008081fd5b8a516119798161183a565b8287013581528b8301358188015290820135908882111561199a5760008081fd5b9181019136603f8401126119b057600091508182fd5b8683013591506119bf82611887565b8c516119cb828261185a565b838152368e8587010111156119e257600091508182fd5b838e86018a830137600093810189019390935250808c019190915282525091830191830161193d565b50865250611a1a88820161173c565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611a5257611a52611a29565b500190565b600060208284031215611a6957600080fd5b81356113f881611727565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff8116811461174757600080fd5b60008060008060808587031215611ab457600080fd5b8451611abf81611727565b60208601519094509250611ad560408601611a8a565b9150606085015167ffffffffffffffff811115611af157600080fd5b8501601f81018713611b0257600080fd5b8051611b0d81611887565b604051611b1a828261185a565b828152896020848601011115611b2f57600080fd5b611b4083602083016020870161160a565b969995985093965050505050565b600060018201611b6057611b60611a29565b5060010190565b6020815260006113f86020830184611662565b8051801515811461174757600080fd5b600060608284031215611b9c57600080fd5b6040516060810181811067ffffffffffffffff82111715611bbf57611bbf6117fe565b60405282516001600160801b0381168114611bd957600080fd5b8152611be760208401611a8a565b6020820152611bf860408401611b7a565b60408201529392505050565b600082601f830112611c1557600080fd5b604051611c2181611814565b806040840185811115611c3357600080fd5b845b81811015611c4d578035835260209283019201611c35565b509195945050505050565b600082601f830112611c6957600080fd5b60405161014080820182811067ffffffffffffffff82111715611c8e57611c8e6117fe565b60405283018185821115611ca157600080fd5b845b82811015611c4d578035825260209182019101611ca3565b6000818303610240811215611ccf57600080fd5b60408051611cdc81611814565b61010080841215611cec57600080fd5b82519350611cf98461183a565b611d038787611c04565b845286605f870112611d1457600080fd5b8251611d1f81611814565b8060c0880189811115611d3157600080fd5b8589015b81811015611d5657611d478b82611c04565b83526020909201918601611d35565b50826020880152611d678a82611c04565b86880152505050838252611d7d87828801611c58565b60208301525095945050505050565b600060208284031215611d9e57600080fd5b5051919050565b600060208284031215611db757600080fd5b6113f882611b7a565b600060408284031215611dd257600080fd5b82601f830112611de157600080fd5b604051611ded81611814565b806040840185811115611dff57600080fd5b845b81811015611c4d578051835260209283019201611e01565b8060005b6002811015610a4d578151845260209384019390910190600101611e1d565b6102408101611e4b8287611e19565b60408083018660005b6002811015611e7b57611e68838351611e19565b9183019160209190910190600101611e54565b50505050611e8c60c0830185611e19565b61010082018360005b600a811015611eb4578151835260209283019290910190600101611e95565b50505095945050505050565b600060033d1115611ed95760046000803e5060005160e01c5b90565b600060443d1015611eea5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611f1a57505050505090565b8285019150815181811115611f325750505050505090565b843d8701016020828501011115611f4c5750505050505090565b611f5b6020828601018761185a565b509095945050505050565b6020815260006113f86020830184611636565b60008060233d1115611f95576020600460003e50506000516001905b9091565b600082611fb657634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220f1374674d2143dc1e1f8e0666c58769f2e4bc209220c094f513f5b717a358ad464736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns the actual attestations constructed from the user request", - "params": { - "proofData": "snark public input as well as snark proof", - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "availableRootsRegistryAddress": "Registry storing the available groups for this attester (e.g roots of registry merkle trees)", - "collectionIdFirst": "Id of the first collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last collection in which the attester is supposed to record", - "commitmentMapperAddress": "commitment mapper's public key registry", - "hydraS1VerifierAddress": "ZK Snark Hydra-S1 Verifier contract" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getAvailableRootsRegistry()": { - "details": "Getter of Roots Registry Contract" - }, - "getCommitmentMapperRegistry()": { - "details": "Getter of Commitment Mapper Registry contract" - }, - "getDestinationOfTicket(uint256)": { - "details": "Getter, returns the last attestation destination of a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getTicketData(uint256)": { - "details": "Getter, returns the data linked to a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getVerifier()": { - "details": "Getter of Hydra-S1 Verifier contract" - }, - "isTicketOnCooldown(uint256)": { - "details": "returns whether a ticket is on cooldown or not", - "params": { - "userTicket": "ticket used*" - } - } - }, - "stateVariables": { - "AUTHORIZED_COLLECTION_ID_FIRST": { - "details": "Getter returns of the first collection in which the attester is supposed to record*" - }, - "AUTHORIZED_COLLECTION_ID_LAST": { - "details": "Getter returns of the last collection in which the attester is supposed to record*" - }, - "SOULBOUND_COOLDOWN_DURATION": { - "details": "Getter returns of the duration of the cooldown period after having used a ticket*" - } - }, - "title": "Hydra-S1 Soulbound Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - SoulBound (with cooldown period) A user can chose to delete attestations or generate attestation to a new destination. When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional User will need to wait until the end of the cooldown period before being able to delete or switch destination again One can however know that the former and the new destinations were created using the same userTicket - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 936, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 939, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 7701, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "_userTicketsData", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_struct(TicketData)7128_storage)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_struct(TicketData)7128_storage)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => struct IHydraS1SoulboundAttester.TicketData)", - "numberOfBytes": "32", - "value": "t_struct(TicketData)7128_storage" - }, - "t_struct(TicketData)7128_storage": { - "encoding": "inplace", - "label": "struct IHydraS1SoulboundAttester.TicketData", - "members": [ - { - "astId": 7125, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "destination", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 7127, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "cooldownStart", - "offset": 20, - "slot": "0", - "type": "t_uint32" - } - ], - "numberOfBytes": "32" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/HydraS1SoulboundAttesterImplem.json b/deployments/goerli/HydraS1SoulboundAttesterImplem.json deleted file mode 100644 index 216abc7..0000000 --- a/deployments/goerli/HydraS1SoulboundAttesterImplem.json +++ /dev/null @@ -1,1003 +0,0 @@ -{ - "address": "0xbd11CD5C77222DD51B270880F6A4148a8e5A6cB0", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "hydraS1VerifierAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "availableRootsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "soulboundCooldownDuration", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "AccountsTreeValueMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "claimLength", - "type": "uint256" - } - ], - "name": "ClaimsLengthDifferentThanOne", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentMapperPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "NotAttestationOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "inputRoot", - "type": "uint256" - } - ], - "name": "RegistryRootMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "ticketData", - "type": "uint256" - } - ], - "name": "TicketFrozen", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedTicketIdentifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ticketIdentifier", - "type": "uint256" - } - ], - "name": "TicketIdentifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "destination", - "type": "address" - }, - { - "internalType": "uint32", - "name": "cooldownStart", - "type": "uint32" - } - ], - "internalType": "struct IHydraS1SoulboundAttester.TicketData", - "name": "ticketData", - "type": "tuple" - } - ], - "name": "TicketUsedAndOnCooldown", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "TicketDestinationUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - } - ], - "name": "TicketSetOnCooldown", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "SOULBOUND_COOLDOWN_DURATION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAvailableRootsRegistry", - "outputs": [ - { - "internalType": "contract IAvailableRootsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentMapperRegistry", - "outputs": [ - { - "internalType": "contract ICommitmentMapperRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getDestinationOfTicket", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getTicketData", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "destination", - "type": "address" - }, - { - "internalType": "uint32", - "name": "cooldownStart", - "type": "uint32" - } - ], - "internalType": "struct IHydraS1SoulboundAttester.TicketData", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract HydraS1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "isTicketOnCooldown", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xaa3d5ac08d453d7e72ac285af59e4ee28ef08ec758735b4e5c3611081a2b93ca", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0xbd11CD5C77222DD51B270880F6A4148a8e5A6cB0", - "transactionIndex": 6, - "gasUsed": "1821131", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x81596a8b0a080b95f877cc557962fe6e917c1ad7f32c15302a718169a5dd182f", - "transactionHash": "0xaa3d5ac08d453d7e72ac285af59e4ee28ef08ec758735b4e5c3611081a2b93ca", - "logs": [], - "blockNumber": 7711096, - "cumulativeGasUsed": "2819339", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf85BA0afA375495eE625910Db61b6b1406756234", - "0x522018b86645F597626aa127EfC22D55a5c79F11", - "0xdDa4c8d2933dAA21Aac75B88fF59725725ba813F", - "0x0844662f25817B735BC9B6d9D11995F1A6c4dCB1", - "20000001", - "30000000", - "295200" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"hydraS1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"availableRootsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"soulboundCooldownDuration\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"AccountsTreeValueMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimLength\",\"type\":\"uint256\"}],\"name\":\"ClaimsLengthDifferentThanOne\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentMapperPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"NotAttestationOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inputRoot\",\"type\":\"uint256\"}],\"name\":\"RegistryRootMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"ticketData\",\"type\":\"uint256\"}],\"name\":\"TicketFrozen\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"cooldownStart\",\"type\":\"uint32\"}],\"internalType\":\"struct IHydraS1SoulboundAttester.TicketData\",\"name\":\"ticketData\",\"type\":\"tuple\"}],\"name\":\"TicketUsedAndOnCooldown\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"}],\"name\":\"TicketSetOnCooldown\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SOULBOUND_COOLDOWN_DURATION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAvailableRootsRegistry\",\"outputs\":[{\"internalType\":\"contract IAvailableRootsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentMapperRegistry\",\"outputs\":[{\"internalType\":\"contract ICommitmentMapperRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getTicketData\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"cooldownStart\",\"type\":\"uint32\"}],\"internalType\":\"struct IHydraS1SoulboundAttester.TicketData\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract HydraS1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"isTicketOnCooldown\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns the actual attestations constructed from the user request\",\"params\":{\"proofData\":\"snark public input as well as snark proof\",\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"availableRootsRegistryAddress\":\"Registry storing the available groups for this attester (e.g roots of registry merkle trees)\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentMapperAddress\":\"commitment mapper's public key registry\",\"hydraS1VerifierAddress\":\"ZK Snark Hydra-S1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getAvailableRootsRegistry()\":{\"details\":\"Getter of Roots Registry Contract\"},\"getCommitmentMapperRegistry()\":{\"details\":\"Getter of Commitment Mapper Registry contract\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getTicketData(uint256)\":{\"details\":\"Getter, returns the data linked to a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Hydra-S1 Verifier contract\"},\"isTicketOnCooldown(uint256)\":{\"details\":\"returns whether a ticket is on cooldown or not\",\"params\":{\"userTicket\":\"ticket used*\"}}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"},\"SOULBOUND_COOLDOWN_DURATION\":{\"details\":\"Getter returns of the duration of the cooldown period after having used a ticket*\"}},\"title\":\"Hydra-S1 Soulbound Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - SoulBound (with cooldown period) A user can chose to delete attestations or generate attestation to a new destination. When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional User will need to wait until the end of the cooldown period before being able to delete or switch destination again One can however know that the former and the new destinations were created using the same userTicket - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol\":\"HydraS1SoulboundAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() initializer {}\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\\n // contract may have been reentered.\\n require(_initializing ? _isConstructor() : !_initialized, \\\"Initializable: contract is already initialized\\\");\\n\\n bool isTopLevelCall = !_initializing;\\n if (isTopLevelCall) {\\n _initializing = true;\\n _initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n _initializing = false;\\n }\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} modifier, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n function _isConstructor() private view returns (bool) {\\n return !Address.isContract(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x4823752b07b8ea4ca971b217e39457930e7cb103c2c91e2a29729e5ca907e4f0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\\n 546002182798634190282541153661423157791776194062719045593389981526666716416\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x70c0b7d96ff1b90538938a4cb2d8086b3aabb4febf1e36cb3f470bfe0b4a9e89\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n \\n \\n **/\\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n virtual\\n returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\\n internal\\n view\\n virtual\\n {\\n if (input.accountsTreeValue != claim.groupId)\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\\n revert RegistryRootMismatch(input.registryRoot);\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n )\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(\\n uint256 /*errorCode*/\\n ) {\\n revert InvalidGroth16Proof('');\\n } catch (\\n bytes memory /*lowLevelData*/\\n ) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0x02708884237382835cd3d3514fdc3603409ce5ea1dc7255a7ceea07dff417c34\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n// todo: explain well what is specific to this attester\\ninterface IHydraS1Base {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x73cff4dcd9c30857859721ea2897be8bb7087c0122f4587acdaa79d8ec0a728d\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SoulboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n// todo: explain well what is specific to this attester\\ninterface IHydraS1SoulboundAttester is IHydraS1Base, IAttester {\\n struct TicketData {\\n address destination;\\n uint32 cooldownStart;\\n }\\n error NotAttestationOwner(uint256 ticket, address sender);\\n error TicketFrozen(uint256 ticketData);\\n error TicketUsedAndOnCooldown(TicketData ticketData);\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n event TicketSetOnCooldown(uint256 ticket);\\n\\n /**\\n * @dev returns whether a ticket is on cooldown or not\\n * @param userTicket ticket used\\n **/\\n function isTicketOnCooldown(uint256 userTicket) external view returns (bool);\\n\\n /**\\n * @dev Getter, returns the data linked to a ticket\\n * @param userTicket ticket used\\n **/\\n function getTicketData(uint256 userTicket) external view returns (TicketData memory);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the duration of the cooldown period after having used a ticket\\n **/\\n function SOULBOUND_COOLDOWN_DURATION() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x253a424fda33fca3de3fabd731e4a4f5d48af14bcd9d7c66302113268fd3a9f5\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // ticketIdentifier\\n // ticket\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (\\n uint256[2] memory,\\n uint256[2][2] memory,\\n uint256[2] memory,\\n uint256[10] memory\\n )\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256[2] memory)\\n {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256)\\n {\\n return self.input[5];\\n }\\n\\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\\n internal\\n pure\\n returns (uint256)\\n {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x596225970aabbc4edb989ee640867c76944e797bfafe5e06dcf37b973480b957\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SoulboundAttester} from '../interfaces/IHydraS1SoulboundAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from '../../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from '../base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Soulbound Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - SoulBound (with cooldown period)\\n * A user can chose to delete attestations or generate attestation to a new destination.\\n * When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional\\n * User will need to wait until the end of the cooldown period before being able to delete or switch destination again\\n * One can however know that the former and the new destinations were created using the same userTicket\\n \\n * - Renewable\\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew or update their attestations\\n **/\\ncontract HydraS1SoulboundAttester is IHydraS1SoulboundAttester, HydraS1Base, Attester {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n uint256 public immutable SOULBOUND_COOLDOWN_DURATION;\\n\\n mapping(uint256 => TicketData) internal _userTicketsData;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n uint256 soulboundCooldownDuration\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n SOULBOUND_COOLDOWN_DURATION = soulboundCooldownDuration;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user attestations request is invalid\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark proof backing the claim\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Throws if user attestations deletion request is not made by its owner\\n * @param attestations attestations to delete\\n */\\n function _verifyAttestationsDeletionRequest(Attestation[] memory attestations, bytes calldata)\\n internal\\n view\\n override\\n {\\n for (uint256 i = 0; i < attestations.length; i++) {\\n uint256 userTicket = abi.decode(attestations[0].extraData, (uint256));\\n if (_userTicketsData[userTicket].destination != msg.sender)\\n revert NotAttestationOwner(userTicket, msg.sender);\\n }\\n }\\n\\n /**\\n * @dev Returns the actual attestations constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark public input as well as snark proof\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n override(IAttester, Attester)\\n returns (Attestation[] memory)\\n {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n // The issuer of attestations is the attester\\n address issuer = address(this);\\n // user sends the ticket as input in the data\\n uint256 userTicket = proofData._getTicket();\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n request.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n abi.encode(userTicket)\\n );\\n\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used, not a renewal, and ticket on cooldown.\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n uint256 userTicket = proofData._getTicket();\\n TicketData memory userTicketData = _userTicketsData[userTicket];\\n\\n if (\\n userTicketData.destination != address(0) && userTicketData.destination != request.destination\\n ) {\\n if (_isOnCooldown(userTicketData)) revert TicketUsedAndOnCooldown(userTicketData);\\n _setTicketOnCooldown(userTicket);\\n }\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n override\\n {\\n // we retrieve the ticketUsed from attestations extraData\\n for (uint256 i = 0; i < attestations.length; i++) {\\n uint256 userTicket = abi.decode(attestations[i].extraData, (uint256));\\n if (_isOnCooldown(_userTicketsData[userTicket]) == true) revert TicketFrozen(userTicket);\\n _userTicketsData[userTicket].destination = address(0);\\n }\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n override\\n returns (uint256)\\n {\\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\\n return ticketIdentifier;\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n /**\\n * @dev Getter, returns the data linked to a ticket\\n * @param userTicket ticket used\\n **/\\n function getTicketData(uint256 userTicket) external view override returns (TicketData memory) {\\n return _getTicketData(userTicket);\\n }\\n\\n /**\\n * @dev returns whether a ticket is on cooldown or not\\n * @param userTicket ticket used\\n **/\\n function isTicketOnCooldown(uint256 userTicket) external view override returns (bool) {\\n return _isOnCooldown(_getTicketData(userTicket));\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _userTicketsData[userTicket].destination = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _setTicketOnCooldown(uint256 userTicket) internal {\\n _userTicketsData[userTicket].cooldownStart = uint32(block.timestamp);\\n emit TicketSetOnCooldown(userTicket);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _userTicketsData[userTicket].destination;\\n }\\n\\n function _isOnCooldown(TicketData memory userTicketData) internal view returns (bool) {\\n return userTicketData.cooldownStart + SOULBOUND_COOLDOWN_DURATION < block.timestamp;\\n }\\n\\n function _getTicketData(uint256 userTicket) internal view returns (TicketData memory) {\\n return _userTicketsData[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0xe72642edf2eecc2886aae203d09ac63f5515a1e51f0ad85b9da410aa59db6261\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n override\\n returns (Attestation[] memory)\\n {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // fetch attestations from the registry\\n Attestation[] memory attestationsToDelete;\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationsToDelete[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestationsToDelete, proofData);\\n\\n _beforeDeleteAttestations(attestationsToDelete, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationsToDelete);\\n\\n _afterDeleteAttestations(attestationsToDelete, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestationsToDelete[i]);\\n }\\n return attestationsToDelete;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n}\\n\",\"keccak256\":\"0x37683c6752d4dc911459084eb191c1045f3bf34e2143f3db3d298a66c971a106\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param attestations Attestations to be deleted\\n */\\n function deleteAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xb5e25bd7e0372c9973e582fb7fe96318c145831a5452d8c79eb848a7464b0297\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) public initializer {\\n _transferOwnership(owner);\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9329ecaf60ffe978c8ab4360e0a8f9bd36e2549e89d672dd39ae80f9a562f9a9\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public initializer {\\n _transferOwnership(owner);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0xacb5347ee1a0e8dc25a1ce3e6fbb427db646e833ff8508909454cad7950418d4\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x87f5035b58936a8458a22f3cf1b3865bd798813310d86af41af74680978c97c8\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0x8d6298b442dde99ee5a9cc989ada6ea808383a08b1e9bb1d4c2b58adc01eec69\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101606040523480156200001257600080fd5b506040516200218c3803806200218c833981016040819052620000359162000088565b6001600160a01b0395861660805293851660c05291841660a0529390921660e05261010092909252610120526101405262000102565b80516001600160a01b03811681146200008357600080fd5b919050565b600080600080600080600060e0888a031215620000a457600080fd5b620000af886200006b565b9650620000bf602089016200006b565b9550620000cf604089016200006b565b9450620000df606089016200006b565b93506080880151925060a0880151915060c0880151905092959891949750929550565b60805160a05160c05160e051610100516101205161014051611ff16200019b6000396000818161013e01526108d30152600081816101ad01526103c901526000818161017301526103a101526000818161023a015281816104e40152818161066601526107a00152600081816101d10152610ec701526000818160d60152610f6301526000818161011501526110be0152611ff16000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063918447af1161008c578063bfa6658511610066578063bfa6658514610238578063c776adde1461025e578063d9895e6a14610271578063e60f999f146102ae57600080fd5b8063918447af146101cf57806392cf369d146101f5578063af411a301461021857600080fd5b80632254f98e146100d457806346657fe9146101135780634e5cf9331461013957806354846d7a1461016e57806363e4afc2146101955780637000b051146101a8575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161010a565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b6100f66101a3366004611537565b6102c1565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b610208610203366004611537565b6102e0565b604051901515815260200161010a565b61022b610226366004611599565b6102f3565b60405161010a91906116c5565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b61022b61026c36600461174c565b6104ce565b61028461027f366004611537565b610745565b6040805182516001600160a01b0316815260209283015163ffffffff16928101929092520161010a565b61022b6102bc366004611599565b610762565b6000818152600160205260408120546001600160a01b03165b92915050565b60006102da6102ee8361087e565b6108ce565b60606000610308610303866118af565b61090e565b60408051600180825281830190925291925060009190816020015b6103746040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816103235750506060830151519091506000906103c5906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611a3f565b90507f000000000000000000000000000000000000000000000000000000000000000081111561041057604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b30600061041d8888610993565b90506040518060c001604052808481526020018a60200160208101906104439190611a57565b6001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff1681526020018260405160200161049191815260200190565b604051602081830303815290604052815250846000815181106104b6576104b6611a74565b60209081029190910101525091979650505050505050565b60608060005b86811015610638576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78d8d8881811061052357610523611a74565b905060200201358c6040518363ffffffff1660e01b815260040161055a9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610577573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261059f9190810190611a9e565b93509350935093506040518060c001604052808d8d888181106105c4576105c4611a74565b9050602002013581526020018b6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061061657610616611a74565b602002602001018190525050505050808061063090611b4e565b9150506104d4565b506106448185856109b8565b61064f818585610a53565b6040516373e4ca1b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e7c994369061069b9084906004016116c5565b600060405180830381600087803b1580156106b557600080fd5b505af11580156106c9573d6000803e3d6000fd5b5050505060005b8681101561073a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070b5761070b611a74565b60200260200101516040516107209190611b67565b60405180910390a18061073281611b4e565b9150506106d0565b509695505050505050565b60408051808201909152600080825260208201526102da8261087e565b606061076f848484610b29565b600061077c8585856102f3565b9050610789858585610b71565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107d59084906004016116c5565b600060405180830381600087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b5050505060005b8151811015610875577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061084657610846611a74565b602002602001015160405161085b9190611b67565b60405180910390a18061086d81611b4e565b91505061080a565b50949350505050565b6040805180820190915260008082526020820152506000908152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff169082015290565b6000427f0000000000000000000000000000000000000000000000000000000000000000836020015163ffffffff166109079190611a3f565b1092915050565b610916611463565b6000826000015160008151811061092f5761092f611a74565b6020026020010151905061094281610c65565b6000816040015180602001905181019061095c9190611b8a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b6000806109a283850185611cbb565b905060006109af82610ca9565b95945050505050565b60005b8351811015610a4d576000846000815181106109d9576109d9611a74565b602002602001015160a001518060200190518101906109f89190611d8c565b6000818152600160205260409020549091506001600160a01b03163314610a3a5760405162f8a2bf60e81b815260048101829052336024820152604401610407565b5080610a4581611b4e565b9150506109bb565b50505050565b60005b8351811015610a4d576000848281518110610a7357610a73611a74565b602002602001015160a00151806020019051810190610a929190611d8c565b6000818152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff1690820152909150610ad6906108ce565b1515600103610afb57604051632fcfdde360e11b815260048101829052602401610407565b600090815260016020526040902080546001600160a01b031916905580610b2181611b4e565b915050610a56565b6000610b3782840184611cbb565b90506000610b4482610cbf565b90506000610b54610303876118af565b9050610b608183610d69565b610b6983611094565b505050505050565b6000610b7d8383610993565b6000818152600160209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910463ffffffff16918301919091529192509015801590610bf15750610bd76040860160208701611a57565b6001600160a01b031681600001516001600160a01b031614155b15610c4257610bff816108ce565b15610c3957604051633f8ffaa560e01b815281516001600160a01b03166004820152602082015163ffffffff166024820152604401610407565b610c428261122d565b610c5b82610c566040880160208901611a57565b61128e565b5050505050565b50565b6000610c7482604001516112f4565b82519091508114610ca55781516040516337e3d1ab60e01b8152610407918391600401918252602082015260400190565b5050565b602081015160009060065b602002015192915050565b610cc76114c6565b604051806101200160405280610cdc84611329565b6001600160a01b03168152602001610cf384611337565b8152602001610d0184611346565b8152602001610d0f84611355565b8152602001610d1d84610ca9565b8152602001610d2b84611364565b8152602001610d3984611373565b8152602001610d518460200151610120015160011490565b15158152602001610d6184611382565b905292915050565b815160c082015114610d9e57815160c082015160405163fe405c7760e01b815260048101929092526024820152604401610407565b81606001516040015115158160e00151151503610de957606082015160409081015160e08301519151634629f1b560e11b815290151560048201529015156024820152604401610407565b81604001516001600160a01b031681600001516001600160a01b031614610e3d57604082810151825191516370a8d99b60e11b81526001600160a01b03918216600482015291166024820152604401610407565b46816020015114610e70576020810151604051630432cec160e31b81524660048201526024810191909152604401610407565b81602001518160a0015114610eab57602082015160a0820151604051630626ade360e41b815260048101929092526024820152604401610407565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a9190611da5565b610f5f57806040015160405163cbfe7bc360e01b815260040161040791815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe29190611dc0565b80516101008401515191925014158061100957506020808201516101008401519091015114155b15611053578051602080830151610100850151805192015160405163318d812b60e01b81526004810194909452602484019190915260448301919091526064820152608401610407565b600061105e846113da565b905080836060015114610a4d5760608301516040516377bb6d2760e11b8152610407918391600401918252602082015260400190565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946110f794909392909190600401611e3c565b602060405180830381865afa925050508015611130575060408051601f3d908101601f1916820190925261112d91810190611da5565b60015b6112065761113c611ec0565b806308c379a0036111755750611150611edc565b8061115b57506111b4565b8060405162dd577760e81b81526004016104079190611f66565b634e487b71036111b457611187611f79565b9061119257506111b4565b60405162dd577760e81b81526020600482015260006024820152604401610407565b3d8080156111de576040519150601f19603f3d011682016040523d82523d6000602084013e6111e3565b606091505b5060405162dd577760e81b81526020600482015260006024820152604401610407565b80610ca55760405162dd577760e81b81526020600482015260006024820152604401610407565b600081815260016020908152604091829020805463ffffffff60a01b1916600160a01b4263ffffffff160217905590518281527f49ab97b1dc68eafe79e6e7f8ff996d00259888e84cb401cf9ec8d39adf7ab196910160405180910390a150565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102da907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611f99565b602081015160009081610cb4565b60208101516000906001610cb4565b60208101516000906004610cb4565b60208101516000906005610cb4565b60208101516000906007610cb4565b60208101516000906008610cb4565b61138a611519565b604051806040016040528083602001516002600a81106113ac576113ac611a74565b6020020151815260200183602001516003600a81106113cd576113cd611a74565b6020020151905292915050565b6000806113f8308460600151600001516001600160801b03166113ff565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113f89190611f99565b6040518060800160405280600081526020016000815260200160006001600160a01b031681526020016114c1604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114c15b60405180604001604052806002906020820280368337509192915050565b60006020828403121561154957600080fd5b5035919050565b60008083601f84011261156257600080fd5b50813567ffffffffffffffff81111561157a57600080fd5b60208301915083602082850101111561159257600080fd5b9250929050565b6000806000604084860312156115ae57600080fd5b833567ffffffffffffffff808211156115c657600080fd5b90850190604082880312156115da57600080fd5b909350602085013590808211156115f057600080fd5b506115fd86828701611550565b9497909650939450505050565b60005b8381101561162557818101518382015260200161160d565b83811115610a4d5750506000910152565b6000815180845261164e81602086016020860161160a565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a08501526116bd60c0850182611636565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561171a57603f19888603018452611708858351611662565b945092850192908501906001016116ec565b5092979650505050505050565b6001600160a01b0381168114610c6257600080fd5b803561174781611727565b919050565b60008060008060006060868803121561176457600080fd5b853567ffffffffffffffff8082111561177c57600080fd5b818801915088601f83011261179057600080fd5b81358181111561179f57600080fd5b8960208260051b85010111156117b457600080fd5b602083019750809650506117ca6020890161173c565b945060408801359150808211156117e057600080fd5b506117ed88828901611550565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b6040810181811067ffffffffffffffff82111715611834576118346117fe565b60405250565b6060810181811067ffffffffffffffff82111715611834576118346117fe565b601f8201601f1916810167ffffffffffffffff81118282101715611880576118806117fe565b6040525050565b600067ffffffffffffffff8211156118a1576118a16117fe565b50601f01601f191660200190565b600060408083360312156118c257600080fd5b80516118cd81611814565b833567ffffffffffffffff808211156118e557600080fd5b9085019036601f8301126118f857600080fd5b813560208282111561190c5761190c6117fe565b8160051b865161191e8383018261185a565b9283528481018201928281013685111561193757600080fd5b83870192505b84831015611a0b578235868111156119555760008081fd5b8701606036829003601f190181131561196e5760008081fd5b8a516119798161183a565b8287013581528b8301358188015290820135908882111561199a5760008081fd5b9181019136603f8401126119b057600091508182fd5b8683013591506119bf82611887565b8c516119cb828261185a565b838152368e8587010111156119e257600091508182fd5b838e86018a830137600093810189019390935250808c019190915282525091830191830161193d565b50865250611a1a88820161173c565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611a5257611a52611a29565b500190565b600060208284031215611a6957600080fd5b81356113f881611727565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff8116811461174757600080fd5b60008060008060808587031215611ab457600080fd5b8451611abf81611727565b60208601519094509250611ad560408601611a8a565b9150606085015167ffffffffffffffff811115611af157600080fd5b8501601f81018713611b0257600080fd5b8051611b0d81611887565b604051611b1a828261185a565b828152896020848601011115611b2f57600080fd5b611b4083602083016020870161160a565b969995985093965050505050565b600060018201611b6057611b60611a29565b5060010190565b6020815260006113f86020830184611662565b8051801515811461174757600080fd5b600060608284031215611b9c57600080fd5b6040516060810181811067ffffffffffffffff82111715611bbf57611bbf6117fe565b60405282516001600160801b0381168114611bd957600080fd5b8152611be760208401611a8a565b6020820152611bf860408401611b7a565b60408201529392505050565b600082601f830112611c1557600080fd5b604051611c2181611814565b806040840185811115611c3357600080fd5b845b81811015611c4d578035835260209283019201611c35565b509195945050505050565b600082601f830112611c6957600080fd5b60405161014080820182811067ffffffffffffffff82111715611c8e57611c8e6117fe565b60405283018185821115611ca157600080fd5b845b82811015611c4d578035825260209182019101611ca3565b6000818303610240811215611ccf57600080fd5b60408051611cdc81611814565b61010080841215611cec57600080fd5b82519350611cf98461183a565b611d038787611c04565b845286605f870112611d1457600080fd5b8251611d1f81611814565b8060c0880189811115611d3157600080fd5b8589015b81811015611d5657611d478b82611c04565b83526020909201918601611d35565b50826020880152611d678a82611c04565b86880152505050838252611d7d87828801611c58565b60208301525095945050505050565b600060208284031215611d9e57600080fd5b5051919050565b600060208284031215611db757600080fd5b6113f882611b7a565b600060408284031215611dd257600080fd5b82601f830112611de157600080fd5b604051611ded81611814565b806040840185811115611dff57600080fd5b845b81811015611c4d578051835260209283019201611e01565b8060005b6002811015610a4d578151845260209384019390910190600101611e1d565b6102408101611e4b8287611e19565b60408083018660005b6002811015611e7b57611e68838351611e19565b9183019160209190910190600101611e54565b50505050611e8c60c0830185611e19565b61010082018360005b600a811015611eb4578151835260209283019290910190600101611e95565b50505095945050505050565b600060033d1115611ed95760046000803e5060005160e01c5b90565b600060443d1015611eea5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611f1a57505050505090565b8285019150815181811115611f325750505050505090565b843d8701016020828501011115611f4c5750505050505090565b611f5b6020828601018761185a565b509095945050505050565b6020815260006113f86020830184611636565b60008060233d1115611f95576020600460003e50506000516001905b9091565b600082611fb657634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220f1374674d2143dc1e1f8e0666c58769f2e4bc209220c094f513f5b717a358ad464736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063918447af1161008c578063bfa6658511610066578063bfa6658514610238578063c776adde1461025e578063d9895e6a14610271578063e60f999f146102ae57600080fd5b8063918447af146101cf57806392cf369d146101f5578063af411a301461021857600080fd5b80632254f98e146100d457806346657fe9146101135780634e5cf9331461013957806354846d7a1461016e57806363e4afc2146101955780637000b051146101a8575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161010a565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b6100f66101a3366004611537565b6102c1565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b610208610203366004611537565b6102e0565b604051901515815260200161010a565b61022b610226366004611599565b6102f3565b60405161010a91906116c5565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b61022b61026c36600461174c565b6104ce565b61028461027f366004611537565b610745565b6040805182516001600160a01b0316815260209283015163ffffffff16928101929092520161010a565b61022b6102bc366004611599565b610762565b6000818152600160205260408120546001600160a01b03165b92915050565b60006102da6102ee8361087e565b6108ce565b60606000610308610303866118af565b61090e565b60408051600180825281830190925291925060009190816020015b6103746040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816103235750506060830151519091506000906103c5906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611a3f565b90507f000000000000000000000000000000000000000000000000000000000000000081111561041057604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b30600061041d8888610993565b90506040518060c001604052808481526020018a60200160208101906104439190611a57565b6001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff1681526020018260405160200161049191815260200190565b604051602081830303815290604052815250846000815181106104b6576104b6611a74565b60209081029190910101525091979650505050505050565b60608060005b86811015610638576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78d8d8881811061052357610523611a74565b905060200201358c6040518363ffffffff1660e01b815260040161055a9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610577573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261059f9190810190611a9e565b93509350935093506040518060c001604052808d8d888181106105c4576105c4611a74565b9050602002013581526020018b6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061061657610616611a74565b602002602001018190525050505050808061063090611b4e565b9150506104d4565b506106448185856109b8565b61064f818585610a53565b6040516373e4ca1b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e7c994369061069b9084906004016116c5565b600060405180830381600087803b1580156106b557600080fd5b505af11580156106c9573d6000803e3d6000fd5b5050505060005b8681101561073a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070b5761070b611a74565b60200260200101516040516107209190611b67565b60405180910390a18061073281611b4e565b9150506106d0565b509695505050505050565b60408051808201909152600080825260208201526102da8261087e565b606061076f848484610b29565b600061077c8585856102f3565b9050610789858585610b71565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107d59084906004016116c5565b600060405180830381600087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b5050505060005b8151811015610875577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061084657610846611a74565b602002602001015160405161085b9190611b67565b60405180910390a18061086d81611b4e565b91505061080a565b50949350505050565b6040805180820190915260008082526020820152506000908152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff169082015290565b6000427f0000000000000000000000000000000000000000000000000000000000000000836020015163ffffffff166109079190611a3f565b1092915050565b610916611463565b6000826000015160008151811061092f5761092f611a74565b6020026020010151905061094281610c65565b6000816040015180602001905181019061095c9190611b8a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b6000806109a283850185611cbb565b905060006109af82610ca9565b95945050505050565b60005b8351811015610a4d576000846000815181106109d9576109d9611a74565b602002602001015160a001518060200190518101906109f89190611d8c565b6000818152600160205260409020549091506001600160a01b03163314610a3a5760405162f8a2bf60e81b815260048101829052336024820152604401610407565b5080610a4581611b4e565b9150506109bb565b50505050565b60005b8351811015610a4d576000848281518110610a7357610a73611a74565b602002602001015160a00151806020019051810190610a929190611d8c565b6000818152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff1690820152909150610ad6906108ce565b1515600103610afb57604051632fcfdde360e11b815260048101829052602401610407565b600090815260016020526040902080546001600160a01b031916905580610b2181611b4e565b915050610a56565b6000610b3782840184611cbb565b90506000610b4482610cbf565b90506000610b54610303876118af565b9050610b608183610d69565b610b6983611094565b505050505050565b6000610b7d8383610993565b6000818152600160209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910463ffffffff16918301919091529192509015801590610bf15750610bd76040860160208701611a57565b6001600160a01b031681600001516001600160a01b031614155b15610c4257610bff816108ce565b15610c3957604051633f8ffaa560e01b815281516001600160a01b03166004820152602082015163ffffffff166024820152604401610407565b610c428261122d565b610c5b82610c566040880160208901611a57565b61128e565b5050505050565b50565b6000610c7482604001516112f4565b82519091508114610ca55781516040516337e3d1ab60e01b8152610407918391600401918252602082015260400190565b5050565b602081015160009060065b602002015192915050565b610cc76114c6565b604051806101200160405280610cdc84611329565b6001600160a01b03168152602001610cf384611337565b8152602001610d0184611346565b8152602001610d0f84611355565b8152602001610d1d84610ca9565b8152602001610d2b84611364565b8152602001610d3984611373565b8152602001610d518460200151610120015160011490565b15158152602001610d6184611382565b905292915050565b815160c082015114610d9e57815160c082015160405163fe405c7760e01b815260048101929092526024820152604401610407565b81606001516040015115158160e00151151503610de957606082015160409081015160e08301519151634629f1b560e11b815290151560048201529015156024820152604401610407565b81604001516001600160a01b031681600001516001600160a01b031614610e3d57604082810151825191516370a8d99b60e11b81526001600160a01b03918216600482015291166024820152604401610407565b46816020015114610e70576020810151604051630432cec160e31b81524660048201526024810191909152604401610407565b81602001518160a0015114610eab57602082015160a0820151604051630626ade360e41b815260048101929092526024820152604401610407565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a9190611da5565b610f5f57806040015160405163cbfe7bc360e01b815260040161040791815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe29190611dc0565b80516101008401515191925014158061100957506020808201516101008401519091015114155b15611053578051602080830151610100850151805192015160405163318d812b60e01b81526004810194909452602484019190915260448301919091526064820152608401610407565b600061105e846113da565b905080836060015114610a4d5760608301516040516377bb6d2760e11b8152610407918391600401918252602082015260400190565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946110f794909392909190600401611e3c565b602060405180830381865afa925050508015611130575060408051601f3d908101601f1916820190925261112d91810190611da5565b60015b6112065761113c611ec0565b806308c379a0036111755750611150611edc565b8061115b57506111b4565b8060405162dd577760e81b81526004016104079190611f66565b634e487b71036111b457611187611f79565b9061119257506111b4565b60405162dd577760e81b81526020600482015260006024820152604401610407565b3d8080156111de576040519150601f19603f3d011682016040523d82523d6000602084013e6111e3565b606091505b5060405162dd577760e81b81526020600482015260006024820152604401610407565b80610ca55760405162dd577760e81b81526020600482015260006024820152604401610407565b600081815260016020908152604091829020805463ffffffff60a01b1916600160a01b4263ffffffff160217905590518281527f49ab97b1dc68eafe79e6e7f8ff996d00259888e84cb401cf9ec8d39adf7ab196910160405180910390a150565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102da907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611f99565b602081015160009081610cb4565b60208101516000906001610cb4565b60208101516000906004610cb4565b60208101516000906005610cb4565b60208101516000906007610cb4565b60208101516000906008610cb4565b61138a611519565b604051806040016040528083602001516002600a81106113ac576113ac611a74565b6020020151815260200183602001516003600a81106113cd576113cd611a74565b6020020151905292915050565b6000806113f8308460600151600001516001600160801b03166113ff565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113f89190611f99565b6040518060800160405280600081526020016000815260200160006001600160a01b031681526020016114c1604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114c15b60405180604001604052806002906020820280368337509192915050565b60006020828403121561154957600080fd5b5035919050565b60008083601f84011261156257600080fd5b50813567ffffffffffffffff81111561157a57600080fd5b60208301915083602082850101111561159257600080fd5b9250929050565b6000806000604084860312156115ae57600080fd5b833567ffffffffffffffff808211156115c657600080fd5b90850190604082880312156115da57600080fd5b909350602085013590808211156115f057600080fd5b506115fd86828701611550565b9497909650939450505050565b60005b8381101561162557818101518382015260200161160d565b83811115610a4d5750506000910152565b6000815180845261164e81602086016020860161160a565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a08501526116bd60c0850182611636565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561171a57603f19888603018452611708858351611662565b945092850192908501906001016116ec565b5092979650505050505050565b6001600160a01b0381168114610c6257600080fd5b803561174781611727565b919050565b60008060008060006060868803121561176457600080fd5b853567ffffffffffffffff8082111561177c57600080fd5b818801915088601f83011261179057600080fd5b81358181111561179f57600080fd5b8960208260051b85010111156117b457600080fd5b602083019750809650506117ca6020890161173c565b945060408801359150808211156117e057600080fd5b506117ed88828901611550565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b6040810181811067ffffffffffffffff82111715611834576118346117fe565b60405250565b6060810181811067ffffffffffffffff82111715611834576118346117fe565b601f8201601f1916810167ffffffffffffffff81118282101715611880576118806117fe565b6040525050565b600067ffffffffffffffff8211156118a1576118a16117fe565b50601f01601f191660200190565b600060408083360312156118c257600080fd5b80516118cd81611814565b833567ffffffffffffffff808211156118e557600080fd5b9085019036601f8301126118f857600080fd5b813560208282111561190c5761190c6117fe565b8160051b865161191e8383018261185a565b9283528481018201928281013685111561193757600080fd5b83870192505b84831015611a0b578235868111156119555760008081fd5b8701606036829003601f190181131561196e5760008081fd5b8a516119798161183a565b8287013581528b8301358188015290820135908882111561199a5760008081fd5b9181019136603f8401126119b057600091508182fd5b8683013591506119bf82611887565b8c516119cb828261185a565b838152368e8587010111156119e257600091508182fd5b838e86018a830137600093810189019390935250808c019190915282525091830191830161193d565b50865250611a1a88820161173c565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611a5257611a52611a29565b500190565b600060208284031215611a6957600080fd5b81356113f881611727565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff8116811461174757600080fd5b60008060008060808587031215611ab457600080fd5b8451611abf81611727565b60208601519094509250611ad560408601611a8a565b9150606085015167ffffffffffffffff811115611af157600080fd5b8501601f81018713611b0257600080fd5b8051611b0d81611887565b604051611b1a828261185a565b828152896020848601011115611b2f57600080fd5b611b4083602083016020870161160a565b969995985093965050505050565b600060018201611b6057611b60611a29565b5060010190565b6020815260006113f86020830184611662565b8051801515811461174757600080fd5b600060608284031215611b9c57600080fd5b6040516060810181811067ffffffffffffffff82111715611bbf57611bbf6117fe565b60405282516001600160801b0381168114611bd957600080fd5b8152611be760208401611a8a565b6020820152611bf860408401611b7a565b60408201529392505050565b600082601f830112611c1557600080fd5b604051611c2181611814565b806040840185811115611c3357600080fd5b845b81811015611c4d578035835260209283019201611c35565b509195945050505050565b600082601f830112611c6957600080fd5b60405161014080820182811067ffffffffffffffff82111715611c8e57611c8e6117fe565b60405283018185821115611ca157600080fd5b845b82811015611c4d578035825260209182019101611ca3565b6000818303610240811215611ccf57600080fd5b60408051611cdc81611814565b61010080841215611cec57600080fd5b82519350611cf98461183a565b611d038787611c04565b845286605f870112611d1457600080fd5b8251611d1f81611814565b8060c0880189811115611d3157600080fd5b8589015b81811015611d5657611d478b82611c04565b83526020909201918601611d35565b50826020880152611d678a82611c04565b86880152505050838252611d7d87828801611c58565b60208301525095945050505050565b600060208284031215611d9e57600080fd5b5051919050565b600060208284031215611db757600080fd5b6113f882611b7a565b600060408284031215611dd257600080fd5b82601f830112611de157600080fd5b604051611ded81611814565b806040840185811115611dff57600080fd5b845b81811015611c4d578051835260209283019201611e01565b8060005b6002811015610a4d578151845260209384019390910190600101611e1d565b6102408101611e4b8287611e19565b60408083018660005b6002811015611e7b57611e68838351611e19565b9183019160209190910190600101611e54565b50505050611e8c60c0830185611e19565b61010082018360005b600a811015611eb4578151835260209283019290910190600101611e95565b50505095945050505050565b600060033d1115611ed95760046000803e5060005160e01c5b90565b600060443d1015611eea5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611f1a57505050505090565b8285019150815181811115611f325750505050505090565b843d8701016020828501011115611f4c5750505050505090565b611f5b6020828601018761185a565b509095945050505050565b6020815260006113f86020830184611636565b60008060233d1115611f95576020600460003e50506000516001905b9091565b600082611fb657634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220f1374674d2143dc1e1f8e0666c58769f2e4bc209220c094f513f5b717a358ad464736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns the actual attestations constructed from the user request", - "params": { - "proofData": "snark public input as well as snark proof", - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "availableRootsRegistryAddress": "Registry storing the available groups for this attester (e.g roots of registry merkle trees)", - "collectionIdFirst": "Id of the first collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last collection in which the attester is supposed to record", - "commitmentMapperAddress": "commitment mapper's public key registry", - "hydraS1VerifierAddress": "ZK Snark Hydra-S1 Verifier contract" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getAvailableRootsRegistry()": { - "details": "Getter of Roots Registry Contract" - }, - "getCommitmentMapperRegistry()": { - "details": "Getter of Commitment Mapper Registry contract" - }, - "getDestinationOfTicket(uint256)": { - "details": "Getter, returns the last attestation destination of a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getTicketData(uint256)": { - "details": "Getter, returns the data linked to a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getVerifier()": { - "details": "Getter of Hydra-S1 Verifier contract" - }, - "isTicketOnCooldown(uint256)": { - "details": "returns whether a ticket is on cooldown or not", - "params": { - "userTicket": "ticket used*" - } - } - }, - "stateVariables": { - "AUTHORIZED_COLLECTION_ID_FIRST": { - "details": "Getter returns of the first collection in which the attester is supposed to record*" - }, - "AUTHORIZED_COLLECTION_ID_LAST": { - "details": "Getter returns of the last collection in which the attester is supposed to record*" - }, - "SOULBOUND_COOLDOWN_DURATION": { - "details": "Getter returns of the duration of the cooldown period after having used a ticket*" - } - }, - "title": "Hydra-S1 Soulbound Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - SoulBound (with cooldown period) A user can chose to delete attestations or generate attestation to a new destination. When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional User will need to wait until the end of the cooldown period before being able to delete or switch destination again One can however know that the former and the new destinations were created using the same userTicket - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 936, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 939, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 7701, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "_userTicketsData", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_struct(TicketData)7128_storage)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_struct(TicketData)7128_storage)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => struct IHydraS1SoulboundAttester.TicketData)", - "numberOfBytes": "32", - "value": "t_struct(TicketData)7128_storage" - }, - "t_struct(TicketData)7128_storage": { - "encoding": "inplace", - "label": "struct IHydraS1SoulboundAttester.TicketData", - "members": [ - { - "astId": 7125, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "destination", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 7127, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "cooldownStart", - "offset": 20, - "slot": "0", - "type": "t_uint32" - } - ], - "numberOfBytes": "32" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/HydraS1SoulboundAttesterProxy.json b/deployments/goerli/HydraS1SoulboundAttesterProxy.json deleted file mode 100644 index 0577614..0000000 --- a/deployments/goerli/HydraS1SoulboundAttesterProxy.json +++ /dev/null @@ -1,235 +0,0 @@ -{ - "address": "0x12e69A9b08709324d64c5AEaF4169b03B6199c6C", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0xb52877608cf50001aa27a8b343b44ba978995db8a0f65b06c4e0c781820cbe1c", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x12e69A9b08709324d64c5AEaF4169b03B6199c6C", - "transactionIndex": 13, - "gasUsed": "583384", - "logsBloom": "0x00000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000080000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000200000000000000000008000000001020000000000000000001000000000000000400000000000000000000000000100000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x39230dfbf6a3d9bfa9252d4ce7b2060cb369b856b25b934615166788a299c1d9", - "transactionHash": "0xb52877608cf50001aa27a8b343b44ba978995db8a0f65b06c4e0c781820cbe1c", - "logs": [ - { - "transactionIndex": 13, - "blockNumber": 7711097, - "transactionHash": "0xb52877608cf50001aa27a8b343b44ba978995db8a0f65b06c4e0c781820cbe1c", - "address": "0x12e69A9b08709324d64c5AEaF4169b03B6199c6C", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000bd11cd5c77222dd51b270880f6a4148a8e5a6cb0" - ], - "data": "0x", - "logIndex": 44, - "blockHash": "0x39230dfbf6a3d9bfa9252d4ce7b2060cb369b856b25b934615166788a299c1d9" - }, - { - "transactionIndex": 13, - "blockNumber": 7711097, - "transactionHash": "0xb52877608cf50001aa27a8b343b44ba978995db8a0f65b06c4e0c781820cbe1c", - "address": "0x12e69A9b08709324d64c5AEaF4169b03B6199c6C", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000246e71bc2a257f4be9c7fad4664e6d7444844adc", - "logIndex": 45, - "blockHash": "0x39230dfbf6a3d9bfa9252d4ce7b2060cb369b856b25b934615166788a299c1d9" - } - ], - "blockNumber": 7711097, - "cumulativeGasUsed": "5491531", - "status": 1, - "byzantium": true - }, - "args": [ - "0xbd11CD5C77222DD51B270880F6A4148a8e5A6cB0", - "0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc", - "0x" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/goerli/HydraS1Verifier.json b/deployments/goerli/HydraS1Verifier.json deleted file mode 100644 index c31ed6f..0000000 --- a/deployments/goerli/HydraS1Verifier.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "address": "0xe1bFE993cF8dB9a3214Cc77fD68194Ac534078b4", - "abi": [ - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "a", - "type": "uint256[2]" - }, - { - "internalType": "uint256[2][2]", - "name": "b", - "type": "uint256[2][2]" - }, - { - "internalType": "uint256[2]", - "name": "c", - "type": "uint256[2]" - }, - { - "internalType": "uint256[10]", - "name": "input", - "type": "uint256[10]" - } - ], - "name": "verifyProof", - "outputs": [ - { - "internalType": "bool", - "name": "r", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x346327c1bc6bfa1eacd4c0cddf85c0fdb438cd563bcdf71132c92804ae713d32", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0xe1bFE993cF8dB9a3214Cc77fD68194Ac534078b4", - "transactionIndex": 108, - "gasUsed": "1247435", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x1470fa78a71042a8e114947a072f13e12ba7b44921fb9eff6654e7ffd493fd2f", - "transactionHash": "0x346327c1bc6bfa1eacd4c0cddf85c0fdb438cd563bcdf71132c92804ae713d32", - "logs": [], - "blockNumber": 8080204, - "cumulativeGasUsed": "28798058", - "status": 1, - "byzantium": true - }, - "args": [], - "numDeployments": 3, - "solcInputHash": "24c70469fd559e01f6ff2a10472da9a6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"a\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2][2]\",\"name\":\"b\",\"type\":\"uint256[2][2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"c\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[10]\",\"name\":\"input\",\"type\":\"uint256[10]\"}],\"name\":\"verifyProof\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"r\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"verifyProof(uint256[2],uint256[2][2],uint256[2],uint256[10])\":{\"returns\":{\"r\":\" bool true if proof is valid\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":\"HydraS1Verifier\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [8609986746108439658545470593166889256314951959466775818870246174320018498804,\\n 6848251127850009101372611262053374737897586140140607384018397707035108265914],\\n [21367916863936594568281095443965096905143705300114190558130516981138584550504,\\n 13327705762185115653848159709412003423932761899188342359583872691135383932883]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 19965766170734310004645394427613286415565755728797065894668054116047682895204,\\n 6952067612339183672227137101423582097916038093373585908267153974352032944482\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 13987716160490730015463796942940452666334097189904948795214986996497499925899,\\n 5336810094802209074340875836312868429276540870324469349093948627126061524544\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 14931593253473978964215343699995811275378324235306358485461293343370969283966,\\n 564306919152089917957316877787764763278299990971316475606280877961553231205\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11591267743733991434114686002448165336885445656808796470854638278338319268343,\\n 11495219763417990955889652410266075210402006084183208750635660647824890013350\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 8183184532870222270700473518157259944911700429689031755853536692005688965081,\\n 9121077094104828462137861111631978599019724423614716723152060153405564278301\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 4314095526093128699362232919686741372014146055311239687202926853002748112330,\\n 11665330391505820654128458332883010598817535082070674418723503440883598640597\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 18925967077785550270509493111690046951994174908254476036944536825999614778001,\\n 4990629719417206796668074534812314525340851981015724652256935997545282642849\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x120f0b311a61cabc9d42ef740c19e5f20b4c8ba400d9a6378e33c76dd54f5c42\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b50611597806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f3bb70f614610030575b600080fd5b61004361003e3660046113ce565b610057565b604051901515815260200160405180910390f35b60006100616111e1565b604080518082018252875181526020808901518183015290835281516080810183528751518184019081528851830151606083015281528251808401845288830180515182525183015181840152818301528382015281518083018352865181528682015181830152838301528151600a8082526101608201909352600092909182016101408036833701905050905060005b600a811015610143578481600a811061010f5761010f6114ac565b6020020151828281518110610126576101266114ac565b60209081029190910101528061013b816114d8565b9150506100f4565b5061014e818361016f565b60000361016057600192505050610167565b6000925050505b949350505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018161019b610366565b9050806080015151855160016101b191906114f1565b146101f85760405162461bcd60e51b81526020600482015260126024820152711d995c9a599a595c8b5898590b5a5b9c1d5d60721b60448201526064015b60405180910390fd5b604080518082019091526000808252602082018190525b86518110156102e9578387828151811061022b5761022b6114ac565b6020026020010151106102805760405162461bcd60e51b815260206004820152601f60248201527f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c640060448201526064016101ef565b6102d5826102d0856080015184600161029991906114f1565b815181106102a9576102a96114ac565b60200260200101518a85815181106102c3576102c36114ac565b6020026020010151610b30565b610bc6565b9150806102e1816114d8565b91505061020f565b50610312818360800151600081518110610305576103056114ac565b6020026020010151610bc6565b90506103486103248660000151610c5f565b8660200151846000015185602001518587604001518b604001518960600151610cfe565b6103585760019350505050610360565b600093505050505b92915050565b61036e611232565b6040805180820182527f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e281527f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d19266020808301919091529083528151608080820184527f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c8285019081527f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab606080850191909152908352845180860186527f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a781527f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec8818601528385015285840192909252835180820185527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28186019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed828501528152845180860186527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa818601528185015285850152835190810184527f1309146df5c443e5db6a7a6e809d782667e59deebf9e8a8e6e622196119ea4f48185019081527f0f23f9080c79c8259f4b3d2442e88c6c1f5a3721f82c1bd3cf33912f4c554fba828401528152835180850185527f2f3dcff69745f046c2bfa13f9c4c81083c41a209f287fa0afb44391b5070bc6881527f1d7736d1e061cab0da0b28c319361de25abd329672d1bec1e29f6fdc604d0fd38185015281840152908401528151600b8082526101808201909352919082015b60408051808201909152600080825260208201528152602001906001900390816105ea57505060808201908152604080518082019091527f2c243922d634f38b0cfa04897932397d47699289aed9b414760d4e729b797d6481527f0f5ebb177a11bce83029d6c7ca0aa97d4f6085fc0fffbc63127ba724e33dd16260208201529051805160009061067d5761067d6114ac565b602002602001018190525060405180604001604052807f084d1b300a1ecc4c0d892345551e790b2d49fe22a1b71fbcd94d0be8931871bb81526020017f24861196b6282d728048cae2ec60fbc8496829a8dfbb4273f731b2b726b0f62881525081608001516001815181106106f4576106f46114ac565b602002602001018190525060405180604001604052807f209369983ced02fe1bdfed53e6c88a12bd3efd860515daa6a398aa73bbb09c7181526020017f28e41e5609c0e714afa30a906663b8ee61baecd274f9d30fd36f9c426ff9e593815250816080015160028151811061076b5761076b6114ac565b602002602001018190525060405180604001604052807f1eecc44c2a661c3f66ae217ec542b70f38b6313e8be081e2a8f95f64c881ad8b81526020017f0bcc87084972fb8309ff46ca4afa1b2934755fb38cff3bdf374c4ab7bda6664081525081608001516003815181106107e2576107e26114ac565b602002602001018190525060405180604001604052807f2102fb775a7dfc364bf6a014da09f86e9144e3239534ab25d3bbd48e4a0afd7e81526020017f013f62eaf435acc457bd2a3d8315dab277c802f0bda44517845768371935bd658152508160800151600481518110610859576108596114ac565b602002602001018190525060405180604001604052807f19a06cd017ddcf6192f42073758c82a6eda2adc572c9be2901c15d6e54b0b9f781526020017f196a10567feeb5a9a1903009034de556585c8ea06b30a73e9b4e88da620026a681525081608001516005815181106108d0576108d06114ac565b602002602001018190525060405180604001604052807f121784b003ec4655b1f312d2011a2117a113d4051e94ce94db805d3d99f5f7d981526020017f142a58c0955ecd67ea19afbcbd0347632d515e9979fcb7d6818de26dbff0561d8152508160800151600681518110610947576109476114ac565b602002602001018190525060405180604001604052807f0989b10899b251f5f04f11415d3d4521b5153f7f4a6d4ac9891d95669f162dca81526020017f19ca57d06136d58c9da48f9bb1aa31eea7d60b19dccdd80b224dd9900afa45d581525081608001516007815181106109be576109be6114ac565b602002602001018190525060405180604001604052807f2b567a1e26a932fa728a650315371e9f9df455a5b0c1c0886bd80d6060a9908981526020017e66798780cd5512ad9f5a2373f1fb64535a8e3c4ad8c33ddc8bd18fc441116a8152508160800151600881518110610a3457610a346114ac565b602002602001018190525060405180604001604052807f29d7b7beed21dea04e4e86841f7ecae70b9af771dd1a05fd97c28240207b9a9181526020017f0b0898a882ba7215368d58cb476b23aa95278245216c92c1823fd2ab7cb5a3a18152508160800151600981518110610aab57610aab6114ac565b602002602001018190525060405180604001604052807f102f5e9ec24f58ddf1d39e018b5367ef9ea173301e98cdd899627bd14762ee6981526020017f068105d1e3d4238ec4274b68a5177670d700a905e46fd5c6779ef83d6916c4f18152508160800151600a81518110610b2257610b226114ac565b602002602001018190525090565b6040805180820190915260008082526020820152610b4c611283565b835181526020808501519082015260408101839052600060608360808460076107d05a03fa90508080610b7b57fe5b5080610bbe5760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5b5d5b0b59985a5b195960721b60448201526064016101ef565b505092915050565b6040805180820190915260008082526020820152610be26112a1565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa90508080610c1c57fe5b5080610bbe5760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5859190b59985a5b195960721b60448201526064016101ef565b604080518082019091526000808252602082015281517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4790158015610ca657506020830151155b15610cc65750506040805180820190915260008082526020820152919050565b604051806040016040528084600001518152602001828560200151610ceb9190611509565b610cf5908461152b565b90529392505050565b60408051600480825260a08201909252600091829190816020015b6040805180820190915260008082526020820152815260200190600190039081610d1957505060408051600480825260a0820190925291925060009190602082015b610d636112bf565b815260200190600190039081610d5b5790505090508a82600081518110610d8c57610d8c6114ac565b60200260200101819052508882600181518110610dab57610dab6114ac565b60200260200101819052508682600281518110610dca57610dca6114ac565b60200260200101819052508482600381518110610de957610de96114ac565b60200260200101819052508981600081518110610e0857610e086114ac565b60200260200101819052508781600181518110610e2757610e276114ac565b60200260200101819052508581600281518110610e4657610e466114ac565b60200260200101819052508381600381518110610e6557610e656114ac565b6020026020010181905250610e7a8282610e89565b9b9a5050505050505050505050565b60008151835114610ed55760405162461bcd60e51b81526020600482015260166024820152751c185a5c9a5b99cb5b195b99dd1a1ccb59985a5b195960521b60448201526064016101ef565b82516000610ee4826006611542565b905060008167ffffffffffffffff811115610f0157610f0161131b565b604051908082528060200260200182016040528015610f2a578160200160208202803683370190505b50905060005b8381101561116557868181518110610f4a57610f4a6114ac565b60200260200101516000015182826006610f649190611542565b610f6f9060006114f1565b81518110610f7f57610f7f6114ac565b602002602001018181525050868181518110610f9d57610f9d6114ac565b60200260200101516020015182826006610fb79190611542565b610fc29060016114f1565b81518110610fd257610fd26114ac565b602002602001018181525050858181518110610ff057610ff06114ac565b6020908102919091010151515182611009836006611542565b6110149060026114f1565b81518110611024576110246114ac565b602002602001018181525050858181518110611042576110426114ac565b6020908102919091018101515101518261105d836006611542565b6110689060036114f1565b81518110611078576110786114ac565b602002602001018181525050858181518110611096576110966114ac565b6020026020010151602001516000600281106110b4576110b46114ac565b6020020151826110c5836006611542565b6110d09060046114f1565b815181106110e0576110e06114ac565b6020026020010181815250508581815181106110fe576110fe6114ac565b60200260200101516020015160016002811061111c5761111c6114ac565b60200201518261112d836006611542565b6111389060056114f1565b81518110611148576111486114ac565b60209081029190910101528061115d816114d8565b915050610f30565b5061116e6112df565b6000602082602086026020860160086107d05a03fa9050808061118d57fe5b50806111d35760405162461bcd60e51b81526020600482015260156024820152741c185a5c9a5b99cb5bdc18dbd9194b59985a5b1959605a1b60448201526064016101ef565b505115159695505050505050565b6040805160a08101909152600060608201818152608083019190915281526020810161120b6112bf565b815260200161122d604051806040016040528060008152602001600081525090565b905290565b6040805160e08101909152600060a0820181815260c083019190915281526020810161125c6112bf565b81526020016112696112bf565b81526020016112766112bf565b8152602001606081525090565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b60405180604001604052806112d26112fd565b815260200161122d6112fd565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156113545761135461131b565b60405290565b604051610140810167ffffffffffffffff811182821017156113545761135461131b565b600082601f83011261138f57600080fd5b611397611331565b8060408401858111156113a957600080fd5b845b818110156113c35780358452602093840193016113ab565b509095945050505050565b6000806000806102408086880312156113e657600080fd5b6113f0878761137e565b9450604087605f88011261140357600080fd5b61140b611331565b8060c089018a81111561141d57600080fd5b838a015b81811015611442576114338c8261137e565b84526020909301928401611421565b508197506114508b8261137e565b9650505050508661011f87011261146657600080fd5b61146e61135a565b90860190808883111561148057600080fd5b61010088015b8381101561149e578035835260209283019201611486565b509598949750929550505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016114ea576114ea6114c2565b5060010190565b60008219821115611504576115046114c2565b500190565b60008261152657634e487b7160e01b600052601260045260246000fd5b500690565b60008282101561153d5761153d6114c2565b500390565b600081600019048311821515161561155c5761155c6114c2565b50029056fea264697066735822122032bcacece0452dcb73e92b9569837e33c48751c237fdb79a212c6dfad1fb31b364736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f3bb70f614610030575b600080fd5b61004361003e3660046113ce565b610057565b604051901515815260200160405180910390f35b60006100616111e1565b604080518082018252875181526020808901518183015290835281516080810183528751518184019081528851830151606083015281528251808401845288830180515182525183015181840152818301528382015281518083018352865181528682015181830152838301528151600a8082526101608201909352600092909182016101408036833701905050905060005b600a811015610143578481600a811061010f5761010f6114ac565b6020020151828281518110610126576101266114ac565b60209081029190910101528061013b816114d8565b9150506100f4565b5061014e818361016f565b60000361016057600192505050610167565b6000925050505b949350505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018161019b610366565b9050806080015151855160016101b191906114f1565b146101f85760405162461bcd60e51b81526020600482015260126024820152711d995c9a599a595c8b5898590b5a5b9c1d5d60721b60448201526064015b60405180910390fd5b604080518082019091526000808252602082018190525b86518110156102e9578387828151811061022b5761022b6114ac565b6020026020010151106102805760405162461bcd60e51b815260206004820152601f60248201527f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c640060448201526064016101ef565b6102d5826102d0856080015184600161029991906114f1565b815181106102a9576102a96114ac565b60200260200101518a85815181106102c3576102c36114ac565b6020026020010151610b30565b610bc6565b9150806102e1816114d8565b91505061020f565b50610312818360800151600081518110610305576103056114ac565b6020026020010151610bc6565b90506103486103248660000151610c5f565b8660200151846000015185602001518587604001518b604001518960600151610cfe565b6103585760019350505050610360565b600093505050505b92915050565b61036e611232565b6040805180820182527f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e281527f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d19266020808301919091529083528151608080820184527f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c8285019081527f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab606080850191909152908352845180860186527f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a781527f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec8818601528385015285840192909252835180820185527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28186019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed828501528152845180860186527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa818601528185015285850152835190810184527f1309146df5c443e5db6a7a6e809d782667e59deebf9e8a8e6e622196119ea4f48185019081527f0f23f9080c79c8259f4b3d2442e88c6c1f5a3721f82c1bd3cf33912f4c554fba828401528152835180850185527f2f3dcff69745f046c2bfa13f9c4c81083c41a209f287fa0afb44391b5070bc6881527f1d7736d1e061cab0da0b28c319361de25abd329672d1bec1e29f6fdc604d0fd38185015281840152908401528151600b8082526101808201909352919082015b60408051808201909152600080825260208201528152602001906001900390816105ea57505060808201908152604080518082019091527f2c243922d634f38b0cfa04897932397d47699289aed9b414760d4e729b797d6481527f0f5ebb177a11bce83029d6c7ca0aa97d4f6085fc0fffbc63127ba724e33dd16260208201529051805160009061067d5761067d6114ac565b602002602001018190525060405180604001604052807f084d1b300a1ecc4c0d892345551e790b2d49fe22a1b71fbcd94d0be8931871bb81526020017f24861196b6282d728048cae2ec60fbc8496829a8dfbb4273f731b2b726b0f62881525081608001516001815181106106f4576106f46114ac565b602002602001018190525060405180604001604052807f209369983ced02fe1bdfed53e6c88a12bd3efd860515daa6a398aa73bbb09c7181526020017f28e41e5609c0e714afa30a906663b8ee61baecd274f9d30fd36f9c426ff9e593815250816080015160028151811061076b5761076b6114ac565b602002602001018190525060405180604001604052807f1eecc44c2a661c3f66ae217ec542b70f38b6313e8be081e2a8f95f64c881ad8b81526020017f0bcc87084972fb8309ff46ca4afa1b2934755fb38cff3bdf374c4ab7bda6664081525081608001516003815181106107e2576107e26114ac565b602002602001018190525060405180604001604052807f2102fb775a7dfc364bf6a014da09f86e9144e3239534ab25d3bbd48e4a0afd7e81526020017f013f62eaf435acc457bd2a3d8315dab277c802f0bda44517845768371935bd658152508160800151600481518110610859576108596114ac565b602002602001018190525060405180604001604052807f19a06cd017ddcf6192f42073758c82a6eda2adc572c9be2901c15d6e54b0b9f781526020017f196a10567feeb5a9a1903009034de556585c8ea06b30a73e9b4e88da620026a681525081608001516005815181106108d0576108d06114ac565b602002602001018190525060405180604001604052807f121784b003ec4655b1f312d2011a2117a113d4051e94ce94db805d3d99f5f7d981526020017f142a58c0955ecd67ea19afbcbd0347632d515e9979fcb7d6818de26dbff0561d8152508160800151600681518110610947576109476114ac565b602002602001018190525060405180604001604052807f0989b10899b251f5f04f11415d3d4521b5153f7f4a6d4ac9891d95669f162dca81526020017f19ca57d06136d58c9da48f9bb1aa31eea7d60b19dccdd80b224dd9900afa45d581525081608001516007815181106109be576109be6114ac565b602002602001018190525060405180604001604052807f2b567a1e26a932fa728a650315371e9f9df455a5b0c1c0886bd80d6060a9908981526020017e66798780cd5512ad9f5a2373f1fb64535a8e3c4ad8c33ddc8bd18fc441116a8152508160800151600881518110610a3457610a346114ac565b602002602001018190525060405180604001604052807f29d7b7beed21dea04e4e86841f7ecae70b9af771dd1a05fd97c28240207b9a9181526020017f0b0898a882ba7215368d58cb476b23aa95278245216c92c1823fd2ab7cb5a3a18152508160800151600981518110610aab57610aab6114ac565b602002602001018190525060405180604001604052807f102f5e9ec24f58ddf1d39e018b5367ef9ea173301e98cdd899627bd14762ee6981526020017f068105d1e3d4238ec4274b68a5177670d700a905e46fd5c6779ef83d6916c4f18152508160800151600a81518110610b2257610b226114ac565b602002602001018190525090565b6040805180820190915260008082526020820152610b4c611283565b835181526020808501519082015260408101839052600060608360808460076107d05a03fa90508080610b7b57fe5b5080610bbe5760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5b5d5b0b59985a5b195960721b60448201526064016101ef565b505092915050565b6040805180820190915260008082526020820152610be26112a1565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa90508080610c1c57fe5b5080610bbe5760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5859190b59985a5b195960721b60448201526064016101ef565b604080518082019091526000808252602082015281517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4790158015610ca657506020830151155b15610cc65750506040805180820190915260008082526020820152919050565b604051806040016040528084600001518152602001828560200151610ceb9190611509565b610cf5908461152b565b90529392505050565b60408051600480825260a08201909252600091829190816020015b6040805180820190915260008082526020820152815260200190600190039081610d1957505060408051600480825260a0820190925291925060009190602082015b610d636112bf565b815260200190600190039081610d5b5790505090508a82600081518110610d8c57610d8c6114ac565b60200260200101819052508882600181518110610dab57610dab6114ac565b60200260200101819052508682600281518110610dca57610dca6114ac565b60200260200101819052508482600381518110610de957610de96114ac565b60200260200101819052508981600081518110610e0857610e086114ac565b60200260200101819052508781600181518110610e2757610e276114ac565b60200260200101819052508581600281518110610e4657610e466114ac565b60200260200101819052508381600381518110610e6557610e656114ac565b6020026020010181905250610e7a8282610e89565b9b9a5050505050505050505050565b60008151835114610ed55760405162461bcd60e51b81526020600482015260166024820152751c185a5c9a5b99cb5b195b99dd1a1ccb59985a5b195960521b60448201526064016101ef565b82516000610ee4826006611542565b905060008167ffffffffffffffff811115610f0157610f0161131b565b604051908082528060200260200182016040528015610f2a578160200160208202803683370190505b50905060005b8381101561116557868181518110610f4a57610f4a6114ac565b60200260200101516000015182826006610f649190611542565b610f6f9060006114f1565b81518110610f7f57610f7f6114ac565b602002602001018181525050868181518110610f9d57610f9d6114ac565b60200260200101516020015182826006610fb79190611542565b610fc29060016114f1565b81518110610fd257610fd26114ac565b602002602001018181525050858181518110610ff057610ff06114ac565b6020908102919091010151515182611009836006611542565b6110149060026114f1565b81518110611024576110246114ac565b602002602001018181525050858181518110611042576110426114ac565b6020908102919091018101515101518261105d836006611542565b6110689060036114f1565b81518110611078576110786114ac565b602002602001018181525050858181518110611096576110966114ac565b6020026020010151602001516000600281106110b4576110b46114ac565b6020020151826110c5836006611542565b6110d09060046114f1565b815181106110e0576110e06114ac565b6020026020010181815250508581815181106110fe576110fe6114ac565b60200260200101516020015160016002811061111c5761111c6114ac565b60200201518261112d836006611542565b6111389060056114f1565b81518110611148576111486114ac565b60209081029190910101528061115d816114d8565b915050610f30565b5061116e6112df565b6000602082602086026020860160086107d05a03fa9050808061118d57fe5b50806111d35760405162461bcd60e51b81526020600482015260156024820152741c185a5c9a5b99cb5bdc18dbd9194b59985a5b1959605a1b60448201526064016101ef565b505115159695505050505050565b6040805160a08101909152600060608201818152608083019190915281526020810161120b6112bf565b815260200161122d604051806040016040528060008152602001600081525090565b905290565b6040805160e08101909152600060a0820181815260c083019190915281526020810161125c6112bf565b81526020016112696112bf565b81526020016112766112bf565b8152602001606081525090565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b60405180604001604052806112d26112fd565b815260200161122d6112fd565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156113545761135461131b565b60405290565b604051610140810167ffffffffffffffff811182821017156113545761135461131b565b600082601f83011261138f57600080fd5b611397611331565b8060408401858111156113a957600080fd5b845b818110156113c35780358452602093840193016113ab565b509095945050505050565b6000806000806102408086880312156113e657600080fd5b6113f0878761137e565b9450604087605f88011261140357600080fd5b61140b611331565b8060c089018a81111561141d57600080fd5b838a015b81811015611442576114338c8261137e565b84526020909301928401611421565b508197506114508b8261137e565b9650505050508661011f87011261146657600080fd5b61146e61135a565b90860190808883111561148057600080fd5b61010088015b8381101561149e578035835260209283019201611486565b509598949750929550505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016114ea576114ea6114c2565b5060010190565b60008219821115611504576115046114c2565b500190565b60008261152657634e487b7160e01b600052601260045260246000fd5b500690565b60008282101561153d5761153d6114c2565b500390565b600081600019048311821515161561155c5761155c6114c2565b50029056fea264697066735822122032bcacece0452dcb73e92b9569837e33c48751c237fdb79a212c6dfad1fb31b364736f6c634300080e0033", - "devdoc": { - "kind": "dev", - "methods": { - "verifyProof(uint256[2],uint256[2][2],uint256[2],uint256[10])": { - "returns": { - "r": " bool true if proof is valid" - } - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/goerli/Pythia1SimpleAttester.json b/deployments/goerli/Pythia1SimpleAttester.json deleted file mode 100644 index f8ffc21..0000000 --- a/deployments/goerli/Pythia1SimpleAttester.json +++ /dev/null @@ -1,1041 +0,0 @@ -{ - "address": "0x8E44f33Df343EA6f85380226BE5Fbf93db09168E", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - }, - { - "internalType": "address", - "name": "pythia1VerifierAddress", - "type": "address" - }, - { - "internalType": "uint256[2]", - "name": "commitmentSignerPubKey", - "type": "uint256[2]" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentSignerPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "GroupIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedTicketIdentifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ticketIdentifier", - "type": "uint256" - } - ], - "name": "TicketIdentifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "TicketUsed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "inputdestination", - "type": "address" - } - ], - "name": "UserShouldOwnItsDestination", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256[2]", - "name": "newCommitmentSignerPubKey", - "type": "uint256[2]" - } - ], - "name": "CommitmentSignerPubKeyUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "TicketDestinationUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentSignerPubKey", - "outputs": [ - { - "internalType": "uint256[2]", - "name": "", - "type": "uint256[2]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getDestinationOfTicket", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract Pythia1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "commitmentSignerPubKey", - "type": "uint256[2]" - }, - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "commitmentSignerPubKey", - "type": "uint256[2]" - } - ], - "name": "updateCommitmentSignerPubKey", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x1f014e056e7143e642fc7d2fa54da4bf937a648afa2251116e9bd6775dbb2870", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x9B66eE70776cd92d1d379F96A6c7b180D8C638b1", - "transactionIndex": 66, - "gasUsed": "1945946", - "logsBloom": "0x00000000000200000000000000020000000000000000000000800000000000000000000000000000000000000200000000000000000040000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000420000000000000000000800002000000000002000000000000000400000000000000000000000000000000000000000000080000000000000000000000000000000000000200000800400000000000000000000000000000000000000000000000000000000000000040000000000000000400000000000000020000000000000000000000000000000000000000200000000000000008000000000", - "blockHash": "0x924c59d3ef7328340a5f8821e8aebcc3cbc2c5b9f533cd66449d009db62c4ba6", - "transactionHash": "0x1f014e056e7143e642fc7d2fa54da4bf937a648afa2251116e9bd6775dbb2870", - "logs": [ - { - "transactionIndex": 66, - "blockNumber": 8080317, - "transactionHash": "0x1f014e056e7143e642fc7d2fa54da4bf937a648afa2251116e9bd6775dbb2870", - "address": "0x9B66eE70776cd92d1d379F96A6c7b180D8C638b1", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "data": "0x", - "logIndex": 131, - "blockHash": "0x924c59d3ef7328340a5f8821e8aebcc3cbc2c5b9f533cd66449d009db62c4ba6" - }, - { - "transactionIndex": 66, - "blockNumber": 8080317, - "transactionHash": "0x1f014e056e7143e642fc7d2fa54da4bf937a648afa2251116e9bd6775dbb2870", - "address": "0x9B66eE70776cd92d1d379F96A6c7b180D8C638b1", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954" - ], - "data": "0x", - "logIndex": 132, - "blockHash": "0x924c59d3ef7328340a5f8821e8aebcc3cbc2c5b9f533cd66449d009db62c4ba6" - }, - { - "transactionIndex": 66, - "blockNumber": 8080317, - "transactionHash": "0x1f014e056e7143e642fc7d2fa54da4bf937a648afa2251116e9bd6775dbb2870", - "address": "0x9B66eE70776cd92d1d379F96A6c7b180D8C638b1", - "topics": [ - "0xda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df" - ], - "data": "0x038d3d596875c66eb90608bbe04e4e238607fd32ad61f4278bdaf47aadc28d601b46b55a0ce3f35d6025cdd4554aaac1fc7180b14d51b0f15aa51a6929bdb952", - "logIndex": 133, - "blockHash": "0x924c59d3ef7328340a5f8821e8aebcc3cbc2c5b9f533cd66449d009db62c4ba6" - }, - { - "transactionIndex": 66, - "blockNumber": 8080317, - "transactionHash": "0x1f014e056e7143e642fc7d2fa54da4bf937a648afa2251116e9bd6775dbb2870", - "address": "0x9B66eE70776cd92d1d379F96A6c7b180D8C638b1", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 134, - "blockHash": "0x924c59d3ef7328340a5f8821e8aebcc3cbc2c5b9f533cd66449d009db62c4ba6" - } - ], - "blockNumber": 8080317, - "cumulativeGasUsed": "23362863", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf85BA0afA375495eE625910Db61b6b1406756234", - "30000001", - "30000100", - "0xEE077AD7a47e56F075f0C3bd41Cdc1629FdA3a9c", - [ - "0x038d3d596875c66eb90608bbe04e4e238607fd32ad61f4278bdaf47aadc28d60", - "0x1b46b55a0ce3f35d6025cdd4554aaac1fc7180b14d51b0f15aa51a6929bdb952" - ], - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954" - ], - "numDeployments": 3, - "solcInputHash": "24c70469fd559e01f6ff2a10472da9a6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"pythia1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentSignerPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"GroupIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"TicketUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputdestination\",\"type\":\"address\"}],\"name\":\"UserShouldOwnItsDestination\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256[2]\",\"name\":\"newCommitmentSignerPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"CommitmentSignerPubKeyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentSignerPubKey\",\"outputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"\",\"type\":\"uint256[2]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract Pythia1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"updateCommitmentSignerPubKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns attestations that will be recorded, constructed from the user request\",\"params\":{\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentSignerPubKey\":\"The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\",\"owner\":\"The owner of the contract that can update the commitment signer pub key\",\"pythia1VerifierAddress\":\"ZK Snark Pythia-1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getCommitmentSignerPubKey()\":{\"details\":\"Getter of the Commitment signer Eddsa Public key\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Pythia-1 Verifier contract\"},\"initialize(uint256[2],address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"commitmentSignerPubKey\":\"EdDSA public key of the commitment signer\",\"ownerAddress\":\"Owner of the contract, can update public key and address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"}},\"title\":\"Pythia-1 Simple Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(uint256[2],address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"This attester is part of the family of the Pythia-1 Attesters. Pythia-1 attesters enable users to prove they have a claim and its proof issued by an offchain service in a privacy preserving way. That means no-one can make the link between the account used in the offchain service and the onchain account where the attestation is stored. The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic. We invite readers to refer to: - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each users gets one userTicket per claim For people used to semaphore/ tornado cash people: userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/pythia-1/Pythia1SimpleAttester.sol\":\"Pythia1SimpleAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/pythia-1/contracts/Pythia1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract Pythia1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\\n );\\n vk.IC = new Pairing.G1Point[](10);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 104028078850975554065172701281783302003220555203883119831575537681421753151,\\n 19148240629904598794948591359118971959790791697910953160820265703277306346\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[9] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3babb956e64535b9bf535df94288b4d83ea82c54727f79ee8949fe4a19c1d5ba\",\"license\":\"GPL-3.0\"},\"contracts/attesters/pythia-1/Pythia1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to Pythia1 Proving Scheme\\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\\n\\n/**\\n * @title Pythia-1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Pythia-1 Attesters.\\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \\n * offchain service in a privacy preserving way. \\n * That means no-one can make the link between the account used in the offchain service\\n * and the onchain account where the attestation is stored.\\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\\n * We invite readers to refer to:\\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each users gets one userTicket per claim\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n **/\\n\\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\\n using Pythia1Lib for Pythia1ProofData;\\n using Pythia1Lib for bytes;\\n using Pythia1Lib for Request;\\n\\n uint8 public constant IMPLEMENTATION_VERSION = 3;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n uint256[2] internal _commitmentSignerPubKey;\\n mapping(uint256 => address) internal _ticketsDestinations;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\\n * @param owner The owner of the contract that can update the commitment signer pub key\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n address pythia1VerifierAddress,\\n uint256[2] memory commitmentSignerPubKey,\\n address owner\\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n initialize(commitmentSignerPubKey, owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n uint256[2] memory commitmentSignerPubKey,\\n address ownerAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\\n }\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into Pythia1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\\n Pythia1ProofInput memory snarkInput = snarkProof._input();\\n Pythia1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata\\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\\n Pythia1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.internalCollectionId;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n uint32(block.timestamp),\\n ''\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used\\n * @param request users request. Claim of beiing part of a group.\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n // we get the ticket used from the snark input in the data provided\\n uint256 userTicket = proofData._getTicket();\\n address currentDestination = _getDestinationOfTicket(userTicket);\\n\\n if (currentDestination != address(0)) {\\n revert TicketUsed(userTicket);\\n }\\n\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n /*******************************************************\\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\\n * users bring secretHash as private input in snark which guarantees privacy\\n * the secretHash is only known by the user and never escape the user's browser\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(\\n Pythia1Claim memory claim\\n ) internal view override returns (uint256) {\\n uint256 ticketIdentifier = _encodeInSnarkField(\\n address(this),\\n claim.groupProperties.internalCollectionId\\n );\\n return ticketIdentifier;\\n }\\n\\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\\n return _commitmentSignerPubKey;\\n }\\n\\n /*******************************************************\\n Pythia-1 Attester Specific Functions\\n *******************************************************/\\n\\n function updateCommitmentSignerPubKey(\\n uint256[2] memory commitmentSignerPubKey\\n ) external onlyOwner {\\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\\n }\\n\\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\\n _commitmentSignerPubKey = commitmentSignerPubKey;\\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\\n }\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _ticketsDestinations[userTicket] = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _ticketsDestinations[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x22a505a2f8a3246ad46cf6fdd5eeab1a58b7fcb08982d03ff742f48aec063b82\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/base/IPythia1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\\n\\ninterface IPythia1Base {\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error UserShouldOwnItsDestination(address sender, address inputdestination);\\n error CommitmentSignerPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Pythia-1 Verifier contract\\n */\\n function getVerifier() external view returns (Pythia1Verifier);\\n\\n /**\\n * @dev Getter of the Commitment Signer EdDSA Public Key\\n */\\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\\n}\\n\",\"keccak256\":\"0x61924d768ab0c8cd61d0ff3c9ecbfbc37aacdbec7f575f0d46041b1847222526\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/base/Pythia1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IPythia1Base} from './IPythia1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Pythia 1 ZK Proving Scheme\\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\\n\\n/**\\n * @title Pythia-1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \\n * without anyone being able to make the link between the offchain service and the onchain service.\\n * It is inherited by the family of Pythia-1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to:\\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\\n \\n \\n **/\\nabstract contract Pythia1Base is IPythia1Base, Initializable {\\n using Pythia1Lib for Pythia1ProofData;\\n\\n // ZK-SNARK Verifier\\n Pythia1Verifier immutable VERIFIER;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\\n */\\n constructor(address Pythia1VerifierAddress) {\\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\\n }\\n\\n /**\\n * @dev Getter of Pythia-1 Verifier contract\\n */\\n function getVerifier() external view returns (Pythia1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of the Commitment signer Eddsa Public key\\n */\\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\\n return _getCommitmentSignerPubKey();\\n }\\n\\n /*******************************************************\\n Pythia-1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\\n * the secretHash is a number only known by the user and is used in \\n * the zero knowledge as a private input which guarantees privacy\\n\\n * This function MUST be implemented by Pythia-1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Pythia-1 Simple Attester for an example\\n * @param claim user claim: a particular claim that a user have that he can prove s right.\\n */\\n function _getTicketIdentifierOfClaim(\\n Pythia1Claim memory claim\\n ) internal view virtual returns (uint256);\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\\n * prove the claim was correctly issued for the user.\\n */\\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(\\n Pythia1Claim memory claim,\\n Pythia1ProofInput memory input\\n ) internal view virtual {\\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (claim.destination != msg.sender)\\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\\n if (\\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\\n )\\n revert CommitmentSignerPubKeyMismatch(\\n commitmentSignerPubKey[0],\\n commitmentSignerPubKey[1],\\n input.commitmentSignerPubKey[0],\\n input.commitmentSignerPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the plonk mathematical proof using the circom verifier contract\\n * @param proofData snark public input\\n */\\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(uint256 /*errorCode*/) {\\n revert InvalidGroth16Proof('');\\n } catch (bytes memory /*lowLevelData*/) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc15ec9f4ae345d96e52465049836e9294a37a45a4c219211264b1d7d15779285\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\\n\\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\\n error TicketUsed(uint256 userTicket);\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xa727568cccc2689a13e843d64003ffd6868537c73220e1dc94b86827c8e445d4\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/libs/Pythia1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\\n\\n// user Pythia-1 claim retrieved form his request\\nstruct Pythia1Claim {\\n uint256 groupId; // user claims be part of this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct Pythia1GroupProperties {\\n uint128 internalCollectionId;\\n bool isScore;\\n}\\n\\nstruct Pythia1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct Pythia1ProofData {\\n Pythia1CircomSnarkProof proof;\\n uint256[9] input;\\n // destination;\\n // chainId;\\n // commitmentSignerPubKey.x;\\n // commitmentSignerPubKey.y;\\n // groupId;\\n // ticketIdentifier;\\n // userTicket;\\n // value;\\n // isStrict;\\n}\\n\\nstruct Pythia1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 groupId;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n bool isStrict;\\n uint256[2] commitmentSignerPubKey;\\n}\\n\\nlibrary Pythia1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\\n return\\n Pythia1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getGroupId(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n Pythia1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (Pythia1GroupProperties)\\n );\\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(\\n Pythia1ProofData memory self\\n )\\n internal\\n pure\\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[9] memory)\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(\\n Pythia1ProofData memory self\\n ) internal pure returns (uint256[2] memory) {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(\\n Pythia1ProofData memory self\\n ) internal pure returns (uint256) {\\n return self.input[5];\\n }\\n\\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\\n return self.input[8] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 internalCollectionId,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\\n }\\n\\n function _generateGroupIdFromEncodedProperties(\\n bytes memory encodedProperties\\n ) internal pure returns (uint256) {\\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 internalCollectionId,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(internalCollectionId, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x9f50e72124764619442a1d9ad876661b56bc0abb330bc2ffe7536a1c65eb0d0e\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n address[] memory attestationOwners = new address[](collectionIds.length);\\n\\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\\n\\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n // fetch attestations from the registry\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationOwners[i] = attestationsOwner;\\n attestationCollectionIds[i] = collectionIds[i];\\n\\n attestations[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestations, proofData);\\n\\n _beforeDeleteAttestations(attestations, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n\\n _afterDeleteAttestations(attestations, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestations[i]);\\n }\\n return attestations;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x7743f02ed07e1b40a2ff45f5a45b5fe87d765326cce3528676cbd36c3d08ba37\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0x2d5faf5df56dfe1294202e89180846a1d4a5f938699619ee73b60c7314a97dfe\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101006040523480156200001257600080fd5b50604051620024dd380380620024dd8339810160408190526200003591620002d8565b6001600160a01b03838116608052861660a052620000533362000075565b60c085905260e0849052620000698282620000d0565b505050505050620003d9565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600390610100900460ff16158015620000f3575060005460ff8083169116105b6200015b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff831617610100178155620001886000546201000090046001600160a01b031690565b6001600160a01b031614806200019d5750303b155b15620001b957620001ae8262000075565b620001b983620001ff565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6200020e60018260026200024b565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051620002409190620003a6565b60405180910390a150565b82600281019282156200027c579160200282015b828111156200027c5782518255916020019190600101906200025f565b506200028a9291506200028e565b5090565b5b808211156200028a57600081556001016200028f565b80516001600160a01b0381168114620002bd57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060e08789031215620002f257600080fd5b620002fd87620002a5565b95506020808801519550604088015194506200031c60608901620002a5565b935088609f8901126200032e57600080fd5b604080519081016001600160401b0381118282101715620003535762000353620002c2565b6040528060c08a018b8111156200036957600080fd5b60808b015b818110156200038757805183529184019184016200036e565b508295506200039681620002a5565b9450505050509295509295509295565b60408101818360005b6002811015620003d0578151835260209283019290910190600101620003af565b50505092915050565b60805160a05160c05160e0516120a06200043d600039600081816101b4015261038a01526000818161016c01526103620152600081816102310152818161055301528181610734015261097801526000818161012f01526110d501526120a06000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c8063754b377c11610097578063c776adde11610066578063c776adde14610255578063c9cdef0414610268578063e60f999f1461027b578063f2fde38b1461028e57600080fd5b8063754b377c146101de5780638da5cb5b146101f8578063af411a301461020f578063bfa665851461022f57600080fd5b806354846d7a116100d357806354846d7a1461016757806363e4afc21461019c5780637000b051146101af578063715018a6146101d657600080fd5b8063124d7199146100fa5780632785e3221461010f57806346657fe91461012d575b600080fd5b61010d61010836600461164e565b6102a1565b005b6101176102b5565b604051610124919061168d565b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610124565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610124565b61014f6101aa36600461169b565b6102ca565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b61010d6102e9565b6101e6600381565b60405160ff9091168152602001610124565b6000546201000090046001600160a01b031661014f565b61022261021d3660046116fc565b6102fd565b6040516101249190611827565b7f000000000000000000000000000000000000000000000000000000000000000061014f565b6102226102633660046118ae565b61045c565b61010d61027636600461195f565b610817565b6102226102893660046116fc565b61093a565b61010d61029c366004611997565b610a56565b6102a9610acc565b6102b281610b2d565b50565b6102bd611445565b6102c5610b75565b905090565b6000818152600360205260408120546001600160a01b03165b92915050565b6102f1610acc565b6102fb6000610baf565b565b6060600061031261030d866119db565b610c0a565b60408051600180825281830190925291925060009190816020015b610335611463565b81526020019060019003908161032d575050606083015151909150600090610386906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611b6a565b90507f00000000000000000000000000000000000000000000000000000000000000008111156103d157604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b03168152602001856020015181526020014263ffffffff168152602001604051806020016040528060008152508152508360008151811061044557610445611b82565b602090810291909101015250909695505050505050565b60606000856001600160401b0381111561047857610478611559565b6040519080825280602002602001820160405280156104a1578160200160208202803683370190505b5090506000866001600160401b038111156104be576104be611559565b6040519080825280602002602001820160405280156104e7578160200160208202803683370190505b5090506000876001600160401b0381111561050457610504611559565b60405190808252806020026020018201604052801561053d57816020015b61052a611463565b8152602001906001900390816105225790505b50905060005b88811015610711576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f8881811061059257610592611b82565b905060200201358e6040518363ffffffff1660e01b81526004016105c99291909182526001600160a01b0316602082015260400190565b600060405180830381865afa1580156105e6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261060e9190810190611b98565b93509350935093508b88868151811061062957610629611b82565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061065b5761065b611b82565b9050602002013587868151811061067457610674611b82565b6020026020010181815250506040518060c001604052808f8f8881811061069d5761069d611b82565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff168152602001828152508686815181106106ef576106ef611b82565b602002602001018190525050505050808061070990611c53565b915050610543565b5061071d818787610cbe565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061076b9086908690600401611c6c565b600060405180830381600087803b15801561078557600080fd5b505af1158015610799573d6000803e3d6000fd5b5050505060005b8881101561080a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b8282815181106107db576107db611b82565b60200260200101516040516107f09190611cf0565b60405180910390a18061080281611c53565b9150506107a0565b5098975050505050505050565b600054600390610100900460ff16158015610839575060005460ff8083169116105b61089c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103c8565b6000805461ffff191660ff8316176101001781556108c96000546001600160a01b03620100009091041690565b6001600160a01b031614806108dd5750303b155b156108f4576108eb82610baf565b6108f483610b2d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6060610947848484610cd7565b60006109548585856102fd565b9050610961858585610d1f565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906109ad908490600401611827565b600060405180830381600087803b1580156109c757600080fd5b505af11580156109db573d6000803e3d6000fd5b5050505060005b8151811015610a4d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610a1e57610a1e611b82565b6020026020010151604051610a339190611cf0565b60405180910390a180610a4581611c53565b9150506109e2565b50949350505050565b610a5e610acc565b6001600160a01b038116610ac35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103c8565b6102b281610baf565b6000546001600160a01b03620100009091041633146102fb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103c8565b610b3a60018260026114b1565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051610b6a919061168d565b60405180910390a150565b610b7d611445565b60408051808201918290529060019060029082845b815481526020019060010190808311610b92575050505050905090565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b610c416040805160808101825260008082526020808301829052828401829052835180850190945281845283015290606082015290565b60008260000151600081518110610c5a57610c5a611b82565b60200260200101519050610c6d81610d88565b60008160400151806020019051810190610c879190611d13565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ce582840184611ddd565b90506000610cf282610dcc565b90506000610d0261030d876119db565b9050610d0e8183610e68565b610d17836110ab565b505050505050565b6000610d2b8383611244565b6000818152600360205260409020549091506001600160a01b03168015610d6857604051631f5d53e360e01b8152600481018390526024016103c8565b610d8182610d7c6040880160208901611997565b611269565b5050505050565b6000610d9782604001516112cf565b82519091508114610dc85781516040516337e3d1ab60e01b81526103c8918391600401918252602082015260400190565b5050565b610dd46114f4565b604051806101000160405280610de984611304565b6001600160a01b03168152602001610e0084611319565b8152602001610e0e84611328565b8152602001610e1c84611337565b8152602001610e2a84611346565b8152602001610e3884611355565b8152602001610e508460200151610100015160011490565b15158152602001610e6084611364565b905292915050565b8151604082015114610e9d57815160408281015190516347a9715d60e01b8152600481019290925260248201526044016103c8565b81606001516020015115158160c00151151503610ee65760608201516020015160c0820151604051634629f1b560e11b81529115156004830152151560248201526044016103c8565b81604001516001600160a01b031681600001516001600160a01b031614610f3a57604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016103c8565b60408201516001600160a01b03163314610f7e576040808301519051632bfa317f60e11b81523360048201526001600160a01b0390911660248201526044016103c8565b46816020015114610fb1576020810151604051630432cec160e31b815246600482015260248101919091526044016103c8565b81602001518160a0015114610fec57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016103c8565b6000610ff6610b75565b805160e08401515191925014158061101b575060208082015160e08401519091015114155b1561106457805160208083015160e0850151805192015160405163f71cb0f760e01b815260048101949094526024840191909152604483019190915260648201526084016103c8565b600061106f846113bc565b9050808360600151146110a55760608301516040516377bb6d2760e11b81526103c8918391600401918252602082015260400190565b50505050565b8051805160208083015160409384015191850151935163c542c93b60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463c542c93b9461110e94909392909190600401611eae565b602060405180830381865afa925050508015611147575060408051601f3d908101601f1916820190925261114491810190611f55565b60015b61121d57611153611f70565b806308c379a00361118c5750611167611f8c565b8061117257506111cb565b8060405162dd577760e81b81526004016103c89190612015565b634e487b71036111cb5761119e612028565b906111a957506111cb565b60405162dd577760e81b815260206004820152600060248201526044016103c8565b3d8080156111f5576040519150601f19603f3d011682016040523d82523d6000602084013e6111fa565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016103c8565b80610dc85760405162dd577760e81b815260206004820152600060248201526044016103c8565b60008061125383850185611ddd565b9050600061126082611346565b95945050505050565b60008281526003602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102e3907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190612048565b6020810151600090815b602002015192915050565b6020810151600090600161130e565b6020810151600090600461130e565b6020810151600090600561130e565b6020810151600090600661130e565b6020810151600090600761130e565b61136c611445565b6040518060400160405280836020015160026009811061138e5761138e611b82565b6020020151815260200183602001516003600981106113af576113af611b82565b6020020151905292915050565b6000806113da308460600151600001516001600160801b03166113e1565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113da9190612048565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b82600281019282156114df579160200282015b828111156114df5782518255916020019190600101906114c4565b506114eb929150611544565b5090565b905290565b60405180610100016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114ef611445565b5b808211156114eb5760008155600101611545565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b038211171561158e5761158e611559565b60405250565b606081018181106001600160401b038211171561158e5761158e611559565b601f8201601f191681016001600160401b03811182821017156115d8576115d8611559565b6040525050565b600082601f8301126115f057600080fd5b604051604081018181106001600160401b038211171561161257611612611559565b806040525080604084018581111561162957600080fd5b845b8181101561164357803583526020928301920161162b565b509195945050505050565b60006040828403121561166057600080fd5b6113da83836115df565b8060005b60028110156110a557815184526020938401939091019060010161166e565b604081016102e3828461166a565b6000602082840312156116ad57600080fd5b5035919050565b60008083601f8401126116c657600080fd5b5081356001600160401b038111156116dd57600080fd5b6020830191508360208285010111156116f557600080fd5b9250929050565b60008060006040848603121561171157600080fd5b83356001600160401b038082111561172857600080fd5b908501906040828803121561173c57600080fd5b9093506020850135908082111561175257600080fd5b5061175f868287016116b4565b9497909650939450505050565b60005b8381101561178757818101518382015260200161176f565b838111156110a55750506000910152565b600081518084526117b081602086016020860161176c565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261181f60c0850182611798565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561187c57603f1988860301845261186a8583516117c4565b9450928501929085019060010161184e565b5092979650505050505050565b6001600160a01b03811681146102b257600080fd5b80356118a981611889565b919050565b6000806000806000606086880312156118c657600080fd5b85356001600160401b03808211156118dd57600080fd5b818801915088601f8301126118f157600080fd5b81358181111561190057600080fd5b8960208260051b850101111561191557600080fd5b6020830197508096505061192b6020890161189e565b9450604088013591508082111561194157600080fd5b5061194e888289016116b4565b969995985093965092949392505050565b6000806060838503121561197257600080fd5b61197c84846115df565b9150604083013561198c81611889565b809150509250929050565b6000602082840312156119a957600080fd5b81356113da81611889565b60006001600160401b038211156119cd576119cd611559565b50601f01601f191660200190565b600060408083360312156119ee57600080fd5b80516119f98161156f565b83356001600160401b0380821115611a1057600080fd5b9085019036601f830112611a2357600080fd5b8135602082821115611a3757611a37611559565b8160051b8651611a49838301826115b3565b92835284810182019282810136851115611a6257600080fd5b83870192505b84831015611b3657823586811115611a805760008081fd5b8701606036829003601f1901811315611a995760008081fd5b8a51611aa481611594565b8287013581528b83013581880152908201359088821115611ac55760008081fd5b9181019136603f840112611adb57600091508182fd5b868301359150611aea826119b4565b8c51611af682826115b3565b838152368e858701011115611b0d57600091508182fd5b838e86018a830137600093810189019390935250808c0191909152825250918301918301611a68565b50865250611b4588820161189e565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611b7d57611b7d611b54565b500190565b634e487b7160e01b600052603260045260246000fd5b60008060008060808587031215611bae57600080fd5b8451611bb981611889565b60208601516040870151919550935063ffffffff81168114611bda57600080fd5b60608601519092506001600160401b03811115611bf657600080fd5b8501601f81018713611c0757600080fd5b8051611c12816119b4565b604051611c1f82826115b3565b828152896020848601011115611c3457600080fd5b611c4583602083016020870161176c565b969995985093965050505050565b600060018201611c6557611c65611b54565b5060010190565b604080825283519082018190526000906020906060840190828701845b82811015611cae5781516001600160a01b031684529284019290840190600101611c89565b5050508381038285015284518082528583019183019060005b81811015611ce357835183529284019291840191600101611cc7565b5090979650505050505050565b6020815260006113da60208301846117c4565b805180151581146118a957600080fd5b600060408284031215611d2557600080fd5b604051604081018181106001600160401b0382111715611d4757611d47611559565b60405282516001600160801b0381168114611d6157600080fd5b8152611d6f60208401611d03565b60208201529392505050565b600082601f830112611d8c57600080fd5b6040516101208082018281106001600160401b0382111715611db057611db0611559565b60405283018185821115611dc357600080fd5b845b82811015611643578035825260209182019101611dc5565b6000818303610220811215611df157600080fd5b60408051611dfe8161156f565b61010080841215611e0e57600080fd5b82519350611e1b84611594565b611e2587876115df565b845286605f870112611e3657600080fd5b8251611e418161156f565b8060c0880189811115611e5357600080fd5b8589015b81811015611e7857611e698b826115df565b83526020909201918601611e57565b50826020880152611e898a826115df565b86880152505050838252611e9f87828801611d7b565b60208301525095945050505050565b6102208101611ebd828761166a565b60408083018660005b6002808210611ed55750611f10565b82518460005b83811015611ef9578251825260209283019290910190600101611edb565b505050928401925060209190910190600101611ec6565b50505050611f2160c083018561166a565b61010082018360005b6009811015611f49578151835260209283019290910190600101611f2a565b50505095945050505050565b600060208284031215611f6757600080fd5b6113da82611d03565b600060033d1115611f895760046000803e5060005160e01c5b90565b600060443d1015611f9a5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611fc957505050505090565b8285019150815181811115611fe15750505050505090565b843d8701016020828501011115611ffb5750505050505090565b61200a602082860101876115b3565b509095945050505050565b6020815260006113da6020830184611798565b60008060233d1115612044576020600460003e50506000516001905b9091565b60008261206557634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220ecfcdd3ed3aafdf6de9cf8f871557ae2657814cf595e7da8c33a09d25121780964736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063754b377c11610097578063c776adde11610066578063c776adde14610255578063c9cdef0414610268578063e60f999f1461027b578063f2fde38b1461028e57600080fd5b8063754b377c146101de5780638da5cb5b146101f8578063af411a301461020f578063bfa665851461022f57600080fd5b806354846d7a116100d357806354846d7a1461016757806363e4afc21461019c5780637000b051146101af578063715018a6146101d657600080fd5b8063124d7199146100fa5780632785e3221461010f57806346657fe91461012d575b600080fd5b61010d61010836600461164e565b6102a1565b005b6101176102b5565b604051610124919061168d565b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610124565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610124565b61014f6101aa36600461169b565b6102ca565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b61010d6102e9565b6101e6600381565b60405160ff9091168152602001610124565b6000546201000090046001600160a01b031661014f565b61022261021d3660046116fc565b6102fd565b6040516101249190611827565b7f000000000000000000000000000000000000000000000000000000000000000061014f565b6102226102633660046118ae565b61045c565b61010d61027636600461195f565b610817565b6102226102893660046116fc565b61093a565b61010d61029c366004611997565b610a56565b6102a9610acc565b6102b281610b2d565b50565b6102bd611445565b6102c5610b75565b905090565b6000818152600360205260408120546001600160a01b03165b92915050565b6102f1610acc565b6102fb6000610baf565b565b6060600061031261030d866119db565b610c0a565b60408051600180825281830190925291925060009190816020015b610335611463565b81526020019060019003908161032d575050606083015151909150600090610386906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611b6a565b90507f00000000000000000000000000000000000000000000000000000000000000008111156103d157604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b03168152602001856020015181526020014263ffffffff168152602001604051806020016040528060008152508152508360008151811061044557610445611b82565b602090810291909101015250909695505050505050565b60606000856001600160401b0381111561047857610478611559565b6040519080825280602002602001820160405280156104a1578160200160208202803683370190505b5090506000866001600160401b038111156104be576104be611559565b6040519080825280602002602001820160405280156104e7578160200160208202803683370190505b5090506000876001600160401b0381111561050457610504611559565b60405190808252806020026020018201604052801561053d57816020015b61052a611463565b8152602001906001900390816105225790505b50905060005b88811015610711576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f8881811061059257610592611b82565b905060200201358e6040518363ffffffff1660e01b81526004016105c99291909182526001600160a01b0316602082015260400190565b600060405180830381865afa1580156105e6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261060e9190810190611b98565b93509350935093508b88868151811061062957610629611b82565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061065b5761065b611b82565b9050602002013587868151811061067457610674611b82565b6020026020010181815250506040518060c001604052808f8f8881811061069d5761069d611b82565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff168152602001828152508686815181106106ef576106ef611b82565b602002602001018190525050505050808061070990611c53565b915050610543565b5061071d818787610cbe565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061076b9086908690600401611c6c565b600060405180830381600087803b15801561078557600080fd5b505af1158015610799573d6000803e3d6000fd5b5050505060005b8881101561080a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b8282815181106107db576107db611b82565b60200260200101516040516107f09190611cf0565b60405180910390a18061080281611c53565b9150506107a0565b5098975050505050505050565b600054600390610100900460ff16158015610839575060005460ff8083169116105b61089c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103c8565b6000805461ffff191660ff8316176101001781556108c96000546001600160a01b03620100009091041690565b6001600160a01b031614806108dd5750303b155b156108f4576108eb82610baf565b6108f483610b2d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6060610947848484610cd7565b60006109548585856102fd565b9050610961858585610d1f565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906109ad908490600401611827565b600060405180830381600087803b1580156109c757600080fd5b505af11580156109db573d6000803e3d6000fd5b5050505060005b8151811015610a4d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610a1e57610a1e611b82565b6020026020010151604051610a339190611cf0565b60405180910390a180610a4581611c53565b9150506109e2565b50949350505050565b610a5e610acc565b6001600160a01b038116610ac35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103c8565b6102b281610baf565b6000546001600160a01b03620100009091041633146102fb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103c8565b610b3a60018260026114b1565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051610b6a919061168d565b60405180910390a150565b610b7d611445565b60408051808201918290529060019060029082845b815481526020019060010190808311610b92575050505050905090565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b610c416040805160808101825260008082526020808301829052828401829052835180850190945281845283015290606082015290565b60008260000151600081518110610c5a57610c5a611b82565b60200260200101519050610c6d81610d88565b60008160400151806020019051810190610c879190611d13565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ce582840184611ddd565b90506000610cf282610dcc565b90506000610d0261030d876119db565b9050610d0e8183610e68565b610d17836110ab565b505050505050565b6000610d2b8383611244565b6000818152600360205260409020549091506001600160a01b03168015610d6857604051631f5d53e360e01b8152600481018390526024016103c8565b610d8182610d7c6040880160208901611997565b611269565b5050505050565b6000610d9782604001516112cf565b82519091508114610dc85781516040516337e3d1ab60e01b81526103c8918391600401918252602082015260400190565b5050565b610dd46114f4565b604051806101000160405280610de984611304565b6001600160a01b03168152602001610e0084611319565b8152602001610e0e84611328565b8152602001610e1c84611337565b8152602001610e2a84611346565b8152602001610e3884611355565b8152602001610e508460200151610100015160011490565b15158152602001610e6084611364565b905292915050565b8151604082015114610e9d57815160408281015190516347a9715d60e01b8152600481019290925260248201526044016103c8565b81606001516020015115158160c00151151503610ee65760608201516020015160c0820151604051634629f1b560e11b81529115156004830152151560248201526044016103c8565b81604001516001600160a01b031681600001516001600160a01b031614610f3a57604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016103c8565b60408201516001600160a01b03163314610f7e576040808301519051632bfa317f60e11b81523360048201526001600160a01b0390911660248201526044016103c8565b46816020015114610fb1576020810151604051630432cec160e31b815246600482015260248101919091526044016103c8565b81602001518160a0015114610fec57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016103c8565b6000610ff6610b75565b805160e08401515191925014158061101b575060208082015160e08401519091015114155b1561106457805160208083015160e0850151805192015160405163f71cb0f760e01b815260048101949094526024840191909152604483019190915260648201526084016103c8565b600061106f846113bc565b9050808360600151146110a55760608301516040516377bb6d2760e11b81526103c8918391600401918252602082015260400190565b50505050565b8051805160208083015160409384015191850151935163c542c93b60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463c542c93b9461110e94909392909190600401611eae565b602060405180830381865afa925050508015611147575060408051601f3d908101601f1916820190925261114491810190611f55565b60015b61121d57611153611f70565b806308c379a00361118c5750611167611f8c565b8061117257506111cb565b8060405162dd577760e81b81526004016103c89190612015565b634e487b71036111cb5761119e612028565b906111a957506111cb565b60405162dd577760e81b815260206004820152600060248201526044016103c8565b3d8080156111f5576040519150601f19603f3d011682016040523d82523d6000602084013e6111fa565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016103c8565b80610dc85760405162dd577760e81b815260206004820152600060248201526044016103c8565b60008061125383850185611ddd565b9050600061126082611346565b95945050505050565b60008281526003602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102e3907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190612048565b6020810151600090815b602002015192915050565b6020810151600090600161130e565b6020810151600090600461130e565b6020810151600090600561130e565b6020810151600090600661130e565b6020810151600090600761130e565b61136c611445565b6040518060400160405280836020015160026009811061138e5761138e611b82565b6020020151815260200183602001516003600981106113af576113af611b82565b6020020151905292915050565b6000806113da308460600151600001516001600160801b03166113e1565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113da9190612048565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b82600281019282156114df579160200282015b828111156114df5782518255916020019190600101906114c4565b506114eb929150611544565b5090565b905290565b60405180610100016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114ef611445565b5b808211156114eb5760008155600101611545565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b038211171561158e5761158e611559565b60405250565b606081018181106001600160401b038211171561158e5761158e611559565b601f8201601f191681016001600160401b03811182821017156115d8576115d8611559565b6040525050565b600082601f8301126115f057600080fd5b604051604081018181106001600160401b038211171561161257611612611559565b806040525080604084018581111561162957600080fd5b845b8181101561164357803583526020928301920161162b565b509195945050505050565b60006040828403121561166057600080fd5b6113da83836115df565b8060005b60028110156110a557815184526020938401939091019060010161166e565b604081016102e3828461166a565b6000602082840312156116ad57600080fd5b5035919050565b60008083601f8401126116c657600080fd5b5081356001600160401b038111156116dd57600080fd5b6020830191508360208285010111156116f557600080fd5b9250929050565b60008060006040848603121561171157600080fd5b83356001600160401b038082111561172857600080fd5b908501906040828803121561173c57600080fd5b9093506020850135908082111561175257600080fd5b5061175f868287016116b4565b9497909650939450505050565b60005b8381101561178757818101518382015260200161176f565b838111156110a55750506000910152565b600081518084526117b081602086016020860161176c565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261181f60c0850182611798565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561187c57603f1988860301845261186a8583516117c4565b9450928501929085019060010161184e565b5092979650505050505050565b6001600160a01b03811681146102b257600080fd5b80356118a981611889565b919050565b6000806000806000606086880312156118c657600080fd5b85356001600160401b03808211156118dd57600080fd5b818801915088601f8301126118f157600080fd5b81358181111561190057600080fd5b8960208260051b850101111561191557600080fd5b6020830197508096505061192b6020890161189e565b9450604088013591508082111561194157600080fd5b5061194e888289016116b4565b969995985093965092949392505050565b6000806060838503121561197257600080fd5b61197c84846115df565b9150604083013561198c81611889565b809150509250929050565b6000602082840312156119a957600080fd5b81356113da81611889565b60006001600160401b038211156119cd576119cd611559565b50601f01601f191660200190565b600060408083360312156119ee57600080fd5b80516119f98161156f565b83356001600160401b0380821115611a1057600080fd5b9085019036601f830112611a2357600080fd5b8135602082821115611a3757611a37611559565b8160051b8651611a49838301826115b3565b92835284810182019282810136851115611a6257600080fd5b83870192505b84831015611b3657823586811115611a805760008081fd5b8701606036829003601f1901811315611a995760008081fd5b8a51611aa481611594565b8287013581528b83013581880152908201359088821115611ac55760008081fd5b9181019136603f840112611adb57600091508182fd5b868301359150611aea826119b4565b8c51611af682826115b3565b838152368e858701011115611b0d57600091508182fd5b838e86018a830137600093810189019390935250808c0191909152825250918301918301611a68565b50865250611b4588820161189e565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611b7d57611b7d611b54565b500190565b634e487b7160e01b600052603260045260246000fd5b60008060008060808587031215611bae57600080fd5b8451611bb981611889565b60208601516040870151919550935063ffffffff81168114611bda57600080fd5b60608601519092506001600160401b03811115611bf657600080fd5b8501601f81018713611c0757600080fd5b8051611c12816119b4565b604051611c1f82826115b3565b828152896020848601011115611c3457600080fd5b611c4583602083016020870161176c565b969995985093965050505050565b600060018201611c6557611c65611b54565b5060010190565b604080825283519082018190526000906020906060840190828701845b82811015611cae5781516001600160a01b031684529284019290840190600101611c89565b5050508381038285015284518082528583019183019060005b81811015611ce357835183529284019291840191600101611cc7565b5090979650505050505050565b6020815260006113da60208301846117c4565b805180151581146118a957600080fd5b600060408284031215611d2557600080fd5b604051604081018181106001600160401b0382111715611d4757611d47611559565b60405282516001600160801b0381168114611d6157600080fd5b8152611d6f60208401611d03565b60208201529392505050565b600082601f830112611d8c57600080fd5b6040516101208082018281106001600160401b0382111715611db057611db0611559565b60405283018185821115611dc357600080fd5b845b82811015611643578035825260209182019101611dc5565b6000818303610220811215611df157600080fd5b60408051611dfe8161156f565b61010080841215611e0e57600080fd5b82519350611e1b84611594565b611e2587876115df565b845286605f870112611e3657600080fd5b8251611e418161156f565b8060c0880189811115611e5357600080fd5b8589015b81811015611e7857611e698b826115df565b83526020909201918601611e57565b50826020880152611e898a826115df565b86880152505050838252611e9f87828801611d7b565b60208301525095945050505050565b6102208101611ebd828761166a565b60408083018660005b6002808210611ed55750611f10565b82518460005b83811015611ef9578251825260209283019290910190600101611edb565b505050928401925060209190910190600101611ec6565b50505050611f2160c083018561166a565b61010082018360005b6009811015611f49578151835260209283019290910190600101611f2a565b50505095945050505050565b600060208284031215611f6757600080fd5b6113da82611d03565b600060033d1115611f895760046000803e5060005160e01c5b90565b600060443d1015611f9a5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611fc957505050505090565b8285019150815181811115611fe15750505050505090565b843d8701016020828501011115611ffb5750505050505090565b61200a602082860101876115b3565b509095945050505050565b6020815260006113da6020830184611798565b60008060233d1115612044576020600460003e50506000516001905b9091565b60008261206557634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220ecfcdd3ed3aafdf6de9cf8f871557ae2657814cf595e7da8c33a09d25121780964736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns attestations that will be recorded, constructed from the user request", - "params": { - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "collectionIdFirst": "Id of the first collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last collection in which the attester is supposed to record", - "commitmentSignerPubKey": "The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme", - "owner": "The owner of the contract that can update the commitment signer pub key", - "pythia1VerifierAddress": "ZK Snark Pythia-1 Verifier contract" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getCommitmentSignerPubKey()": { - "details": "Getter of the Commitment signer Eddsa Public key" - }, - "getDestinationOfTicket(uint256)": { - "details": "Getter, returns the last attestation destination of a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getVerifier()": { - "details": "Getter of Pythia-1 Verifier contract" - }, - "initialize(uint256[2],address)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "commitmentSignerPubKey": "EdDSA public key of the commitment signer", - "ownerAddress": "Owner of the contract, can update public key and address" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "stateVariables": { - "AUTHORIZED_COLLECTION_ID_FIRST": { - "details": "Getter returns of the first collection in which the attester is supposed to record*" - }, - "AUTHORIZED_COLLECTION_ID_LAST": { - "details": "Getter returns of the last collection in which the attester is supposed to record*" - } - }, - "title": "Pythia-1 Simple Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(uint256[2],address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "This attester is part of the family of the Pythia-1 Attesters. Pythia-1 attesters enable users to prove they have a claim and its proof issued by an offchain service in a privacy preserving way. That means no-one can make the link between the account used in the offchain service and the onchain account where the attestation is stored. The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic. We invite readers to refer to: - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each users gets one userTicket per claim For people used to semaphore/ tornado cash people: userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 396, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_owner", - "offset": 2, - "slot": "0", - "type": "t_address" - }, - { - "astId": 9697, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_commitmentSignerPubKey", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)2_storage" - }, - { - "astId": 9701, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_ticketsDestinations", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_uint256,t_address)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)2_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[2]", - "numberOfBytes": "64" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_address)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/Pythia1SimpleAttesterImplem.json b/deployments/goerli/Pythia1SimpleAttesterImplem.json deleted file mode 100644 index 07f6fd6..0000000 --- a/deployments/goerli/Pythia1SimpleAttesterImplem.json +++ /dev/null @@ -1,1041 +0,0 @@ -{ - "address": "0x9B66eE70776cd92d1d379F96A6c7b180D8C638b1", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - }, - { - "internalType": "address", - "name": "pythia1VerifierAddress", - "type": "address" - }, - { - "internalType": "uint256[2]", - "name": "commitmentSignerPubKey", - "type": "uint256[2]" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentSignerPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "GroupIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedTicketIdentifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ticketIdentifier", - "type": "uint256" - } - ], - "name": "TicketIdentifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "TicketUsed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "inputdestination", - "type": "address" - } - ], - "name": "UserShouldOwnItsDestination", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256[2]", - "name": "newCommitmentSignerPubKey", - "type": "uint256[2]" - } - ], - "name": "CommitmentSignerPubKeyUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "TicketDestinationUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentSignerPubKey", - "outputs": [ - { - "internalType": "uint256[2]", - "name": "", - "type": "uint256[2]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getDestinationOfTicket", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract Pythia1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "commitmentSignerPubKey", - "type": "uint256[2]" - }, - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "commitmentSignerPubKey", - "type": "uint256[2]" - } - ], - "name": "updateCommitmentSignerPubKey", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x1f014e056e7143e642fc7d2fa54da4bf937a648afa2251116e9bd6775dbb2870", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x9B66eE70776cd92d1d379F96A6c7b180D8C638b1", - "transactionIndex": 66, - "gasUsed": "1945946", - "logsBloom": "0x00000000000200000000000000020000000000000000000000800000000000000000000000000000000000000200000000000000000040000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000420000000000000000000800002000000000002000000000000000400000000000000000000000000000000000000000000080000000000000000000000000000000000000200000800400000000000000000000000000000000000000000000000000000000000000040000000000000000400000000000000020000000000000000000000000000000000000000200000000000000008000000000", - "blockHash": "0x924c59d3ef7328340a5f8821e8aebcc3cbc2c5b9f533cd66449d009db62c4ba6", - "transactionHash": "0x1f014e056e7143e642fc7d2fa54da4bf937a648afa2251116e9bd6775dbb2870", - "logs": [ - { - "transactionIndex": 66, - "blockNumber": 8080317, - "transactionHash": "0x1f014e056e7143e642fc7d2fa54da4bf937a648afa2251116e9bd6775dbb2870", - "address": "0x9B66eE70776cd92d1d379F96A6c7b180D8C638b1", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "data": "0x", - "logIndex": 131, - "blockHash": "0x924c59d3ef7328340a5f8821e8aebcc3cbc2c5b9f533cd66449d009db62c4ba6" - }, - { - "transactionIndex": 66, - "blockNumber": 8080317, - "transactionHash": "0x1f014e056e7143e642fc7d2fa54da4bf937a648afa2251116e9bd6775dbb2870", - "address": "0x9B66eE70776cd92d1d379F96A6c7b180D8C638b1", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954" - ], - "data": "0x", - "logIndex": 132, - "blockHash": "0x924c59d3ef7328340a5f8821e8aebcc3cbc2c5b9f533cd66449d009db62c4ba6" - }, - { - "transactionIndex": 66, - "blockNumber": 8080317, - "transactionHash": "0x1f014e056e7143e642fc7d2fa54da4bf937a648afa2251116e9bd6775dbb2870", - "address": "0x9B66eE70776cd92d1d379F96A6c7b180D8C638b1", - "topics": [ - "0xda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df" - ], - "data": "0x038d3d596875c66eb90608bbe04e4e238607fd32ad61f4278bdaf47aadc28d601b46b55a0ce3f35d6025cdd4554aaac1fc7180b14d51b0f15aa51a6929bdb952", - "logIndex": 133, - "blockHash": "0x924c59d3ef7328340a5f8821e8aebcc3cbc2c5b9f533cd66449d009db62c4ba6" - }, - { - "transactionIndex": 66, - "blockNumber": 8080317, - "transactionHash": "0x1f014e056e7143e642fc7d2fa54da4bf937a648afa2251116e9bd6775dbb2870", - "address": "0x9B66eE70776cd92d1d379F96A6c7b180D8C638b1", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 134, - "blockHash": "0x924c59d3ef7328340a5f8821e8aebcc3cbc2c5b9f533cd66449d009db62c4ba6" - } - ], - "blockNumber": 8080317, - "cumulativeGasUsed": "23362863", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf85BA0afA375495eE625910Db61b6b1406756234", - "30000001", - "30000100", - "0xEE077AD7a47e56F075f0C3bd41Cdc1629FdA3a9c", - [ - "0x038d3d596875c66eb90608bbe04e4e238607fd32ad61f4278bdaf47aadc28d60", - "0x1b46b55a0ce3f35d6025cdd4554aaac1fc7180b14d51b0f15aa51a6929bdb952" - ], - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954" - ], - "numDeployments": 2, - "solcInputHash": "24c70469fd559e01f6ff2a10472da9a6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"pythia1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentSignerPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"GroupIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"TicketUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputdestination\",\"type\":\"address\"}],\"name\":\"UserShouldOwnItsDestination\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256[2]\",\"name\":\"newCommitmentSignerPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"CommitmentSignerPubKeyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentSignerPubKey\",\"outputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"\",\"type\":\"uint256[2]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract Pythia1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"updateCommitmentSignerPubKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns attestations that will be recorded, constructed from the user request\",\"params\":{\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentSignerPubKey\":\"The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\",\"owner\":\"The owner of the contract that can update the commitment signer pub key\",\"pythia1VerifierAddress\":\"ZK Snark Pythia-1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getCommitmentSignerPubKey()\":{\"details\":\"Getter of the Commitment signer Eddsa Public key\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Pythia-1 Verifier contract\"},\"initialize(uint256[2],address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"commitmentSignerPubKey\":\"EdDSA public key of the commitment signer\",\"ownerAddress\":\"Owner of the contract, can update public key and address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"}},\"title\":\"Pythia-1 Simple Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(uint256[2],address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"This attester is part of the family of the Pythia-1 Attesters. Pythia-1 attesters enable users to prove they have a claim and its proof issued by an offchain service in a privacy preserving way. That means no-one can make the link between the account used in the offchain service and the onchain account where the attestation is stored. The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic. We invite readers to refer to: - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each users gets one userTicket per claim For people used to semaphore/ tornado cash people: userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/pythia-1/Pythia1SimpleAttester.sol\":\"Pythia1SimpleAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/pythia-1/contracts/Pythia1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract Pythia1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\\n );\\n vk.IC = new Pairing.G1Point[](10);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 104028078850975554065172701281783302003220555203883119831575537681421753151,\\n 19148240629904598794948591359118971959790791697910953160820265703277306346\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[9] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3babb956e64535b9bf535df94288b4d83ea82c54727f79ee8949fe4a19c1d5ba\",\"license\":\"GPL-3.0\"},\"contracts/attesters/pythia-1/Pythia1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to Pythia1 Proving Scheme\\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\\n\\n/**\\n * @title Pythia-1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Pythia-1 Attesters.\\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \\n * offchain service in a privacy preserving way. \\n * That means no-one can make the link between the account used in the offchain service\\n * and the onchain account where the attestation is stored.\\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\\n * We invite readers to refer to:\\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each users gets one userTicket per claim\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n **/\\n\\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\\n using Pythia1Lib for Pythia1ProofData;\\n using Pythia1Lib for bytes;\\n using Pythia1Lib for Request;\\n\\n uint8 public constant IMPLEMENTATION_VERSION = 3;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n uint256[2] internal _commitmentSignerPubKey;\\n mapping(uint256 => address) internal _ticketsDestinations;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\\n * @param owner The owner of the contract that can update the commitment signer pub key\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n address pythia1VerifierAddress,\\n uint256[2] memory commitmentSignerPubKey,\\n address owner\\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n initialize(commitmentSignerPubKey, owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n uint256[2] memory commitmentSignerPubKey,\\n address ownerAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\\n }\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into Pythia1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\\n Pythia1ProofInput memory snarkInput = snarkProof._input();\\n Pythia1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata\\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\\n Pythia1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.internalCollectionId;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n uint32(block.timestamp),\\n ''\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used\\n * @param request users request. Claim of beiing part of a group.\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n // we get the ticket used from the snark input in the data provided\\n uint256 userTicket = proofData._getTicket();\\n address currentDestination = _getDestinationOfTicket(userTicket);\\n\\n if (currentDestination != address(0)) {\\n revert TicketUsed(userTicket);\\n }\\n\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n /*******************************************************\\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\\n * users bring secretHash as private input in snark which guarantees privacy\\n * the secretHash is only known by the user and never escape the user's browser\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(\\n Pythia1Claim memory claim\\n ) internal view override returns (uint256) {\\n uint256 ticketIdentifier = _encodeInSnarkField(\\n address(this),\\n claim.groupProperties.internalCollectionId\\n );\\n return ticketIdentifier;\\n }\\n\\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\\n return _commitmentSignerPubKey;\\n }\\n\\n /*******************************************************\\n Pythia-1 Attester Specific Functions\\n *******************************************************/\\n\\n function updateCommitmentSignerPubKey(\\n uint256[2] memory commitmentSignerPubKey\\n ) external onlyOwner {\\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\\n }\\n\\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\\n _commitmentSignerPubKey = commitmentSignerPubKey;\\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\\n }\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _ticketsDestinations[userTicket] = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _ticketsDestinations[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x22a505a2f8a3246ad46cf6fdd5eeab1a58b7fcb08982d03ff742f48aec063b82\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/base/IPythia1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\\n\\ninterface IPythia1Base {\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error UserShouldOwnItsDestination(address sender, address inputdestination);\\n error CommitmentSignerPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Pythia-1 Verifier contract\\n */\\n function getVerifier() external view returns (Pythia1Verifier);\\n\\n /**\\n * @dev Getter of the Commitment Signer EdDSA Public Key\\n */\\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\\n}\\n\",\"keccak256\":\"0x61924d768ab0c8cd61d0ff3c9ecbfbc37aacdbec7f575f0d46041b1847222526\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/base/Pythia1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IPythia1Base} from './IPythia1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Pythia 1 ZK Proving Scheme\\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\\n\\n/**\\n * @title Pythia-1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \\n * without anyone being able to make the link between the offchain service and the onchain service.\\n * It is inherited by the family of Pythia-1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to:\\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\\n \\n \\n **/\\nabstract contract Pythia1Base is IPythia1Base, Initializable {\\n using Pythia1Lib for Pythia1ProofData;\\n\\n // ZK-SNARK Verifier\\n Pythia1Verifier immutable VERIFIER;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\\n */\\n constructor(address Pythia1VerifierAddress) {\\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\\n }\\n\\n /**\\n * @dev Getter of Pythia-1 Verifier contract\\n */\\n function getVerifier() external view returns (Pythia1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of the Commitment signer Eddsa Public key\\n */\\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\\n return _getCommitmentSignerPubKey();\\n }\\n\\n /*******************************************************\\n Pythia-1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\\n * the secretHash is a number only known by the user and is used in \\n * the zero knowledge as a private input which guarantees privacy\\n\\n * This function MUST be implemented by Pythia-1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Pythia-1 Simple Attester for an example\\n * @param claim user claim: a particular claim that a user have that he can prove s right.\\n */\\n function _getTicketIdentifierOfClaim(\\n Pythia1Claim memory claim\\n ) internal view virtual returns (uint256);\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\\n * prove the claim was correctly issued for the user.\\n */\\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(\\n Pythia1Claim memory claim,\\n Pythia1ProofInput memory input\\n ) internal view virtual {\\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (claim.destination != msg.sender)\\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\\n if (\\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\\n )\\n revert CommitmentSignerPubKeyMismatch(\\n commitmentSignerPubKey[0],\\n commitmentSignerPubKey[1],\\n input.commitmentSignerPubKey[0],\\n input.commitmentSignerPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the plonk mathematical proof using the circom verifier contract\\n * @param proofData snark public input\\n */\\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(uint256 /*errorCode*/) {\\n revert InvalidGroth16Proof('');\\n } catch (bytes memory /*lowLevelData*/) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc15ec9f4ae345d96e52465049836e9294a37a45a4c219211264b1d7d15779285\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\\n\\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\\n error TicketUsed(uint256 userTicket);\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xa727568cccc2689a13e843d64003ffd6868537c73220e1dc94b86827c8e445d4\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/libs/Pythia1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\\n\\n// user Pythia-1 claim retrieved form his request\\nstruct Pythia1Claim {\\n uint256 groupId; // user claims be part of this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct Pythia1GroupProperties {\\n uint128 internalCollectionId;\\n bool isScore;\\n}\\n\\nstruct Pythia1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct Pythia1ProofData {\\n Pythia1CircomSnarkProof proof;\\n uint256[9] input;\\n // destination;\\n // chainId;\\n // commitmentSignerPubKey.x;\\n // commitmentSignerPubKey.y;\\n // groupId;\\n // ticketIdentifier;\\n // userTicket;\\n // value;\\n // isStrict;\\n}\\n\\nstruct Pythia1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 groupId;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n bool isStrict;\\n uint256[2] commitmentSignerPubKey;\\n}\\n\\nlibrary Pythia1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\\n return\\n Pythia1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getGroupId(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n Pythia1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (Pythia1GroupProperties)\\n );\\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(\\n Pythia1ProofData memory self\\n )\\n internal\\n pure\\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[9] memory)\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(\\n Pythia1ProofData memory self\\n ) internal pure returns (uint256[2] memory) {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(\\n Pythia1ProofData memory self\\n ) internal pure returns (uint256) {\\n return self.input[5];\\n }\\n\\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\\n return self.input[8] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 internalCollectionId,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\\n }\\n\\n function _generateGroupIdFromEncodedProperties(\\n bytes memory encodedProperties\\n ) internal pure returns (uint256) {\\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 internalCollectionId,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(internalCollectionId, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x9f50e72124764619442a1d9ad876661b56bc0abb330bc2ffe7536a1c65eb0d0e\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n address[] memory attestationOwners = new address[](collectionIds.length);\\n\\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\\n\\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n // fetch attestations from the registry\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationOwners[i] = attestationsOwner;\\n attestationCollectionIds[i] = collectionIds[i];\\n\\n attestations[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestations, proofData);\\n\\n _beforeDeleteAttestations(attestations, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n\\n _afterDeleteAttestations(attestations, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestations[i]);\\n }\\n return attestations;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x7743f02ed07e1b40a2ff45f5a45b5fe87d765326cce3528676cbd36c3d08ba37\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0x2d5faf5df56dfe1294202e89180846a1d4a5f938699619ee73b60c7314a97dfe\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101006040523480156200001257600080fd5b50604051620024dd380380620024dd8339810160408190526200003591620002d8565b6001600160a01b03838116608052861660a052620000533362000075565b60c085905260e0849052620000698282620000d0565b505050505050620003d9565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600390610100900460ff16158015620000f3575060005460ff8083169116105b6200015b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff831617610100178155620001886000546201000090046001600160a01b031690565b6001600160a01b031614806200019d5750303b155b15620001b957620001ae8262000075565b620001b983620001ff565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6200020e60018260026200024b565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051620002409190620003a6565b60405180910390a150565b82600281019282156200027c579160200282015b828111156200027c5782518255916020019190600101906200025f565b506200028a9291506200028e565b5090565b5b808211156200028a57600081556001016200028f565b80516001600160a01b0381168114620002bd57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060e08789031215620002f257600080fd5b620002fd87620002a5565b95506020808801519550604088015194506200031c60608901620002a5565b935088609f8901126200032e57600080fd5b604080519081016001600160401b0381118282101715620003535762000353620002c2565b6040528060c08a018b8111156200036957600080fd5b60808b015b818110156200038757805183529184019184016200036e565b508295506200039681620002a5565b9450505050509295509295509295565b60408101818360005b6002811015620003d0578151835260209283019290910190600101620003af565b50505092915050565b60805160a05160c05160e0516120a06200043d600039600081816101b4015261038a01526000818161016c01526103620152600081816102310152818161055301528181610734015261097801526000818161012f01526110d501526120a06000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c8063754b377c11610097578063c776adde11610066578063c776adde14610255578063c9cdef0414610268578063e60f999f1461027b578063f2fde38b1461028e57600080fd5b8063754b377c146101de5780638da5cb5b146101f8578063af411a301461020f578063bfa665851461022f57600080fd5b806354846d7a116100d357806354846d7a1461016757806363e4afc21461019c5780637000b051146101af578063715018a6146101d657600080fd5b8063124d7199146100fa5780632785e3221461010f57806346657fe91461012d575b600080fd5b61010d61010836600461164e565b6102a1565b005b6101176102b5565b604051610124919061168d565b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610124565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610124565b61014f6101aa36600461169b565b6102ca565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b61010d6102e9565b6101e6600381565b60405160ff9091168152602001610124565b6000546201000090046001600160a01b031661014f565b61022261021d3660046116fc565b6102fd565b6040516101249190611827565b7f000000000000000000000000000000000000000000000000000000000000000061014f565b6102226102633660046118ae565b61045c565b61010d61027636600461195f565b610817565b6102226102893660046116fc565b61093a565b61010d61029c366004611997565b610a56565b6102a9610acc565b6102b281610b2d565b50565b6102bd611445565b6102c5610b75565b905090565b6000818152600360205260408120546001600160a01b03165b92915050565b6102f1610acc565b6102fb6000610baf565b565b6060600061031261030d866119db565b610c0a565b60408051600180825281830190925291925060009190816020015b610335611463565b81526020019060019003908161032d575050606083015151909150600090610386906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611b6a565b90507f00000000000000000000000000000000000000000000000000000000000000008111156103d157604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b03168152602001856020015181526020014263ffffffff168152602001604051806020016040528060008152508152508360008151811061044557610445611b82565b602090810291909101015250909695505050505050565b60606000856001600160401b0381111561047857610478611559565b6040519080825280602002602001820160405280156104a1578160200160208202803683370190505b5090506000866001600160401b038111156104be576104be611559565b6040519080825280602002602001820160405280156104e7578160200160208202803683370190505b5090506000876001600160401b0381111561050457610504611559565b60405190808252806020026020018201604052801561053d57816020015b61052a611463565b8152602001906001900390816105225790505b50905060005b88811015610711576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f8881811061059257610592611b82565b905060200201358e6040518363ffffffff1660e01b81526004016105c99291909182526001600160a01b0316602082015260400190565b600060405180830381865afa1580156105e6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261060e9190810190611b98565b93509350935093508b88868151811061062957610629611b82565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061065b5761065b611b82565b9050602002013587868151811061067457610674611b82565b6020026020010181815250506040518060c001604052808f8f8881811061069d5761069d611b82565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff168152602001828152508686815181106106ef576106ef611b82565b602002602001018190525050505050808061070990611c53565b915050610543565b5061071d818787610cbe565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061076b9086908690600401611c6c565b600060405180830381600087803b15801561078557600080fd5b505af1158015610799573d6000803e3d6000fd5b5050505060005b8881101561080a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b8282815181106107db576107db611b82565b60200260200101516040516107f09190611cf0565b60405180910390a18061080281611c53565b9150506107a0565b5098975050505050505050565b600054600390610100900460ff16158015610839575060005460ff8083169116105b61089c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103c8565b6000805461ffff191660ff8316176101001781556108c96000546001600160a01b03620100009091041690565b6001600160a01b031614806108dd5750303b155b156108f4576108eb82610baf565b6108f483610b2d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6060610947848484610cd7565b60006109548585856102fd565b9050610961858585610d1f565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906109ad908490600401611827565b600060405180830381600087803b1580156109c757600080fd5b505af11580156109db573d6000803e3d6000fd5b5050505060005b8151811015610a4d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610a1e57610a1e611b82565b6020026020010151604051610a339190611cf0565b60405180910390a180610a4581611c53565b9150506109e2565b50949350505050565b610a5e610acc565b6001600160a01b038116610ac35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103c8565b6102b281610baf565b6000546001600160a01b03620100009091041633146102fb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103c8565b610b3a60018260026114b1565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051610b6a919061168d565b60405180910390a150565b610b7d611445565b60408051808201918290529060019060029082845b815481526020019060010190808311610b92575050505050905090565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b610c416040805160808101825260008082526020808301829052828401829052835180850190945281845283015290606082015290565b60008260000151600081518110610c5a57610c5a611b82565b60200260200101519050610c6d81610d88565b60008160400151806020019051810190610c879190611d13565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ce582840184611ddd565b90506000610cf282610dcc565b90506000610d0261030d876119db565b9050610d0e8183610e68565b610d17836110ab565b505050505050565b6000610d2b8383611244565b6000818152600360205260409020549091506001600160a01b03168015610d6857604051631f5d53e360e01b8152600481018390526024016103c8565b610d8182610d7c6040880160208901611997565b611269565b5050505050565b6000610d9782604001516112cf565b82519091508114610dc85781516040516337e3d1ab60e01b81526103c8918391600401918252602082015260400190565b5050565b610dd46114f4565b604051806101000160405280610de984611304565b6001600160a01b03168152602001610e0084611319565b8152602001610e0e84611328565b8152602001610e1c84611337565b8152602001610e2a84611346565b8152602001610e3884611355565b8152602001610e508460200151610100015160011490565b15158152602001610e6084611364565b905292915050565b8151604082015114610e9d57815160408281015190516347a9715d60e01b8152600481019290925260248201526044016103c8565b81606001516020015115158160c00151151503610ee65760608201516020015160c0820151604051634629f1b560e11b81529115156004830152151560248201526044016103c8565b81604001516001600160a01b031681600001516001600160a01b031614610f3a57604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016103c8565b60408201516001600160a01b03163314610f7e576040808301519051632bfa317f60e11b81523360048201526001600160a01b0390911660248201526044016103c8565b46816020015114610fb1576020810151604051630432cec160e31b815246600482015260248101919091526044016103c8565b81602001518160a0015114610fec57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016103c8565b6000610ff6610b75565b805160e08401515191925014158061101b575060208082015160e08401519091015114155b1561106457805160208083015160e0850151805192015160405163f71cb0f760e01b815260048101949094526024840191909152604483019190915260648201526084016103c8565b600061106f846113bc565b9050808360600151146110a55760608301516040516377bb6d2760e11b81526103c8918391600401918252602082015260400190565b50505050565b8051805160208083015160409384015191850151935163c542c93b60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463c542c93b9461110e94909392909190600401611eae565b602060405180830381865afa925050508015611147575060408051601f3d908101601f1916820190925261114491810190611f55565b60015b61121d57611153611f70565b806308c379a00361118c5750611167611f8c565b8061117257506111cb565b8060405162dd577760e81b81526004016103c89190612015565b634e487b71036111cb5761119e612028565b906111a957506111cb565b60405162dd577760e81b815260206004820152600060248201526044016103c8565b3d8080156111f5576040519150601f19603f3d011682016040523d82523d6000602084013e6111fa565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016103c8565b80610dc85760405162dd577760e81b815260206004820152600060248201526044016103c8565b60008061125383850185611ddd565b9050600061126082611346565b95945050505050565b60008281526003602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102e3907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190612048565b6020810151600090815b602002015192915050565b6020810151600090600161130e565b6020810151600090600461130e565b6020810151600090600561130e565b6020810151600090600661130e565b6020810151600090600761130e565b61136c611445565b6040518060400160405280836020015160026009811061138e5761138e611b82565b6020020151815260200183602001516003600981106113af576113af611b82565b6020020151905292915050565b6000806113da308460600151600001516001600160801b03166113e1565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113da9190612048565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b82600281019282156114df579160200282015b828111156114df5782518255916020019190600101906114c4565b506114eb929150611544565b5090565b905290565b60405180610100016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114ef611445565b5b808211156114eb5760008155600101611545565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b038211171561158e5761158e611559565b60405250565b606081018181106001600160401b038211171561158e5761158e611559565b601f8201601f191681016001600160401b03811182821017156115d8576115d8611559565b6040525050565b600082601f8301126115f057600080fd5b604051604081018181106001600160401b038211171561161257611612611559565b806040525080604084018581111561162957600080fd5b845b8181101561164357803583526020928301920161162b565b509195945050505050565b60006040828403121561166057600080fd5b6113da83836115df565b8060005b60028110156110a557815184526020938401939091019060010161166e565b604081016102e3828461166a565b6000602082840312156116ad57600080fd5b5035919050565b60008083601f8401126116c657600080fd5b5081356001600160401b038111156116dd57600080fd5b6020830191508360208285010111156116f557600080fd5b9250929050565b60008060006040848603121561171157600080fd5b83356001600160401b038082111561172857600080fd5b908501906040828803121561173c57600080fd5b9093506020850135908082111561175257600080fd5b5061175f868287016116b4565b9497909650939450505050565b60005b8381101561178757818101518382015260200161176f565b838111156110a55750506000910152565b600081518084526117b081602086016020860161176c565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261181f60c0850182611798565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561187c57603f1988860301845261186a8583516117c4565b9450928501929085019060010161184e565b5092979650505050505050565b6001600160a01b03811681146102b257600080fd5b80356118a981611889565b919050565b6000806000806000606086880312156118c657600080fd5b85356001600160401b03808211156118dd57600080fd5b818801915088601f8301126118f157600080fd5b81358181111561190057600080fd5b8960208260051b850101111561191557600080fd5b6020830197508096505061192b6020890161189e565b9450604088013591508082111561194157600080fd5b5061194e888289016116b4565b969995985093965092949392505050565b6000806060838503121561197257600080fd5b61197c84846115df565b9150604083013561198c81611889565b809150509250929050565b6000602082840312156119a957600080fd5b81356113da81611889565b60006001600160401b038211156119cd576119cd611559565b50601f01601f191660200190565b600060408083360312156119ee57600080fd5b80516119f98161156f565b83356001600160401b0380821115611a1057600080fd5b9085019036601f830112611a2357600080fd5b8135602082821115611a3757611a37611559565b8160051b8651611a49838301826115b3565b92835284810182019282810136851115611a6257600080fd5b83870192505b84831015611b3657823586811115611a805760008081fd5b8701606036829003601f1901811315611a995760008081fd5b8a51611aa481611594565b8287013581528b83013581880152908201359088821115611ac55760008081fd5b9181019136603f840112611adb57600091508182fd5b868301359150611aea826119b4565b8c51611af682826115b3565b838152368e858701011115611b0d57600091508182fd5b838e86018a830137600093810189019390935250808c0191909152825250918301918301611a68565b50865250611b4588820161189e565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611b7d57611b7d611b54565b500190565b634e487b7160e01b600052603260045260246000fd5b60008060008060808587031215611bae57600080fd5b8451611bb981611889565b60208601516040870151919550935063ffffffff81168114611bda57600080fd5b60608601519092506001600160401b03811115611bf657600080fd5b8501601f81018713611c0757600080fd5b8051611c12816119b4565b604051611c1f82826115b3565b828152896020848601011115611c3457600080fd5b611c4583602083016020870161176c565b969995985093965050505050565b600060018201611c6557611c65611b54565b5060010190565b604080825283519082018190526000906020906060840190828701845b82811015611cae5781516001600160a01b031684529284019290840190600101611c89565b5050508381038285015284518082528583019183019060005b81811015611ce357835183529284019291840191600101611cc7565b5090979650505050505050565b6020815260006113da60208301846117c4565b805180151581146118a957600080fd5b600060408284031215611d2557600080fd5b604051604081018181106001600160401b0382111715611d4757611d47611559565b60405282516001600160801b0381168114611d6157600080fd5b8152611d6f60208401611d03565b60208201529392505050565b600082601f830112611d8c57600080fd5b6040516101208082018281106001600160401b0382111715611db057611db0611559565b60405283018185821115611dc357600080fd5b845b82811015611643578035825260209182019101611dc5565b6000818303610220811215611df157600080fd5b60408051611dfe8161156f565b61010080841215611e0e57600080fd5b82519350611e1b84611594565b611e2587876115df565b845286605f870112611e3657600080fd5b8251611e418161156f565b8060c0880189811115611e5357600080fd5b8589015b81811015611e7857611e698b826115df565b83526020909201918601611e57565b50826020880152611e898a826115df565b86880152505050838252611e9f87828801611d7b565b60208301525095945050505050565b6102208101611ebd828761166a565b60408083018660005b6002808210611ed55750611f10565b82518460005b83811015611ef9578251825260209283019290910190600101611edb565b505050928401925060209190910190600101611ec6565b50505050611f2160c083018561166a565b61010082018360005b6009811015611f49578151835260209283019290910190600101611f2a565b50505095945050505050565b600060208284031215611f6757600080fd5b6113da82611d03565b600060033d1115611f895760046000803e5060005160e01c5b90565b600060443d1015611f9a5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611fc957505050505090565b8285019150815181811115611fe15750505050505090565b843d8701016020828501011115611ffb5750505050505090565b61200a602082860101876115b3565b509095945050505050565b6020815260006113da6020830184611798565b60008060233d1115612044576020600460003e50506000516001905b9091565b60008261206557634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220ecfcdd3ed3aafdf6de9cf8f871557ae2657814cf595e7da8c33a09d25121780964736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063754b377c11610097578063c776adde11610066578063c776adde14610255578063c9cdef0414610268578063e60f999f1461027b578063f2fde38b1461028e57600080fd5b8063754b377c146101de5780638da5cb5b146101f8578063af411a301461020f578063bfa665851461022f57600080fd5b806354846d7a116100d357806354846d7a1461016757806363e4afc21461019c5780637000b051146101af578063715018a6146101d657600080fd5b8063124d7199146100fa5780632785e3221461010f57806346657fe91461012d575b600080fd5b61010d61010836600461164e565b6102a1565b005b6101176102b5565b604051610124919061168d565b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610124565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610124565b61014f6101aa36600461169b565b6102ca565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b61010d6102e9565b6101e6600381565b60405160ff9091168152602001610124565b6000546201000090046001600160a01b031661014f565b61022261021d3660046116fc565b6102fd565b6040516101249190611827565b7f000000000000000000000000000000000000000000000000000000000000000061014f565b6102226102633660046118ae565b61045c565b61010d61027636600461195f565b610817565b6102226102893660046116fc565b61093a565b61010d61029c366004611997565b610a56565b6102a9610acc565b6102b281610b2d565b50565b6102bd611445565b6102c5610b75565b905090565b6000818152600360205260408120546001600160a01b03165b92915050565b6102f1610acc565b6102fb6000610baf565b565b6060600061031261030d866119db565b610c0a565b60408051600180825281830190925291925060009190816020015b610335611463565b81526020019060019003908161032d575050606083015151909150600090610386906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611b6a565b90507f00000000000000000000000000000000000000000000000000000000000000008111156103d157604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b03168152602001856020015181526020014263ffffffff168152602001604051806020016040528060008152508152508360008151811061044557610445611b82565b602090810291909101015250909695505050505050565b60606000856001600160401b0381111561047857610478611559565b6040519080825280602002602001820160405280156104a1578160200160208202803683370190505b5090506000866001600160401b038111156104be576104be611559565b6040519080825280602002602001820160405280156104e7578160200160208202803683370190505b5090506000876001600160401b0381111561050457610504611559565b60405190808252806020026020018201604052801561053d57816020015b61052a611463565b8152602001906001900390816105225790505b50905060005b88811015610711576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f8881811061059257610592611b82565b905060200201358e6040518363ffffffff1660e01b81526004016105c99291909182526001600160a01b0316602082015260400190565b600060405180830381865afa1580156105e6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261060e9190810190611b98565b93509350935093508b88868151811061062957610629611b82565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061065b5761065b611b82565b9050602002013587868151811061067457610674611b82565b6020026020010181815250506040518060c001604052808f8f8881811061069d5761069d611b82565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff168152602001828152508686815181106106ef576106ef611b82565b602002602001018190525050505050808061070990611c53565b915050610543565b5061071d818787610cbe565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061076b9086908690600401611c6c565b600060405180830381600087803b15801561078557600080fd5b505af1158015610799573d6000803e3d6000fd5b5050505060005b8881101561080a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b8282815181106107db576107db611b82565b60200260200101516040516107f09190611cf0565b60405180910390a18061080281611c53565b9150506107a0565b5098975050505050505050565b600054600390610100900460ff16158015610839575060005460ff8083169116105b61089c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103c8565b6000805461ffff191660ff8316176101001781556108c96000546001600160a01b03620100009091041690565b6001600160a01b031614806108dd5750303b155b156108f4576108eb82610baf565b6108f483610b2d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6060610947848484610cd7565b60006109548585856102fd565b9050610961858585610d1f565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906109ad908490600401611827565b600060405180830381600087803b1580156109c757600080fd5b505af11580156109db573d6000803e3d6000fd5b5050505060005b8151811015610a4d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610a1e57610a1e611b82565b6020026020010151604051610a339190611cf0565b60405180910390a180610a4581611c53565b9150506109e2565b50949350505050565b610a5e610acc565b6001600160a01b038116610ac35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103c8565b6102b281610baf565b6000546001600160a01b03620100009091041633146102fb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103c8565b610b3a60018260026114b1565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051610b6a919061168d565b60405180910390a150565b610b7d611445565b60408051808201918290529060019060029082845b815481526020019060010190808311610b92575050505050905090565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b610c416040805160808101825260008082526020808301829052828401829052835180850190945281845283015290606082015290565b60008260000151600081518110610c5a57610c5a611b82565b60200260200101519050610c6d81610d88565b60008160400151806020019051810190610c879190611d13565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ce582840184611ddd565b90506000610cf282610dcc565b90506000610d0261030d876119db565b9050610d0e8183610e68565b610d17836110ab565b505050505050565b6000610d2b8383611244565b6000818152600360205260409020549091506001600160a01b03168015610d6857604051631f5d53e360e01b8152600481018390526024016103c8565b610d8182610d7c6040880160208901611997565b611269565b5050505050565b6000610d9782604001516112cf565b82519091508114610dc85781516040516337e3d1ab60e01b81526103c8918391600401918252602082015260400190565b5050565b610dd46114f4565b604051806101000160405280610de984611304565b6001600160a01b03168152602001610e0084611319565b8152602001610e0e84611328565b8152602001610e1c84611337565b8152602001610e2a84611346565b8152602001610e3884611355565b8152602001610e508460200151610100015160011490565b15158152602001610e6084611364565b905292915050565b8151604082015114610e9d57815160408281015190516347a9715d60e01b8152600481019290925260248201526044016103c8565b81606001516020015115158160c00151151503610ee65760608201516020015160c0820151604051634629f1b560e11b81529115156004830152151560248201526044016103c8565b81604001516001600160a01b031681600001516001600160a01b031614610f3a57604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016103c8565b60408201516001600160a01b03163314610f7e576040808301519051632bfa317f60e11b81523360048201526001600160a01b0390911660248201526044016103c8565b46816020015114610fb1576020810151604051630432cec160e31b815246600482015260248101919091526044016103c8565b81602001518160a0015114610fec57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016103c8565b6000610ff6610b75565b805160e08401515191925014158061101b575060208082015160e08401519091015114155b1561106457805160208083015160e0850151805192015160405163f71cb0f760e01b815260048101949094526024840191909152604483019190915260648201526084016103c8565b600061106f846113bc565b9050808360600151146110a55760608301516040516377bb6d2760e11b81526103c8918391600401918252602082015260400190565b50505050565b8051805160208083015160409384015191850151935163c542c93b60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463c542c93b9461110e94909392909190600401611eae565b602060405180830381865afa925050508015611147575060408051601f3d908101601f1916820190925261114491810190611f55565b60015b61121d57611153611f70565b806308c379a00361118c5750611167611f8c565b8061117257506111cb565b8060405162dd577760e81b81526004016103c89190612015565b634e487b71036111cb5761119e612028565b906111a957506111cb565b60405162dd577760e81b815260206004820152600060248201526044016103c8565b3d8080156111f5576040519150601f19603f3d011682016040523d82523d6000602084013e6111fa565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016103c8565b80610dc85760405162dd577760e81b815260206004820152600060248201526044016103c8565b60008061125383850185611ddd565b9050600061126082611346565b95945050505050565b60008281526003602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102e3907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190612048565b6020810151600090815b602002015192915050565b6020810151600090600161130e565b6020810151600090600461130e565b6020810151600090600561130e565b6020810151600090600661130e565b6020810151600090600761130e565b61136c611445565b6040518060400160405280836020015160026009811061138e5761138e611b82565b6020020151815260200183602001516003600981106113af576113af611b82565b6020020151905292915050565b6000806113da308460600151600001516001600160801b03166113e1565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113da9190612048565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b82600281019282156114df579160200282015b828111156114df5782518255916020019190600101906114c4565b506114eb929150611544565b5090565b905290565b60405180610100016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114ef611445565b5b808211156114eb5760008155600101611545565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b038211171561158e5761158e611559565b60405250565b606081018181106001600160401b038211171561158e5761158e611559565b601f8201601f191681016001600160401b03811182821017156115d8576115d8611559565b6040525050565b600082601f8301126115f057600080fd5b604051604081018181106001600160401b038211171561161257611612611559565b806040525080604084018581111561162957600080fd5b845b8181101561164357803583526020928301920161162b565b509195945050505050565b60006040828403121561166057600080fd5b6113da83836115df565b8060005b60028110156110a557815184526020938401939091019060010161166e565b604081016102e3828461166a565b6000602082840312156116ad57600080fd5b5035919050565b60008083601f8401126116c657600080fd5b5081356001600160401b038111156116dd57600080fd5b6020830191508360208285010111156116f557600080fd5b9250929050565b60008060006040848603121561171157600080fd5b83356001600160401b038082111561172857600080fd5b908501906040828803121561173c57600080fd5b9093506020850135908082111561175257600080fd5b5061175f868287016116b4565b9497909650939450505050565b60005b8381101561178757818101518382015260200161176f565b838111156110a55750506000910152565b600081518084526117b081602086016020860161176c565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261181f60c0850182611798565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561187c57603f1988860301845261186a8583516117c4565b9450928501929085019060010161184e565b5092979650505050505050565b6001600160a01b03811681146102b257600080fd5b80356118a981611889565b919050565b6000806000806000606086880312156118c657600080fd5b85356001600160401b03808211156118dd57600080fd5b818801915088601f8301126118f157600080fd5b81358181111561190057600080fd5b8960208260051b850101111561191557600080fd5b6020830197508096505061192b6020890161189e565b9450604088013591508082111561194157600080fd5b5061194e888289016116b4565b969995985093965092949392505050565b6000806060838503121561197257600080fd5b61197c84846115df565b9150604083013561198c81611889565b809150509250929050565b6000602082840312156119a957600080fd5b81356113da81611889565b60006001600160401b038211156119cd576119cd611559565b50601f01601f191660200190565b600060408083360312156119ee57600080fd5b80516119f98161156f565b83356001600160401b0380821115611a1057600080fd5b9085019036601f830112611a2357600080fd5b8135602082821115611a3757611a37611559565b8160051b8651611a49838301826115b3565b92835284810182019282810136851115611a6257600080fd5b83870192505b84831015611b3657823586811115611a805760008081fd5b8701606036829003601f1901811315611a995760008081fd5b8a51611aa481611594565b8287013581528b83013581880152908201359088821115611ac55760008081fd5b9181019136603f840112611adb57600091508182fd5b868301359150611aea826119b4565b8c51611af682826115b3565b838152368e858701011115611b0d57600091508182fd5b838e86018a830137600093810189019390935250808c0191909152825250918301918301611a68565b50865250611b4588820161189e565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611b7d57611b7d611b54565b500190565b634e487b7160e01b600052603260045260246000fd5b60008060008060808587031215611bae57600080fd5b8451611bb981611889565b60208601516040870151919550935063ffffffff81168114611bda57600080fd5b60608601519092506001600160401b03811115611bf657600080fd5b8501601f81018713611c0757600080fd5b8051611c12816119b4565b604051611c1f82826115b3565b828152896020848601011115611c3457600080fd5b611c4583602083016020870161176c565b969995985093965050505050565b600060018201611c6557611c65611b54565b5060010190565b604080825283519082018190526000906020906060840190828701845b82811015611cae5781516001600160a01b031684529284019290840190600101611c89565b5050508381038285015284518082528583019183019060005b81811015611ce357835183529284019291840191600101611cc7565b5090979650505050505050565b6020815260006113da60208301846117c4565b805180151581146118a957600080fd5b600060408284031215611d2557600080fd5b604051604081018181106001600160401b0382111715611d4757611d47611559565b60405282516001600160801b0381168114611d6157600080fd5b8152611d6f60208401611d03565b60208201529392505050565b600082601f830112611d8c57600080fd5b6040516101208082018281106001600160401b0382111715611db057611db0611559565b60405283018185821115611dc357600080fd5b845b82811015611643578035825260209182019101611dc5565b6000818303610220811215611df157600080fd5b60408051611dfe8161156f565b61010080841215611e0e57600080fd5b82519350611e1b84611594565b611e2587876115df565b845286605f870112611e3657600080fd5b8251611e418161156f565b8060c0880189811115611e5357600080fd5b8589015b81811015611e7857611e698b826115df565b83526020909201918601611e57565b50826020880152611e898a826115df565b86880152505050838252611e9f87828801611d7b565b60208301525095945050505050565b6102208101611ebd828761166a565b60408083018660005b6002808210611ed55750611f10565b82518460005b83811015611ef9578251825260209283019290910190600101611edb565b505050928401925060209190910190600101611ec6565b50505050611f2160c083018561166a565b61010082018360005b6009811015611f49578151835260209283019290910190600101611f2a565b50505095945050505050565b600060208284031215611f6757600080fd5b6113da82611d03565b600060033d1115611f895760046000803e5060005160e01c5b90565b600060443d1015611f9a5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611fc957505050505090565b8285019150815181811115611fe15750505050505090565b843d8701016020828501011115611ffb5750505050505090565b61200a602082860101876115b3565b509095945050505050565b6020815260006113da6020830184611798565b60008060233d1115612044576020600460003e50506000516001905b9091565b60008261206557634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220ecfcdd3ed3aafdf6de9cf8f871557ae2657814cf595e7da8c33a09d25121780964736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns attestations that will be recorded, constructed from the user request", - "params": { - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "collectionIdFirst": "Id of the first collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last collection in which the attester is supposed to record", - "commitmentSignerPubKey": "The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme", - "owner": "The owner of the contract that can update the commitment signer pub key", - "pythia1VerifierAddress": "ZK Snark Pythia-1 Verifier contract" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getCommitmentSignerPubKey()": { - "details": "Getter of the Commitment signer Eddsa Public key" - }, - "getDestinationOfTicket(uint256)": { - "details": "Getter, returns the last attestation destination of a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getVerifier()": { - "details": "Getter of Pythia-1 Verifier contract" - }, - "initialize(uint256[2],address)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "commitmentSignerPubKey": "EdDSA public key of the commitment signer", - "ownerAddress": "Owner of the contract, can update public key and address" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "stateVariables": { - "AUTHORIZED_COLLECTION_ID_FIRST": { - "details": "Getter returns of the first collection in which the attester is supposed to record*" - }, - "AUTHORIZED_COLLECTION_ID_LAST": { - "details": "Getter returns of the last collection in which the attester is supposed to record*" - } - }, - "title": "Pythia-1 Simple Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(uint256[2],address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "This attester is part of the family of the Pythia-1 Attesters. Pythia-1 attesters enable users to prove they have a claim and its proof issued by an offchain service in a privacy preserving way. That means no-one can make the link between the account used in the offchain service and the onchain account where the attestation is stored. The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic. We invite readers to refer to: - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each users gets one userTicket per claim For people used to semaphore/ tornado cash people: userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 396, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_owner", - "offset": 2, - "slot": "0", - "type": "t_address" - }, - { - "astId": 9697, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_commitmentSignerPubKey", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)2_storage" - }, - { - "astId": 9701, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_ticketsDestinations", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_uint256,t_address)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)2_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[2]", - "numberOfBytes": "64" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_address)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/Pythia1SimpleAttesterImplemV2.json b/deployments/goerli/Pythia1SimpleAttesterImplemV2.json deleted file mode 100644 index d647106..0000000 --- a/deployments/goerli/Pythia1SimpleAttesterImplemV2.json +++ /dev/null @@ -1,994 +0,0 @@ -{ - "address": "0x816A79BfD43c8a72c4bB5831d3863CbDD966719D", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - }, - { - "internalType": "address", - "name": "pythia1VerifierAddress", - "type": "address" - }, - { - "internalType": "uint256[2]", - "name": "commitmentSignerPubKey", - "type": "uint256[2]" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentSignerPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "GroupIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedTicketIdentifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ticketIdentifier", - "type": "uint256" - } - ], - "name": "TicketIdentifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "TicketUsed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "inputdestination", - "type": "address" - } - ], - "name": "UserShouldOwnItsDestination", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256[2]", - "name": "newCommitmentSignerPubKey", - "type": "uint256[2]" - } - ], - "name": "CommitmentSignerPubKeyUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "TicketDestinationUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentSignerPubKey", - "outputs": [ - { - "internalType": "uint256[2]", - "name": "", - "type": "uint256[2]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getDestinationOfTicket", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract Pythia1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "commitmentSignerPubKey", - "type": "uint256[2]" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "commitmentSignerPubKey", - "type": "uint256[2]" - } - ], - "name": "updateCommitmentSignerPubKey", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x06a4f9cd74294bcc324b4a48234a53efc93a84f7a7e67688887d45a4ce5f8ee5", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x816A79BfD43c8a72c4bB5831d3863CbDD966719D", - "transactionIndex": 62, - "gasUsed": "1938626", - "logsBloom": "0x00000000000200000000000000020000000000000000000000800000000000000000000000000000000000000000000000000000000040000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000020000000000000000000800002000800000000000000000000000400000000000000000000000000000000000000000000000000000000000000800000000000000200000200000800000000000000000000000000000000000000000000000000000000000000000000000000000000000400000000000000020000000000000000000000000000000000000000200000000000000008000000000", - "blockHash": "0x9ee54c1063117f1e4199686fba71783aa8e2946e8a2b11bcc5a11ce071a905a9", - "transactionHash": "0x06a4f9cd74294bcc324b4a48234a53efc93a84f7a7e67688887d45a4ce5f8ee5", - "logs": [ - { - "transactionIndex": 62, - "blockNumber": 7827084, - "transactionHash": "0x06a4f9cd74294bcc324b4a48234a53efc93a84f7a7e67688887d45a4ce5f8ee5", - "address": "0x816A79BfD43c8a72c4bB5831d3863CbDD966719D", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "data": "0x", - "logIndex": 196, - "blockHash": "0x9ee54c1063117f1e4199686fba71783aa8e2946e8a2b11bcc5a11ce071a905a9" - }, - { - "transactionIndex": 62, - "blockNumber": 7827084, - "transactionHash": "0x06a4f9cd74294bcc324b4a48234a53efc93a84f7a7e67688887d45a4ce5f8ee5", - "address": "0x816A79BfD43c8a72c4bB5831d3863CbDD966719D", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954" - ], - "data": "0x", - "logIndex": 197, - "blockHash": "0x9ee54c1063117f1e4199686fba71783aa8e2946e8a2b11bcc5a11ce071a905a9" - }, - { - "transactionIndex": 62, - "blockNumber": 7827084, - "transactionHash": "0x06a4f9cd74294bcc324b4a48234a53efc93a84f7a7e67688887d45a4ce5f8ee5", - "address": "0x816A79BfD43c8a72c4bB5831d3863CbDD966719D", - "topics": [ - "0xda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df" - ], - "data": "0x038d3d596875c66eb90608bbe04e4e238607fd32ad61f4278bdaf47aadc28d601b46b55a0ce3f35d6025cdd4554aaac1fc7180b14d51b0f15aa51a6929bdb952", - "logIndex": 198, - "blockHash": "0x9ee54c1063117f1e4199686fba71783aa8e2946e8a2b11bcc5a11ce071a905a9" - } - ], - "blockNumber": 7827084, - "cumulativeGasUsed": "16939285", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf85BA0afA375495eE625910Db61b6b1406756234", - "30000001", - "30000100", - "0xEE077AD7a47e56F075f0C3bd41Cdc1629FdA3a9c", - [ - "0x038d3d596875c66eb90608bbe04e4e238607fd32ad61f4278bdaf47aadc28d60", - "0x1b46b55a0ce3f35d6025cdd4554aaac1fc7180b14d51b0f15aa51a6929bdb952" - ], - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954" - ], - "numDeployments": 1, - "solcInputHash": "7e84cd39af8dda1388150d22fc6a7983", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"pythia1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentSignerPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"GroupIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"TicketUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputdestination\",\"type\":\"address\"}],\"name\":\"UserShouldOwnItsDestination\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256[2]\",\"name\":\"newCommitmentSignerPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"CommitmentSignerPubKeyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentSignerPubKey\",\"outputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"\",\"type\":\"uint256[2]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract Pythia1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"updateCommitmentSignerPubKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns attestations that will be recorded, constructed from the user request\",\"params\":{\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentSignerPubKey\":\"The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\",\"owner\":\"The owner of the contract that can update the commitment signer pub key\",\"pythia1VerifierAddress\":\"ZK Snark Pythia-1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getCommitmentSignerPubKey()\":{\"details\":\"Getter of the Commitment signer Eddsa Public key\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Pythia-1 Verifier contract\"},\"initialize(uint256[2],address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"commitmentSignerPubKey\":\"EdDSA public key of the commitment signer\",\"owner\":\"Owner of the contract, can update public key and address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"}},\"title\":\"Pythia-1 Simple Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This attester is part of the family of the Pythia-1 Attesters. Pythia-1 attesters enable users to prove they have a claim and its proof issued by an offchain service in a privacy preserving way. That means no-one can make the link between the account used in the offchain service and the onchain account where the attestation is stored. The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic. We invite readers to refer to: - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each users gets one userTicket per claim For people used to semaphore/ tornado cash people: userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/pythia-1/Pythia1SimpleAttester.sol\":\"Pythia1SimpleAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() initializer {}\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\\n // contract may have been reentered.\\n require(_initializing ? _isConstructor() : !_initialized, \\\"Initializable: contract is already initialized\\\");\\n\\n bool isTopLevelCall = !_initializing;\\n if (isTopLevelCall) {\\n _initializing = true;\\n _initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n _initializing = false;\\n }\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} modifier, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n function _isConstructor() private view returns (bool) {\\n return !Address.isContract(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x4823752b07b8ea4ca971b217e39457930e7cb103c2c91e2a29729e5ca907e4f0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/pythia-1/contracts/Pythia1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract Pythia1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\\n );\\n vk.IC = new Pairing.G1Point[](10);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 104028078850975554065172701281783302003220555203883119831575537681421753151,\\n 19148240629904598794948591359118971959790791697910953160820265703277306346\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[9] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3babb956e64535b9bf535df94288b4d83ea82c54727f79ee8949fe4a19c1d5ba\",\"license\":\"GPL-3.0\"},\"contracts/attesters/pythia-1/Pythia1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to Pythia1 Proving Scheme\\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\\n\\n/**\\n * @title Pythia-1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Pythia-1 Attesters.\\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \\n * offchain service in a privacy preserving way. \\n * That means no-one can make the link between the account used in the offchain service\\n * and the onchain account where the attestation is stored.\\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\\n * We invite readers to refer to:\\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each users gets one userTicket per claim\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n **/\\n\\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\\n using Pythia1Lib for Pythia1ProofData;\\n using Pythia1Lib for bytes;\\n using Pythia1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n uint256[2] internal _commitmentSignerPubKey;\\n mapping(uint256 => address) internal _ticketsDestinations;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\\n * @param owner The owner of the contract that can update the commitment signer pub key\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n address pythia1VerifierAddress,\\n uint256[2] memory commitmentSignerPubKey,\\n address owner\\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n initialize(commitmentSignerPubKey, owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) public initializer {\\n _transferOwnership(owner);\\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into Pythia1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\\n Pythia1ProofInput memory snarkInput = snarkProof._input();\\n Pythia1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(Request calldata request, bytes calldata)\\n public\\n view\\n virtual\\n override(IAttester, Attester)\\n returns (Attestation[] memory)\\n {\\n Pythia1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.internalCollectionId;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n uint32(block.timestamp),\\n ''\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used\\n * @param request users request. Claim of beiing part of a group.\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n // we get the ticket used from the snark input in the data provided\\n uint256 userTicket = proofData._getTicket();\\n address currentDestination = _getDestinationOfTicket(userTicket);\\n\\n if (currentDestination != address(0)) {\\n revert TicketUsed(userTicket);\\n }\\n\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n /*******************************************************\\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\\n * users bring secretHash as private input in snark which guarantees privacy\\n * the secretHash is only known by the user and never escape the user's browser\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(Pythia1Claim memory claim)\\n internal\\n view\\n override\\n returns (uint256)\\n {\\n uint256 ticketIdentifier = _encodeInSnarkField(\\n address(this),\\n claim.groupProperties.internalCollectionId\\n );\\n return ticketIdentifier;\\n }\\n\\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\\n return _commitmentSignerPubKey;\\n }\\n\\n /*******************************************************\\n Pythia-1 Attester Specific Functions\\n *******************************************************/\\n\\n function updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey)\\n external\\n onlyOwner\\n {\\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\\n }\\n\\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\\n _commitmentSignerPubKey = commitmentSignerPubKey;\\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\\n }\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _ticketsDestinations[userTicket] = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _ticketsDestinations[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x8e9e36f3b5d2ca8decde179a6aac0c06de656f20c25268444fd8d0feac327bc0\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/base/IPythia1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\\n\\ninterface IPythia1Base {\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error UserShouldOwnItsDestination(address sender, address inputdestination);\\n error CommitmentSignerPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Pythia-1 Verifier contract\\n */\\n function getVerifier() external view returns (Pythia1Verifier);\\n\\n /**\\n * @dev Getter of the Commitment Signer EdDSA Public Key\\n */\\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\\n}\\n\",\"keccak256\":\"0x61924d768ab0c8cd61d0ff3c9ecbfbc37aacdbec7f575f0d46041b1847222526\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/base/Pythia1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IPythia1Base} from './IPythia1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Pythia 1 ZK Proving Scheme\\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\\n\\n/**\\n * @title Pythia-1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \\n * without anyone being able to make the link between the offchain service and the onchain service.\\n * It is inherited by the family of Pythia-1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to:\\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\\n \\n \\n **/\\nabstract contract Pythia1Base is IPythia1Base, Initializable {\\n using Pythia1Lib for Pythia1ProofData;\\n\\n // ZK-SNARK Verifier\\n Pythia1Verifier immutable VERIFIER;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\\n */\\n constructor(address Pythia1VerifierAddress) {\\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\\n }\\n\\n /**\\n * @dev Getter of Pythia-1 Verifier contract\\n */\\n function getVerifier() external view returns (Pythia1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of the Commitment signer Eddsa Public key\\n */\\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\\n return _getCommitmentSignerPubKey();\\n }\\n\\n /*******************************************************\\n Pythia-1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\\n * the secretHash is a number only known by the user and is used in \\n * the zero knowledge as a private input which guarantees privacy\\n\\n * This function MUST be implemented by Pythia-1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Pythia-1 Simple Attester for an example\\n * @param claim user claim: a particular claim that a user have that he can prove s right.\\n */\\n function _getTicketIdentifierOfClaim(Pythia1Claim memory claim)\\n internal\\n view\\n virtual\\n returns (uint256);\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\\n * prove the claim was correctly issued for the user.\\n */\\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(Pythia1Claim memory claim, Pythia1ProofInput memory input)\\n internal\\n view\\n virtual\\n {\\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (claim.destination != msg.sender)\\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\\n if (\\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\\n )\\n revert CommitmentSignerPubKeyMismatch(\\n commitmentSignerPubKey[0],\\n commitmentSignerPubKey[1],\\n input.commitmentSignerPubKey[0],\\n input.commitmentSignerPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the plonk mathematical proof using the circom verifier contract\\n * @param proofData snark public input\\n */\\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(\\n uint256 /*errorCode*/\\n ) {\\n revert InvalidGroth16Proof('');\\n } catch (\\n bytes memory /*lowLevelData*/\\n ) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0x6ec48f1e07923e6ceed30965ef7bdd0faf6763a3bbd239c31e1eb3c54577e5cb\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\\n\\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\\n error TicketUsed(uint256 userTicket);\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb5eca9793c0e8f015e5c7fbdc6b4e6a5137f4fd0b82b51c1c3d69accec039a4b\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/libs/Pythia1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\\n\\n// user Pythia-1 claim retrieved form his request\\nstruct Pythia1Claim {\\n uint256 groupId; // user claims be part of this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct Pythia1GroupProperties {\\n uint128 internalCollectionId;\\n bool isScore;\\n}\\n\\nstruct Pythia1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct Pythia1ProofData {\\n Pythia1CircomSnarkProof proof;\\n uint256[9] input;\\n // destination;\\n // chainId;\\n // commitmentSignerPubKey.x;\\n // commitmentSignerPubKey.y;\\n // groupId;\\n // ticketIdentifier;\\n // userTicket;\\n // value;\\n // isStrict;\\n}\\n\\nstruct Pythia1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 groupId;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n bool isStrict;\\n uint256[2] commitmentSignerPubKey;\\n}\\n\\nlibrary Pythia1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\\n return\\n Pythia1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getGroupId(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n Pythia1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (Pythia1GroupProperties)\\n );\\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(Pythia1ProofData memory self)\\n internal\\n pure\\n returns (\\n uint256[2] memory,\\n uint256[2][2] memory,\\n uint256[2] memory,\\n uint256[9] memory\\n )\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(Pythia1ProofData memory self)\\n internal\\n pure\\n returns (uint256[2] memory)\\n {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(Pythia1ProofData memory self)\\n internal\\n pure\\n returns (uint256)\\n {\\n return self.input[5];\\n }\\n\\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\\n return self.input[8] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(uint128 internalCollectionId, bool isScore)\\n internal\\n pure\\n returns (uint256)\\n {\\n return\\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\\n }\\n\\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\\n internal\\n pure\\n returns (uint256)\\n {\\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(uint128 internalCollectionId, bool isScore)\\n internal\\n pure\\n returns (bytes memory)\\n {\\n return abi.encode(internalCollectionId, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x2431749971d4fa2f5789cd0adb62457edec6819ed956962b9db55a39bc2e5832\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n override\\n returns (Attestation[] memory)\\n {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n address[] memory attestationOwners = new address[](collectionIds.length);\\n\\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\\n\\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n // fetch attestations from the registry\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationOwners[i] = attestationsOwner;\\n attestationCollectionIds[i] = collectionIds[i];\\n\\n attestations[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestations, proofData);\\n\\n _beforeDeleteAttestations(attestations, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n\\n _afterDeleteAttestations(attestations, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestations[i]);\\n }\\n return attestations;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n}\\n\",\"keccak256\":\"0xcab4865f46f442ae11ea0689f63eb7fa0763fcfe86522aa67521a548171cb8e0\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xcf79a817ec578f5b4d8f23853dd8df0e3b1acfbff2b5a01601fd9a7315862ec9\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101006040523480156200001257600080fd5b50604051620024a2380380620024a28339810160408190526200003591620002b6565b6001600160a01b03838116608052861660a052620000533362000075565b60c085905260e0849052620000698282620000d0565b505050505050620003b7565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054610100900460ff16620000ed5760005460ff1615620000f7565b620000f7620001b0565b6200015f5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b600054610100900460ff1615801562000182576000805461ffff19166101011790555b6200018d8262000075565b6200019883620001ce565b8015620001ab576000805461ff00191690555b505050565b6000620001c8306200021a60201b62000ad01760201c565b15905090565b620001dd600182600262000229565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df816040516200020f919062000384565b60405180910390a150565b6001600160a01b03163b151590565b82600281019282156200025a579160200282015b828111156200025a5782518255916020019190600101906200023d565b50620002689291506200026c565b5090565b5b808211156200026857600081556001016200026d565b80516001600160a01b03811681146200029b57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060e08789031215620002d057600080fd5b620002db8762000283565b9550602080880151955060408801519450620002fa6060890162000283565b935088609f8901126200030c57600080fd5b604080519081016001600160401b0381118282101715620003315762000331620002a0565b6040528060c08a018b8111156200034757600080fd5b60808b015b818110156200036557805183529184019184016200034c565b50829550620003748162000283565b9450505050509295509295509295565b60408101818360005b6002811015620003ae5781518352602092830192909101906001016200038d565b50505092915050565b60805160a05160c05160e0516120876200041b600039600081816101a901526103c0015260008181610161015261039801526000818161020c01528181610584015281816107650152610953015260008181610124015261108701526120876000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638da5cb5b1161008c578063c776adde11610066578063c776adde14610230578063c9cdef0414610243578063e60f999f14610256578063f2fde38b1461026957600080fd5b80638da5cb5b146101d3578063af411a30146101ea578063bfa665851461020a57600080fd5b806354846d7a116100c857806354846d7a1461015c57806363e4afc2146101915780637000b051146101a4578063715018a6146101cb57600080fd5b8063124d7199146100ef5780632785e3221461010457806346657fe914610122575b600080fd5b6101026100fd366004611600565b61027c565b005b61010c6102c2565b604051610119919061163f565b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610119565b6101837f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610119565b61014461019f36600461164d565b6102d7565b6101837f000000000000000000000000000000000000000000000000000000000000000081565b6101026102f6565b6000546201000090046001600160a01b0316610144565b6101fd6101f83660046116ae565b610333565b60405161011991906117d9565b7f0000000000000000000000000000000000000000000000000000000000000000610144565b6101fd61023e366004611860565b61048d565b610102610251366004611911565b610848565b6101fd6102643660046116ae565b610915565b610102610277366004611949565b610a31565b6000546001600160a01b03620100009091041633146102b65760405162461bcd60e51b81526004016102ad90611966565b60405180910390fd5b6102bf81610adf565b50565b6102ca6113f7565b6102d2610b27565b905090565b6000818152600360205260408120546001600160a01b03165b92915050565b6000546001600160a01b03620100009091041633146103275760405162461bcd60e51b81526004016102ad90611966565b6103316000610b61565b565b60606000610348610343866119c2565b610bbc565b60408051600180825281830190925291925060009190816020015b61036b611415565b8152602001906001900390816103635750506060830151519091506000906103bc906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611b51565b90507f000000000000000000000000000000000000000000000000000000000000000081111561040257604051637bbf29e360e01b8152600481018290526024016102ad565b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b03168152602001856020015181526020014263ffffffff168152602001604051806020016040528060008152508152508360008151811061047657610476611b69565b602090810291909101015250909695505050505050565b60606000856001600160401b038111156104a9576104a961150b565b6040519080825280602002602001820160405280156104d2578160200160208202803683370190505b5090506000866001600160401b038111156104ef576104ef61150b565b604051908082528060200260200182016040528015610518578160200160208202803683370190505b5090506000876001600160401b038111156105355761053561150b565b60405190808252806020026020018201604052801561056e57816020015b61055b611415565b8152602001906001900390816105535790505b50905060005b88811015610742576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106105c3576105c3611b69565b905060200201358e6040518363ffffffff1660e01b81526004016105fa9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610617573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261063f9190810190611b7f565b93509350935093508b88868151811061065a5761065a611b69565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061068c5761068c611b69565b905060200201358786815181106106a5576106a5611b69565b6020026020010181815250506040518060c001604052808f8f888181106106ce576106ce611b69565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061072057610720611b69565b602002602001018190525050505050808061073a90611c3a565b915050610574565b5061074e818787610c70565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061079c9086908690600401611c53565b600060405180830381600087803b1580156107b657600080fd5b505af11580156107ca573d6000803e3d6000fd5b5050505060005b8881101561083b577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061080c5761080c611b69565b60200260200101516040516108219190611cd7565b60405180910390a18061083381611c3a565b9150506107d1565b5098975050505050505050565b600054610100900460ff166108635760005460ff1615610867565b303b155b6108ca5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016102ad565b600054610100900460ff161580156108ec576000805461ffff19166101011790555b6108f582610b61565b6108fe83610adf565b8015610910576000805461ff00191690555b505050565b6060610922848484610c89565b600061092f858585610333565b905061093c858585610cd1565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906109889084906004016117d9565b600060405180830381600087803b1580156109a257600080fd5b505af11580156109b6573d6000803e3d6000fd5b5050505060005b8151811015610a28577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc8282815181106109f9576109f9611b69565b6020026020010151604051610a0e9190611cd7565b60405180910390a180610a2081611c3a565b9150506109bd565b50949350505050565b6000546001600160a01b0362010000909104163314610a625760405162461bcd60e51b81526004016102ad90611966565b6001600160a01b038116610ac75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102ad565b6102bf81610b61565b6001600160a01b03163b151590565b610aec6001826002611463565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051610b1c919061163f565b60405180910390a150565b610b2f6113f7565b60408051808201918290529060019060029082845b815481526020019060010190808311610b44575050505050905090565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b610bf36040805160808101825260008082526020808301829052828401829052835180850190945281845283015290606082015290565b60008260000151600081518110610c0c57610c0c611b69565b60200260200101519050610c1f81610d3a565b60008160400151806020019051810190610c399190611cfa565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610c9782840184611dc4565b90506000610ca482610d7e565b90506000610cb4610343876119c2565b9050610cc08183610e1a565b610cc98361105d565b505050505050565b6000610cdd83836111f6565b6000818152600360205260409020549091506001600160a01b03168015610d1a57604051631f5d53e360e01b8152600481018390526024016102ad565b610d3382610d2e6040880160208901611949565b61121b565b5050505050565b6000610d498260400151611281565b82519091508114610d7a5781516040516337e3d1ab60e01b81526102ad918391600401918252602082015260400190565b5050565b610d866114a6565b604051806101000160405280610d9b846112b6565b6001600160a01b03168152602001610db2846112cb565b8152602001610dc0846112da565b8152602001610dce846112e9565b8152602001610ddc846112f8565b8152602001610dea84611307565b8152602001610e028460200151610100015160011490565b15158152602001610e1284611316565b905292915050565b8151604082015114610e4f57815160408281015190516347a9715d60e01b8152600481019290925260248201526044016102ad565b81606001516020015115158160c00151151503610e985760608201516020015160c0820151604051634629f1b560e11b81529115156004830152151560248201526044016102ad565b81604001516001600160a01b031681600001516001600160a01b031614610eec57604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016102ad565b60408201516001600160a01b03163314610f30576040808301519051632bfa317f60e11b81523360048201526001600160a01b0390911660248201526044016102ad565b46816020015114610f63576020810151604051630432cec160e31b815246600482015260248101919091526044016102ad565b81602001518160a0015114610f9e57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016102ad565b6000610fa8610b27565b805160e084015151919250141580610fcd575060208082015160e08401519091015114155b1561101657805160208083015160e0850151805192015160405163f71cb0f760e01b815260048101949094526024840191909152604483019190915260648201526084016102ad565b60006110218461136e565b9050808360600151146110575760608301516040516377bb6d2760e11b81526102ad918391600401918252602082015260400190565b50505050565b8051805160208083015160409384015191850151935163c542c93b60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463c542c93b946110c094909392909190600401611e95565b602060405180830381865afa9250505080156110f9575060408051601f3d908101601f191682019092526110f691810190611f3c565b60015b6111cf57611105611f57565b806308c379a00361113e5750611119611f73565b80611124575061117d565b8060405162dd577760e81b81526004016102ad9190611ffc565b634e487b710361117d5761115061200f565b9061115b575061117d565b60405162dd577760e81b815260206004820152600060248201526044016102ad565b3d8080156111a7576040519150601f19603f3d011682016040523d82523d6000602084013e6111ac565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016102ad565b80610d7a5760405162dd577760e81b815260206004820152600060248201526044016102ad565b60008061120583850185611dc4565b90506000611212826112f8565b95945050505050565b60008281526003602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102f0907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000019061202f565b6020810151600090815b602002015192915050565b602081015160009060016112c0565b602081015160009060046112c0565b602081015160009060056112c0565b602081015160009060066112c0565b602081015160009060076112c0565b61131e6113f7565b6040518060400160405280836020015160026009811061134057611340611b69565b60200201518152602001836020015160036009811061136157611361611b69565b6020020151905292915050565b60008061138c308460600151600001516001600160801b0316611393565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c61138c919061202f565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8260028101928215611491579160200282015b82811115611491578251825591602001919060010190611476565b5061149d9291506114f6565b5090565b905290565b60405180610100016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114a16113f7565b5b8082111561149d57600081556001016114f7565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b03821117156115405761154061150b565b60405250565b606081018181106001600160401b03821117156115405761154061150b565b601f8201601f191681016001600160401b038111828210171561158a5761158a61150b565b6040525050565b600082601f8301126115a257600080fd5b604051604081018181106001600160401b03821117156115c4576115c461150b565b80604052508060408401858111156115db57600080fd5b845b818110156115f55780358352602092830192016115dd565b509195945050505050565b60006040828403121561161257600080fd5b61138c8383611591565b8060005b6002811015611057578151845260209384019390910190600101611620565b604081016102f0828461161c565b60006020828403121561165f57600080fd5b5035919050565b60008083601f84011261167857600080fd5b5081356001600160401b0381111561168f57600080fd5b6020830191508360208285010111156116a757600080fd5b9250929050565b6000806000604084860312156116c357600080fd5b83356001600160401b03808211156116da57600080fd5b90850190604082880312156116ee57600080fd5b9093506020850135908082111561170457600080fd5b5061171186828701611666565b9497909650939450505050565b60005b83811015611739578181015183820152602001611721565b838111156110575750506000910152565b6000815180845261176281602086016020860161171e565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a08501526117d160c085018261174a565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561182e57603f1988860301845261181c858351611776565b94509285019290850190600101611800565b5092979650505050505050565b6001600160a01b03811681146102bf57600080fd5b803561185b8161183b565b919050565b60008060008060006060868803121561187857600080fd5b85356001600160401b038082111561188f57600080fd5b818801915088601f8301126118a357600080fd5b8135818111156118b257600080fd5b8960208260051b85010111156118c757600080fd5b602083019750809650506118dd60208901611850565b945060408801359150808211156118f357600080fd5b5061190088828901611666565b969995985093965092949392505050565b6000806060838503121561192457600080fd5b61192e8484611591565b9150604083013561193e8161183b565b809150509250929050565b60006020828403121561195b57600080fd5b813561138c8161183b565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006001600160401b038211156119b4576119b461150b565b50601f01601f191660200190565b600060408083360312156119d557600080fd5b80516119e081611521565b83356001600160401b03808211156119f757600080fd5b9085019036601f830112611a0a57600080fd5b8135602082821115611a1e57611a1e61150b565b8160051b8651611a3083830182611565565b92835284810182019282810136851115611a4957600080fd5b83870192505b84831015611b1d57823586811115611a675760008081fd5b8701606036829003601f1901811315611a805760008081fd5b8a51611a8b81611546565b8287013581528b83013581880152908201359088821115611aac5760008081fd5b9181019136603f840112611ac257600091508182fd5b868301359150611ad18261199b565b8c51611add8282611565565b838152368e858701011115611af457600091508182fd5b838e86018a830137600093810189019390935250808c0191909152825250918301918301611a4f565b50865250611b2c888201611850565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611b6457611b64611b3b565b500190565b634e487b7160e01b600052603260045260246000fd5b60008060008060808587031215611b9557600080fd5b8451611ba08161183b565b60208601516040870151919550935063ffffffff81168114611bc157600080fd5b60608601519092506001600160401b03811115611bdd57600080fd5b8501601f81018713611bee57600080fd5b8051611bf98161199b565b604051611c068282611565565b828152896020848601011115611c1b57600080fd5b611c2c83602083016020870161171e565b969995985093965050505050565b600060018201611c4c57611c4c611b3b565b5060010190565b604080825283519082018190526000906020906060840190828701845b82811015611c955781516001600160a01b031684529284019290840190600101611c70565b5050508381038285015284518082528583019183019060005b81811015611cca57835183529284019291840191600101611cae565b5090979650505050505050565b60208152600061138c6020830184611776565b8051801515811461185b57600080fd5b600060408284031215611d0c57600080fd5b604051604081018181106001600160401b0382111715611d2e57611d2e61150b565b60405282516001600160801b0381168114611d4857600080fd5b8152611d5660208401611cea565b60208201529392505050565b600082601f830112611d7357600080fd5b6040516101208082018281106001600160401b0382111715611d9757611d9761150b565b60405283018185821115611daa57600080fd5b845b828110156115f5578035825260209182019101611dac565b6000818303610220811215611dd857600080fd5b60408051611de581611521565b61010080841215611df557600080fd5b82519350611e0284611546565b611e0c8787611591565b845286605f870112611e1d57600080fd5b8251611e2881611521565b8060c0880189811115611e3a57600080fd5b8589015b81811015611e5f57611e508b82611591565b83526020909201918601611e3e565b50826020880152611e708a82611591565b86880152505050838252611e8687828801611d62565b60208301525095945050505050565b6102208101611ea4828761161c565b60408083018660005b6002808210611ebc5750611ef7565b82518460005b83811015611ee0578251825260209283019290910190600101611ec2565b505050928401925060209190910190600101611ead565b50505050611f0860c083018561161c565b61010082018360005b6009811015611f30578151835260209283019290910190600101611f11565b50505095945050505050565b600060208284031215611f4e57600080fd5b61138c82611cea565b600060033d1115611f705760046000803e5060005160e01c5b90565b600060443d1015611f815790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611fb057505050505090565b8285019150815181811115611fc85750505050505090565b843d8701016020828501011115611fe25750505050505090565b611ff160208286010187611565565b509095945050505050565b60208152600061138c602083018461174a565b60008060233d111561202b576020600460003e50506000516001905b9091565b60008261204c57634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220202c7874d91a345d5d1d262476c8976188ed40687e181d4b647f63471e63576b64736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638da5cb5b1161008c578063c776adde11610066578063c776adde14610230578063c9cdef0414610243578063e60f999f14610256578063f2fde38b1461026957600080fd5b80638da5cb5b146101d3578063af411a30146101ea578063bfa665851461020a57600080fd5b806354846d7a116100c857806354846d7a1461015c57806363e4afc2146101915780637000b051146101a4578063715018a6146101cb57600080fd5b8063124d7199146100ef5780632785e3221461010457806346657fe914610122575b600080fd5b6101026100fd366004611600565b61027c565b005b61010c6102c2565b604051610119919061163f565b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610119565b6101837f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610119565b61014461019f36600461164d565b6102d7565b6101837f000000000000000000000000000000000000000000000000000000000000000081565b6101026102f6565b6000546201000090046001600160a01b0316610144565b6101fd6101f83660046116ae565b610333565b60405161011991906117d9565b7f0000000000000000000000000000000000000000000000000000000000000000610144565b6101fd61023e366004611860565b61048d565b610102610251366004611911565b610848565b6101fd6102643660046116ae565b610915565b610102610277366004611949565b610a31565b6000546001600160a01b03620100009091041633146102b65760405162461bcd60e51b81526004016102ad90611966565b60405180910390fd5b6102bf81610adf565b50565b6102ca6113f7565b6102d2610b27565b905090565b6000818152600360205260408120546001600160a01b03165b92915050565b6000546001600160a01b03620100009091041633146103275760405162461bcd60e51b81526004016102ad90611966565b6103316000610b61565b565b60606000610348610343866119c2565b610bbc565b60408051600180825281830190925291925060009190816020015b61036b611415565b8152602001906001900390816103635750506060830151519091506000906103bc906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611b51565b90507f000000000000000000000000000000000000000000000000000000000000000081111561040257604051637bbf29e360e01b8152600481018290526024016102ad565b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b03168152602001856020015181526020014263ffffffff168152602001604051806020016040528060008152508152508360008151811061047657610476611b69565b602090810291909101015250909695505050505050565b60606000856001600160401b038111156104a9576104a961150b565b6040519080825280602002602001820160405280156104d2578160200160208202803683370190505b5090506000866001600160401b038111156104ef576104ef61150b565b604051908082528060200260200182016040528015610518578160200160208202803683370190505b5090506000876001600160401b038111156105355761053561150b565b60405190808252806020026020018201604052801561056e57816020015b61055b611415565b8152602001906001900390816105535790505b50905060005b88811015610742576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106105c3576105c3611b69565b905060200201358e6040518363ffffffff1660e01b81526004016105fa9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610617573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261063f9190810190611b7f565b93509350935093508b88868151811061065a5761065a611b69565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061068c5761068c611b69565b905060200201358786815181106106a5576106a5611b69565b6020026020010181815250506040518060c001604052808f8f888181106106ce576106ce611b69565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061072057610720611b69565b602002602001018190525050505050808061073a90611c3a565b915050610574565b5061074e818787610c70565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061079c9086908690600401611c53565b600060405180830381600087803b1580156107b657600080fd5b505af11580156107ca573d6000803e3d6000fd5b5050505060005b8881101561083b577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061080c5761080c611b69565b60200260200101516040516108219190611cd7565b60405180910390a18061083381611c3a565b9150506107d1565b5098975050505050505050565b600054610100900460ff166108635760005460ff1615610867565b303b155b6108ca5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016102ad565b600054610100900460ff161580156108ec576000805461ffff19166101011790555b6108f582610b61565b6108fe83610adf565b8015610910576000805461ff00191690555b505050565b6060610922848484610c89565b600061092f858585610333565b905061093c858585610cd1565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906109889084906004016117d9565b600060405180830381600087803b1580156109a257600080fd5b505af11580156109b6573d6000803e3d6000fd5b5050505060005b8151811015610a28577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc8282815181106109f9576109f9611b69565b6020026020010151604051610a0e9190611cd7565b60405180910390a180610a2081611c3a565b9150506109bd565b50949350505050565b6000546001600160a01b0362010000909104163314610a625760405162461bcd60e51b81526004016102ad90611966565b6001600160a01b038116610ac75760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016102ad565b6102bf81610b61565b6001600160a01b03163b151590565b610aec6001826002611463565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051610b1c919061163f565b60405180910390a150565b610b2f6113f7565b60408051808201918290529060019060029082845b815481526020019060010190808311610b44575050505050905090565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b610bf36040805160808101825260008082526020808301829052828401829052835180850190945281845283015290606082015290565b60008260000151600081518110610c0c57610c0c611b69565b60200260200101519050610c1f81610d3a565b60008160400151806020019051810190610c399190611cfa565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610c9782840184611dc4565b90506000610ca482610d7e565b90506000610cb4610343876119c2565b9050610cc08183610e1a565b610cc98361105d565b505050505050565b6000610cdd83836111f6565b6000818152600360205260409020549091506001600160a01b03168015610d1a57604051631f5d53e360e01b8152600481018390526024016102ad565b610d3382610d2e6040880160208901611949565b61121b565b5050505050565b6000610d498260400151611281565b82519091508114610d7a5781516040516337e3d1ab60e01b81526102ad918391600401918252602082015260400190565b5050565b610d866114a6565b604051806101000160405280610d9b846112b6565b6001600160a01b03168152602001610db2846112cb565b8152602001610dc0846112da565b8152602001610dce846112e9565b8152602001610ddc846112f8565b8152602001610dea84611307565b8152602001610e028460200151610100015160011490565b15158152602001610e1284611316565b905292915050565b8151604082015114610e4f57815160408281015190516347a9715d60e01b8152600481019290925260248201526044016102ad565b81606001516020015115158160c00151151503610e985760608201516020015160c0820151604051634629f1b560e11b81529115156004830152151560248201526044016102ad565b81604001516001600160a01b031681600001516001600160a01b031614610eec57604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016102ad565b60408201516001600160a01b03163314610f30576040808301519051632bfa317f60e11b81523360048201526001600160a01b0390911660248201526044016102ad565b46816020015114610f63576020810151604051630432cec160e31b815246600482015260248101919091526044016102ad565b81602001518160a0015114610f9e57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016102ad565b6000610fa8610b27565b805160e084015151919250141580610fcd575060208082015160e08401519091015114155b1561101657805160208083015160e0850151805192015160405163f71cb0f760e01b815260048101949094526024840191909152604483019190915260648201526084016102ad565b60006110218461136e565b9050808360600151146110575760608301516040516377bb6d2760e11b81526102ad918391600401918252602082015260400190565b50505050565b8051805160208083015160409384015191850151935163c542c93b60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463c542c93b946110c094909392909190600401611e95565b602060405180830381865afa9250505080156110f9575060408051601f3d908101601f191682019092526110f691810190611f3c565b60015b6111cf57611105611f57565b806308c379a00361113e5750611119611f73565b80611124575061117d565b8060405162dd577760e81b81526004016102ad9190611ffc565b634e487b710361117d5761115061200f565b9061115b575061117d565b60405162dd577760e81b815260206004820152600060248201526044016102ad565b3d8080156111a7576040519150601f19603f3d011682016040523d82523d6000602084013e6111ac565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016102ad565b80610d7a5760405162dd577760e81b815260206004820152600060248201526044016102ad565b60008061120583850185611dc4565b90506000611212826112f8565b95945050505050565b60008281526003602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102f0907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000019061202f565b6020810151600090815b602002015192915050565b602081015160009060016112c0565b602081015160009060046112c0565b602081015160009060056112c0565b602081015160009060066112c0565b602081015160009060076112c0565b61131e6113f7565b6040518060400160405280836020015160026009811061134057611340611b69565b60200201518152602001836020015160036009811061136157611361611b69565b6020020151905292915050565b60008061138c308460600151600001516001600160801b0316611393565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c61138c919061202f565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8260028101928215611491579160200282015b82811115611491578251825591602001919060010190611476565b5061149d9291506114f6565b5090565b905290565b60405180610100016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114a16113f7565b5b8082111561149d57600081556001016114f7565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b03821117156115405761154061150b565b60405250565b606081018181106001600160401b03821117156115405761154061150b565b601f8201601f191681016001600160401b038111828210171561158a5761158a61150b565b6040525050565b600082601f8301126115a257600080fd5b604051604081018181106001600160401b03821117156115c4576115c461150b565b80604052508060408401858111156115db57600080fd5b845b818110156115f55780358352602092830192016115dd565b509195945050505050565b60006040828403121561161257600080fd5b61138c8383611591565b8060005b6002811015611057578151845260209384019390910190600101611620565b604081016102f0828461161c565b60006020828403121561165f57600080fd5b5035919050565b60008083601f84011261167857600080fd5b5081356001600160401b0381111561168f57600080fd5b6020830191508360208285010111156116a757600080fd5b9250929050565b6000806000604084860312156116c357600080fd5b83356001600160401b03808211156116da57600080fd5b90850190604082880312156116ee57600080fd5b9093506020850135908082111561170457600080fd5b5061171186828701611666565b9497909650939450505050565b60005b83811015611739578181015183820152602001611721565b838111156110575750506000910152565b6000815180845261176281602086016020860161171e565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a08501526117d160c085018261174a565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561182e57603f1988860301845261181c858351611776565b94509285019290850190600101611800565b5092979650505050505050565b6001600160a01b03811681146102bf57600080fd5b803561185b8161183b565b919050565b60008060008060006060868803121561187857600080fd5b85356001600160401b038082111561188f57600080fd5b818801915088601f8301126118a357600080fd5b8135818111156118b257600080fd5b8960208260051b85010111156118c757600080fd5b602083019750809650506118dd60208901611850565b945060408801359150808211156118f357600080fd5b5061190088828901611666565b969995985093965092949392505050565b6000806060838503121561192457600080fd5b61192e8484611591565b9150604083013561193e8161183b565b809150509250929050565b60006020828403121561195b57600080fd5b813561138c8161183b565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60006001600160401b038211156119b4576119b461150b565b50601f01601f191660200190565b600060408083360312156119d557600080fd5b80516119e081611521565b83356001600160401b03808211156119f757600080fd5b9085019036601f830112611a0a57600080fd5b8135602082821115611a1e57611a1e61150b565b8160051b8651611a3083830182611565565b92835284810182019282810136851115611a4957600080fd5b83870192505b84831015611b1d57823586811115611a675760008081fd5b8701606036829003601f1901811315611a805760008081fd5b8a51611a8b81611546565b8287013581528b83013581880152908201359088821115611aac5760008081fd5b9181019136603f840112611ac257600091508182fd5b868301359150611ad18261199b565b8c51611add8282611565565b838152368e858701011115611af457600091508182fd5b838e86018a830137600093810189019390935250808c0191909152825250918301918301611a4f565b50865250611b2c888201611850565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611b6457611b64611b3b565b500190565b634e487b7160e01b600052603260045260246000fd5b60008060008060808587031215611b9557600080fd5b8451611ba08161183b565b60208601516040870151919550935063ffffffff81168114611bc157600080fd5b60608601519092506001600160401b03811115611bdd57600080fd5b8501601f81018713611bee57600080fd5b8051611bf98161199b565b604051611c068282611565565b828152896020848601011115611c1b57600080fd5b611c2c83602083016020870161171e565b969995985093965050505050565b600060018201611c4c57611c4c611b3b565b5060010190565b604080825283519082018190526000906020906060840190828701845b82811015611c955781516001600160a01b031684529284019290840190600101611c70565b5050508381038285015284518082528583019183019060005b81811015611cca57835183529284019291840191600101611cae565b5090979650505050505050565b60208152600061138c6020830184611776565b8051801515811461185b57600080fd5b600060408284031215611d0c57600080fd5b604051604081018181106001600160401b0382111715611d2e57611d2e61150b565b60405282516001600160801b0381168114611d4857600080fd5b8152611d5660208401611cea565b60208201529392505050565b600082601f830112611d7357600080fd5b6040516101208082018281106001600160401b0382111715611d9757611d9761150b565b60405283018185821115611daa57600080fd5b845b828110156115f5578035825260209182019101611dac565b6000818303610220811215611dd857600080fd5b60408051611de581611521565b61010080841215611df557600080fd5b82519350611e0284611546565b611e0c8787611591565b845286605f870112611e1d57600080fd5b8251611e2881611521565b8060c0880189811115611e3a57600080fd5b8589015b81811015611e5f57611e508b82611591565b83526020909201918601611e3e565b50826020880152611e708a82611591565b86880152505050838252611e8687828801611d62565b60208301525095945050505050565b6102208101611ea4828761161c565b60408083018660005b6002808210611ebc5750611ef7565b82518460005b83811015611ee0578251825260209283019290910190600101611ec2565b505050928401925060209190910190600101611ead565b50505050611f0860c083018561161c565b61010082018360005b6009811015611f30578151835260209283019290910190600101611f11565b50505095945050505050565b600060208284031215611f4e57600080fd5b61138c82611cea565b600060033d1115611f705760046000803e5060005160e01c5b90565b600060443d1015611f815790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611fb057505050505090565b8285019150815181811115611fc85750505050505090565b843d8701016020828501011115611fe25750505050505090565b611ff160208286010187611565565b509095945050505050565b60208152600061138c602083018461174a565b60008060233d111561202b576020600460003e50506000516001905b9091565b60008261204c57634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220202c7874d91a345d5d1d262476c8976188ed40687e181d4b647f63471e63576b64736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns attestations that will be recorded, constructed from the user request", - "params": { - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "collectionIdFirst": "Id of the first collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last collection in which the attester is supposed to record", - "commitmentSignerPubKey": "The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme", - "owner": "The owner of the contract that can update the commitment signer pub key", - "pythia1VerifierAddress": "ZK Snark Pythia-1 Verifier contract" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getCommitmentSignerPubKey()": { - "details": "Getter of the Commitment signer Eddsa Public key" - }, - "getDestinationOfTicket(uint256)": { - "details": "Getter, returns the last attestation destination of a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getVerifier()": { - "details": "Getter of Pythia-1 Verifier contract" - }, - "initialize(uint256[2],address)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "commitmentSignerPubKey": "EdDSA public key of the commitment signer", - "owner": "Owner of the contract, can update public key and address" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "stateVariables": { - "AUTHORIZED_COLLECTION_ID_FIRST": { - "details": "Getter returns of the first collection in which the attester is supposed to record*" - }, - "AUTHORIZED_COLLECTION_ID_LAST": { - "details": "Getter returns of the last collection in which the attester is supposed to record*" - } - }, - "title": "Pythia-1 Simple Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "This attester is part of the family of the Pythia-1 Attesters. Pythia-1 attesters enable users to prove they have a claim and its proof issued by an offchain service in a privacy preserving way. That means no-one can make the link between the account used in the offchain service and the onchain account where the attestation is stored. The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic. We invite readers to refer to: - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each users gets one userTicket per claim For people used to semaphore/ tornado cash people: userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 936, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 939, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 389, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_owner", - "offset": 2, - "slot": "0", - "type": "t_address" - }, - { - "astId": 8427, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_commitmentSignerPubKey", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)2_storage" - }, - { - "astId": 8431, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_ticketsDestinations", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_uint256,t_address)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)2_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[2]", - "numberOfBytes": "64" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_address)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} \ No newline at end of file diff --git a/deployments/goerli/Pythia1SimpleAttesterProxy.json b/deployments/goerli/Pythia1SimpleAttesterProxy.json deleted file mode 100644 index 087afa1..0000000 --- a/deployments/goerli/Pythia1SimpleAttesterProxy.json +++ /dev/null @@ -1,261 +0,0 @@ -{ - "address": "0x8E44f33Df343EA6f85380226BE5Fbf93db09168E", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0xd3d674f3a741ee8dab45bf4b3e6548c7e6616470631046c408ace05f9a920f84", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0x8E44f33Df343EA6f85380226BE5Fbf93db09168E", - "transactionIndex": 11, - "gasUsed": "657801", - "logsBloom": "0x00000000000200000000000000000000400000000000000000800000000000000000000000000000001000000000000000000000000040000000000000000000000000000000000000000000000002000001000000000000000000000000000000000000020000000000000000000800000000800000000000400000000000404000000010000000000000000000000000000000000000000000000000800000000000000000000000200000000000000000000000000400000000000000000000000020000000000000000000010000000000000400400000000000000020000000000000000000000000000000000000000200000000000000008000000000", - "blockHash": "0xd269984e09564e8d088c6dcce1b535bb066743806f677393e2d05574406fdcb6", - "transactionHash": "0xd3d674f3a741ee8dab45bf4b3e6548c7e6616470631046c408ace05f9a920f84", - "logs": [ - { - "transactionIndex": 11, - "blockNumber": 7711139, - "transactionHash": "0xd3d674f3a741ee8dab45bf4b3e6548c7e6616470631046c408ace05f9a920f84", - "address": "0x8E44f33Df343EA6f85380226BE5Fbf93db09168E", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000d081df20bab598336e09bba851ad18bf208cf87c" - ], - "data": "0x", - "logIndex": 27, - "blockHash": "0xd269984e09564e8d088c6dcce1b535bb066743806f677393e2d05574406fdcb6" - }, - { - "transactionIndex": 11, - "blockNumber": 7711139, - "transactionHash": "0xd3d674f3a741ee8dab45bf4b3e6548c7e6616470631046c408ace05f9a920f84", - "address": "0x8E44f33Df343EA6f85380226BE5Fbf93db09168E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "data": "0x", - "logIndex": 28, - "blockHash": "0xd269984e09564e8d088c6dcce1b535bb066743806f677393e2d05574406fdcb6" - }, - { - "transactionIndex": 11, - "blockNumber": 7711139, - "transactionHash": "0xd3d674f3a741ee8dab45bf4b3e6548c7e6616470631046c408ace05f9a920f84", - "address": "0x8E44f33Df343EA6f85380226BE5Fbf93db09168E", - "topics": [ - "0xda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df" - ], - "data": "0x038d3d596875c66eb90608bbe04e4e238607fd32ad61f4278bdaf47aadc28d601b46b55a0ce3f35d6025cdd4554aaac1fc7180b14d51b0f15aa51a6929bdb952", - "logIndex": 29, - "blockHash": "0xd269984e09564e8d088c6dcce1b535bb066743806f677393e2d05574406fdcb6" - }, - { - "transactionIndex": 11, - "blockNumber": 7711139, - "transactionHash": "0xd3d674f3a741ee8dab45bf4b3e6548c7e6616470631046c408ace05f9a920f84", - "address": "0x8E44f33Df343EA6f85380226BE5Fbf93db09168E", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000246e71bc2a257f4be9c7fad4664e6d7444844adc", - "logIndex": 30, - "blockHash": "0xd269984e09564e8d088c6dcce1b535bb066743806f677393e2d05574406fdcb6" - } - ], - "blockNumber": 7711139, - "cumulativeGasUsed": "7535790", - "status": 1, - "byzantium": true - }, - "args": [ - "0xD081dF20BAb598336e09BBa851AD18bF208cF87C", - "0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc", - "0xc9cdef04038d3d596875c66eb90608bbe04e4e238607fd32ad61f4278bdaf47aadc28d601b46b55a0ce3f35d6025cdd4554aaac1fc7180b14d51b0f15aa51a6929bdb952000000000000000000000000620d296604f4fa7ca0804d8c2c74414e8a1ad10e" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/goerli/Pythia1Verifier.json b/deployments/goerli/Pythia1Verifier.json deleted file mode 100644 index 076debb..0000000 --- a/deployments/goerli/Pythia1Verifier.json +++ /dev/null @@ -1,81 +0,0 @@ -{ - "address": "0xEE077AD7a47e56F075f0C3bd41Cdc1629FdA3a9c", - "abi": [ - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "a", - "type": "uint256[2]" - }, - { - "internalType": "uint256[2][2]", - "name": "b", - "type": "uint256[2][2]" - }, - { - "internalType": "uint256[2]", - "name": "c", - "type": "uint256[2]" - }, - { - "internalType": "uint256[9]", - "name": "input", - "type": "uint256[9]" - } - ], - "name": "verifyProof", - "outputs": [ - { - "internalType": "bool", - "name": "r", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x2ff2a513d305f3b047350a550ed0e487fdc3b8a99d3a537219f2484021e64366", - "receipt": { - "to": null, - "from": "0x620d296604F4fa7ca0804d8C2C74414e8A1AD10E", - "contractAddress": "0xEE077AD7a47e56F075f0C3bd41Cdc1629FdA3a9c", - "transactionIndex": 43, - "gasUsed": "1221464", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x965a9a0031ff738c89eee37b0644d1468df487c21a6b936e3e0d03d7f61c2504", - "transactionHash": "0x2ff2a513d305f3b047350a550ed0e487fdc3b8a99d3a537219f2484021e64366", - "logs": [], - "blockNumber": 7711136, - "cumulativeGasUsed": "13779629", - "status": 1, - "byzantium": true - }, - "args": [], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"a\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2][2]\",\"name\":\"b\",\"type\":\"uint256[2][2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"c\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[9]\",\"name\":\"input\",\"type\":\"uint256[9]\"}],\"name\":\"verifyProof\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"r\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"verifyProof(uint256[2],uint256[2][2],uint256[2],uint256[9])\":{\"returns\":{\"r\":\" bool true if proof is valid\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@sismo-core/pythia-1/contracts/Pythia1Verifier.sol\":\"Pythia1Verifier\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@sismo-core/pythia-1/contracts/Pythia1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract Pythia1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\\n );\\n vk.IC = new Pairing.G1Point[](10);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 104028078850975554065172701281783302003220555203883119831575537681421753151,\\n 19148240629904598794948591359118971959790791697910953160820265703277306346\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[9] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3babb956e64535b9bf535df94288b4d83ea82c54727f79ee8949fe4a19c1d5ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5061151f806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c542c93b14610030575b600080fd5b61004361003e366004611356565b610057565b604051901515815260200160405180910390f35b6000610061611169565b60408051808201825287518152602080890151818301529083528151608081018352875151818401908152885183015160608301528152825180840184528883018051518252518301518184015281830152838201528151808301835286518152868201518183015283830152815160098082526101408201909352600092909182016101208036833701905050905060005b60098110156101435784816009811061010f5761010f611434565b602002015182828151811061012657610126611434565b60209081029190910101528061013b81611460565b9150506100f4565b5061014e818361016f565b60000361016057600192505050610167565b6000925050505b949350505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018161019b610366565b9050806080015151855160016101b19190611479565b146101f85760405162461bcd60e51b81526020600482015260126024820152711d995c9a599a595c8b5898590b5a5b9c1d5d60721b60448201526064015b60405180910390fd5b604080518082019091526000808252602082018190525b86518110156102e9578387828151811061022b5761022b611434565b6020026020010151106102805760405162461bcd60e51b815260206004820152601f60248201527f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c640060448201526064016101ef565b6102d5826102d085608001518460016102999190611479565b815181106102a9576102a9611434565b60200260200101518a85815181106102c3576102c3611434565b6020026020010151610ab8565b610b4e565b9150806102e181611460565b91505061020f565b5061031281836080015160008151811061030557610305611434565b6020026020010151610b4e565b90506103486103248660000151610be7565b8660200151846000015185602001518587604001518b604001518960600151610c86565b6103585760019350505050610360565b600093505050505b92915050565b61036e6111ba565b6040805180820182527f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e281527f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d19266020808301919091529083528151608080820184527f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c8285019081527f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab606080850191909152908352845180860186527f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a781527f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec8818601528385015285840192909252835180820185527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28186019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed828501528152845180860186527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa818601528185015285850152835190810184527f174892b5bad4ddcfd89eda92cc1a5fb630cfd006cdb1659b082e3fae39df9b9c8185019081527f256176846e5a9b02d671495ae4d617f2bd45ce621c1a181cb505f4b5b8b785ae828401528152835180850185527f02ca7609b5aecf9430434e2f4ecb35f1d85090b34f1e9db416b6ed27a47211ac81527f232e1bb08a19b6cc0e639c831b21a6fefdb07f9361801b61dcab9871483b7c528185015281840152908401528151600a8082526101608201909352919082015b60408051808201909152600080825260208201528152602001906001900390816105ea57505060808201908152604080518082019091527f0c32e6a2033cd6027d1a46a68265e41b8a47bfb7a3e130a2c0f533ef102de83d81527f0cc770fbf603ef9467a0c6e6cc28e85214afd8411c933e69178479d2841e976c60208201529051805160009061067d5761067d611434565b602002602001018190525060405180604001604052807f1c12c8210513044ddb9ea2a7cfb8f3b529b6d43abe416e35c005a63a6fffc83a81526020017f11921fe7e6b849a03a0428e49a6465a87f3c98016eb6d13ad110ab15ee0cb5bd81525081608001516001815181106106f4576106f4611434565b602002602001018190525060405180604001604052807e3ae0b7e630d0708e4da300f02dd27c42654381541ab974a678042eb4fadb3f81526020017e0ad667b81d05c6e95487a6140ca0dc3ba85d47509073a2c1b457cfbf67a1ea815250816080015160028151811061076957610769611434565b602002602001018190525060405180604001604052807f0bea1f762ed1b817dddb25a7b7e60f69ff7671eb72fe695a8a24b620fae6515381526020017f069f91831bbeea0bcb8e658c68c110e35e033ae01637be60803083e3696b439181525081608001516003815181106107e0576107e0611434565b602002602001018190525060405180604001604052807f1d8a4973e60e7186c4dd89fd553304f628ebac9870b43dead962ce96064803a681526020017f1ce0f6623640030a2a8210d5e37d04e983127c85dd0bca8f503b2b24c8ad04d1815250816080015160048151811061085757610857611434565b602002602001018190525060405180604001604052807f1955b5fc797055fe5682e71ee08375742622a371f736e40a827fde747dbc7b1881526020017f259ab98a8122832a5779c0c1373733a1d9204803eabd831c550583852bab2c1e81525081608001516005815181106108ce576108ce611434565b602002602001018190525060405180604001604052807f0f2d07869bdb9a50651a2ad87da88a78d29bc7f5abb0c866769189f94f3b37d581526020017f3042b79c235d1a7e6781dde92773e7a52276a8912fe06de16a781d3995ed1319815250816080015160068151811061094557610945611434565b602002602001018190525060405180604001604052807f14dde6710af95fd2d6c49a1cadc761ae8b093e2b80fe9d7b980538baf49b854981526020017f0c4f6f112e147b22270b3c65f5d65a07842b81682deb09f6d4236dac4b9b1fd081525081608001516007815181106109bc576109bc611434565b602002602001018190525060405180604001604052807f1239824d3a77d0e97d55504525df59d36e148fab147bc75b41e74e47478c5f6c81526020017f25393a4bf81046bad1869efc59edfb1a6b379d1d1eab45fcb634b73c0108ebf98152508160800151600881518110610a3357610a33611434565b602002602001018190525060405180604001604052807f13ae19e280548637b1ce4de3d1405ffdd1d8838f2c34a3017cb05810880cd9a481526020017f0803bdf0743261ea96d28d68f7f3cce9505ad2dbce28eb78ba7ccc002c93991a8152508160800151600981518110610aaa57610aaa611434565b602002602001018190525090565b6040805180820190915260008082526020820152610ad461120b565b835181526020808501519082015260408101839052600060608360808460076107d05a03fa90508080610b0357fe5b5080610b465760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5b5d5b0b59985a5b195960721b60448201526064016101ef565b505092915050565b6040805180820190915260008082526020820152610b6a611229565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa90508080610ba457fe5b5080610b465760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5859190b59985a5b195960721b60448201526064016101ef565b604080518082019091526000808252602082015281517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4790158015610c2e57506020830151155b15610c4e5750506040805180820190915260008082526020820152919050565b604051806040016040528084600001518152602001828560200151610c739190611491565b610c7d90846114b3565b90529392505050565b60408051600480825260a08201909252600091829190816020015b6040805180820190915260008082526020820152815260200190600190039081610ca157505060408051600480825260a0820190925291925060009190602082015b610ceb611247565b815260200190600190039081610ce35790505090508a82600081518110610d1457610d14611434565b60200260200101819052508882600181518110610d3357610d33611434565b60200260200101819052508682600281518110610d5257610d52611434565b60200260200101819052508482600381518110610d7157610d71611434565b60200260200101819052508981600081518110610d9057610d90611434565b60200260200101819052508781600181518110610daf57610daf611434565b60200260200101819052508581600281518110610dce57610dce611434565b60200260200101819052508381600381518110610ded57610ded611434565b6020026020010181905250610e028282610e11565b9b9a5050505050505050505050565b60008151835114610e5d5760405162461bcd60e51b81526020600482015260166024820152751c185a5c9a5b99cb5b195b99dd1a1ccb59985a5b195960521b60448201526064016101ef565b82516000610e6c8260066114ca565b905060008167ffffffffffffffff811115610e8957610e896112a3565b604051908082528060200260200182016040528015610eb2578160200160208202803683370190505b50905060005b838110156110ed57868181518110610ed257610ed2611434565b60200260200101516000015182826006610eec91906114ca565b610ef7906000611479565b81518110610f0757610f07611434565b602002602001018181525050868181518110610f2557610f25611434565b60200260200101516020015182826006610f3f91906114ca565b610f4a906001611479565b81518110610f5a57610f5a611434565b602002602001018181525050858181518110610f7857610f78611434565b6020908102919091010151515182610f918360066114ca565b610f9c906002611479565b81518110610fac57610fac611434565b602002602001018181525050858181518110610fca57610fca611434565b60209081029190910181015151015182610fe58360066114ca565b610ff0906003611479565b8151811061100057611000611434565b60200260200101818152505085818151811061101e5761101e611434565b60200260200101516020015160006002811061103c5761103c611434565b60200201518261104d8360066114ca565b611058906004611479565b8151811061106857611068611434565b60200260200101818152505085818151811061108657611086611434565b6020026020010151602001516001600281106110a4576110a4611434565b6020020151826110b58360066114ca565b6110c0906005611479565b815181106110d0576110d0611434565b6020908102919091010152806110e581611460565b915050610eb8565b506110f6611267565b6000602082602086026020860160086107d05a03fa9050808061111557fe5b508061115b5760405162461bcd60e51b81526020600482015260156024820152741c185a5c9a5b99cb5bdc18dbd9194b59985a5b1959605a1b60448201526064016101ef565b505115159695505050505050565b6040805160a081019091526000606082018181526080830191909152815260208101611193611247565b81526020016111b5604051806040016040528060008152602001600081525090565b905290565b6040805160e08101909152600060a0820181815260c08301919091528152602081016111e4611247565b81526020016111f1611247565b81526020016111fe611247565b8152602001606081525090565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b604051806040016040528061125a611285565b81526020016111b5611285565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156112dc576112dc6112a3565b60405290565b604051610120810167ffffffffffffffff811182821017156112dc576112dc6112a3565b600082601f83011261131757600080fd5b61131f6112b9565b80604084018581111561133157600080fd5b845b8181101561134b578035845260209384019301611333565b509095945050505050565b60008060008061022080868803121561136e57600080fd5b6113788787611306565b9450604087605f88011261138b57600080fd5b6113936112b9565b8060c089018a8111156113a557600080fd5b838a015b818110156113ca576113bb8c82611306565b845260209093019284016113a9565b508197506113d88b82611306565b9650505050508661011f8701126113ee57600080fd5b6113f66112e2565b90860190808883111561140857600080fd5b61010088015b8381101561142657803583526020928301920161140e565b509598949750929550505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016114725761147261144a565b5060010190565b6000821982111561148c5761148c61144a565b500190565b6000826114ae57634e487b7160e01b600052601260045260246000fd5b500690565b6000828210156114c5576114c561144a565b500390565b60008160001904831182151516156114e4576114e461144a565b50029056fea264697066735822122064ca8e728369809bbfe58b0cff27a54a0e5e793919a8ed928a392738c3f2924564736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c542c93b14610030575b600080fd5b61004361003e366004611356565b610057565b604051901515815260200160405180910390f35b6000610061611169565b60408051808201825287518152602080890151818301529083528151608081018352875151818401908152885183015160608301528152825180840184528883018051518252518301518184015281830152838201528151808301835286518152868201518183015283830152815160098082526101408201909352600092909182016101208036833701905050905060005b60098110156101435784816009811061010f5761010f611434565b602002015182828151811061012657610126611434565b60209081029190910101528061013b81611460565b9150506100f4565b5061014e818361016f565b60000361016057600192505050610167565b6000925050505b949350505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018161019b610366565b9050806080015151855160016101b19190611479565b146101f85760405162461bcd60e51b81526020600482015260126024820152711d995c9a599a595c8b5898590b5a5b9c1d5d60721b60448201526064015b60405180910390fd5b604080518082019091526000808252602082018190525b86518110156102e9578387828151811061022b5761022b611434565b6020026020010151106102805760405162461bcd60e51b815260206004820152601f60248201527f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c640060448201526064016101ef565b6102d5826102d085608001518460016102999190611479565b815181106102a9576102a9611434565b60200260200101518a85815181106102c3576102c3611434565b6020026020010151610ab8565b610b4e565b9150806102e181611460565b91505061020f565b5061031281836080015160008151811061030557610305611434565b6020026020010151610b4e565b90506103486103248660000151610be7565b8660200151846000015185602001518587604001518b604001518960600151610c86565b6103585760019350505050610360565b600093505050505b92915050565b61036e6111ba565b6040805180820182527f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e281527f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d19266020808301919091529083528151608080820184527f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c8285019081527f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab606080850191909152908352845180860186527f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a781527f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec8818601528385015285840192909252835180820185527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28186019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed828501528152845180860186527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa818601528185015285850152835190810184527f174892b5bad4ddcfd89eda92cc1a5fb630cfd006cdb1659b082e3fae39df9b9c8185019081527f256176846e5a9b02d671495ae4d617f2bd45ce621c1a181cb505f4b5b8b785ae828401528152835180850185527f02ca7609b5aecf9430434e2f4ecb35f1d85090b34f1e9db416b6ed27a47211ac81527f232e1bb08a19b6cc0e639c831b21a6fefdb07f9361801b61dcab9871483b7c528185015281840152908401528151600a8082526101608201909352919082015b60408051808201909152600080825260208201528152602001906001900390816105ea57505060808201908152604080518082019091527f0c32e6a2033cd6027d1a46a68265e41b8a47bfb7a3e130a2c0f533ef102de83d81527f0cc770fbf603ef9467a0c6e6cc28e85214afd8411c933e69178479d2841e976c60208201529051805160009061067d5761067d611434565b602002602001018190525060405180604001604052807f1c12c8210513044ddb9ea2a7cfb8f3b529b6d43abe416e35c005a63a6fffc83a81526020017f11921fe7e6b849a03a0428e49a6465a87f3c98016eb6d13ad110ab15ee0cb5bd81525081608001516001815181106106f4576106f4611434565b602002602001018190525060405180604001604052807e3ae0b7e630d0708e4da300f02dd27c42654381541ab974a678042eb4fadb3f81526020017e0ad667b81d05c6e95487a6140ca0dc3ba85d47509073a2c1b457cfbf67a1ea815250816080015160028151811061076957610769611434565b602002602001018190525060405180604001604052807f0bea1f762ed1b817dddb25a7b7e60f69ff7671eb72fe695a8a24b620fae6515381526020017f069f91831bbeea0bcb8e658c68c110e35e033ae01637be60803083e3696b439181525081608001516003815181106107e0576107e0611434565b602002602001018190525060405180604001604052807f1d8a4973e60e7186c4dd89fd553304f628ebac9870b43dead962ce96064803a681526020017f1ce0f6623640030a2a8210d5e37d04e983127c85dd0bca8f503b2b24c8ad04d1815250816080015160048151811061085757610857611434565b602002602001018190525060405180604001604052807f1955b5fc797055fe5682e71ee08375742622a371f736e40a827fde747dbc7b1881526020017f259ab98a8122832a5779c0c1373733a1d9204803eabd831c550583852bab2c1e81525081608001516005815181106108ce576108ce611434565b602002602001018190525060405180604001604052807f0f2d07869bdb9a50651a2ad87da88a78d29bc7f5abb0c866769189f94f3b37d581526020017f3042b79c235d1a7e6781dde92773e7a52276a8912fe06de16a781d3995ed1319815250816080015160068151811061094557610945611434565b602002602001018190525060405180604001604052807f14dde6710af95fd2d6c49a1cadc761ae8b093e2b80fe9d7b980538baf49b854981526020017f0c4f6f112e147b22270b3c65f5d65a07842b81682deb09f6d4236dac4b9b1fd081525081608001516007815181106109bc576109bc611434565b602002602001018190525060405180604001604052807f1239824d3a77d0e97d55504525df59d36e148fab147bc75b41e74e47478c5f6c81526020017f25393a4bf81046bad1869efc59edfb1a6b379d1d1eab45fcb634b73c0108ebf98152508160800151600881518110610a3357610a33611434565b602002602001018190525060405180604001604052807f13ae19e280548637b1ce4de3d1405ffdd1d8838f2c34a3017cb05810880cd9a481526020017f0803bdf0743261ea96d28d68f7f3cce9505ad2dbce28eb78ba7ccc002c93991a8152508160800151600981518110610aaa57610aaa611434565b602002602001018190525090565b6040805180820190915260008082526020820152610ad461120b565b835181526020808501519082015260408101839052600060608360808460076107d05a03fa90508080610b0357fe5b5080610b465760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5b5d5b0b59985a5b195960721b60448201526064016101ef565b505092915050565b6040805180820190915260008082526020820152610b6a611229565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa90508080610ba457fe5b5080610b465760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5859190b59985a5b195960721b60448201526064016101ef565b604080518082019091526000808252602082015281517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4790158015610c2e57506020830151155b15610c4e5750506040805180820190915260008082526020820152919050565b604051806040016040528084600001518152602001828560200151610c739190611491565b610c7d90846114b3565b90529392505050565b60408051600480825260a08201909252600091829190816020015b6040805180820190915260008082526020820152815260200190600190039081610ca157505060408051600480825260a0820190925291925060009190602082015b610ceb611247565b815260200190600190039081610ce35790505090508a82600081518110610d1457610d14611434565b60200260200101819052508882600181518110610d3357610d33611434565b60200260200101819052508682600281518110610d5257610d52611434565b60200260200101819052508482600381518110610d7157610d71611434565b60200260200101819052508981600081518110610d9057610d90611434565b60200260200101819052508781600181518110610daf57610daf611434565b60200260200101819052508581600281518110610dce57610dce611434565b60200260200101819052508381600381518110610ded57610ded611434565b6020026020010181905250610e028282610e11565b9b9a5050505050505050505050565b60008151835114610e5d5760405162461bcd60e51b81526020600482015260166024820152751c185a5c9a5b99cb5b195b99dd1a1ccb59985a5b195960521b60448201526064016101ef565b82516000610e6c8260066114ca565b905060008167ffffffffffffffff811115610e8957610e896112a3565b604051908082528060200260200182016040528015610eb2578160200160208202803683370190505b50905060005b838110156110ed57868181518110610ed257610ed2611434565b60200260200101516000015182826006610eec91906114ca565b610ef7906000611479565b81518110610f0757610f07611434565b602002602001018181525050868181518110610f2557610f25611434565b60200260200101516020015182826006610f3f91906114ca565b610f4a906001611479565b81518110610f5a57610f5a611434565b602002602001018181525050858181518110610f7857610f78611434565b6020908102919091010151515182610f918360066114ca565b610f9c906002611479565b81518110610fac57610fac611434565b602002602001018181525050858181518110610fca57610fca611434565b60209081029190910181015151015182610fe58360066114ca565b610ff0906003611479565b8151811061100057611000611434565b60200260200101818152505085818151811061101e5761101e611434565b60200260200101516020015160006002811061103c5761103c611434565b60200201518261104d8360066114ca565b611058906004611479565b8151811061106857611068611434565b60200260200101818152505085818151811061108657611086611434565b6020026020010151602001516001600281106110a4576110a4611434565b6020020151826110b58360066114ca565b6110c0906005611479565b815181106110d0576110d0611434565b6020908102919091010152806110e581611460565b915050610eb8565b506110f6611267565b6000602082602086026020860160086107d05a03fa9050808061111557fe5b508061115b5760405162461bcd60e51b81526020600482015260156024820152741c185a5c9a5b99cb5bdc18dbd9194b59985a5b1959605a1b60448201526064016101ef565b505115159695505050505050565b6040805160a081019091526000606082018181526080830191909152815260208101611193611247565b81526020016111b5604051806040016040528060008152602001600081525090565b905290565b6040805160e08101909152600060a0820181815260c08301919091528152602081016111e4611247565b81526020016111f1611247565b81526020016111fe611247565b8152602001606081525090565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b604051806040016040528061125a611285565b81526020016111b5611285565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156112dc576112dc6112a3565b60405290565b604051610120810167ffffffffffffffff811182821017156112dc576112dc6112a3565b600082601f83011261131757600080fd5b61131f6112b9565b80604084018581111561133157600080fd5b845b8181101561134b578035845260209384019301611333565b509095945050505050565b60008060008061022080868803121561136e57600080fd5b6113788787611306565b9450604087605f88011261138b57600080fd5b6113936112b9565b8060c089018a8111156113a557600080fd5b838a015b818110156113ca576113bb8c82611306565b845260209093019284016113a9565b508197506113d88b82611306565b9650505050508661011f8701126113ee57600080fd5b6113f66112e2565b90860190808883111561140857600080fd5b61010088015b8381101561142657803583526020928301920161140e565b509598949750929550505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016114725761147261144a565b5060010190565b6000821982111561148c5761148c61144a565b500190565b6000826114ae57634e487b7160e01b600052601260045260246000fd5b500690565b6000828210156114c5576114c561144a565b500390565b60008160001904831182151516156114e4576114e461144a565b50029056fea264697066735822122064ca8e728369809bbfe58b0cff27a54a0e5e793919a8ed928a392738c3f2924564736f6c634300080e0033", - "devdoc": { - "kind": "dev", - "methods": { - "verifyProof(uint256[2],uint256[2][2],uint256[2],uint256[9])": { - "returns": { - "r": " bool true if proof is valid" - } - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/goerli/solcInputs/24c70469fd559e01f6ff2a10472da9a6.json b/deployments/goerli/solcInputs/24c70469fd559e01f6ff2a10472da9a6.json deleted file mode 100644 index f931f7d..0000000 --- a/deployments/goerli/solcInputs/24c70469fd559e01f6ff2a10472da9a6.json +++ /dev/null @@ -1,237 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/access/AccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(account),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" - }, - "@openzeppelin/contracts/access/IAccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" - }, - "@openzeppelin/contracts/access/Ownable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" - }, - "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" - }, - "@openzeppelin/contracts/security/Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/ERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC1155.sol\";\nimport \"./IERC1155Receiver.sol\";\nimport \"./extensions/IERC1155MetadataURI.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of the basic standard multi-token.\n * See https://eips.ethereum.org/EIPS/eip-1155\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\n *\n * _Available since v3.1._\n */\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\n using Address for address;\n\n // Mapping from token ID to account balances\n mapping(uint256 => mapping(address => uint256)) private _balances;\n\n // Mapping from account to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n string private _uri;\n\n /**\n * @dev See {_setURI}.\n */\n constructor(string memory uri_) {\n _setURI(uri_);\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155).interfaceId ||\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC1155MetadataURI-uri}.\n *\n * This implementation returns the same URI for *all* token types. It relies\n * on the token type ID substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * Clients calling this function must replace the `\\{id\\}` substring with the\n * actual token type ID.\n */\n function uri(uint256) public view virtual override returns (string memory) {\n return _uri;\n }\n\n /**\n * @dev See {IERC1155-balanceOf}.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\n require(account != address(0), \"ERC1155: address zero is not a valid owner\");\n return _balances[id][account];\n }\n\n /**\n * @dev See {IERC1155-balanceOfBatch}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\n public\n view\n virtual\n override\n returns (uint256[] memory)\n {\n require(accounts.length == ids.length, \"ERC1155: accounts and ids length mismatch\");\n\n uint256[] memory batchBalances = new uint256[](accounts.length);\n\n for (uint256 i = 0; i < accounts.length; ++i) {\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\n }\n\n return batchBalances;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev See {IERC1155-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not token owner or approved\"\n );\n _safeTransferFrom(from, to, id, amount, data);\n }\n\n /**\n * @dev See {IERC1155-safeBatchTransferFrom}.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not token owner or approved\"\n );\n _safeBatchTransferFrom(from, to, ids, amounts, data);\n }\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n\n emit TransferSingle(operator, from, to, id, amount);\n\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\n\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; ++i) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n }\n\n emit TransferBatch(operator, from, to, ids, amounts);\n\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\n\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\n }\n\n /**\n * @dev Sets a new URI for all token types, by relying on the token type ID\n * substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * By this mechanism, any occurrence of the `\\{id\\}` substring in either the\n * URI or any of the amounts in the JSON file at said URI will be replaced by\n * clients with the token type ID.\n *\n * For example, the `https://token-cdn-domain/\\{id\\}.json` URI would be\n * interpreted by clients as\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\n * for token type ID 0x4cce0.\n *\n * See {uri}.\n *\n * Because these URIs cannot be meaningfully represented by the {URI} event,\n * this function emits no events.\n */\n function _setURI(string memory newuri) internal virtual {\n _uri = newuri;\n }\n\n /**\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _mint(\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _balances[id][to] += amount;\n emit TransferSingle(operator, address(0), to, id, amount);\n\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _mintBatch(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; i++) {\n _balances[ids[i]][to] += amounts[i];\n }\n\n emit TransferBatch(operator, address(0), to, ids, amounts);\n\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\n }\n\n /**\n * @dev Destroys `amount` tokens of token type `id` from `from`\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `from` must have at least `amount` tokens of token type `id`.\n */\n function _burn(\n address from,\n uint256 id,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n\n emit TransferSingle(operator, from, address(0), id, amount);\n\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n */\n function _burnBatch(\n address from,\n uint256[] memory ids,\n uint256[] memory amounts\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n for (uint256 i = 0; i < ids.length; i++) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n }\n\n emit TransferBatch(operator, from, address(0), ids, amounts);\n\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC1155: setting approval status for self\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `ids` and `amounts` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `id` and `amount` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n function _doSafeTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\n if (response != IERC1155Receiver.onERC1155Received.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non-ERC1155Receiver implementer\");\n }\n }\n }\n\n function _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\n bytes4 response\n ) {\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non-ERC1155Receiver implementer\");\n }\n }\n }\n\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\n uint256[] memory array = new uint256[](1);\n array[0] = element;\n\n return array;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1155.sol\";\nimport \"../../../security/Pausable.sol\";\n\n/**\n * @dev ERC1155 token with pausable token transfers, minting and burning.\n *\n * Useful for scenarios such as preventing trades until the end of an evaluation\n * period, or having an emergency switch for freezing all token transfers in the\n * event of a large bug.\n *\n * _Available since v3.1._\n */\nabstract contract ERC1155Pausable is ERC1155, Pausable {\n /**\n * @dev See {ERC1155-_beforeTokenTransfer}.\n *\n * Requirements:\n *\n * - the contract must not be paused.\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n require(!paused(), \"ERC1155Pausable: token transfer while paused\");\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155MetadataURI is IERC1155 {\n /**\n * @dev Returns the URI for token type `id`.\n *\n * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n * clients with the actual token type ID.\n */\n function uri(uint256 id) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/ERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"./extensions/IERC721Metadata.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/Strings.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: address zero is not a valid owner\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _ownerOf(tokenId);\n require(owner != address(0), \"ERC721: invalid token ID\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireMinted(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not token owner or approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n _requireMinted(tokenId);\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n _safeTransfer(from, to, tokenId, data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _ownerOf(tokenId) != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId, 1);\n\n // Check that tokenId was not minted by `_beforeTokenTransfer` hook\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n unchecked {\n // Will not overflow unless all 2**256 token ids are minted to the same owner.\n // Given that tokens are minted one by one, it is impossible in practice that\n // this ever happens. Might change if we allow batch minting.\n // The ERC fails to describe this case.\n _balances[to] += 1;\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId, 1);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId, 1);\n\n // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook\n owner = ERC721.ownerOf(tokenId);\n\n // Clear approvals\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // Cannot overflow, as that would require more tokens to be burned/transferred\n // out than the owner initially received through minting and transferring in.\n _balances[owner] -= 1;\n }\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId, 1);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId, 1);\n\n // Check that tokenId was not transferred by `_beforeTokenTransfer` hook\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n\n // Clear approvals from the previous owner\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // `_balances[from]` cannot overflow for the same reason as described in `_burn`:\n // `from`'s balance is the number of token held, which is at least one before the current\n // transfer.\n // `_balances[to]` could overflow in the conditions described in `_mint`. That would require\n // all 2**256 token ids to be minted, which in practice is impossible.\n _balances[from] -= 1;\n _balances[to] += 1;\n }\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId, 1);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits an {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` has not been minted yet.\n */\n function _requireMinted(uint256 tokenId) internal view virtual {\n require(_exists(tokenId), \"ERC721: invalid token ID\");\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.\n * - When `from` is zero, the tokens will be minted for `to`.\n * - When `to` is zero, ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256, /* firstTokenId */\n uint256 batchSize\n ) internal virtual {\n if (batchSize > 1) {\n if (from != address(0)) {\n _balances[from] -= batchSize;\n }\n if (to != address(0)) {\n _balances[to] += batchSize;\n }\n }\n }\n\n /**\n * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.\n * - When `from` is zero, the tokens were minted for `to`.\n * - When `to` is zero, ``from``'s tokens were burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 firstTokenId,\n uint256 batchSize\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/ERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/StorageSlot.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Strings.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" - }, - "@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract HydraS1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [8609986746108439658545470593166889256314951959466775818870246174320018498804,\n 6848251127850009101372611262053374737897586140140607384018397707035108265914],\n [21367916863936594568281095443965096905143705300114190558130516981138584550504,\n 13327705762185115653848159709412003423932761899188342359583872691135383932883]\n );\n vk.IC = new Pairing.G1Point[](11);\n \n vk.IC[0] = Pairing.G1Point( \n 19965766170734310004645394427613286415565755728797065894668054116047682895204,\n 6952067612339183672227137101423582097916038093373585908267153974352032944482\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 13987716160490730015463796942940452666334097189904948795214986996497499925899,\n 5336810094802209074340875836312868429276540870324469349093948627126061524544\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 14931593253473978964215343699995811275378324235306358485461293343370969283966,\n 564306919152089917957316877787764763278299990971316475606280877961553231205\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11591267743733991434114686002448165336885445656808796470854638278338319268343,\n 11495219763417990955889652410266075210402006084183208750635660647824890013350\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 8183184532870222270700473518157259944911700429689031755853536692005688965081,\n 9121077094104828462137861111631978599019724423614716723152060153405564278301\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 4314095526093128699362232919686741372014146055311239687202926853002748112330,\n 11665330391505820654128458332883010598817535082070674418723503440883598640597\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\n 181057165072599074288983745076121344893296348827576905983079816835912241514\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 18925967077785550270509493111690046951994174908254476036944536825999614778001,\n 4990629719417206796668074534812314525340851981015724652256935997545282642849\n ); \n \n vk.IC[10] = Pairing.G1Point( \n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[10] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "@sismo-core/pythia-1/contracts/Pythia1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract Pythia1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\n );\n vk.IC = new Pairing.G1Point[](10);\n \n vk.IC[0] = Pairing.G1Point( \n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 104028078850975554065172701281783302003220555203883119831575537681421753151,\n 19148240629904598794948591359118971959790791697910953160820265703277306346\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[9] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/HydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1Base} from './IHydraS1Base.sol';\nimport {Attester} from '../../../core/Attester.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Hydra S1 ZK Proving Scheme\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to the following:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n *\n */\nabstract contract HydraS1Base is IHydraS1Base, Attester, Initializable {\n using HydraS1Lib for HydraS1ProofData;\n\n // ZK-SNARK Verifier\n HydraS1Verifier immutable VERIFIER;\n // Registry storing the Commitment Mapper EdDSA Public key\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS\n *******************************************************/\n\n /**\n * @dev Constructor. Initializes the contract\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\n * @param commitmentMapperAddress Commitment mapper's public key registry\n */\n constructor(\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress\n ) {\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\n }\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\n return COMMITMENT_MAPPER_REGISTRY;\n }\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\n return AVAILABLE_ROOTS_REGISTRY;\n }\n\n /*******************************************************\n Hydra-S1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the nullifier from an attestation extraData\n * @dev Getter of a nullifier encoded in extraData\n * @notice Must be implemented by the inheriting contracts\n * @param extraData extraData where nullifier can be encoded\n */\n function getNullifierFromExtraData(\n bytes memory extraData\n ) external view virtual returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the external nullifier from a user request\n * so it can be checked against snark input\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\n * users bring sourceSecretHash as private input which guarantees privacy\n *\n * This function MUST be implemented by Hydra-S1 attesters.\n * This is the core function that implements the logic of external nullifiers\n *\n * Do they get one external nullifier per claim?\n * Do they get 2 external nullifiers per claim?\n * Do they get 1 external nullifier per claim, every month?\n * Take a look at Hydra-S1 Simple Attester for an example\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\n */\n function _getExternalNullifierOfClaim(\n HydraS1Claim memory claim\n ) internal view virtual returns (uint256);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(\n HydraS1Claim memory claim,\n HydraS1ProofInput memory input\n ) internal view virtual {\n if (input.accountsTreeValue != claim.groupId) {\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\n }\n\n if (input.isStrict == claim.groupProperties.isScore) {\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n }\n\n if (input.destination != claim.destination) {\n revert DestinationMismatch(claim.destination, input.destination);\n }\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot)) {\n revert RegistryRootMismatch(input.registryRoot);\n }\n\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\n if (\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\n ) {\n revert CommitmentMapperPubKeyMismatch(\n commitmentMapperPubKey[0],\n commitmentMapperPubKey[1],\n input.commitmentMapperPubKey[0],\n input.commitmentMapperPubKey[1]\n );\n }\n\n uint256 externalNullifier = _getExternalNullifierOfClaim(claim);\n\n if (input.externalNullifier != externalNullifier) {\n revert ExternalNullifierMismatch(externalNullifier, input.externalNullifier);\n }\n }\n\n /**\n * @dev verify the groth16 mathematical proof\n * @param proofData snark public input\n */\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(uint256 /*errorCode*/) {\n revert InvalidGroth16Proof('');\n } catch (bytes memory /*lowLevelData*/) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/IHydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Interface\n * @author Sismo\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\n * We invite readers to refer to the following:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n **/\ninterface IHydraS1Base is IAttester {\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\n error RegistryRootMismatch(uint256 inputRoot);\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error CommitmentMapperPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error ExternalNullifierMismatch(uint256 expectedExternalNullifier, uint256 externalNullifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error AccountsTreeValueMismatch(\n uint256 expectedAccountsTreeValue,\n uint256 inputAccountsTreeValue\n );\n error InvalidGroth16Proof(string reason);\n\n function getNullifierFromExtraData(bytes memory extraData) external view returns (uint256);\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier);\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\n\nimport {IHydraS1AccountboundAttester} from './interfaces/IHydraS1AccountboundAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from '../../core/libs/Structs.sol';\n\n// Imports related to Hydra-S1\nimport {HydraS1SimpleAttester, IAttester, HydraS1Lib, HydraS1ProofData, HydraS1Claim} from './HydraS1SimpleAttester.sol';\n\n/**\n * @title Hydra-S1 Accountbound Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic.\n * Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic.\n * However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation.\n * The _beforeRecordAttestations is also overriden to fit the Accountbound logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Nullified\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\n * While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier)\n * We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation.\n * We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation.\n * Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier)\n\n * - Accountbound (opt-in, with cooldown period)\n * The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group.\n * Users can update their attestation's destination by providing a new Hydra-S1 ZK proof \n * It means the attestation is bound to the source account, stored on an updatable destination account.\n * When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional.\n * A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred\n * One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations.\n \n * - Renewable\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew or update their attestations\n **/\n\ncontract HydraS1AccountboundAttester is\n IHydraS1AccountboundAttester,\n HydraS1SimpleAttester,\n Ownable\n{\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n uint8 public constant IMPLEMENTATION_VERSION = 4;\n\n /*******************************************************\n Storage layout:\n 20 slots between HydraS1SimpleAttester and HydraS1AccountboundAttester\n 1 currently used by Ownable\n 19 place holders\n 2O for config\n 1 currently used\n 19 place holders\n 20 for logic\n 2 currently used\n 18 place holders\n *******************************************************/\n\n // keeping some space for future config logics\n uint256[19] private _placeHolderBeforeHydraS1Accountbound;\n\n // cooldown durations for each groupIndex\n mapping(uint256 => uint32) internal _cooldownDurations;\n\n // keeping some space for future config logics\n uint256[19] private _placeHoldersHydraS1AccountboundConfig;\n\n mapping(uint256 => uint32) internal _nullifiersCooldownStart;\n mapping(uint256 => uint16) internal _nullifiersBurnCount;\n\n // keeping some space for future config logics\n uint256[18] private _placeHoldersHydraS1AccountboundLogic;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first attestation collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last attestation collection in which the attester is supposed to record\n * @param owner Address of attester's owner\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address owner\n )\n HydraS1SimpleAttester(\n attestationsRegistryAddress,\n hydraS1VerifierAddress,\n availableRootsRegistryAddress,\n commitmentMapperAddress,\n collectionIdFirst,\n collectionIdLast\n )\n {\n initialize(owner);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n }\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Returns the actual attestations constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark public input as well as snark proof\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) public view virtual override(IAttester, HydraS1SimpleAttester) returns (Attestation[] memory) {\n Attestation[] memory attestations = super.buildAttestations(request, proofData);\n\n uint256 nullifier = proofData._getNullifier();\n attestations[0].extraData = abi.encodePacked(\n attestations[0].extraData, // nullifier, from HydraS1 Simple\n _getNextBurnCount(nullifier, attestations[0].owner) // BurnCount\n );\n\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Hook run before recording the attestation.\n * Throws if nullifier already used, not a renewal, and nullifier on cooldown.\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n uint256 nullifier = proofData._getNullifier();\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\n\n HydraS1Claim memory claim = request._claim();\n\n // check if the nullifier has already been used previously, if so it may be on cooldown\n if (\n previousNullifierDestination != address(0) &&\n previousNullifierDestination != claim.destination\n ) {\n uint32 cooldownDuration = _getCooldownDurationForGroupIndex(claim.groupProperties.groupIndex);\n if (cooldownDuration == 0) {\n revert CooldownDurationNotSetForGroupIndex(claim.groupProperties.groupIndex);\n }\n if (_isOnCooldown(nullifier, cooldownDuration)) {\n uint16 burnCount = _getNullifierBurnCount(nullifier);\n revert NullifierOnCooldown(\n nullifier,\n previousNullifierDestination,\n burnCount,\n cooldownDuration\n );\n }\n\n // Delete the old Attestation linked to the nullifier before recording the new one (accountbound feature)\n _deletePreviousAttestation(claim, previousNullifierDestination);\n\n _setNullifierOnCooldownAndIncrementBurnCount(nullifier);\n }\n _setDestinationForNullifier(nullifier, request.destination);\n }\n\n /*******************************************************\n LOGIC FUNCTIONS RELATED TO ACCOUNTBOUND FEATURE\n *******************************************************/\n\n /**\n * @dev Getter, returns the burnCount of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16) {\n return _getNullifierBurnCount(nullifier);\n }\n\n /**\n * @dev Getter, returns the cooldown start of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32) {\n return _getNullifierCooldownStart(nullifier);\n }\n\n /**\n * @dev returns the nullifier for a given extraData\n * @param extraData bytes where the nullifier is encoded\n */\n function getNullifierFromExtraData(\n bytes memory extraData\n ) external pure override(HydraS1SimpleAttester, IHydraS1AccountboundAttester) returns (uint256) {\n (uint256 nullifier, ) = abi.decode(extraData, (uint256, uint16));\n\n return nullifier;\n }\n\n /**\n * @dev Returns the burn count for a given extraData\n * @param extraData bytes where the burnCount is encoded\n */\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16) {\n (, uint16 burnCount) = abi.decode(extraData, (uint256, uint16));\n\n return burnCount;\n }\n\n /**\n * @dev Checks if a nullifier is on cooldown\n * @param nullifier user nullifier\n * @param cooldownDuration waiting time before the user can change its badge destination\n */\n function _isOnCooldown(uint256 nullifier, uint32 cooldownDuration) internal view returns (bool) {\n return _getNullifierCooldownStart(nullifier) + cooldownDuration > block.timestamp;\n }\n\n /**\n * @dev Delete the previous attestation created with this nullifier\n * @param claim user claim\n * @param previousNullifierDestination previous destination chosen for this user nullifier\n */\n function _deletePreviousAttestation(\n HydraS1Claim memory claim,\n address previousNullifierDestination\n ) internal {\n address[] memory attestationOwners = new address[](1);\n uint256[] memory attestationCollectionIds = new uint256[](1);\n\n attestationOwners[0] = previousNullifierDestination;\n attestationCollectionIds[0] = AUTHORIZED_COLLECTION_ID_FIRST + claim.groupProperties.groupIndex;\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n }\n\n function _setNullifierOnCooldownAndIncrementBurnCount(uint256 nullifier) internal {\n _nullifiersCooldownStart[nullifier] = uint32(block.timestamp);\n _nullifiersBurnCount[nullifier] += 1;\n emit NullifierSetOnCooldown(nullifier, _nullifiersBurnCount[nullifier]);\n }\n\n function _getNullifierCooldownStart(uint256 nullifier) internal view returns (uint32) {\n return _nullifiersCooldownStart[nullifier];\n }\n\n function _getNullifierBurnCount(uint256 nullifier) internal view returns (uint16) {\n return _nullifiersBurnCount[nullifier];\n }\n\n /**\n * @dev returns burn count or burn count + 1 if new burn will happen\n * @param nullifier user nullifier\n * @param claimDestination destination referenced in the user claim\n */\n function _getNextBurnCount(\n uint256 nullifier,\n address claimDestination\n ) public view virtual returns (uint16) {\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\n uint16 burnCount = _getNullifierBurnCount(nullifier);\n // If the attestation is minted on a new destination address\n // the burnCount that will be encoded in the extraData of the Attestation should be incremented\n if (\n previousNullifierDestination != address(0) && previousNullifierDestination != claimDestination\n ) {\n burnCount += 1;\n }\n return burnCount;\n }\n\n /*******************************************************\n GROUP CONFIGURATION LOGIC\n *******************************************************/\n\n /**\n * @dev Setter, sets the cooldown duration of a groupIndex\n * @notice set to 0 to deactivate the accountbound feature for this group\n * @param groupIndex internal collection id\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\n **/\n function setCooldownDurationForGroupIndex(\n uint256 groupIndex,\n uint32 cooldownDuration\n ) external onlyOwner {\n _cooldownDurations[groupIndex] = cooldownDuration;\n emit CooldownDurationSetForGroupIndex(groupIndex, cooldownDuration);\n }\n\n /**\n * @dev Getter, get the cooldown duration of a groupIndex\n * @notice returns 0 when the accountbound feature is deactivated for this group\n * @param groupIndex internal collection id\n **/\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32) {\n return _getCooldownDurationForGroupIndex(groupIndex);\n }\n\n // = 0 means that the accountbound feature is deactivated for this group\n function _getCooldownDurationForGroupIndex(uint256 groupIndex) internal view returns (uint32) {\n return _cooldownDurations[groupIndex];\n }\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\nimport {IHydraS1Base} from './base/IHydraS1Base.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Nullified\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * nullifier = hash(sourceSecret, externalNullifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - Renewable\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew their attestations\n **/\n\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n /*******************************************************\n Storage layout:\n 20 slots for HydraS1\n 1 slot used\n 19 place holders\n *******************************************************/\n\n mapping(uint256 => address) internal _nullifiersDestinations;\n\n // keeping some space for future\n uint256[19] private _placeHoldersHydraS1Simple;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\n HydraS1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n uint256 nullifier = proofData._getNullifier();\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n abi.encode(nullifier)\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if nullifier already used and not a renewal (e.g destination different that last)\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n // we get the nullifier used from the snark input in the data provided\n uint256 nullifier = proofData._getNullifier();\n address currentDestination = _getDestinationOfNullifier(nullifier);\n\n if (currentDestination != address(0) && currentDestination != request.destination) {\n revert NullifierUsed(nullifier);\n }\n\n _setDestinationForNullifier(nullifier, request.destination);\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the external nullifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose externalNullifier = hash(attesterAddress, claim.GroupId)\n * Creates one nullifier per group, per user and makes sure no collision with other attester's nullifiers\n **/\n function _getExternalNullifierOfClaim(\n HydraS1Claim memory claim\n ) internal view override returns (uint256) {\n uint256 externalNullifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.groupIndex\n );\n return externalNullifier;\n }\n\n /**\n * @dev returns the nullifier for a given extraData\n * @param extraData bytes where the nullifier is encoded\n */\n function getNullifierFromExtraData(\n bytes memory extraData\n ) external pure virtual override(IHydraS1Base, HydraS1Base) returns (uint256) {\n return abi.decode(extraData, (uint256));\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a nullifier\n * @param nullifier nullifier used\n **/\n function getDestinationOfNullifier(uint256 nullifier) external view override returns (address) {\n return _getDestinationOfNullifier(nullifier);\n }\n\n function _setDestinationForNullifier(uint256 nullifier, address destination) internal virtual {\n _nullifiersDestinations[nullifier] = destination;\n emit NullifierDestinationUpdated(nullifier, destination);\n }\n\n function _getDestinationOfNullifier(uint256 nullifier) internal view returns (address) {\n return _nullifiersDestinations[nullifier];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from '././IHydraS1SimpleAttester.sol';\n\n/**\n * @title Hydra-S1 Accountbound Interface\n * @author Sismo\n * @notice Interface of the HydraS1AccountboundAttester contract which inherits from the errors, events and methods specific to the HydraS1SimpleAttester interface.\n **/\ninterface IHydraS1AccountboundAttester is IHydraS1SimpleAttester {\n /**\n * @dev Event emitted when the duration of the cooldown duration for a group index (internal collection id) has been set\n * @param groupIndex internal collection id\n * @param cooldownDuration the duration of the cooldown period\n **/\n event CooldownDurationSetForGroupIndex(uint256 indexed groupIndex, uint32 cooldownDuration);\n\n /**\n * @dev Event emitted when the nullifier has been set on cooldown. This happens when the\n * attestation destination of a nullifier has been changed\n * @param nullifier user nullifier\n * @param burnCount the number of times the attestation destination of a nullifier has been changed\n **/\n event NullifierSetOnCooldown(uint256 indexed nullifier, uint16 burnCount);\n\n /**\n * @dev Error when the nullifier is on cooldown. The user have to wait the cooldownDuration\n * before being able to change again the destination address.\n **/\n error NullifierOnCooldown(\n uint256 nullifier,\n address destination,\n uint16 burnCount,\n uint32 cooldownStart\n );\n\n /**\n * @dev Error when the cooldown duration for a given groupIndex is equal to zero.\n * The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.\n **/\n error CooldownDurationNotSetForGroupIndex(uint256 groupIndex);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) external;\n\n /**\n * @dev returns the nullifier for a given extraData\n * @param extraData bytes where the nullifier is encoded\n */\n function getNullifierFromExtraData(bytes memory extraData) external pure returns (uint256);\n\n /**\n * @dev Returns the burn count for a given extraData\n * @param extraData bytes where the burnCount is encoded\n */\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16);\n\n /**\n * @dev Getter, returns the cooldown start of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32);\n\n /**\n * @dev Getter, returns the burnCount of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16);\n\n /**\n * @dev Setter, sets the cooldown duration of a groupIndex\n * @param groupIndex internal collection id\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\n **/\n function setCooldownDurationForGroupIndex(uint256 groupIndex, uint32 cooldownDuration) external;\n\n /*/**\n * @dev Getter, get the cooldown duration of a groupIndex\n * @notice returns 0 when the accountbound feature is deactivated for this group\n * @param groupIndex internal collection id\n **/\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32);\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Accountbound Interface\n * @author Sismo\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\n **/\ninterface IHydraS1SimpleAttester is IHydraS1Base {\n /**\n * @dev Error when the nullifier is already used for a destination address\n **/\n error NullifierUsed(uint256 nullifier);\n\n /**\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\n **/\n error CollectionIdOutOfBound(uint256 collectionId);\n\n /**\n * @dev Event emitted when the nullifier is associated to a destination address.\n **/\n event NullifierDestinationUpdated(uint256 nullifier, address newOwner);\n\n /**\n * @dev Getter, returns the last attestation destination of a nullifier\n * @param nullifier nullifier used\n **/\n function getDestinationOfNullifier(uint256 nullifier) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1AccountboundLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Lib, HydraS1Claim, HydraS1GroupProperties} from './HydraS1Lib.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1AccountboundClaim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1AccountboundGroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1AccountboundGroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n uint32 cooldownDuration;\n bool isScore;\n}\n\nlibrary HydraS1AccountboundLib {\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _hydraS1claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n HydraS1GroupProperties memory hydraS1GroupProperties = HydraS1GroupProperties(\n groupProperties.groupIndex,\n groupProperties.generationTimestamp,\n groupProperties.isScore\n );\n\n return (\n HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, hydraS1GroupProperties)\n );\n }\n\n function _hydraS1Accountboundclaim(\n Request memory self\n ) internal pure returns (HydraS1AccountboundClaim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory hydraS1AccountboundGroupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n return (\n HydraS1AccountboundClaim(\n claim.groupId,\n claim.claimedValue,\n self.destination,\n hydraS1AccountboundGroupProperties\n )\n );\n }\n\n function _generateGroupIdFromEncodedProperties(\n bytes memory encodedProperties\n ) internal pure returns (uint256) {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1GroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n bool isScore;\n}\n\nstruct HydraS1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct HydraS1ProofData {\n HydraS1CircomSnarkProof proof;\n uint256[10] input;\n // destination\n // chainId\n // commitmentMapperPubKey.x\n // commitmentMapperPubKey.y\n // registryTreeRoot\n // externalNullifier\n // nullifier\n // claimedValue\n // accountsTreeValue\n // isStrict\n}\n\nstruct HydraS1ProofInput {\n address destination;\n uint256 chainId;\n uint256 registryRoot;\n uint256 externalNullifier;\n uint256 nullifier;\n uint256 value;\n uint256 accountsTreeValue;\n bool isStrict;\n uint256[2] commitmentMapperPubKey;\n}\n\nlibrary HydraS1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\n return\n HydraS1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getRegistryRoot(self),\n _getExpectedExternalNullifier(self),\n _getNullifier(self),\n _getValue(self),\n _getAccountsTreeValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1GroupProperties)\n );\n\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(\n HydraS1ProofData memory self\n )\n internal\n pure\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[10] memory)\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(\n HydraS1ProofData memory self\n ) internal pure returns (uint256[2] memory) {\n return [self.input[2], self.input[3]];\n }\n\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(\n HydraS1ProofData memory self\n ) internal pure returns (uint256) {\n return self.input[5];\n }\n\n function _getNullifier(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[8];\n }\n\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\n return self.input[9] == 1;\n }\n\n function _getNullifier(bytes calldata self) internal pure returns (uint256) {\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\n uint256 nullifier = uint256(_getNullifier(snarkProofData));\n return nullifier;\n }\n\n function _generateGroupIdFromProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\n );\n }\n\n function _generateGroupIdFromEncodedProperties(\n bytes memory encodedProperties\n ) internal pure returns (uint256) {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(groupIndex, generationTimestamp, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/pythia-1/base/IPythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\n\ninterface IPythia1Base {\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error UserShouldOwnItsDestination(address sender, address inputdestination);\n error CommitmentSignerPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier);\n\n /**\n * @dev Getter of the Commitment Signer EdDSA Public Key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\n}\n" - }, - "contracts/attesters/pythia-1/base/Pythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IPythia1Base} from './IPythia1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Pythia 1 ZK Proving Scheme\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\n\n/**\n * @title Pythia-1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \n * without anyone being able to make the link between the offchain service and the onchain service.\n * It is inherited by the family of Pythia-1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n \n \n **/\nabstract contract Pythia1Base is IPythia1Base, Initializable {\n using Pythia1Lib for Pythia1ProofData;\n\n // ZK-SNARK Verifier\n Pythia1Verifier immutable VERIFIER;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\n */\n constructor(address Pythia1VerifierAddress) {\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\n }\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of the Commitment signer Eddsa Public key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\n return _getCommitmentSignerPubKey();\n }\n\n /*******************************************************\n Pythia-1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * the secretHash is a number only known by the user and is used in \n * the zero knowledge as a private input which guarantees privacy\n\n * This function MUST be implemented by Pythia-1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Pythia-1 Simple Attester for an example\n * @param claim user claim: a particular claim that a user have that he can prove s right.\n */\n function _getTicketIdentifierOfClaim(\n Pythia1Claim memory claim\n ) internal view virtual returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\n * prove the claim was correctly issued for the user.\n */\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(\n Pythia1Claim memory claim,\n Pythia1ProofInput memory input\n ) internal view virtual {\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (claim.destination != msg.sender)\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\n if (\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\n )\n revert CommitmentSignerPubKeyMismatch(\n commitmentSignerPubKey[0],\n commitmentSignerPubKey[1],\n input.commitmentSignerPubKey[0],\n input.commitmentSignerPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the plonk mathematical proof using the circom verifier contract\n * @param proofData snark public input\n */\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(uint256 /*errorCode*/) {\n revert InvalidGroth16Proof('');\n } catch (bytes memory /*lowLevelData*/) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\n\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\n error TicketUsed(uint256 userTicket);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/pythia-1/libs/Pythia1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\n\n// user Pythia-1 claim retrieved form his request\nstruct Pythia1Claim {\n uint256 groupId; // user claims be part of this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct Pythia1GroupProperties {\n uint128 internalCollectionId;\n bool isScore;\n}\n\nstruct Pythia1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct Pythia1ProofData {\n Pythia1CircomSnarkProof proof;\n uint256[9] input;\n // destination;\n // chainId;\n // commitmentSignerPubKey.x;\n // commitmentSignerPubKey.y;\n // groupId;\n // ticketIdentifier;\n // userTicket;\n // value;\n // isStrict;\n}\n\nstruct Pythia1ProofInput {\n address destination;\n uint256 chainId;\n uint256 groupId;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n bool isStrict;\n uint256[2] commitmentSignerPubKey;\n}\n\nlibrary Pythia1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\n return\n Pythia1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getGroupId(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n Pythia1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (Pythia1GroupProperties)\n );\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(\n Pythia1ProofData memory self\n )\n internal\n pure\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[9] memory)\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(\n Pythia1ProofData memory self\n ) internal pure returns (uint256[2] memory) {\n return [self.input[2], self.input[3]];\n }\n\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(\n Pythia1ProofData memory self\n ) internal pure returns (uint256) {\n return self.input[5];\n }\n\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\n return self.input[8] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(\n uint128 internalCollectionId,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\n }\n\n function _generateGroupIdFromEncodedProperties(\n bytes memory encodedProperties\n ) internal pure returns (uint256) {\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 internalCollectionId,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(internalCollectionId, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to Pythia1 Proving Scheme\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\n\n/**\n * @title Pythia-1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Pythia-1 Attesters.\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \n * offchain service in a privacy preserving way. \n * That means no-one can make the link between the account used in the offchain service\n * and the onchain account where the attestation is stored.\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each users gets one userTicket per claim\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n **/\n\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\n using Pythia1Lib for Pythia1ProofData;\n using Pythia1Lib for bytes;\n using Pythia1Lib for Request;\n\n uint8 public constant IMPLEMENTATION_VERSION = 3;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n uint256[2] internal _commitmentSignerPubKey;\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\n * @param owner The owner of the contract that can update the commitment signer pub key\n */\n constructor(\n address attestationsRegistryAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address pythia1VerifierAddress,\n uint256[2] memory commitmentSignerPubKey,\n address owner\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n initialize(commitmentSignerPubKey, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param ownerAddress Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n uint256[2] memory commitmentSignerPubKey,\n address ownerAddress\n ) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into Pythia1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\n Pythia1ProofInput memory snarkInput = snarkProof._input();\n Pythia1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\n Pythia1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.internalCollectionId;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n uint32(block.timestamp),\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used\n * @param request users request. Claim of beiing part of a group.\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0)) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * users bring secretHash as private input in snark which guarantees privacy\n * the secretHash is only known by the user and never escape the user's browser\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(\n Pythia1Claim memory claim\n ) internal view override returns (uint256) {\n uint256 ticketIdentifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.internalCollectionId\n );\n return ticketIdentifier;\n }\n\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\n return _commitmentSignerPubKey;\n }\n\n /*******************************************************\n Pythia-1 Attester Specific Functions\n *******************************************************/\n\n function updateCommitmentSignerPubKey(\n uint256[2] memory commitmentSignerPubKey\n ) external onlyOwner {\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\n _commitmentSignerPubKey = commitmentSignerPubKey;\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\n }\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/core/AttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\nimport {Attestation, AttestationData} from './libs/Structs.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Attestations Registry\n * @author Sismo\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\n * Only authorized attestations issuers can record attestation in the registry\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\n * For more information: https://attestations-registry.docs.sismo.io\n\n * For each attestation recorded, a badge is received by the user\n * The badge is the Non transferrable NFT representation of an attestation \n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\n * It enables off-chain apps such as opensea to catch the \"shadow mint\" of the badge\n **/\ncontract AttestationsRegistry is\n AttestationsRegistryState,\n IAttestationsRegistry,\n AttestationsRegistryConfigLogic\n{\n uint8 public constant IMPLEMENTATION_VERSION = 3;\n IBadges immutable BADGES;\n\n /**\n * @dev Constructor.\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @param badgesAddress Stateless ERC1155 Badges contract\n */\n constructor(address owner, address badgesAddress) {\n BADGES = IBadges(badgesAddress);\n initialize(owner);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n }\n }\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\n address issuer = _msgSender();\n for (uint256 i = 0; i < attestations.length; i++) {\n if (!_isAuthorized(issuer, attestations[i].collectionId))\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\n\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\n attestations[i].owner\n ].value;\n\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\n attestations[i].issuer,\n attestations[i].value,\n attestations[i].timestamp,\n attestations[i].extraData\n );\n\n _triggerBadgeTransferEvent(\n attestations[i].collectionId,\n attestations[i].owner,\n previousAttestationValue,\n attestations[i].value\n );\n emit AttestationRecorded(attestations[i]);\n }\n }\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(\n address[] calldata owners,\n uint256[] calldata collectionIds\n ) external override whenNotPaused {\n if (owners.length != collectionIds.length)\n revert OwnersAndCollectionIdsLengthMismatch(owners, collectionIds);\n\n address issuer = _msgSender();\n for (uint256 i = 0; i < owners.length; i++) {\n AttestationData memory attestationData = _attestationsData[collectionIds[i]][owners[i]];\n\n if (!_isAuthorized(issuer, collectionIds[i]))\n revert IssuerNotAuthorized(issuer, collectionIds[i]);\n delete _attestationsData[collectionIds[i]][owners[i]];\n\n _triggerBadgeTransferEvent(collectionIds[i], owners[i], attestationData.value, 0);\n\n emit AttestationDeleted(\n Attestation(\n collectionIds[i],\n owners[i],\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n )\n );\n }\n }\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(\n uint256 collectionId,\n address owner\n ) external view override returns (bool) {\n return _getAttestationValue(collectionId, owner) != 0;\n }\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(\n uint256 collectionId,\n address owner\n ) external view override returns (AttestationData memory) {\n return _getAttestationData(collectionId, owner);\n }\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(\n uint256 collectionId,\n address owner\n ) external view override returns (uint256) {\n return _getAttestationValue(collectionId, owner);\n }\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(\n uint256 collectionId,\n address owner\n ) external view override returns (address, uint256, uint32, bytes memory) {\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\n return (\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n );\n }\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(\n uint256 collectionId,\n address owner\n ) external view override returns (bytes memory) {\n return _attestationsData[collectionId][owner].extraData;\n }\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(\n uint256 collectionId,\n address owner\n ) external view override returns (address) {\n return _attestationsData[collectionId][owner].issuer;\n }\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(\n uint256 collectionId,\n address owner\n ) external view override returns (uint32) {\n return _attestationsData[collectionId][owner].timestamp;\n }\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view override returns (AttestationData[] memory) {\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\n }\n return attestationsDataArray;\n }\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view override returns (uint256[] memory) {\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\n }\n return attestationsValues;\n }\n\n /**\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\n * It enables off-chain apps such as opensea to catch the \"shadow mints/burns\" of badges\n */\n function _triggerBadgeTransferEvent(\n uint256 badgeTokenId,\n address owner,\n uint256 previousValue,\n uint256 newValue\n ) internal {\n bool isGreaterValue = newValue > previousValue;\n address operator = address(this);\n address from = isGreaterValue ? address(0) : owner;\n address to = isGreaterValue ? owner : address(0);\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\n\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\n }\n\n function _getAttestationData(\n uint256 collectionId,\n address owner\n ) internal view returns (AttestationData memory) {\n return (_attestationsData[collectionId][owner]);\n }\n\n function _getAttestationValue(\n uint256 collectionId,\n address owner\n ) internal view returns (uint256) {\n return _attestationsData[collectionId][owner].value;\n }\n}\n" - }, - "contracts/core/Attester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\n\n/**\n * @title Attester Abstract Contract\n * @author Sismo\n * @notice Contract to be inherited by Attesters\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\n * are recommended to implemented this abstract contract\n\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\n *\n * This contracts is built around two main external standard functions.\n * They must NOT be override them, unless your really know what you are doing\n \n * - generateAttestations(request, proof) => will write attestations in the registry\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\n\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\n\n * For more information: https://attesters.docs.sismo.io\n **/\nabstract contract Attester is IAttester {\n // Registry where all attestations are stored\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n // Verify if request is valid by verifying against proof\n _verifyRequest(request, proofData);\n\n // Generate the actual attestations from user request\n Attestation[] memory attestations = buildAttestations(request, proofData);\n\n _beforeRecordAttestations(request, proofData);\n\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n\n _afterRecordAttestations(attestations);\n\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationGenerated(attestations[i]);\n }\n\n return attestations;\n }\n\n /**\n * @dev External facing function. Allows to delete attestations by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that were deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n address[] memory attestationOwners = new address[](collectionIds.length);\n\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\n\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n // fetch attestations from the registry\n (\n address issuer,\n uint256 attestationValue,\n uint32 timestamp,\n bytes memory extraData\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\n\n attestationOwners[i] = attestationsOwner;\n attestationCollectionIds[i] = collectionIds[i];\n\n attestations[i] = (\n Attestation(\n collectionIds[i],\n attestationsOwner,\n issuer,\n attestationValue,\n timestamp,\n extraData\n )\n );\n }\n\n _verifyAttestationsDeletionRequest(attestations, proofData);\n\n _beforeDeleteAttestations(attestations, proofData);\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n\n _afterDeleteAttestations(attestations, proofData);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n emit AttestationDeleted(attestations[i]);\n }\n return attestations;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) public view virtual returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry getter\n * @return attestationRegistry\n */\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\n return ATTESTATIONS_REGISTRY;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should verify the user request is valid\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\n\n /**\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\n * Default behavior: throws\n * It should verify attestations deletion request is valid\n * @param attestations Attestations that will be deleted\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyAttestationsDeletionRequest(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {\n revert AttestationDeletionNotImplemented();\n }\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before recording attestations in the registry\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual {}\n\n /**\n * @dev (Optional) Can be overridden in attesters inheriting this contract\n * Will be called after recording an attestation\n * @param attestations Recorded attestations\n */\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _beforeDeleteAttestations(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called after deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _afterDeleteAttestations(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {}\n}\n" - }, - "contracts/core/Badges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Badges contract\n * @author Sismo\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n * For more information: https://badges.docs.sismo.io\n */\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\n uint8 public constant IMPLEMENTATION_VERSION = 3;\n\n IAttestationsRegistry internal _attestationsRegistry;\n\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\n\n /**\n * @dev Constructor\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n constructor(\n string memory uri,\n address owner // This is Sismo Frontend Contract\n ) ERC1155(uri) {\n initialize(uri, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n string memory uri,\n address owner\n ) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup uri yet or if called by constructor (for implem setup)\n if (bytes(ERC1155.uri(0)).length == 0 || address(this).code.length == 0) {\n _setURI(uri);\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n }\n }\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(\n address account,\n uint256 id\n ) public view virtual override(ERC1155, IBadges) returns (uint256) {\n return _attestationsRegistry.getAttestationValue(id, account);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function isApprovedForAll(\n address account,\n address operator\n ) public view virtual override returns (bool) {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\n emit TransferSingle(operator, from, to, id, value);\n }\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(\n address attestationsRegistry\n ) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\n }\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _setURI(uri);\n }\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view override returns (address) {\n return address(_attestationsRegistry);\n }\n\n /**\n * @dev Getter of the badge issuer\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeIssuer(address account, uint256 id) external view returns (address) {\n return _attestationsRegistry.getAttestationIssuer(id, account);\n }\n\n /**\n * @dev Getter of the badge timestamp\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32) {\n return _attestationsRegistry.getAttestationTimestamp(id, account);\n }\n\n /**\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory) {\n return _attestationsRegistry.getAttestationExtraData(id, account);\n }\n\n /**\n * @dev Getter of the value of a specific badge attribute\n * @param id Badge Id to check (= attestationCollectionId)\n * @param index Index of the attribute\n */\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8) {\n return _attestationsRegistry.getAttributeValueForAttestationsCollection(id, index);\n }\n\n /**\n * @dev Getter of all badge attributes and their values for a specific badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getAttributesNamesAndValuesForBadge(\n uint256 id\n ) external view returns (bytes32[] memory, uint8[] memory) {\n return _attestationsRegistry.getAttributesNamesAndValuesForAttestationsCollection(id);\n }\n\n /**\n * @dev ERC165\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(AccessControl, ERC1155) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n revert BadgesNonTransferrable();\n }\n}\n" - }, - "contracts/core/Front.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IFront} from './interfaces/IFront.sol';\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation} from './libs/Structs.sol';\n\n/**\n * @title Front\n * @author Sismo\n * @notice This is the Front contract of the Sismo protocol\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\n\n * For more information: https://front.docs.sismo.io\n */\ncontract Front is IFront {\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\n uint256 public constant EARLY_USER_COLLECTION = 0;\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress Attestations registry contract address\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n Attestation[] memory attestations = _forwardAttestationsGeneration(\n attester,\n request,\n proofData\n );\n _generateEarlyUserAttestation(request.destination);\n return attestations;\n }\n\n /**\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n address destination = requests[0].destination;\n for (uint256 i = 0; i < attesters.length; i++) {\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\n attestations[i] = _forwardAttestationsGeneration(\n attesters[i],\n requests[i],\n proofDataArray[i]\n );\n }\n _generateEarlyUserAttestation(destination);\n return attestations;\n }\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view override returns (Attestation[] memory) {\n return _forwardAttestationsBuild(attester, request, proofData);\n }\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function of targeted attester\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n\n for (uint256 i = 0; i < attesters.length; i++) {\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\n }\n return attestations;\n }\n\n function _forwardAttestationsBuild(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal view returns (Attestation[] memory) {\n return IAttester(attester).buildAttestations(request, proofData);\n }\n\n function _forwardAttestationsGeneration(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal returns (Attestation[] memory) {\n return IAttester(attester).generateAttestations(request, proofData);\n }\n\n function _generateEarlyUserAttestation(address destination) internal {\n uint32 currentTimestamp = uint32(block.timestamp);\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\n EARLY_USER_COLLECTION,\n destination\n );\n\n if (!alreadyHasAttestation) {\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n EARLY_USER_COLLECTION,\n destination,\n address(this),\n 1,\n currentTimestamp,\n 'With strong love from Sismo'\n );\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n emit EarlyUserAttestationGenerated(destination);\n }\n }\n }\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\n\n/**\n * @title IAttestationsRegistry\n * @author Sismo\n * @notice This is the interface of the AttestationRegistry\n */\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\n event AttestationRecorded(Attestation attestation);\n event AttestationDeleted(Attestation attestation);\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external;\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(\n uint256 collectionId,\n address owner\n ) external view returns (AttestationData memory);\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(\n uint256 collectionId,\n address owner\n ) external view returns (address, uint256, uint32, bytes memory);\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(\n uint256 collectionId,\n address owner\n ) external view returns (bytes memory);\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(\n uint256 collectionId,\n address owner\n ) external view returns (address);\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(\n uint256 collectionId,\n address owner\n ) external view returns (uint32);\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view returns (AttestationData[] memory);\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view returns (uint256[] memory);\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\n\ninterface IAttestationsRegistryConfigLogic {\n error AttesterNotFound(address issuer);\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\n error IdsMismatch(\n address issuer,\n uint256 rangeIndex,\n uint256 expectedFirstId,\n uint256 expectedLastId,\n uint256 FirstId,\n uint256 lastCollectionId\n );\n error AttributeDoesNotExist(uint8 attributeIndex);\n error AttributeAlreadyExists(uint8 attributeIndex);\n error ArgsLengthDoesNotMatch();\n\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\n event AttributeNameUpdated(\n uint8 attributeIndex,\n bytes32 newAttributeName,\n bytes32 previousAttributeName\n );\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\n\n event AttestationsCollectionAttributeSet(\n uint256 collectionId,\n uint8 attributeIndex,\n uint8 attributeValue\n );\n\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n\n /**\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute. Can go from 0 to 63.\n */\n function attestationsCollectionHasAttribute(\n uint256 collectionId,\n uint8 index\n ) external view returns (bool);\n\n function attestationsCollectionHasAttributes(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (bool);\n\n /**\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\n */\n function getAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 attributeIndex\n ) external view returns (uint8);\n\n function getAttributesValuesForAttestationsCollection(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (uint8[] memory);\n\n /**\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute (must be between 0 and 63)\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\n */\n function setAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 index,\n uint8 value\n ) external;\n\n function setAttributesValuesForAttestationsCollections(\n uint256[] memory collectionIds,\n uint8[] memory indices,\n uint8[] memory values\n ) external;\n\n /**\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n */\n function getAttributesNamesAndValuesForAttestationsCollection(\n uint256 collectionId\n ) external view returns (bytes32[] memory, uint8[] memory);\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external;\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external;\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external;\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external;\n\n /**\n * @dev Create a new attribute.\n * @param index Index of the attribute. Can go from 0 to 63.\n * @param name Name in bytes32 of the attribute\n */\n function createNewAttribute(uint8 index, bytes32 name) external;\n\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\n\n /**\n * @dev Update the name of an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\n * @param newName new name in bytes32 of the attribute\n */\n function updateAttributeName(uint8 index, bytes32 newName) external;\n\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\n\n /**\n * @dev Delete an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\n */\n function deleteAttribute(uint8 index) external;\n\n function deleteAttributes(uint8[] memory indices) external;\n}\n" - }, - "contracts/core/interfaces/IAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\n\n/**\n * @title IAttester\n * @author Sismo\n * @notice This is the interface for the attesters in Sismo Protocol\n */\ninterface IAttester {\n event AttestationGenerated(Attestation attestation);\n\n event AttestationDeleted(Attestation attestation);\n\n error AttestationDeletionNotImplemented();\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev External facing function. Allows to delete an attestation by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that was deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry address getter\n * @return attestationRegistry Address of the registry\n */\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\n}\n" - }, - "contracts/core/interfaces/IBadges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Interface for Badges contract\n * @author Sismo\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n */\ninterface IBadges {\n error BadgesNonTransferrable();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(string memory uri, address owner) external;\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external;\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry) external;\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external;\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view returns (address);\n\n /**\n * @dev Getter of the badge issuer\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeIssuer(address account, uint256 id) external view returns (address);\n\n /**\n * @dev Getter of the badge timestamp\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);\n\n /**\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);\n\n /**\n * @dev Getter of the value of a specific badge attribute\n * @param id Badge Id to check (= attestationCollectionId)\n * @param index Index of the attribute\n */\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);\n\n /**\n * @dev Getter of all badge attributes and their values for a specific badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getAttributesNamesAndValuesForBadge(\n uint256 id\n ) external view returns (bytes32[] memory, uint8[] memory);\n}\n" - }, - "contracts/core/interfaces/IFront.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\n\n/**\n * @title IFront\n * @author Sismo\n * @notice This is the interface of the Front Contract\n */\ninterface IFront {\n error DifferentRequestsDestinations();\n event EarlyUserAttestationGenerated(address destination);\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev generate multiple attestations at once, to the same destination\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external returns (Attestation[][] memory);\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function(s) of targeted attester(s)\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view returns (Attestation[][] memory);\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport './OwnableLogic.sol';\nimport './PausableLogic.sol';\nimport './InitializableLogic.sol';\nimport './AttestationsRegistryState.sol';\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\nimport {Bitmap256Bit} from '../utils/Bitmap256Bit.sol';\n\n/**\n * @title Attestations Registry Config Logic contract\n * @author Sismo\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\n **/\ncontract AttestationsRegistryConfigLogic is\n AttestationsRegistryState,\n IAttestationsRegistryConfigLogic,\n OwnableLogic,\n PausableLogic,\n InitializableLogic\n{\n using RangeUtils for Range[];\n using Bitmap256Bit for uint256;\n using Bitmap256Bit for uint8;\n\n /******************************************\n *\n * ATTESTATION REGISTRY WRITE ACCESS MANAGEMENT (ISSUERS)\n *\n *****************************************/\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external override onlyOwner {\n _pause();\n }\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external override onlyOwner {\n _unpause();\n }\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\n for (uint256 i = 0; i < ranges.length; i++) {\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external override onlyOwner {\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\n return _isAuthorized(issuer, collectionId);\n }\n\n /******************************************\n *\n * ATTRIBUTES CONFIG LOGIC\n *\n *****************************************/\n\n /**\n * @dev Create a new attribute.\n * @param index Index of the attribute. Can go from 0 to 63.\n * @param name Name in bytes32 of the attribute\n */\n function createNewAttribute(uint8 index, bytes32 name) public onlyOwner {\n index._checkIndexIsValid();\n if (_isAttributeCreated(index)) {\n revert AttributeAlreadyExists(index);\n }\n _createNewAttribute(index, name);\n }\n\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external onlyOwner {\n if (indices.length != names.length) {\n revert ArgsLengthDoesNotMatch();\n }\n\n for (uint256 i = 0; i < indices.length; i++) {\n createNewAttribute(indices[i], names[i]);\n }\n }\n\n /**\n * @dev Update the name of an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\n * @param newName new name in bytes32 of the attribute\n */\n function updateAttributeName(uint8 index, bytes32 newName) public onlyOwner {\n index._checkIndexIsValid();\n if (!_isAttributeCreated(index)) {\n revert AttributeDoesNotExist(index);\n }\n _updateAttributeName(index, newName);\n }\n\n function updateAttributesName(\n uint8[] memory indices,\n bytes32[] memory newNames\n ) external onlyOwner {\n if (indices.length != newNames.length) {\n revert ArgsLengthDoesNotMatch();\n }\n\n for (uint256 i = 0; i < indices.length; i++) {\n updateAttributeName(indices[i], newNames[i]);\n }\n }\n\n /**\n * @dev Delete an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must already exist\n */\n function deleteAttribute(uint8 index) public onlyOwner {\n index._checkIndexIsValid();\n if (!_isAttributeCreated(index)) {\n revert AttributeDoesNotExist(index);\n }\n _deleteAttribute(index);\n }\n\n function deleteAttributes(uint8[] memory indices) external onlyOwner {\n for (uint256 i = 0; i < indices.length; i++) {\n deleteAttribute(indices[i]);\n }\n }\n\n /**\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute (must be between 0 and 63)\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\n */\n function setAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 index,\n uint8 value\n ) public onlyOwner {\n index._checkIndexIsValid();\n\n if (!_isAttributeCreated(index)) {\n revert AttributeDoesNotExist(index);\n }\n\n _setAttributeForAttestationsCollection(collectionId, index, value);\n }\n\n function setAttributesValuesForAttestationsCollections(\n uint256[] memory collectionIds,\n uint8[] memory indices,\n uint8[] memory values\n ) external onlyOwner {\n if (collectionIds.length != indices.length || collectionIds.length != values.length) {\n revert ArgsLengthDoesNotMatch();\n }\n for (uint256 i = 0; i < collectionIds.length; i++) {\n setAttributeValueForAttestationsCollection(collectionIds[i], indices[i], values[i]);\n }\n }\n\n /**\n * @dev Returns the attribute's value (from 0 to 15) of an attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute. Can go from 0 to 63.\n */\n function getAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 index\n ) public view returns (uint8) {\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\n collectionId\n );\n return currentAttributesValues._get(index);\n }\n\n function getAttributesValuesForAttestationsCollection(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (uint8[] memory) {\n uint8[] memory attributesValues = new uint8[](indices.length);\n for (uint256 i = 0; i < indices.length; i++) {\n attributesValues[i] = getAttributeValueForAttestationsCollection(collectionId, indices[i]);\n }\n return attributesValues;\n }\n\n /**\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute. Can go from 0 to 63.\n */\n function attestationsCollectionHasAttribute(\n uint256 collectionId,\n uint8 index\n ) public view returns (bool) {\n uint256 currentAttributeValues = _getAttributesValuesBitmapForAttestationsCollection(\n collectionId\n );\n return currentAttributeValues._get(index) > 0;\n }\n\n function attestationsCollectionHasAttributes(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (bool) {\n for (uint256 i = 0; i < indices.length; i++) {\n if (!attestationsCollectionHasAttribute(collectionId, indices[i])) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n */\n function getAttributesNamesAndValuesForAttestationsCollection(\n uint256 collectionId\n ) public view returns (bytes32[] memory, uint8[] memory) {\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\n collectionId\n );\n\n (\n uint8[] memory indices,\n uint8[] memory values,\n uint8 nbOfNonZeroValues\n ) = currentAttributesValues._getAllNonZeroValues();\n\n bytes32[] memory attributesNames = new bytes32[](nbOfNonZeroValues);\n uint8[] memory attributesValues = new uint8[](nbOfNonZeroValues);\n for (uint8 i = 0; i < nbOfNonZeroValues; i++) {\n attributesNames[i] = _attributesNames[indices[i]];\n attributesValues[i] = values[i];\n }\n\n return (attributesNames, attributesValues);\n }\n\n /*****************************\n *\n * INTERNAL FUNCTIONS\n *\n *****************************/\n\n function _authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal {\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\n _authorizedRanges[issuer].push(newRange);\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal onlyOwner {\n if (rangeIndex >= _authorizedRanges[issuer].length)\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\n\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\n revert IdsMismatch(\n issuer,\n rangeIndex,\n expectedFirstId,\n expectedLastId,\n firstCollectionId,\n lastCollectionId\n );\n\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\n _authorizedRanges[issuer].length - 1\n ];\n _authorizedRanges[issuer].pop();\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\n return _authorizedRanges[issuer]._includes(collectionId);\n }\n\n function _setAttributeForAttestationsCollection(\n uint256 collectionId,\n uint8 index,\n uint8 value\n ) internal {\n uint256 currentAttributes = _getAttributesValuesBitmapForAttestationsCollection(collectionId);\n\n _attestationsCollectionAttributesValuesBitmap[collectionId] = currentAttributes._set(\n index,\n value\n );\n\n emit AttestationsCollectionAttributeSet(collectionId, index, value);\n }\n\n function _createNewAttribute(uint8 index, bytes32 name) internal {\n _attributesNames[index] = name;\n\n emit NewAttributeCreated(index, name);\n }\n\n function _updateAttributeName(uint8 index, bytes32 newName) internal {\n bytes32 previousName = _attributesNames[index];\n\n _attributesNames[index] = newName;\n\n emit AttributeNameUpdated(index, newName, previousName);\n }\n\n function _deleteAttribute(uint8 index) internal {\n bytes32 deletedName = _attributesNames[index];\n\n delete _attributesNames[index];\n\n emit AttributeDeleted(index, deletedName);\n }\n\n function _getAttributesValuesBitmapForAttestationsCollection(\n uint256 collectionId\n ) internal view returns (uint256) {\n return _attestationsCollectionAttributesValuesBitmap[collectionId];\n }\n\n function _isAttributeCreated(uint8 index) internal view returns (bool) {\n if (_attributesNames[index] == 0) {\n return false;\n }\n return true;\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryState.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Range} from '../utils/RangeLib.sol';\nimport {Attestation, AttestationData} from '../Structs.sol';\n\ncontract AttestationsRegistryState {\n /*******************************************************\n Storage layout:\n 19 slots for config\n 4 currently used for _initialized, _initializing, _paused, _owner\n 15 place holders\n 16 slots for logic\n 3 currently used for _authorizedRanges, _attestationsCollectionAttributesValuesBitmap, _attributesNames\n 13 place holders\n 1 slot for _attestationsData \n *******************************************************/\n\n // main config\n // changed `_initialized` from bool to uint8\n // as we were using OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n // and changed to OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n // PR: https://github.com/sismo-core/sismo-protocol/pull/41\n uint8 internal _initialized;\n bool internal _initializing;\n bool internal _paused;\n address internal _owner;\n // keeping some space for future\n uint256[15] private _placeHoldersAdmin;\n\n // storing the authorized ranges for each attesters\n mapping(address => Range[]) internal _authorizedRanges;\n // Storing the attributes values used for each attestations collection\n // Each attribute value is an hexadecimal\n mapping(uint256 => uint256) internal _attestationsCollectionAttributesValuesBitmap;\n // Storing the attribute name for each attributes index\n mapping(uint8 => bytes32) internal _attributesNames;\n // keeping some space for future\n uint256[13] private _placeHoldersConfig;\n // storing the data of attestations\n // =collectionId=> =owner=> attestationData\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\n}\n" - }, - "contracts/core/libs/attestations-registry/InitializableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Address.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract InitializableLogic is AttestationsRegistryState {\n // only diff with oz\n // /**\n // * @dev Indicates that the contract has been initialized.\n // */\n // bool private _initialized;\n\n // /**\n // * @dev Indicates that the contract is in the process of being initialized.\n // */\n // bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) ||\n (!Address.isContract(address(this)) && _initialized == 1),\n 'Initializable: contract is already initialized'\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(\n !_initializing && _initialized < version,\n 'Initializable: contract is already initialized'\n );\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, 'Initializable: contract is not initializing');\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, 'Initializable: contract is initializing');\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/OwnableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n // This is the only diff with OZ contract\n // address private _owner;\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/PausableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableLogic is Context, AttestationsRegistryState {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n // this is the only diff with OZ contract\n // bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), 'Pausable: paused');\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), 'Pausable: not paused');\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "contracts/core/libs/Structs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Attestations Registry State\n * @author Sismo\n * @notice This contract holds all of the storage variables and data\n * structures used by the AttestationsRegistry and parent\n * contracts.\n */\n\n// User Attestation Request, can be made by any user\n// The context of an Attestation Request is a specific attester contract\n// Each attester has groups of accounts in its available data\n// eg: for a specific attester:\n// group 1 <=> accounts that sent txs on mainnet\n// group 2 <=> accounts that sent txs on polygon\n// eg: for another attester:\n// group 1 <=> accounts that sent eth txs in 2022\n// group 2 <=> accounts sent eth txs in 2021\nstruct Request {\n // implicit address attester;\n // implicit uint256 chainId;\n Claim[] claims;\n address destination; // destination that will receive the end attestation\n}\n\nstruct Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\n}\n\n/**\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\n * @param collectionId Attestation collection\n * @param owner Attestation collection\n * @param issuer Attestation collection\n * @param value Attestation collection\n * @param timestamp Attestation collection\n * @param extraData Attestation collection\n */\nstruct Attestation {\n // implicit uint256 chainId;\n uint256 collectionId; // Id of the attestation collection (in the registry)\n address owner; // Owner of the attestation\n address issuer; // Contract that created or last updated the record.\n uint256 value; // Value of the attestation\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\n // it is different from the recording timestamp (date when the attestation was recorded)\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\n bytes extraData; // arbitrary data that can be added by the attester\n}\n\n// Attestation Data, stored in the registry\n// The context is a specific owner of a specific collection\nstruct AttestationData {\n // implicit uint256 chainId\n // implicit uint256 collectionId - from context\n // implicit owner\n address issuer; // Address of the contract that recorded the attestation\n uint256 value; // Value of the attestation\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\n bytes extraData; // arbitrary data that can be added by the attester\n}\n" - }, - "contracts/core/libs/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, 'Address: insufficient balance');\n\n (bool success, ) = recipient.call{value: amount}('');\n require(success, 'Address: unable to send value, recipient may have reverted');\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, 'Address: low-level call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, 'Address: insufficient balance for call');\n require(isContract(target), 'Address: call to non-contract');\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data\n ) internal view returns (bytes memory) {\n return functionStaticCall(target, data, 'Address: low-level static call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), 'Address: static call to non-contract');\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), 'Address: delegate call to non-contract');\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/core/libs/utils/Bitmap256Bit.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/*\n * The 256-bit bitmap is structured in 64 chuncks of 4 bits each.\n * The 4 bits can encode any value from 0 to 15.\n\n chunck63 chunck2 chunck1 chunck0\n bits bits bits bits \n ┌────────────┐ ┌────────────┬────────────┬────────────┐\n │ 1 1 1 1 │ .... │ 1 0 1 1 │ 0 0 0 0 │ 0 0 0 1 │\n └────────────┘ └────────────┴────────────┴────────────┘\n value 15 value 11 value 0 value 1\n\n * A chunck index must be between 0 and 63.\n * A value must be between 0 and 15.\n **/\n\nlibrary Bitmap256Bit {\n uint256 constant MAX_INT = 2 ** 256 - 1;\n\n error IndexOutOfBounds(uint8 index);\n error ValueOutOfBounds(uint8 value);\n\n /**\n * @dev Return the value at a given index of a 256-bit bitmap\n * @param index index where the value can be found. Can be between 0 and 63\n */\n function _get(uint256 self, uint8 index) internal pure returns (uint8) {\n uint256 currentValues = self;\n // Get the encoded 4-bit value by right shifting to the `index` position\n uint256 shifted = currentValues >> (4 * index);\n // Get the value by only masking the last 4 bits with an AND operator\n return uint8(shifted & (2 ** 4 - 1));\n }\n\n /**\n * @dev Set a value at a chosen index in a 256-bit bitmap\n * @param index index where the value will be stored. Can be between 0 and 63\n * @param value value to store. Can be between 0 and 15\n */\n function _set(uint256 self, uint8 index, uint8 value) internal pure returns (uint256) {\n _checkIndexIsValid(index);\n _checkValueIsValid(value);\n\n uint256 currentValues = self;\n // 1. first we need to remove the current value for the inputed `index`\n // Left Shift 4 bits mask (1111 mask) to the `index` position\n uint256 mask = (2 ** 4 - 1) << (4 * index);\n // Apply a XOR operation to obtain a mask with all bits set to 1 except the 4 bits that we want to remove\n uint256 negativeMask = MAX_INT ^ mask;\n // Apply a AND operation between the current values and the negative mask to remove the wanted bits\n uint256 newValues = currentValues & negativeMask;\n\n // 2. We set the new value wanted at the `index` position\n // Create the 4 bits encoding the new value and left shift them to the `index` position\n uint256 newValueMask = uint256(value) << (4 * index);\n // Apply an OR operation between the current values and the newValueMask to reference new value\n return newValues | newValueMask;\n }\n\n /**\n * @dev Get all the non-zero values in a 256-bit bitmap\n * @param self a 256-bit bitmap\n */\n function _getAllNonZeroValues(\n uint256 self\n ) internal pure returns (uint8[] memory, uint8[] memory, uint8) {\n uint8[] memory indices = new uint8[](64);\n uint8[] memory values = new uint8[](64);\n uint8 nbOfNonZeroValues = 0;\n for (uint8 i = 0; i < 63; i++) {\n uint8 value = _get(self, i);\n if (value > 0) {\n indices[nbOfNonZeroValues] = i;\n values[nbOfNonZeroValues] = value;\n nbOfNonZeroValues++;\n }\n }\n return (indices, values, nbOfNonZeroValues);\n }\n\n /**\n * @dev Check if the index is valid (is between 0 and 63)\n * @param index index of a chunck\n */\n function _checkIndexIsValid(uint8 index) internal pure {\n if (index > 63) {\n revert IndexOutOfBounds(index);\n }\n }\n\n /**\n * @dev Check if the value is valid (is between 0 and 15)\n * @param value value to encode in a chunck\n */\n function _checkValueIsValid(uint8 value) internal pure {\n if (value > 15) {\n revert ValueOutOfBounds(value);\n }\n }\n}\n" - }, - "contracts/core/libs/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.14;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "contracts/core/libs/utils/RangeLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nstruct Range {\n uint256 min;\n uint256 max;\n}\n\n// Range [0;3] includees 0 and 3\nlibrary RangeUtils {\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\n for (uint256 i = 0; i < ranges.length; i++) {\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\n return true;\n }\n }\n return false;\n }\n}\n" - }, - "contracts/periphery/badges-examples/BAYCOwnershipBadgeExample.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC721} from '@openzeppelin/contracts/token/ERC721/ERC721.sol';\nimport {IAttestationsRegistry} from '../../core/interfaces/IAttestationsRegistry.sol';\n\ncontract BAYCOwnershipBadge is ERC721 {\n IAttestationsRegistry immutable ATTESTATIONS_REGISTRY;\n uint256 constant HydraS1_BAYC_ATTESTATION_COLLECTION_ID = 100000001;\n uint256 constant SMPS_BAYC_ATTESTATION_COLLECTION_ID = 30000000000003;\n\n constructor(\n address attestationsRegistryAddress,\n string memory name,\n string memory symbol\n ) ERC721(name, symbol) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n function balanceOf(address account) public view virtual override returns (uint256) {\n bool hasZKAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n HydraS1_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n bool hasDoxingAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n SMPS_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n return hasZKAttestation || hasDoxingAttestation ? 1 : 0;\n }\n}\n" - }, - "contracts/periphery/utils/AvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n/**\n * @title Attesters Groups Registry\n * @author Sismo\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\n * For more information: https://available-roots-registry.docs.sismo.io\n *\n **/\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\n uint8 public constant IMPLEMENTATION_VERSION = 2;\n\n mapping(address => mapping(uint256 => bool)) public _roots;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can register/ unregister roots\n */\n constructor(address owner) {\n initialize(owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n }\n }\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\n _registerRootForAttester(attester, root);\n }\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\n _unregisterRootForAttester(attester, root);\n }\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external onlyOwner {\n _registerRootForAttester(address(0), root);\n }\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external onlyOwner {\n _unregisterRootForAttester(address(0), root);\n }\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\n return _roots[_msgSender()][root] || _roots[address(0)][root];\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\n return _roots[attester][root] || _roots[address(0)][root];\n }\n\n function _registerRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = true;\n if (attester == address(0)) {\n emit RegisteredRootForAll(root);\n } else {\n emit RegisteredRootForAttester(attester, root);\n }\n }\n\n function _unregisterRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = false;\n if (attester == address(0)) {\n emit UnregisteredRootForAll(root);\n } else {\n emit UnregisteredRootForAttester(attester, root);\n }\n }\n}\n" - }, - "contracts/periphery/utils/CommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\n\n/**\n * @title Commitment Mapper Registry Contract\n * @author Sismo\n * @notice This contract stores information about the commitment mapper.\n * Its ethereum address and its EdDSA public key\n * For more information: https://commitment-mapper.docs.sismo.io\n *\n **/\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\n uint8 public constant IMPLEMENTATION_VERSION = 2;\n\n uint256[2] internal _commitmentMapperPubKey;\n address _commitmentMapperAddress;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n constructor(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) {\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n address ownerAddress,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\n _updateCommitmentMapperAddress(commitmentMapperAddress);\n }\n }\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\n }\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\n _updateCommitmentMapperAddress(newAddress);\n }\n\n /**\n * @dev Getter of the EdDSA public key of the commitment mapper\n */\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\n return _commitmentMapperPubKey;\n }\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view override returns (address) {\n return _commitmentMapperAddress;\n }\n\n function _updateCommitmentMapperAddress(address newAddress) internal {\n _commitmentMapperAddress = newAddress;\n emit UpdatedCommitmentMapperAddress(newAddress);\n }\n\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\n _commitmentMapperPubKey = pubKey;\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\n/**\n * @title IAvailableRootsRegistry\n * @author Sismo\n * @notice Interface for (Merkle) Roots Registry\n */\ninterface IAvailableRootsRegistry {\n event RegisteredRootForAttester(address attester, uint256 root);\n event RegisteredRootForAll(uint256 root);\n event UnregisteredRootForAttester(address attester, uint256 root);\n event UnregisteredRootForAll(uint256 root);\n\n error CannotRegisterForZeroAddress();\n error CannotUnregisterForZeroAddress();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address owner) external;\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external;\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external;\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\n}\n" - }, - "contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\ninterface ICommitmentMapperRegistry {\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\n event UpdatedCommitmentMapperAddress(address newAddress);\n error PubKeyNotValid(uint256[2] pubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) external;\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external;\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getEdDSAPubKey() external view returns (uint256[2] memory);\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view returns (address);\n}\n" - }, - "contracts/periphery/utils/TransparentUpgradeableProxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n// Note: we just copied so that we can see the contract used\npragma solidity ^0.8.14;\n\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(''), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(\n address newImplementation,\n bytes calldata data\n ) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(\n msg.sender != _getAdmin(),\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\n );\n super._beforeFallback();\n }\n}\n" - }, - "contracts/tests/MockAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttestationsRegistry} from '../core/interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from '../core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from '../core/libs/attestations-registry/AttestationsRegistryState.sol';\nimport {IBadges} from '../core/interfaces/IBadges.sol';\nimport {Attestation, AttestationData} from '../core/libs/Structs.sol';\n\ncontract MockAttestationsRegistry {\n uint256 immutable ATTESTATION_VALUE;\n\n event AttestationRecorded(Attestation attestation);\n\n constructor(uint256 attestationValue) {\n ATTESTATION_VALUE = attestationValue;\n }\n\n function getAttestationValue(\n uint256 collectionId,\n address owner\n ) external view returns (uint256) {\n return ATTESTATION_VALUE;\n }\n\n function recordAttestations(Attestation[] calldata attestations) external {\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationRecorded(attestations[i]);\n }\n }\n}\n" - }, - "contracts/tests/MockAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\nimport {Attestation, Request} from '../core/libs/Structs.sol';\nimport {Attester} from '../core/Attester.sol';\nimport {IAttester} from '../core/interfaces/IAttester.sol';\n\ncontract MockAttester is IAttester, Attester {\n uint256 public immutable ATTESTATION_ID_MIN;\n uint256 public immutable ATTESTATION_ID_MAX;\n\n constructor(\n address ATTESTATION_REGISTRY_ADDRESS,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n ) Attester(ATTESTATION_REGISTRY_ADDRESS) {\n ATTESTATION_ID_MIN = collectionIdFirst;\n ATTESTATION_ID_MAX = collectionIdLast;\n }\n\n function _verifyRequest(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {}\n\n function buildAttestations(\n Request calldata request,\n bytes calldata /*data*/\n ) public view virtual override(Attester, IAttester) returns (Attestation[] memory) {\n uint256 collectionId = ATTESTATION_ID_MIN + request.claims[0].groupId;\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n collectionId,\n request.destination,\n address(this),\n request.claims[0].claimedValue,\n abi.decode(request.claims[0].extraData, (uint32)),\n 'Mock Attester v0'\n );\n return (attestations);\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates", - "storageLayout" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/goerli/solcInputs/6edb98fea2bf424a369954d0e80655f6.json b/deployments/goerli/solcInputs/6edb98fea2bf424a369954d0e80655f6.json deleted file mode 100644 index 8f3bf5d..0000000 --- a/deployments/goerli/solcInputs/6edb98fea2bf424a369954d0e80655f6.json +++ /dev/null @@ -1,237 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/access/AccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(account),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" - }, - "@openzeppelin/contracts/access/IAccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" - }, - "@openzeppelin/contracts/access/Ownable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" - }, - "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" - }, - "@openzeppelin/contracts/security/Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/ERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC1155.sol\";\nimport \"./IERC1155Receiver.sol\";\nimport \"./extensions/IERC1155MetadataURI.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of the basic standard multi-token.\n * See https://eips.ethereum.org/EIPS/eip-1155\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\n *\n * _Available since v3.1._\n */\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\n using Address for address;\n\n // Mapping from token ID to account balances\n mapping(uint256 => mapping(address => uint256)) private _balances;\n\n // Mapping from account to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n string private _uri;\n\n /**\n * @dev See {_setURI}.\n */\n constructor(string memory uri_) {\n _setURI(uri_);\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155).interfaceId ||\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC1155MetadataURI-uri}.\n *\n * This implementation returns the same URI for *all* token types. It relies\n * on the token type ID substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * Clients calling this function must replace the `\\{id\\}` substring with the\n * actual token type ID.\n */\n function uri(uint256) public view virtual override returns (string memory) {\n return _uri;\n }\n\n /**\n * @dev See {IERC1155-balanceOf}.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\n require(account != address(0), \"ERC1155: address zero is not a valid owner\");\n return _balances[id][account];\n }\n\n /**\n * @dev See {IERC1155-balanceOfBatch}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\n public\n view\n virtual\n override\n returns (uint256[] memory)\n {\n require(accounts.length == ids.length, \"ERC1155: accounts and ids length mismatch\");\n\n uint256[] memory batchBalances = new uint256[](accounts.length);\n\n for (uint256 i = 0; i < accounts.length; ++i) {\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\n }\n\n return batchBalances;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev See {IERC1155-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not token owner or approved\"\n );\n _safeTransferFrom(from, to, id, amount, data);\n }\n\n /**\n * @dev See {IERC1155-safeBatchTransferFrom}.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not token owner or approved\"\n );\n _safeBatchTransferFrom(from, to, ids, amounts, data);\n }\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n\n emit TransferSingle(operator, from, to, id, amount);\n\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\n\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; ++i) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n }\n\n emit TransferBatch(operator, from, to, ids, amounts);\n\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\n\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\n }\n\n /**\n * @dev Sets a new URI for all token types, by relying on the token type ID\n * substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * By this mechanism, any occurrence of the `\\{id\\}` substring in either the\n * URI or any of the amounts in the JSON file at said URI will be replaced by\n * clients with the token type ID.\n *\n * For example, the `https://token-cdn-domain/\\{id\\}.json` URI would be\n * interpreted by clients as\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\n * for token type ID 0x4cce0.\n *\n * See {uri}.\n *\n * Because these URIs cannot be meaningfully represented by the {URI} event,\n * this function emits no events.\n */\n function _setURI(string memory newuri) internal virtual {\n _uri = newuri;\n }\n\n /**\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _mint(\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _balances[id][to] += amount;\n emit TransferSingle(operator, address(0), to, id, amount);\n\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _mintBatch(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; i++) {\n _balances[ids[i]][to] += amounts[i];\n }\n\n emit TransferBatch(operator, address(0), to, ids, amounts);\n\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\n }\n\n /**\n * @dev Destroys `amount` tokens of token type `id` from `from`\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `from` must have at least `amount` tokens of token type `id`.\n */\n function _burn(\n address from,\n uint256 id,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n\n emit TransferSingle(operator, from, address(0), id, amount);\n\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n */\n function _burnBatch(\n address from,\n uint256[] memory ids,\n uint256[] memory amounts\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n for (uint256 i = 0; i < ids.length; i++) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n }\n\n emit TransferBatch(operator, from, address(0), ids, amounts);\n\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC1155: setting approval status for self\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `ids` and `amounts` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `id` and `amount` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n function _doSafeTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\n if (response != IERC1155Receiver.onERC1155Received.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non-ERC1155Receiver implementer\");\n }\n }\n }\n\n function _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\n bytes4 response\n ) {\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non-ERC1155Receiver implementer\");\n }\n }\n }\n\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\n uint256[] memory array = new uint256[](1);\n array[0] = element;\n\n return array;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1155.sol\";\nimport \"../../../security/Pausable.sol\";\n\n/**\n * @dev ERC1155 token with pausable token transfers, minting and burning.\n *\n * Useful for scenarios such as preventing trades until the end of an evaluation\n * period, or having an emergency switch for freezing all token transfers in the\n * event of a large bug.\n *\n * _Available since v3.1._\n */\nabstract contract ERC1155Pausable is ERC1155, Pausable {\n /**\n * @dev See {ERC1155-_beforeTokenTransfer}.\n *\n * Requirements:\n *\n * - the contract must not be paused.\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n require(!paused(), \"ERC1155Pausable: token transfer while paused\");\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155MetadataURI is IERC1155 {\n /**\n * @dev Returns the URI for token type `id`.\n *\n * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n * clients with the actual token type ID.\n */\n function uri(uint256 id) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/ERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"./extensions/IERC721Metadata.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/Strings.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: address zero is not a valid owner\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _ownerOf(tokenId);\n require(owner != address(0), \"ERC721: invalid token ID\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireMinted(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not token owner or approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n _requireMinted(tokenId);\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n _safeTransfer(from, to, tokenId, data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _ownerOf(tokenId) != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId, 1);\n\n // Check that tokenId was not minted by `_beforeTokenTransfer` hook\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n unchecked {\n // Will not overflow unless all 2**256 token ids are minted to the same owner.\n // Given that tokens are minted one by one, it is impossible in practice that\n // this ever happens. Might change if we allow batch minting.\n // The ERC fails to describe this case.\n _balances[to] += 1;\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId, 1);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId, 1);\n\n // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook\n owner = ERC721.ownerOf(tokenId);\n\n // Clear approvals\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // Cannot overflow, as that would require more tokens to be burned/transferred\n // out than the owner initially received through minting and transferring in.\n _balances[owner] -= 1;\n }\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId, 1);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId, 1);\n\n // Check that tokenId was not transferred by `_beforeTokenTransfer` hook\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n\n // Clear approvals from the previous owner\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // `_balances[from]` cannot overflow for the same reason as described in `_burn`:\n // `from`'s balance is the number of token held, which is at least one before the current\n // transfer.\n // `_balances[to]` could overflow in the conditions described in `_mint`. That would require\n // all 2**256 token ids to be minted, which in practice is impossible.\n _balances[from] -= 1;\n _balances[to] += 1;\n }\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId, 1);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits an {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` has not been minted yet.\n */\n function _requireMinted(uint256 tokenId) internal view virtual {\n require(_exists(tokenId), \"ERC721: invalid token ID\");\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.\n * - When `from` is zero, the tokens will be minted for `to`.\n * - When `to` is zero, ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256, /* firstTokenId */\n uint256 batchSize\n ) internal virtual {\n if (batchSize > 1) {\n if (from != address(0)) {\n _balances[from] -= batchSize;\n }\n if (to != address(0)) {\n _balances[to] += batchSize;\n }\n }\n }\n\n /**\n * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.\n * - When `from` is zero, the tokens were minted for `to`.\n * - When `to` is zero, ``from``'s tokens were burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 firstTokenId,\n uint256 batchSize\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/ERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/StorageSlot.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Strings.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" - }, - "@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract HydraS1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [8609986746108439658545470593166889256314951959466775818870246174320018498804,\n 6848251127850009101372611262053374737897586140140607384018397707035108265914],\n [21367916863936594568281095443965096905143705300114190558130516981138584550504,\n 13327705762185115653848159709412003423932761899188342359583872691135383932883]\n );\n vk.IC = new Pairing.G1Point[](11);\n \n vk.IC[0] = Pairing.G1Point( \n 19965766170734310004645394427613286415565755728797065894668054116047682895204,\n 6952067612339183672227137101423582097916038093373585908267153974352032944482\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 13987716160490730015463796942940452666334097189904948795214986996497499925899,\n 5336810094802209074340875836312868429276540870324469349093948627126061524544\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 14931593253473978964215343699995811275378324235306358485461293343370969283966,\n 564306919152089917957316877787764763278299990971316475606280877961553231205\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11591267743733991434114686002448165336885445656808796470854638278338319268343,\n 11495219763417990955889652410266075210402006084183208750635660647824890013350\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 8183184532870222270700473518157259944911700429689031755853536692005688965081,\n 9121077094104828462137861111631978599019724423614716723152060153405564278301\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 4314095526093128699362232919686741372014146055311239687202926853002748112330,\n 11665330391505820654128458332883010598817535082070674418723503440883598640597\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\n 181057165072599074288983745076121344893296348827576905983079816835912241514\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 18925967077785550270509493111690046951994174908254476036944536825999614778001,\n 4990629719417206796668074534812314525340851981015724652256935997545282642849\n ); \n \n vk.IC[10] = Pairing.G1Point( \n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[10] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "@sismo-core/pythia-1/contracts/Pythia1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract Pythia1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\n );\n vk.IC = new Pairing.G1Point[](10);\n \n vk.IC[0] = Pairing.G1Point( \n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 104028078850975554065172701281783302003220555203883119831575537681421753151,\n 19148240629904598794948591359118971959790791697910953160820265703277306346\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[9] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/HydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1Base} from './IHydraS1Base.sol';\nimport {Attester} from '../../../core/Attester.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Hydra S1 ZK Proving Scheme\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to the following:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n *\n */\nabstract contract HydraS1Base is IHydraS1Base, Attester, Initializable {\n using HydraS1Lib for HydraS1ProofData;\n\n // ZK-SNARK Verifier\n HydraS1Verifier immutable VERIFIER;\n // Registry storing the Commitment Mapper EdDSA Public key\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS\n *******************************************************/\n\n /**\n * @dev Constructor. Initializes the contract\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\n * @param commitmentMapperAddress Commitment mapper's public key registry\n */\n constructor(\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress\n ) {\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\n }\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\n return COMMITMENT_MAPPER_REGISTRY;\n }\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\n return AVAILABLE_ROOTS_REGISTRY;\n }\n\n /*******************************************************\n Hydra-S1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the nullifier from an attestation extraData\n * @dev Getter of a nullifier encoded in extraData\n * @notice Must be implemented by the inheriting contracts\n * @param extraData extraData where nullifier can be encoded\n */\n function getNullifierFromExtraData(\n bytes memory extraData\n ) external view virtual returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the external nullifier from a user request\n * so it can be checked against snark input\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\n * users bring sourceSecretHash as private input which guarantees privacy\n *\n * This function MUST be implemented by Hydra-S1 attesters.\n * This is the core function that implements the logic of external nullifiers\n *\n * Do they get one external nullifier per claim?\n * Do they get 2 external nullifiers per claim?\n * Do they get 1 external nullifier per claim, every month?\n * Take a look at Hydra-S1 Simple Attester for an example\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\n */\n function _getExternalNullifierOfClaim(\n HydraS1Claim memory claim\n ) internal view virtual returns (uint256);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(\n HydraS1Claim memory claim,\n HydraS1ProofInput memory input\n ) internal view virtual {\n if (input.accountsTreeValue != claim.groupId) {\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\n }\n\n if (input.isStrict == claim.groupProperties.isScore) {\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n }\n\n if (input.destination != claim.destination) {\n revert DestinationMismatch(claim.destination, input.destination);\n }\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot)) {\n revert RegistryRootMismatch(input.registryRoot);\n }\n\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\n if (\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\n ) {\n revert CommitmentMapperPubKeyMismatch(\n commitmentMapperPubKey[0],\n commitmentMapperPubKey[1],\n input.commitmentMapperPubKey[0],\n input.commitmentMapperPubKey[1]\n );\n }\n\n uint256 externalNullifier = _getExternalNullifierOfClaim(claim);\n\n if (input.externalNullifier != externalNullifier) {\n revert ExternalNullifierMismatch(externalNullifier, input.externalNullifier);\n }\n }\n\n /**\n * @dev verify the groth16 mathematical proof\n * @param proofData snark public input\n */\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(uint256 /*errorCode*/) {\n revert InvalidGroth16Proof('');\n } catch (bytes memory /*lowLevelData*/) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/IHydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Interface\n * @author Sismo\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\n * We invite readers to refer to the following:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n **/\ninterface IHydraS1Base is IAttester {\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\n error RegistryRootMismatch(uint256 inputRoot);\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error CommitmentMapperPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error ExternalNullifierMismatch(uint256 expectedExternalNullifier, uint256 externalNullifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error AccountsTreeValueMismatch(\n uint256 expectedAccountsTreeValue,\n uint256 inputAccountsTreeValue\n );\n error InvalidGroth16Proof(string reason);\n\n function getNullifierFromExtraData(bytes memory extraData) external view returns (uint256);\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier);\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\n\nimport {IHydraS1AccountboundAttester} from './interfaces/IHydraS1AccountboundAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from '../../core/libs/Structs.sol';\n\n// Imports related to Hydra-S1\nimport {HydraS1SimpleAttester, IAttester, HydraS1Lib, HydraS1ProofData, HydraS1Claim} from './HydraS1SimpleAttester.sol';\n\n/**\n * @title Hydra-S1 Accountbound Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic.\n * Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic.\n * However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation.\n * The _beforeRecordAttestations is also overriden to fit the Accountbound logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Nullified\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\n * While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier)\n * We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation.\n * We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation.\n * Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier)\n\n * - Accountbound (opt-in, with cooldown period)\n * The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group.\n * Users can update their attestation's destination by providing a new Hydra-S1 ZK proof \n * It means the attestation is bound to the source account, stored on an updatable destination account.\n * When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional.\n * A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred\n * One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations.\n \n * - Renewable\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew or update their attestations\n **/\n\ncontract HydraS1AccountboundAttester is\n IHydraS1AccountboundAttester,\n HydraS1SimpleAttester,\n Ownable\n{\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n uint8 public constant IMPLEMENTATION_VERSION = 4;\n\n /*******************************************************\n Storage layout:\n 20 slots between HydraS1SimpleAttester and HydraS1AccountboundAttester\n 1 currently used by Ownable\n 19 place holders\n 2O for config\n 1 currently used\n 19 place holders\n 20 for logic\n 2 currently used\n 18 place holders\n *******************************************************/\n\n // keeping some space for future config logics\n uint256[19] private _placeHolderBeforeHydraS1Accountbound;\n\n // cooldown durations for each groupIndex\n mapping(uint256 => uint32) internal _cooldownDurations;\n\n // keeping some space for future config logics\n uint256[19] private _placeHoldersHydraS1AccountboundConfig;\n\n mapping(uint256 => uint32) internal _nullifiersCooldownStart;\n mapping(uint256 => uint16) internal _nullifiersBurnCount;\n\n // keeping some space for future config logics\n uint256[18] private _placeHoldersHydraS1AccountboundLogic;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first attestation collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last attestation collection in which the attester is supposed to record\n * @param owner Address of attester's owner\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address owner\n )\n HydraS1SimpleAttester(\n attestationsRegistryAddress,\n hydraS1VerifierAddress,\n availableRootsRegistryAddress,\n commitmentMapperAddress,\n collectionIdFirst,\n collectionIdLast\n )\n {\n initialize(owner);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n }\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Returns the actual attestations constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark public input as well as snark proof\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) public view virtual override(IAttester, HydraS1SimpleAttester) returns (Attestation[] memory) {\n Attestation[] memory attestations = super.buildAttestations(request, proofData);\n\n uint256 nullifier = proofData._getNullifier();\n attestations[0].extraData = abi.encode(\n attestations[0].extraData, // nullifier, from HydraS1 Simple\n _getNextBurnCount(nullifier, attestations[0].owner) // BurnCount\n );\n\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Hook run before recording the attestation.\n * Throws if nullifier already used, not a renewal, and nullifier on cooldown.\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n uint256 nullifier = proofData._getNullifier();\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\n\n HydraS1Claim memory claim = request._claim();\n\n // check if the nullifier has already been used previously, if so it may be on cooldown\n if (\n previousNullifierDestination != address(0) &&\n previousNullifierDestination != claim.destination\n ) {\n uint32 cooldownDuration = _getCooldownDurationForGroupIndex(claim.groupProperties.groupIndex);\n if (cooldownDuration == 0) {\n revert CooldownDurationNotSetForGroupIndex(claim.groupProperties.groupIndex);\n }\n if (_isOnCooldown(nullifier, cooldownDuration)) {\n uint16 burnCount = _getNullifierBurnCount(nullifier);\n revert NullifierOnCooldown(\n nullifier,\n previousNullifierDestination,\n burnCount,\n cooldownDuration\n );\n }\n\n // Delete the old Attestation linked to the nullifier before recording the new one (accountbound feature)\n _deletePreviousAttestation(claim, previousNullifierDestination);\n\n _setNullifierOnCooldownAndIncrementBurnCount(nullifier);\n }\n _setDestinationForNullifier(nullifier, request.destination);\n }\n\n /*******************************************************\n LOGIC FUNCTIONS RELATED TO ACCOUNTBOUND FEATURE\n *******************************************************/\n\n /**\n * @dev Getter, returns the burnCount of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16) {\n return _getNullifierBurnCount(nullifier);\n }\n\n /**\n * @dev Getter, returns the cooldown start of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32) {\n return _getNullifierCooldownStart(nullifier);\n }\n\n /**\n * @dev returns the nullifier for a given extraData\n * @param extraData bytes where the nullifier is encoded\n */\n function getNullifierFromExtraData(\n bytes memory extraData\n ) external pure override(HydraS1SimpleAttester, IHydraS1AccountboundAttester) returns (uint256) {\n (uint256 nullifier, ) = abi.decode(extraData, (uint256, uint16));\n\n return nullifier;\n }\n\n /**\n * @dev Returns the burn count for a given extraData\n * @param extraData bytes where the burnCount is encoded\n */\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16) {\n (, uint16 burnCount) = abi.decode(extraData, (uint256, uint16));\n\n return burnCount;\n }\n\n /**\n * @dev Checks if a nullifier is on cooldown\n * @param nullifier user nullifier\n * @param cooldownDuration waiting time before the user can change its badge destination\n */\n function _isOnCooldown(uint256 nullifier, uint32 cooldownDuration) internal view returns (bool) {\n return _getNullifierCooldownStart(nullifier) + cooldownDuration > block.timestamp;\n }\n\n /**\n * @dev Delete the previous attestation created with this nullifier\n * @param claim user claim\n * @param previousNullifierDestination previous destination chosen for this user nullifier\n */\n function _deletePreviousAttestation(\n HydraS1Claim memory claim,\n address previousNullifierDestination\n ) internal {\n address[] memory attestationOwners = new address[](1);\n uint256[] memory attestationCollectionIds = new uint256[](1);\n\n attestationOwners[0] = previousNullifierDestination;\n attestationCollectionIds[0] = AUTHORIZED_COLLECTION_ID_FIRST + claim.groupProperties.groupIndex;\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n }\n\n function _setNullifierOnCooldownAndIncrementBurnCount(uint256 nullifier) internal {\n _nullifiersCooldownStart[nullifier] = uint32(block.timestamp);\n _nullifiersBurnCount[nullifier] += 1;\n emit NullifierSetOnCooldown(nullifier, _nullifiersBurnCount[nullifier]);\n }\n\n function _getNullifierCooldownStart(uint256 nullifier) internal view returns (uint32) {\n return _nullifiersCooldownStart[nullifier];\n }\n\n function _getNullifierBurnCount(uint256 nullifier) internal view returns (uint16) {\n return _nullifiersBurnCount[nullifier];\n }\n\n /**\n * @dev returns burn count or burn count + 1 if new burn will happen\n * @param nullifier user nullifier\n * @param claimDestination destination referenced in the user claim\n */\n function _getNextBurnCount(\n uint256 nullifier,\n address claimDestination\n ) public view virtual returns (uint16) {\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\n uint16 burnCount = _getNullifierBurnCount(nullifier);\n // If the attestation is minted on a new destination address\n // the burnCount that will be encoded in the extraData of the Attestation should be incremented\n if (\n previousNullifierDestination != address(0) && previousNullifierDestination != claimDestination\n ) {\n burnCount += 1;\n }\n return burnCount;\n }\n\n /*******************************************************\n GROUP CONFIGURATION LOGIC\n *******************************************************/\n\n /**\n * @dev Setter, sets the cooldown duration of a groupIndex\n * @notice set to 0 to deactivate the accountbound feature for this group\n * @param groupIndex internal collection id\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\n **/\n function setCooldownDurationForGroupIndex(\n uint256 groupIndex,\n uint32 cooldownDuration\n ) external onlyOwner {\n _cooldownDurations[groupIndex] = cooldownDuration;\n emit CooldownDurationSetForGroupIndex(groupIndex, cooldownDuration);\n }\n\n /**\n * @dev Getter, get the cooldown duration of a groupIndex\n * @notice returns 0 when the accountbound feature is deactivated for this group\n * @param groupIndex internal collection id\n **/\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32) {\n return _getCooldownDurationForGroupIndex(groupIndex);\n }\n\n // = 0 means that the accountbound feature is deactivated for this group\n function _getCooldownDurationForGroupIndex(uint256 groupIndex) internal view returns (uint32) {\n return _cooldownDurations[groupIndex];\n }\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\nimport {IHydraS1Base} from './base/IHydraS1Base.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Nullified\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * nullifier = hash(sourceSecret, externalNullifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - Renewable\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew their attestations\n **/\n\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n /*******************************************************\n Storage layout:\n 20 slots for HydraS1\n 1 slot used\n 19 place holders\n *******************************************************/\n\n mapping(uint256 => address) internal _nullifiersDestinations;\n\n // keeping some space for future\n uint256[19] private _placeHoldersHydraS1Simple;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\n HydraS1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n uint256 nullifier = proofData._getNullifier();\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n abi.encode(nullifier)\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if nullifier already used and not a renewal (e.g destination different that last)\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n // we get the nullifier used from the snark input in the data provided\n uint256 nullifier = proofData._getNullifier();\n address currentDestination = _getDestinationOfNullifier(nullifier);\n\n if (currentDestination != address(0) && currentDestination != request.destination) {\n revert NullifierUsed(nullifier);\n }\n\n _setDestinationForNullifier(nullifier, request.destination);\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the external nullifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose externalNullifier = hash(attesterAddress, claim.GroupId)\n * Creates one nullifier per group, per user and makes sure no collision with other attester's nullifiers\n **/\n function _getExternalNullifierOfClaim(\n HydraS1Claim memory claim\n ) internal view override returns (uint256) {\n uint256 externalNullifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.groupIndex\n );\n return externalNullifier;\n }\n\n /**\n * @dev returns the nullifier for a given extraData\n * @param extraData bytes where the nullifier is encoded\n */\n function getNullifierFromExtraData(\n bytes memory extraData\n ) external pure virtual override(IHydraS1Base, HydraS1Base) returns (uint256) {\n return abi.decode(extraData, (uint256));\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a nullifier\n * @param nullifier nullifier used\n **/\n function getDestinationOfNullifier(uint256 nullifier) external view override returns (address) {\n return _getDestinationOfNullifier(nullifier);\n }\n\n function _setDestinationForNullifier(uint256 nullifier, address destination) internal virtual {\n _nullifiersDestinations[nullifier] = destination;\n emit NullifierDestinationUpdated(nullifier, destination);\n }\n\n function _getDestinationOfNullifier(uint256 nullifier) internal view returns (address) {\n return _nullifiersDestinations[nullifier];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from '././IHydraS1SimpleAttester.sol';\n\n/**\n * @title Hydra-S1 Accountbound Interface\n * @author Sismo\n * @notice Interface of the HydraS1AccountboundAttester contract which inherits from the errors, events and methods specific to the HydraS1SimpleAttester interface.\n **/\ninterface IHydraS1AccountboundAttester is IHydraS1SimpleAttester {\n /**\n * @dev Event emitted when the duration of the cooldown duration for a group index (internal collection id) has been set\n * @param groupIndex internal collection id\n * @param cooldownDuration the duration of the cooldown period\n **/\n event CooldownDurationSetForGroupIndex(uint256 indexed groupIndex, uint32 cooldownDuration);\n\n /**\n * @dev Event emitted when the nullifier has been set on cooldown. This happens when the\n * attestation destination of a nullifier has been changed\n * @param nullifier user nullifier\n * @param burnCount the number of times the attestation destination of a nullifier has been changed\n **/\n event NullifierSetOnCooldown(uint256 indexed nullifier, uint16 burnCount);\n\n /**\n * @dev Error when the nullifier is on cooldown. The user have to wait the cooldownDuration\n * before being able to change again the destination address.\n **/\n error NullifierOnCooldown(\n uint256 nullifier,\n address destination,\n uint16 burnCount,\n uint32 cooldownStart\n );\n\n /**\n * @dev Error when the cooldown duration for a given groupIndex is equal to zero.\n * The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.\n **/\n error CooldownDurationNotSetForGroupIndex(uint256 groupIndex);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) external;\n\n /**\n * @dev returns the nullifier for a given extraData\n * @param extraData bytes where the nullifier is encoded\n */\n function getNullifierFromExtraData(bytes memory extraData) external pure returns (uint256);\n\n /**\n * @dev Returns the burn count for a given extraData\n * @param extraData bytes where the burnCount is encoded\n */\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16);\n\n /**\n * @dev Getter, returns the cooldown start of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32);\n\n /**\n * @dev Getter, returns the burnCount of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16);\n\n /**\n * @dev Setter, sets the cooldown duration of a groupIndex\n * @param groupIndex internal collection id\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\n **/\n function setCooldownDurationForGroupIndex(uint256 groupIndex, uint32 cooldownDuration) external;\n\n /*/**\n * @dev Getter, get the cooldown duration of a groupIndex\n * @notice returns 0 when the accountbound feature is deactivated for this group\n * @param groupIndex internal collection id\n **/\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32);\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Accountbound Interface\n * @author Sismo\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\n **/\ninterface IHydraS1SimpleAttester is IHydraS1Base {\n /**\n * @dev Error when the nullifier is already used for a destination address\n **/\n error NullifierUsed(uint256 nullifier);\n\n /**\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\n **/\n error CollectionIdOutOfBound(uint256 collectionId);\n\n /**\n * @dev Event emitted when the nullifier is associated to a destination address.\n **/\n event NullifierDestinationUpdated(uint256 nullifier, address newOwner);\n\n /**\n * @dev Getter, returns the last attestation destination of a nullifier\n * @param nullifier nullifier used\n **/\n function getDestinationOfNullifier(uint256 nullifier) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1AccountboundLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Lib, HydraS1Claim, HydraS1GroupProperties} from './HydraS1Lib.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1AccountboundClaim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1AccountboundGroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1AccountboundGroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n uint32 cooldownDuration;\n bool isScore;\n}\n\nlibrary HydraS1AccountboundLib {\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _hydraS1claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n HydraS1GroupProperties memory hydraS1GroupProperties = HydraS1GroupProperties(\n groupProperties.groupIndex,\n groupProperties.generationTimestamp,\n groupProperties.isScore\n );\n\n return (\n HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, hydraS1GroupProperties)\n );\n }\n\n function _hydraS1Accountboundclaim(\n Request memory self\n ) internal pure returns (HydraS1AccountboundClaim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory hydraS1AccountboundGroupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n return (\n HydraS1AccountboundClaim(\n claim.groupId,\n claim.claimedValue,\n self.destination,\n hydraS1AccountboundGroupProperties\n )\n );\n }\n\n function _generateGroupIdFromEncodedProperties(\n bytes memory encodedProperties\n ) internal pure returns (uint256) {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1GroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n bool isScore;\n}\n\nstruct HydraS1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct HydraS1ProofData {\n HydraS1CircomSnarkProof proof;\n uint256[10] input;\n // destination\n // chainId\n // commitmentMapperPubKey.x\n // commitmentMapperPubKey.y\n // registryTreeRoot\n // externalNullifier\n // nullifier\n // claimedValue\n // accountsTreeValue\n // isStrict\n}\n\nstruct HydraS1ProofInput {\n address destination;\n uint256 chainId;\n uint256 registryRoot;\n uint256 externalNullifier;\n uint256 nullifier;\n uint256 value;\n uint256 accountsTreeValue;\n bool isStrict;\n uint256[2] commitmentMapperPubKey;\n}\n\nlibrary HydraS1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\n return\n HydraS1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getRegistryRoot(self),\n _getExpectedExternalNullifier(self),\n _getNullifier(self),\n _getValue(self),\n _getAccountsTreeValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1GroupProperties)\n );\n\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(\n HydraS1ProofData memory self\n )\n internal\n pure\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[10] memory)\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(\n HydraS1ProofData memory self\n ) internal pure returns (uint256[2] memory) {\n return [self.input[2], self.input[3]];\n }\n\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(\n HydraS1ProofData memory self\n ) internal pure returns (uint256) {\n return self.input[5];\n }\n\n function _getNullifier(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[8];\n }\n\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\n return self.input[9] == 1;\n }\n\n function _getNullifier(bytes calldata self) internal pure returns (uint256) {\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\n uint256 nullifier = uint256(_getNullifier(snarkProofData));\n return nullifier;\n }\n\n function _generateGroupIdFromProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\n );\n }\n\n function _generateGroupIdFromEncodedProperties(\n bytes memory encodedProperties\n ) internal pure returns (uint256) {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(groupIndex, generationTimestamp, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/pythia-1/base/IPythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\n\ninterface IPythia1Base {\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error UserShouldOwnItsDestination(address sender, address inputdestination);\n error CommitmentSignerPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier);\n\n /**\n * @dev Getter of the Commitment Signer EdDSA Public Key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\n}\n" - }, - "contracts/attesters/pythia-1/base/Pythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IPythia1Base} from './IPythia1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Pythia 1 ZK Proving Scheme\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\n\n/**\n * @title Pythia-1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \n * without anyone being able to make the link between the offchain service and the onchain service.\n * It is inherited by the family of Pythia-1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n \n \n **/\nabstract contract Pythia1Base is IPythia1Base, Initializable {\n using Pythia1Lib for Pythia1ProofData;\n\n // ZK-SNARK Verifier\n Pythia1Verifier immutable VERIFIER;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\n */\n constructor(address Pythia1VerifierAddress) {\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\n }\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of the Commitment signer Eddsa Public key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\n return _getCommitmentSignerPubKey();\n }\n\n /*******************************************************\n Pythia-1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * the secretHash is a number only known by the user and is used in \n * the zero knowledge as a private input which guarantees privacy\n\n * This function MUST be implemented by Pythia-1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Pythia-1 Simple Attester for an example\n * @param claim user claim: a particular claim that a user have that he can prove s right.\n */\n function _getTicketIdentifierOfClaim(\n Pythia1Claim memory claim\n ) internal view virtual returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\n * prove the claim was correctly issued for the user.\n */\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(\n Pythia1Claim memory claim,\n Pythia1ProofInput memory input\n ) internal view virtual {\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (claim.destination != msg.sender)\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\n if (\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\n )\n revert CommitmentSignerPubKeyMismatch(\n commitmentSignerPubKey[0],\n commitmentSignerPubKey[1],\n input.commitmentSignerPubKey[0],\n input.commitmentSignerPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the plonk mathematical proof using the circom verifier contract\n * @param proofData snark public input\n */\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(uint256 /*errorCode*/) {\n revert InvalidGroth16Proof('');\n } catch (bytes memory /*lowLevelData*/) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\n\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\n error TicketUsed(uint256 userTicket);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/pythia-1/libs/Pythia1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\n\n// user Pythia-1 claim retrieved form his request\nstruct Pythia1Claim {\n uint256 groupId; // user claims be part of this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct Pythia1GroupProperties {\n uint128 internalCollectionId;\n bool isScore;\n}\n\nstruct Pythia1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct Pythia1ProofData {\n Pythia1CircomSnarkProof proof;\n uint256[9] input;\n // destination;\n // chainId;\n // commitmentSignerPubKey.x;\n // commitmentSignerPubKey.y;\n // groupId;\n // ticketIdentifier;\n // userTicket;\n // value;\n // isStrict;\n}\n\nstruct Pythia1ProofInput {\n address destination;\n uint256 chainId;\n uint256 groupId;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n bool isStrict;\n uint256[2] commitmentSignerPubKey;\n}\n\nlibrary Pythia1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\n return\n Pythia1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getGroupId(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n Pythia1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (Pythia1GroupProperties)\n );\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(\n Pythia1ProofData memory self\n )\n internal\n pure\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[9] memory)\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(\n Pythia1ProofData memory self\n ) internal pure returns (uint256[2] memory) {\n return [self.input[2], self.input[3]];\n }\n\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(\n Pythia1ProofData memory self\n ) internal pure returns (uint256) {\n return self.input[5];\n }\n\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\n return self.input[8] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(\n uint128 internalCollectionId,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\n }\n\n function _generateGroupIdFromEncodedProperties(\n bytes memory encodedProperties\n ) internal pure returns (uint256) {\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 internalCollectionId,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(internalCollectionId, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to Pythia1 Proving Scheme\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\n\n/**\n * @title Pythia-1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Pythia-1 Attesters.\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \n * offchain service in a privacy preserving way. \n * That means no-one can make the link between the account used in the offchain service\n * and the onchain account where the attestation is stored.\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each users gets one userTicket per claim\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n **/\n\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\n using Pythia1Lib for Pythia1ProofData;\n using Pythia1Lib for bytes;\n using Pythia1Lib for Request;\n\n uint8 public constant IMPLEMENTATION_VERSION = 3;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n uint256[2] internal _commitmentSignerPubKey;\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\n * @param owner The owner of the contract that can update the commitment signer pub key\n */\n constructor(\n address attestationsRegistryAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address pythia1VerifierAddress,\n uint256[2] memory commitmentSignerPubKey,\n address owner\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n initialize(commitmentSignerPubKey, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param ownerAddress Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n uint256[2] memory commitmentSignerPubKey,\n address ownerAddress\n ) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into Pythia1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\n Pythia1ProofInput memory snarkInput = snarkProof._input();\n Pythia1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\n Pythia1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.internalCollectionId;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n uint32(block.timestamp),\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used\n * @param request users request. Claim of beiing part of a group.\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0)) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * users bring secretHash as private input in snark which guarantees privacy\n * the secretHash is only known by the user and never escape the user's browser\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(\n Pythia1Claim memory claim\n ) internal view override returns (uint256) {\n uint256 ticketIdentifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.internalCollectionId\n );\n return ticketIdentifier;\n }\n\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\n return _commitmentSignerPubKey;\n }\n\n /*******************************************************\n Pythia-1 Attester Specific Functions\n *******************************************************/\n\n function updateCommitmentSignerPubKey(\n uint256[2] memory commitmentSignerPubKey\n ) external onlyOwner {\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\n _commitmentSignerPubKey = commitmentSignerPubKey;\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\n }\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/core/AttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\nimport {Attestation, AttestationData} from './libs/Structs.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Attestations Registry\n * @author Sismo\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\n * Only authorized attestations issuers can record attestation in the registry\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\n * For more information: https://attestations-registry.docs.sismo.io\n\n * For each attestation recorded, a badge is received by the user\n * The badge is the Non transferrable NFT representation of an attestation \n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\n * It enables off-chain apps such as opensea to catch the \"shadow mint\" of the badge\n **/\ncontract AttestationsRegistry is\n AttestationsRegistryState,\n IAttestationsRegistry,\n AttestationsRegistryConfigLogic\n{\n uint8 public constant IMPLEMENTATION_VERSION = 3;\n IBadges immutable BADGES;\n\n /**\n * @dev Constructor.\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @param badgesAddress Stateless ERC1155 Badges contract\n */\n constructor(address owner, address badgesAddress) {\n BADGES = IBadges(badgesAddress);\n initialize(owner);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n }\n }\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\n address issuer = _msgSender();\n for (uint256 i = 0; i < attestations.length; i++) {\n if (!_isAuthorized(issuer, attestations[i].collectionId))\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\n\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\n attestations[i].owner\n ].value;\n\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\n attestations[i].issuer,\n attestations[i].value,\n attestations[i].timestamp,\n attestations[i].extraData\n );\n\n _triggerBadgeTransferEvent(\n attestations[i].collectionId,\n attestations[i].owner,\n previousAttestationValue,\n attestations[i].value\n );\n emit AttestationRecorded(attestations[i]);\n }\n }\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(\n address[] calldata owners,\n uint256[] calldata collectionIds\n ) external override whenNotPaused {\n if (owners.length != collectionIds.length)\n revert OwnersAndCollectionIdsLengthMismatch(owners, collectionIds);\n\n address issuer = _msgSender();\n for (uint256 i = 0; i < owners.length; i++) {\n AttestationData memory attestationData = _attestationsData[collectionIds[i]][owners[i]];\n\n if (!_isAuthorized(issuer, collectionIds[i]))\n revert IssuerNotAuthorized(issuer, collectionIds[i]);\n delete _attestationsData[collectionIds[i]][owners[i]];\n\n _triggerBadgeTransferEvent(collectionIds[i], owners[i], attestationData.value, 0);\n\n emit AttestationDeleted(\n Attestation(\n collectionIds[i],\n owners[i],\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n )\n );\n }\n }\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(\n uint256 collectionId,\n address owner\n ) external view override returns (bool) {\n return _getAttestationValue(collectionId, owner) != 0;\n }\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(\n uint256 collectionId,\n address owner\n ) external view override returns (AttestationData memory) {\n return _getAttestationData(collectionId, owner);\n }\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(\n uint256 collectionId,\n address owner\n ) external view override returns (uint256) {\n return _getAttestationValue(collectionId, owner);\n }\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(\n uint256 collectionId,\n address owner\n ) external view override returns (address, uint256, uint32, bytes memory) {\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\n return (\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n );\n }\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(\n uint256 collectionId,\n address owner\n ) external view override returns (bytes memory) {\n return _attestationsData[collectionId][owner].extraData;\n }\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(\n uint256 collectionId,\n address owner\n ) external view override returns (address) {\n return _attestationsData[collectionId][owner].issuer;\n }\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(\n uint256 collectionId,\n address owner\n ) external view override returns (uint32) {\n return _attestationsData[collectionId][owner].timestamp;\n }\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view override returns (AttestationData[] memory) {\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\n }\n return attestationsDataArray;\n }\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view override returns (uint256[] memory) {\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\n }\n return attestationsValues;\n }\n\n /**\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\n * It enables off-chain apps such as opensea to catch the \"shadow mints/burns\" of badges\n */\n function _triggerBadgeTransferEvent(\n uint256 badgeTokenId,\n address owner,\n uint256 previousValue,\n uint256 newValue\n ) internal {\n bool isGreaterValue = newValue > previousValue;\n address operator = address(this);\n address from = isGreaterValue ? address(0) : owner;\n address to = isGreaterValue ? owner : address(0);\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\n\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\n }\n\n function _getAttestationData(\n uint256 collectionId,\n address owner\n ) internal view returns (AttestationData memory) {\n return (_attestationsData[collectionId][owner]);\n }\n\n function _getAttestationValue(\n uint256 collectionId,\n address owner\n ) internal view returns (uint256) {\n return _attestationsData[collectionId][owner].value;\n }\n}\n" - }, - "contracts/core/Attester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\n\n/**\n * @title Attester Abstract Contract\n * @author Sismo\n * @notice Contract to be inherited by Attesters\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\n * are recommended to implemented this abstract contract\n\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\n *\n * This contracts is built around two main external standard functions.\n * They must NOT be override them, unless your really know what you are doing\n \n * - generateAttestations(request, proof) => will write attestations in the registry\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\n\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\n\n * For more information: https://attesters.docs.sismo.io\n **/\nabstract contract Attester is IAttester {\n // Registry where all attestations are stored\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n // Verify if request is valid by verifying against proof\n _verifyRequest(request, proofData);\n\n // Generate the actual attestations from user request\n Attestation[] memory attestations = buildAttestations(request, proofData);\n\n _beforeRecordAttestations(request, proofData);\n\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n\n _afterRecordAttestations(attestations);\n\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationGenerated(attestations[i]);\n }\n\n return attestations;\n }\n\n /**\n * @dev External facing function. Allows to delete attestations by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that were deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n address[] memory attestationOwners = new address[](collectionIds.length);\n\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\n\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n // fetch attestations from the registry\n (\n address issuer,\n uint256 attestationValue,\n uint32 timestamp,\n bytes memory extraData\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\n\n attestationOwners[i] = attestationsOwner;\n attestationCollectionIds[i] = collectionIds[i];\n\n attestations[i] = (\n Attestation(\n collectionIds[i],\n attestationsOwner,\n issuer,\n attestationValue,\n timestamp,\n extraData\n )\n );\n }\n\n _verifyAttestationsDeletionRequest(attestations, proofData);\n\n _beforeDeleteAttestations(attestations, proofData);\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n\n _afterDeleteAttestations(attestations, proofData);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n emit AttestationDeleted(attestations[i]);\n }\n return attestations;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) public view virtual returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry getter\n * @return attestationRegistry\n */\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\n return ATTESTATIONS_REGISTRY;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should verify the user request is valid\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\n\n /**\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\n * Default behavior: throws\n * It should verify attestations deletion request is valid\n * @param attestations Attestations that will be deleted\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyAttestationsDeletionRequest(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {\n revert AttestationDeletionNotImplemented();\n }\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before recording attestations in the registry\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual {}\n\n /**\n * @dev (Optional) Can be overridden in attesters inheriting this contract\n * Will be called after recording an attestation\n * @param attestations Recorded attestations\n */\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _beforeDeleteAttestations(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called after deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _afterDeleteAttestations(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {}\n}\n" - }, - "contracts/core/Badges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Badges contract\n * @author Sismo\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n * For more information: https://badges.docs.sismo.io\n */\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\n uint8 public constant IMPLEMENTATION_VERSION = 3;\n\n IAttestationsRegistry internal _attestationsRegistry;\n\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\n\n /**\n * @dev Constructor\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n constructor(\n string memory uri,\n address owner // This is Sismo Frontend Contract\n ) ERC1155(uri) {\n initialize(uri, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n string memory uri,\n address owner\n ) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup uri yet or if called by constructor (for implem setup)\n if (bytes(ERC1155.uri(0)).length == 0 || address(this).code.length == 0) {\n _setURI(uri);\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n }\n }\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(\n address account,\n uint256 id\n ) public view virtual override(ERC1155, IBadges) returns (uint256) {\n return _attestationsRegistry.getAttestationValue(id, account);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function isApprovedForAll(\n address account,\n address operator\n ) public view virtual override returns (bool) {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\n emit TransferSingle(operator, from, to, id, value);\n }\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(\n address attestationsRegistry\n ) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\n }\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _setURI(uri);\n }\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view override returns (address) {\n return address(_attestationsRegistry);\n }\n\n /**\n * @dev Getter of the badge issuer\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeIssuer(address account, uint256 id) external view returns (address) {\n return _attestationsRegistry.getAttestationIssuer(id, account);\n }\n\n /**\n * @dev Getter of the badge timestamp\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32) {\n return _attestationsRegistry.getAttestationTimestamp(id, account);\n }\n\n /**\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory) {\n return _attestationsRegistry.getAttestationExtraData(id, account);\n }\n\n /**\n * @dev Getter of the value of a specific badge attribute\n * @param id Badge Id to check (= attestationCollectionId)\n * @param index Index of the attribute\n */\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8) {\n return _attestationsRegistry.getAttributeValueForAttestationsCollection(id, index);\n }\n\n /**\n * @dev Getter of all badge attributes and their values for a specific badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getAttributesNamesAndValuesForBadge(\n uint256 id\n ) external view returns (bytes32[] memory, uint8[] memory) {\n return _attestationsRegistry.getAttributesNamesAndValuesForAttestationsCollection(id);\n }\n\n /**\n * @dev ERC165\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(AccessControl, ERC1155) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n revert BadgesNonTransferrable();\n }\n}\n" - }, - "contracts/core/Front.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IFront} from './interfaces/IFront.sol';\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation} from './libs/Structs.sol';\n\n/**\n * @title Front\n * @author Sismo\n * @notice This is the Front contract of the Sismo protocol\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\n\n * For more information: https://front.docs.sismo.io\n */\ncontract Front is IFront {\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\n uint256 public constant EARLY_USER_COLLECTION = 0;\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress Attestations registry contract address\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n Attestation[] memory attestations = _forwardAttestationsGeneration(\n attester,\n request,\n proofData\n );\n _generateEarlyUserAttestation(request.destination);\n return attestations;\n }\n\n /**\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n address destination = requests[0].destination;\n for (uint256 i = 0; i < attesters.length; i++) {\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\n attestations[i] = _forwardAttestationsGeneration(\n attesters[i],\n requests[i],\n proofDataArray[i]\n );\n }\n _generateEarlyUserAttestation(destination);\n return attestations;\n }\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view override returns (Attestation[] memory) {\n return _forwardAttestationsBuild(attester, request, proofData);\n }\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function of targeted attester\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n\n for (uint256 i = 0; i < attesters.length; i++) {\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\n }\n return attestations;\n }\n\n function _forwardAttestationsBuild(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal view returns (Attestation[] memory) {\n return IAttester(attester).buildAttestations(request, proofData);\n }\n\n function _forwardAttestationsGeneration(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal returns (Attestation[] memory) {\n return IAttester(attester).generateAttestations(request, proofData);\n }\n\n function _generateEarlyUserAttestation(address destination) internal {\n uint32 currentTimestamp = uint32(block.timestamp);\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\n EARLY_USER_COLLECTION,\n destination\n );\n\n if (!alreadyHasAttestation) {\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n EARLY_USER_COLLECTION,\n destination,\n address(this),\n 1,\n currentTimestamp,\n 'With strong love from Sismo'\n );\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n emit EarlyUserAttestationGenerated(destination);\n }\n }\n }\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\n\n/**\n * @title IAttestationsRegistry\n * @author Sismo\n * @notice This is the interface of the AttestationRegistry\n */\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\n event AttestationRecorded(Attestation attestation);\n event AttestationDeleted(Attestation attestation);\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external;\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(\n uint256 collectionId,\n address owner\n ) external view returns (AttestationData memory);\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(\n uint256 collectionId,\n address owner\n ) external view returns (address, uint256, uint32, bytes memory);\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(\n uint256 collectionId,\n address owner\n ) external view returns (bytes memory);\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(\n uint256 collectionId,\n address owner\n ) external view returns (address);\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(\n uint256 collectionId,\n address owner\n ) external view returns (uint32);\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view returns (AttestationData[] memory);\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view returns (uint256[] memory);\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\n\ninterface IAttestationsRegistryConfigLogic {\n error AttesterNotFound(address issuer);\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\n error IdsMismatch(\n address issuer,\n uint256 rangeIndex,\n uint256 expectedFirstId,\n uint256 expectedLastId,\n uint256 FirstId,\n uint256 lastCollectionId\n );\n error AttributeDoesNotExist(uint8 attributeIndex);\n error AttributeAlreadyExists(uint8 attributeIndex);\n error ArgsLengthDoesNotMatch();\n\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\n event AttributeNameUpdated(\n uint8 attributeIndex,\n bytes32 newAttributeName,\n bytes32 previousAttributeName\n );\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\n\n event AttestationsCollectionAttributeSet(\n uint256 collectionId,\n uint8 attributeIndex,\n uint8 attributeValue\n );\n\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n\n /**\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute. Can go from 0 to 63.\n */\n function attestationsCollectionHasAttribute(\n uint256 collectionId,\n uint8 index\n ) external view returns (bool);\n\n function attestationsCollectionHasAttributes(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (bool);\n\n /**\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\n */\n function getAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 attributeIndex\n ) external view returns (uint8);\n\n function getAttributesValuesForAttestationsCollection(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (uint8[] memory);\n\n /**\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute (must be between 0 and 63)\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\n */\n function setAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 index,\n uint8 value\n ) external;\n\n function setAttributesValuesForAttestationsCollections(\n uint256[] memory collectionIds,\n uint8[] memory indices,\n uint8[] memory values\n ) external;\n\n /**\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n */\n function getAttributesNamesAndValuesForAttestationsCollection(\n uint256 collectionId\n ) external view returns (bytes32[] memory, uint8[] memory);\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external;\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external;\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external;\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external;\n\n /**\n * @dev Create a new attribute.\n * @param index Index of the attribute. Can go from 0 to 63.\n * @param name Name in bytes32 of the attribute\n */\n function createNewAttribute(uint8 index, bytes32 name) external;\n\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\n\n /**\n * @dev Update the name of an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\n * @param newName new name in bytes32 of the attribute\n */\n function updateAttributeName(uint8 index, bytes32 newName) external;\n\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\n\n /**\n * @dev Delete an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\n */\n function deleteAttribute(uint8 index) external;\n\n function deleteAttributes(uint8[] memory indices) external;\n}\n" - }, - "contracts/core/interfaces/IAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\n\n/**\n * @title IAttester\n * @author Sismo\n * @notice This is the interface for the attesters in Sismo Protocol\n */\ninterface IAttester {\n event AttestationGenerated(Attestation attestation);\n\n event AttestationDeleted(Attestation attestation);\n\n error AttestationDeletionNotImplemented();\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev External facing function. Allows to delete an attestation by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that was deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry address getter\n * @return attestationRegistry Address of the registry\n */\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\n}\n" - }, - "contracts/core/interfaces/IBadges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Interface for Badges contract\n * @author Sismo\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n */\ninterface IBadges {\n error BadgesNonTransferrable();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(string memory uri, address owner) external;\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external;\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry) external;\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external;\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view returns (address);\n\n /**\n * @dev Getter of the badge issuer\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeIssuer(address account, uint256 id) external view returns (address);\n\n /**\n * @dev Getter of the badge timestamp\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);\n\n /**\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);\n\n /**\n * @dev Getter of the value of a specific badge attribute\n * @param id Badge Id to check (= attestationCollectionId)\n * @param index Index of the attribute\n */\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);\n\n /**\n * @dev Getter of all badge attributes and their values for a specific badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getAttributesNamesAndValuesForBadge(\n uint256 id\n ) external view returns (bytes32[] memory, uint8[] memory);\n}\n" - }, - "contracts/core/interfaces/IFront.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\n\n/**\n * @title IFront\n * @author Sismo\n * @notice This is the interface of the Front Contract\n */\ninterface IFront {\n error DifferentRequestsDestinations();\n event EarlyUserAttestationGenerated(address destination);\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev generate multiple attestations at once, to the same destination\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external returns (Attestation[][] memory);\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function(s) of targeted attester(s)\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view returns (Attestation[][] memory);\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport './OwnableLogic.sol';\nimport './PausableLogic.sol';\nimport './InitializableLogic.sol';\nimport './AttestationsRegistryState.sol';\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\nimport {Bitmap256Bit} from '../utils/Bitmap256Bit.sol';\n\n/**\n * @title Attestations Registry Config Logic contract\n * @author Sismo\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\n **/\ncontract AttestationsRegistryConfigLogic is\n AttestationsRegistryState,\n IAttestationsRegistryConfigLogic,\n OwnableLogic,\n PausableLogic,\n InitializableLogic\n{\n using RangeUtils for Range[];\n using Bitmap256Bit for uint256;\n using Bitmap256Bit for uint8;\n\n /******************************************\n *\n * ATTESTATION REGISTRY WRITE ACCESS MANAGEMENT (ISSUERS)\n *\n *****************************************/\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external override onlyOwner {\n _pause();\n }\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external override onlyOwner {\n _unpause();\n }\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\n for (uint256 i = 0; i < ranges.length; i++) {\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external override onlyOwner {\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\n return _isAuthorized(issuer, collectionId);\n }\n\n /******************************************\n *\n * ATTRIBUTES CONFIG LOGIC\n *\n *****************************************/\n\n /**\n * @dev Create a new attribute.\n * @param index Index of the attribute. Can go from 0 to 63.\n * @param name Name in bytes32 of the attribute\n */\n function createNewAttribute(uint8 index, bytes32 name) public onlyOwner {\n index._checkIndexIsValid();\n if (_isAttributeCreated(index)) {\n revert AttributeAlreadyExists(index);\n }\n _createNewAttribute(index, name);\n }\n\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external onlyOwner {\n if (indices.length != names.length) {\n revert ArgsLengthDoesNotMatch();\n }\n\n for (uint256 i = 0; i < indices.length; i++) {\n createNewAttribute(indices[i], names[i]);\n }\n }\n\n /**\n * @dev Update the name of an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\n * @param newName new name in bytes32 of the attribute\n */\n function updateAttributeName(uint8 index, bytes32 newName) public onlyOwner {\n index._checkIndexIsValid();\n if (!_isAttributeCreated(index)) {\n revert AttributeDoesNotExist(index);\n }\n _updateAttributeName(index, newName);\n }\n\n function updateAttributesName(\n uint8[] memory indices,\n bytes32[] memory newNames\n ) external onlyOwner {\n if (indices.length != newNames.length) {\n revert ArgsLengthDoesNotMatch();\n }\n\n for (uint256 i = 0; i < indices.length; i++) {\n updateAttributeName(indices[i], newNames[i]);\n }\n }\n\n /**\n * @dev Delete an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must already exist\n */\n function deleteAttribute(uint8 index) public onlyOwner {\n index._checkIndexIsValid();\n if (!_isAttributeCreated(index)) {\n revert AttributeDoesNotExist(index);\n }\n _deleteAttribute(index);\n }\n\n function deleteAttributes(uint8[] memory indices) external onlyOwner {\n for (uint256 i = 0; i < indices.length; i++) {\n deleteAttribute(indices[i]);\n }\n }\n\n /**\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute (must be between 0 and 63)\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\n */\n function setAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 index,\n uint8 value\n ) public onlyOwner {\n index._checkIndexIsValid();\n\n if (!_isAttributeCreated(index)) {\n revert AttributeDoesNotExist(index);\n }\n\n _setAttributeForAttestationsCollection(collectionId, index, value);\n }\n\n function setAttributesValuesForAttestationsCollections(\n uint256[] memory collectionIds,\n uint8[] memory indices,\n uint8[] memory values\n ) external onlyOwner {\n if (collectionIds.length != indices.length || collectionIds.length != values.length) {\n revert ArgsLengthDoesNotMatch();\n }\n for (uint256 i = 0; i < collectionIds.length; i++) {\n setAttributeValueForAttestationsCollection(collectionIds[i], indices[i], values[i]);\n }\n }\n\n /**\n * @dev Returns the attribute's value (from 0 to 15) of an attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute. Can go from 0 to 63.\n */\n function getAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 index\n ) public view returns (uint8) {\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\n collectionId\n );\n return currentAttributesValues._get(index);\n }\n\n function getAttributesValuesForAttestationsCollection(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (uint8[] memory) {\n uint8[] memory attributesValues = new uint8[](indices.length);\n for (uint256 i = 0; i < indices.length; i++) {\n attributesValues[i] = getAttributeValueForAttestationsCollection(collectionId, indices[i]);\n }\n return attributesValues;\n }\n\n /**\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute. Can go from 0 to 63.\n */\n function attestationsCollectionHasAttribute(\n uint256 collectionId,\n uint8 index\n ) public view returns (bool) {\n uint256 currentAttributeValues = _getAttributesValuesBitmapForAttestationsCollection(\n collectionId\n );\n return currentAttributeValues._get(index) > 0;\n }\n\n function attestationsCollectionHasAttributes(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (bool) {\n for (uint256 i = 0; i < indices.length; i++) {\n if (!attestationsCollectionHasAttribute(collectionId, indices[i])) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n */\n function getAttributesNamesAndValuesForAttestationsCollection(\n uint256 collectionId\n ) public view returns (bytes32[] memory, uint8[] memory) {\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\n collectionId\n );\n\n (\n uint8[] memory indices,\n uint8[] memory values,\n uint8 nbOfNonZeroValues\n ) = currentAttributesValues._getAllNonZeroValues();\n\n bytes32[] memory attributesNames = new bytes32[](nbOfNonZeroValues);\n uint8[] memory attributesValues = new uint8[](nbOfNonZeroValues);\n for (uint8 i = 0; i < nbOfNonZeroValues; i++) {\n attributesNames[i] = _attributesNames[indices[i]];\n attributesValues[i] = values[i];\n }\n\n return (attributesNames, attributesValues);\n }\n\n /*****************************\n *\n * INTERNAL FUNCTIONS\n *\n *****************************/\n\n function _authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal {\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\n _authorizedRanges[issuer].push(newRange);\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal onlyOwner {\n if (rangeIndex >= _authorizedRanges[issuer].length)\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\n\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\n revert IdsMismatch(\n issuer,\n rangeIndex,\n expectedFirstId,\n expectedLastId,\n firstCollectionId,\n lastCollectionId\n );\n\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\n _authorizedRanges[issuer].length - 1\n ];\n _authorizedRanges[issuer].pop();\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\n return _authorizedRanges[issuer]._includes(collectionId);\n }\n\n function _setAttributeForAttestationsCollection(\n uint256 collectionId,\n uint8 index,\n uint8 value\n ) internal {\n uint256 currentAttributes = _getAttributesValuesBitmapForAttestationsCollection(collectionId);\n\n _attestationsCollectionAttributesValuesBitmap[collectionId] = currentAttributes._set(\n index,\n value\n );\n\n emit AttestationsCollectionAttributeSet(collectionId, index, value);\n }\n\n function _createNewAttribute(uint8 index, bytes32 name) internal {\n _attributesNames[index] = name;\n\n emit NewAttributeCreated(index, name);\n }\n\n function _updateAttributeName(uint8 index, bytes32 newName) internal {\n bytes32 previousName = _attributesNames[index];\n\n _attributesNames[index] = newName;\n\n emit AttributeNameUpdated(index, newName, previousName);\n }\n\n function _deleteAttribute(uint8 index) internal {\n bytes32 deletedName = _attributesNames[index];\n\n delete _attributesNames[index];\n\n emit AttributeDeleted(index, deletedName);\n }\n\n function _getAttributesValuesBitmapForAttestationsCollection(\n uint256 collectionId\n ) internal view returns (uint256) {\n return _attestationsCollectionAttributesValuesBitmap[collectionId];\n }\n\n function _isAttributeCreated(uint8 index) internal view returns (bool) {\n if (_attributesNames[index] == 0) {\n return false;\n }\n return true;\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryState.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Range} from '../utils/RangeLib.sol';\nimport {Attestation, AttestationData} from '../Structs.sol';\n\ncontract AttestationsRegistryState {\n /*******************************************************\n Storage layout:\n 19 slots for config\n 4 currently used for _initialized, _initializing, _paused, _owner\n 15 place holders\n 16 slots for logic\n 3 currently used for _authorizedRanges, _attestationsCollectionAttributesValuesBitmap, _attributesNames\n 13 place holders\n 1 slot for _attestationsData \n *******************************************************/\n\n // main config\n // changed `_initialized` from bool to uint8\n // as we were using OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n // and changed to OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n // PR: https://github.com/sismo-core/sismo-protocol/pull/41\n uint8 internal _initialized;\n bool internal _initializing;\n bool internal _paused;\n address internal _owner;\n // keeping some space for future\n uint256[15] private _placeHoldersAdmin;\n\n // storing the authorized ranges for each attesters\n mapping(address => Range[]) internal _authorizedRanges;\n // Storing the attributes values used for each attestations collection\n // Each attribute value is an hexadecimal\n mapping(uint256 => uint256) internal _attestationsCollectionAttributesValuesBitmap;\n // Storing the attribute name for each attributes index\n mapping(uint8 => bytes32) internal _attributesNames;\n // keeping some space for future\n uint256[13] private _placeHoldersConfig;\n // storing the data of attestations\n // =collectionId=> =owner=> attestationData\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\n}\n" - }, - "contracts/core/libs/attestations-registry/InitializableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Address.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract InitializableLogic is AttestationsRegistryState {\n // only diff with oz\n // /**\n // * @dev Indicates that the contract has been initialized.\n // */\n // bool private _initialized;\n\n // /**\n // * @dev Indicates that the contract is in the process of being initialized.\n // */\n // bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) ||\n (!Address.isContract(address(this)) && _initialized == 1),\n 'Initializable: contract is already initialized'\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(\n !_initializing && _initialized < version,\n 'Initializable: contract is already initialized'\n );\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, 'Initializable: contract is not initializing');\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, 'Initializable: contract is initializing');\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/OwnableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n // This is the only diff with OZ contract\n // address private _owner;\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/PausableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableLogic is Context, AttestationsRegistryState {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n // this is the only diff with OZ contract\n // bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), 'Pausable: paused');\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), 'Pausable: not paused');\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "contracts/core/libs/Structs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Attestations Registry State\n * @author Sismo\n * @notice This contract holds all of the storage variables and data\n * structures used by the AttestationsRegistry and parent\n * contracts.\n */\n\n// User Attestation Request, can be made by any user\n// The context of an Attestation Request is a specific attester contract\n// Each attester has groups of accounts in its available data\n// eg: for a specific attester:\n// group 1 <=> accounts that sent txs on mainnet\n// group 2 <=> accounts that sent txs on polygon\n// eg: for another attester:\n// group 1 <=> accounts that sent eth txs in 2022\n// group 2 <=> accounts sent eth txs in 2021\nstruct Request {\n // implicit address attester;\n // implicit uint256 chainId;\n Claim[] claims;\n address destination; // destination that will receive the end attestation\n}\n\nstruct Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\n}\n\n/**\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\n * @param collectionId Attestation collection\n * @param owner Attestation collection\n * @param issuer Attestation collection\n * @param value Attestation collection\n * @param timestamp Attestation collection\n * @param extraData Attestation collection\n */\nstruct Attestation {\n // implicit uint256 chainId;\n uint256 collectionId; // Id of the attestation collection (in the registry)\n address owner; // Owner of the attestation\n address issuer; // Contract that created or last updated the record.\n uint256 value; // Value of the attestation\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\n // it is different from the recording timestamp (date when the attestation was recorded)\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\n bytes extraData; // arbitrary data that can be added by the attester\n}\n\n// Attestation Data, stored in the registry\n// The context is a specific owner of a specific collection\nstruct AttestationData {\n // implicit uint256 chainId\n // implicit uint256 collectionId - from context\n // implicit owner\n address issuer; // Address of the contract that recorded the attestation\n uint256 value; // Value of the attestation\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\n bytes extraData; // arbitrary data that can be added by the attester\n}\n" - }, - "contracts/core/libs/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, 'Address: insufficient balance');\n\n (bool success, ) = recipient.call{value: amount}('');\n require(success, 'Address: unable to send value, recipient may have reverted');\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, 'Address: low-level call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, 'Address: insufficient balance for call');\n require(isContract(target), 'Address: call to non-contract');\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data\n ) internal view returns (bytes memory) {\n return functionStaticCall(target, data, 'Address: low-level static call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), 'Address: static call to non-contract');\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), 'Address: delegate call to non-contract');\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/core/libs/utils/Bitmap256Bit.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/*\n * The 256-bit bitmap is structured in 64 chuncks of 4 bits each.\n * The 4 bits can encode any value from 0 to 15.\n\n chunck63 chunck2 chunck1 chunck0\n bits bits bits bits \n ┌────────────┐ ┌────────────┬────────────┬────────────┐\n │ 1 1 1 1 │ .... │ 1 0 1 1 │ 0 0 0 0 │ 0 0 0 1 │\n └────────────┘ └────────────┴────────────┴────────────┘\n value 15 value 11 value 0 value 1\n\n * A chunck index must be between 0 and 63.\n * A value must be between 0 and 15.\n **/\n\nlibrary Bitmap256Bit {\n uint256 constant MAX_INT = 2 ** 256 - 1;\n\n error IndexOutOfBounds(uint8 index);\n error ValueOutOfBounds(uint8 value);\n\n /**\n * @dev Return the value at a given index of a 256-bit bitmap\n * @param index index where the value can be found. Can be between 0 and 63\n */\n function _get(uint256 self, uint8 index) internal pure returns (uint8) {\n uint256 currentValues = self;\n // Get the encoded 4-bit value by right shifting to the `index` position\n uint256 shifted = currentValues >> (4 * index);\n // Get the value by only masking the last 4 bits with an AND operator\n return uint8(shifted & (2 ** 4 - 1));\n }\n\n /**\n * @dev Set a value at a chosen index in a 256-bit bitmap\n * @param index index where the value will be stored. Can be between 0 and 63\n * @param value value to store. Can be between 0 and 15\n */\n function _set(uint256 self, uint8 index, uint8 value) internal pure returns (uint256) {\n _checkIndexIsValid(index);\n _checkValueIsValid(value);\n\n uint256 currentValues = self;\n // 1. first we need to remove the current value for the inputed `index`\n // Left Shift 4 bits mask (1111 mask) to the `index` position\n uint256 mask = (2 ** 4 - 1) << (4 * index);\n // Apply a XOR operation to obtain a mask with all bits set to 1 except the 4 bits that we want to remove\n uint256 negativeMask = MAX_INT ^ mask;\n // Apply a AND operation between the current values and the negative mask to remove the wanted bits\n uint256 newValues = currentValues & negativeMask;\n\n // 2. We set the new value wanted at the `index` position\n // Create the 4 bits encoding the new value and left shift them to the `index` position\n uint256 newValueMask = uint256(value) << (4 * index);\n // Apply an OR operation between the current values and the newValueMask to reference new value\n return newValues | newValueMask;\n }\n\n /**\n * @dev Get all the non-zero values in a 256-bit bitmap\n * @param self a 256-bit bitmap\n */\n function _getAllNonZeroValues(\n uint256 self\n ) internal pure returns (uint8[] memory, uint8[] memory, uint8) {\n uint8[] memory indices = new uint8[](64);\n uint8[] memory values = new uint8[](64);\n uint8 nbOfNonZeroValues = 0;\n for (uint8 i = 0; i < 63; i++) {\n uint8 value = _get(self, i);\n if (value > 0) {\n indices[nbOfNonZeroValues] = i;\n values[nbOfNonZeroValues] = value;\n nbOfNonZeroValues++;\n }\n }\n return (indices, values, nbOfNonZeroValues);\n }\n\n /**\n * @dev Check if the index is valid (is between 0 and 63)\n * @param index index of a chunck\n */\n function _checkIndexIsValid(uint8 index) internal pure {\n if (index > 63) {\n revert IndexOutOfBounds(index);\n }\n }\n\n /**\n * @dev Check if the value is valid (is between 0 and 15)\n * @param value value to encode in a chunck\n */\n function _checkValueIsValid(uint8 value) internal pure {\n if (value > 15) {\n revert ValueOutOfBounds(value);\n }\n }\n}\n" - }, - "contracts/core/libs/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.14;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "contracts/core/libs/utils/RangeLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nstruct Range {\n uint256 min;\n uint256 max;\n}\n\n// Range [0;3] includees 0 and 3\nlibrary RangeUtils {\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\n for (uint256 i = 0; i < ranges.length; i++) {\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\n return true;\n }\n }\n return false;\n }\n}\n" - }, - "contracts/periphery/badges-examples/BAYCOwnershipBadgeExample.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC721} from '@openzeppelin/contracts/token/ERC721/ERC721.sol';\nimport {IAttestationsRegistry} from '../../core/interfaces/IAttestationsRegistry.sol';\n\ncontract BAYCOwnershipBadge is ERC721 {\n IAttestationsRegistry immutable ATTESTATIONS_REGISTRY;\n uint256 constant HydraS1_BAYC_ATTESTATION_COLLECTION_ID = 100000001;\n uint256 constant SMPS_BAYC_ATTESTATION_COLLECTION_ID = 30000000000003;\n\n constructor(\n address attestationsRegistryAddress,\n string memory name,\n string memory symbol\n ) ERC721(name, symbol) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n function balanceOf(address account) public view virtual override returns (uint256) {\n bool hasZKAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n HydraS1_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n bool hasDoxingAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n SMPS_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n return hasZKAttestation || hasDoxingAttestation ? 1 : 0;\n }\n}\n" - }, - "contracts/periphery/utils/AvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n/**\n * @title Attesters Groups Registry\n * @author Sismo\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\n * For more information: https://available-roots-registry.docs.sismo.io\n *\n **/\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\n uint8 public constant IMPLEMENTATION_VERSION = 2;\n\n mapping(address => mapping(uint256 => bool)) public _roots;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can register/ unregister roots\n */\n constructor(address owner) {\n initialize(owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n }\n }\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\n _registerRootForAttester(attester, root);\n }\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\n _unregisterRootForAttester(attester, root);\n }\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external onlyOwner {\n _registerRootForAttester(address(0), root);\n }\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external onlyOwner {\n _unregisterRootForAttester(address(0), root);\n }\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\n return _roots[_msgSender()][root] || _roots[address(0)][root];\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\n return _roots[attester][root] || _roots[address(0)][root];\n }\n\n function _registerRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = true;\n if (attester == address(0)) {\n emit RegisteredRootForAll(root);\n } else {\n emit RegisteredRootForAttester(attester, root);\n }\n }\n\n function _unregisterRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = false;\n if (attester == address(0)) {\n emit UnregisteredRootForAll(root);\n } else {\n emit UnregisteredRootForAttester(attester, root);\n }\n }\n}\n" - }, - "contracts/periphery/utils/CommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\n\n/**\n * @title Commitment Mapper Registry Contract\n * @author Sismo\n * @notice This contract stores information about the commitment mapper.\n * Its ethereum address and its EdDSA public key\n * For more information: https://commitment-mapper.docs.sismo.io\n *\n **/\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\n uint8 public constant IMPLEMENTATION_VERSION = 2;\n\n uint256[2] internal _commitmentMapperPubKey;\n address _commitmentMapperAddress;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n constructor(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) {\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n address ownerAddress,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\n _updateCommitmentMapperAddress(commitmentMapperAddress);\n }\n }\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\n }\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\n _updateCommitmentMapperAddress(newAddress);\n }\n\n /**\n * @dev Getter of the EdDSA public key of the commitment mapper\n */\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\n return _commitmentMapperPubKey;\n }\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view override returns (address) {\n return _commitmentMapperAddress;\n }\n\n function _updateCommitmentMapperAddress(address newAddress) internal {\n _commitmentMapperAddress = newAddress;\n emit UpdatedCommitmentMapperAddress(newAddress);\n }\n\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\n _commitmentMapperPubKey = pubKey;\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\n/**\n * @title IAvailableRootsRegistry\n * @author Sismo\n * @notice Interface for (Merkle) Roots Registry\n */\ninterface IAvailableRootsRegistry {\n event RegisteredRootForAttester(address attester, uint256 root);\n event RegisteredRootForAll(uint256 root);\n event UnregisteredRootForAttester(address attester, uint256 root);\n event UnregisteredRootForAll(uint256 root);\n\n error CannotRegisterForZeroAddress();\n error CannotUnregisterForZeroAddress();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address owner) external;\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external;\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external;\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\n}\n" - }, - "contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\ninterface ICommitmentMapperRegistry {\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\n event UpdatedCommitmentMapperAddress(address newAddress);\n error PubKeyNotValid(uint256[2] pubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) external;\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external;\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getEdDSAPubKey() external view returns (uint256[2] memory);\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view returns (address);\n}\n" - }, - "contracts/periphery/utils/TransparentUpgradeableProxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n// Note: we just copied so that we can see the contract used\npragma solidity ^0.8.14;\n\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(''), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(\n address newImplementation,\n bytes calldata data\n ) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(\n msg.sender != _getAdmin(),\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\n );\n super._beforeFallback();\n }\n}\n" - }, - "contracts/tests/MockAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttestationsRegistry} from '../core/interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from '../core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from '../core/libs/attestations-registry/AttestationsRegistryState.sol';\nimport {IBadges} from '../core/interfaces/IBadges.sol';\nimport {Attestation, AttestationData} from '../core/libs/Structs.sol';\n\ncontract MockAttestationsRegistry {\n uint256 immutable ATTESTATION_VALUE;\n\n event AttestationRecorded(Attestation attestation);\n\n constructor(uint256 attestationValue) {\n ATTESTATION_VALUE = attestationValue;\n }\n\n function getAttestationValue(\n uint256 collectionId,\n address owner\n ) external view returns (uint256) {\n return ATTESTATION_VALUE;\n }\n\n function recordAttestations(Attestation[] calldata attestations) external {\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationRecorded(attestations[i]);\n }\n }\n}\n" - }, - "contracts/tests/MockAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\nimport {Attestation, Request} from '../core/libs/Structs.sol';\nimport {Attester} from '../core/Attester.sol';\nimport {IAttester} from '../core/interfaces/IAttester.sol';\n\ncontract MockAttester is IAttester, Attester {\n uint256 public immutable ATTESTATION_ID_MIN;\n uint256 public immutable ATTESTATION_ID_MAX;\n\n constructor(\n address ATTESTATION_REGISTRY_ADDRESS,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n ) Attester(ATTESTATION_REGISTRY_ADDRESS) {\n ATTESTATION_ID_MIN = collectionIdFirst;\n ATTESTATION_ID_MAX = collectionIdLast;\n }\n\n function _verifyRequest(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {}\n\n function buildAttestations(\n Request calldata request,\n bytes calldata /*data*/\n ) public view virtual override(Attester, IAttester) returns (Attestation[] memory) {\n uint256 collectionId = ATTESTATION_ID_MIN + request.claims[0].groupId;\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n collectionId,\n request.destination,\n address(this),\n request.claims[0].claimedValue,\n abi.decode(request.claims[0].extraData, (uint32)),\n 'Mock Attester v0'\n );\n return (attestations);\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates", - "storageLayout" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/goerli/solcInputs/70d5ec851bd4311fac67c09b114b9c0c.json b/deployments/goerli/solcInputs/70d5ec851bd4311fac67c09b114b9c0c.json deleted file mode 100644 index 1733491..0000000 --- a/deployments/goerli/solcInputs/70d5ec851bd4311fac67c09b114b9c0c.json +++ /dev/null @@ -1,227 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/attesters/hydra-s1/base/HydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1Base} from './IHydraS1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Hydra S1 ZK Proving Scheme\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n \n \n **/\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\n using HydraS1Lib for HydraS1ProofData;\n\n // ZK-SNARK Verifier\n HydraS1Verifier immutable VERIFIER;\n // Registry storing the Commitment Mapper EdDSA Public key\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\n * @param commitmentMapperAddress Commitment mapper's public key registry\n */\n constructor(\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress\n ) {\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\n }\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\n return COMMITMENT_MAPPER_REGISTRY;\n }\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\n return AVAILABLE_ROOTS_REGISTRY;\n }\n\n /*******************************************************\n Hydra-S1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input which guarantees privacy\n\n * This function MUST be implemented by Hydra-S1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Hydra-S1 Simple Attester for an example\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\n */\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n virtual\n returns (uint256);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\n internal\n view\n virtual\n {\n if (input.accountsTreeValue != claim.groupId)\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\n revert RegistryRootMismatch(input.registryRoot);\n\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\n if (\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\n )\n revert CommitmentMapperPubKeyMismatch(\n commitmentMapperPubKey[0],\n commitmentMapperPubKey[1],\n input.commitmentMapperPubKey[0],\n input.commitmentMapperPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the groth16 mathematical proof\n * @param proofData snark public input\n */\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(\n uint256 /*errorCode*/\n ) {\n revert InvalidGroth16Proof('');\n } catch (\n bytes memory /*lowLevelData*/\n ) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/IHydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n// todo: explain well what is specific to this attester\ninterface IHydraS1Base {\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\n error RegistryRootMismatch(uint256 inputRoot);\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error CommitmentMapperPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error AccountsTreeValueMismatch(\n uint256 expectedAccountsTreeValue,\n uint256 inputAccountsTreeValue\n );\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier);\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\n}\n" - }, - "@openzeppelin/contracts/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" - }, - "contracts/core/libs/Structs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Attestations Registry State\n * @author Sismo\n * @notice This contract holds all of the storage variables and data\n * structures used by the AttestationsRegistry and parent\n * contracts.\n */\n\n// User Attestation Request, can be made by any user\n// The context of an Attestation Request is a specific attester contract\n// Each attester has groups of accounts in its available data\n// eg: for a specific attester:\n// group 1 <=> accounts that sent txs on mainnet\n// group 2 <=> accounts that sent txs on polygon\n// eg: for another attester:\n// group 1 <=> accounts that sent eth txs in 2022\n// group 2 <=> accounts sent eth txs in 2021\nstruct Request {\n // implicit address attester;\n // implicit uint256 chainId;\n Claim[] claims;\n address destination; // destination that will receive the end attestation\n}\n\nstruct Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\n}\n\n/**\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\n * @param collectionId Attestation collection\n * @param owner Attestation collection\n * @param issuer Attestation collection\n * @param value Attestation collection\n * @param timestamp Attestation collection\n * @param extraData Attestation collection\n */\nstruct Attestation {\n // implicit uint256 chainId;\n uint256 collectionId; // Id of the attestation collection (in the registry)\n address owner; // Owner of the attestation\n address issuer; // Contract that created or last updated the record.\n uint256 value; // Value of the attestation\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\n // it is different from the recording timestamp (date when the attestation was recorded)\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\n bytes extraData; // arbitrary data that can be added by the attester\n}\n\n// Attestation Data, stored in the registry\n// The context is a specific owner of a specific collection\nstruct AttestationData {\n // implicit uint256 chainId\n // implicit uint256 collectionId - from context\n // implicit owner\n address issuer; // Address of the contract that recorded the attestation\n uint256 value; // Value of the attestation\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\n bytes extraData; // arbitrary data that can be added by the attester\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1GroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n bool isScore;\n}\n\nstruct HydraS1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct HydraS1ProofData {\n HydraS1CircomSnarkProof proof;\n uint256[10] input;\n // destination\n // chainId\n // commitmentMapperPubKey.x\n // commitmentMapperPubKey.y\n // registryTreeRoot\n // ticketIdentifier\n // ticket\n // claimedValue\n // accountsTreeValue\n // isStrict\n}\n\nstruct HydraS1ProofInput {\n address destination;\n uint256 chainId;\n uint256 registryRoot;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n uint256 accountsTreeValue;\n bool isStrict;\n uint256[2] commitmentMapperPubKey;\n}\n\nlibrary HydraS1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\n return\n HydraS1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getRegistryRoot(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getAccountsTreeValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1GroupProperties)\n );\n\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(HydraS1ProofData memory self)\n internal\n pure\n returns (\n uint256[2] memory,\n uint256[2][2] memory,\n uint256[2] memory,\n uint256[10] memory\n )\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\n internal\n pure\n returns (uint256[2] memory)\n {\n return [self.input[2], self.input[3]];\n }\n\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\n internal\n pure\n returns (uint256)\n {\n return self.input[5];\n }\n\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[8];\n }\n\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\n return self.input[9] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\n );\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(groupIndex, generationTimestamp, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/periphery/utils/CommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\n\n/**\n * @title Commitment Mapper Registry Contract\n * @author Sismo\n * @notice This contract stores information about the commitment mapper.\n * Its ethereum address and its EdDSA public key\n * For more information: https://commitment-mapper.docs.sismo.io\n *\n **/\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\n uint256[2] internal _commitmentMapperPubKey;\n address _commitmentMapperAddress;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n constructor(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) {\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) public initializer {\n _transferOwnership(owner);\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\n _updateCommitmentMapperAddress(commitmentMapperAddress);\n }\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\n }\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\n _updateCommitmentMapperAddress(newAddress);\n }\n\n /**\n * @dev Getter of the EdDSA public key of the commitment mapper\n */\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\n return _commitmentMapperPubKey;\n }\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view override returns (address) {\n return _commitmentMapperAddress;\n }\n\n function _updateCommitmentMapperAddress(address newAddress) internal {\n _commitmentMapperAddress = newAddress;\n emit UpdatedCommitmentMapperAddress(newAddress);\n }\n\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\n _commitmentMapperPubKey = pubKey;\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\n }\n}\n" - }, - "contracts/periphery/utils/AvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n/**\n * @title Attesters Groups Registry\n * @author Sismo\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\n * For more information: https://available-roots-registry.docs.sismo.io\n *\n **/\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\n mapping(address => mapping(uint256 => bool)) public _roots;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can register/ unregister roots\n */\n constructor(address owner) {\n initialize(owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) public initializer {\n _transferOwnership(owner);\n }\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\n _registerRootForAttester(attester, root);\n }\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\n _unregisterRootForAttester(attester, root);\n }\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external onlyOwner {\n _registerRootForAttester(address(0), root);\n }\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external onlyOwner {\n _unregisterRootForAttester(address(0), root);\n }\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\n return _roots[_msgSender()][root] || _roots[address(0)][root];\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\n return _roots[attester][root] || _roots[address(0)][root];\n }\n\n function _registerRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = true;\n if (attester == address(0)) {\n emit RegisteredRootForAll(root);\n } else {\n emit RegisteredRootForAttester(attester, root);\n }\n }\n\n function _unregisterRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = false;\n if (attester == address(0)) {\n emit UnregisteredRootForAll(root);\n } else {\n emit UnregisteredRootForAttester(attester, root);\n }\n }\n}\n" - }, - "@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract HydraS1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\n );\n vk.IC = new Pairing.G1Point[](11);\n \n vk.IC[0] = Pairing.G1Point( \n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\n 546002182798634190282541153661423157791776194062719045593389981526666716416\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\n 181057165072599074288983745076121344893296348827576905983079816835912241514\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\n ); \n \n vk.IC[10] = Pairing.G1Point( \n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[10] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "@openzeppelin/contracts/access/Ownable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\ninterface ICommitmentMapperRegistry {\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\n event UpdatedCommitmentMapperAddress(address newAddress);\n error PubKeyNotValid(uint256[2] pubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) external;\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external;\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getEdDSAPubKey() external view returns (uint256[2] memory);\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\n/**\n * @title IAvailableRootsRegistry\n * @author Sismo\n * @notice Interface for (Merkle) Roots Registry\n */\ninterface IAvailableRootsRegistry {\n event RegisteredRootForAttester(address attester, uint256 root);\n event RegisteredRootForAll(uint256 root);\n event UnregisteredRootForAttester(address attester, uint256 root);\n event UnregisteredRootForAll(uint256 root);\n\n error CannotRegisterForZeroAddress();\n error CannotUnregisterForZeroAddress();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) external;\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external;\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external;\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\n}\n" - }, - "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SoulboundAttester} from '../interfaces/IHydraS1SoulboundAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from '../../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from '../base/HydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Soulbound Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - SoulBound (with cooldown period)\n * A user can chose to delete attestations or generate attestation to a new destination.\n * When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional\n * User will need to wait until the end of the cooldown period before being able to delete or switch destination again\n * One can however know that the former and the new destinations were created using the same userTicket\n \n * - Renewable\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew or update their attestations\n **/\ncontract HydraS1SoulboundAttester is IHydraS1SoulboundAttester, HydraS1Base, Attester {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n uint256 public immutable SOULBOUND_COOLDOWN_DURATION;\n\n mapping(uint256 => TicketData) internal _userTicketsData;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n uint256 soulboundCooldownDuration\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n SOULBOUND_COOLDOWN_DURATION = soulboundCooldownDuration;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user attestations request is invalid\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark proof backing the claim\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Throws if user attestations deletion request is not made by its owner\n * @param attestations attestations to delete\n */\n function _verifyAttestationsDeletionRequest(Attestation[] memory attestations, bytes calldata)\n internal\n view\n override\n {\n for (uint256 i = 0; i < attestations.length; i++) {\n uint256 userTicket = abi.decode(attestations[0].extraData, (uint256));\n if (_userTicketsData[userTicket].destination != msg.sender)\n revert NotAttestationOwner(userTicket, msg.sender);\n }\n }\n\n /**\n * @dev Returns the actual attestations constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark public input as well as snark proof\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n HydraS1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n // The issuer of attestations is the attester\n address issuer = address(this);\n // user sends the ticket as input in the data\n uint256 userTicket = proofData._getTicket();\n\n attestations[0] = Attestation(\n attestationCollectionId,\n request.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n abi.encode(userTicket)\n );\n\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used, not a renewal, and ticket on cooldown.\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n uint256 userTicket = proofData._getTicket();\n TicketData memory userTicketData = _userTicketsData[userTicket];\n\n if (\n userTicketData.destination != address(0) && userTicketData.destination != request.destination\n ) {\n if (_isOnCooldown(userTicketData)) revert TicketUsedAndOnCooldown(userTicketData);\n _setTicketOnCooldown(userTicket);\n }\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n override\n {\n // we retrieve the ticketUsed from attestations extraData\n for (uint256 i = 0; i < attestations.length; i++) {\n uint256 userTicket = abi.decode(attestations[i].extraData, (uint256));\n if (_isOnCooldown(_userTicketsData[userTicket]) == true) revert TicketFrozen(userTicket);\n _userTicketsData[userTicket].destination = address(0);\n }\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\n return ticketIdentifier;\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n /**\n * @dev Getter, returns the data linked to a ticket\n * @param userTicket ticket used\n **/\n function getTicketData(uint256 userTicket) external view override returns (TicketData memory) {\n return _getTicketData(userTicket);\n }\n\n /**\n * @dev returns whether a ticket is on cooldown or not\n * @param userTicket ticket used\n **/\n function isTicketOnCooldown(uint256 userTicket) external view override returns (bool) {\n return _isOnCooldown(_getTicketData(userTicket));\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _userTicketsData[userTicket].destination = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _setTicketOnCooldown(uint256 userTicket) internal {\n _userTicketsData[userTicket].cooldownStart = uint32(block.timestamp);\n emit TicketSetOnCooldown(userTicket);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _userTicketsData[userTicket].destination;\n }\n\n function _isOnCooldown(TicketData memory userTicketData) internal view returns (bool) {\n return userTicketData.cooldownStart + SOULBOUND_COOLDOWN_DURATION < block.timestamp;\n }\n\n function _getTicketData(uint256 userTicket) internal view returns (TicketData memory) {\n return _userTicketsData[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1SoulboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n// todo: explain well what is specific to this attester\ninterface IHydraS1SoulboundAttester is IHydraS1Base, IAttester {\n struct TicketData {\n address destination;\n uint32 cooldownStart;\n }\n error NotAttestationOwner(uint256 ticket, address sender);\n error TicketFrozen(uint256 ticketData);\n error TicketUsedAndOnCooldown(TicketData ticketData);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n event TicketSetOnCooldown(uint256 ticket);\n\n /**\n * @dev returns whether a ticket is on cooldown or not\n * @param userTicket ticket used\n **/\n function isTicketOnCooldown(uint256 userTicket) external view returns (bool);\n\n /**\n * @dev Getter, returns the data linked to a ticket\n * @param userTicket ticket used\n **/\n function getTicketData(uint256 userTicket) external view returns (TicketData memory);\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the duration of the cooldown period after having used a ticket\n **/\n function SOULBOUND_COOLDOWN_DURATION() external view returns (uint256);\n}\n" - }, - "contracts/core/Attester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\n\n/**\n * @title Attester Abstract Contract\n * @author Sismo\n * @notice Contract to be inherited by Attesters\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\n * are recommended to implemented this abstract contract\n\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\n *\n * This contracts is built around two main external standard functions.\n * They must NOT be override them, unless your really know what you are doing\n \n * - generateAttestations(request, proof) => will write attestations in the registry\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\n\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\n\n * For more information: https://attesters.docs.sismo.io\n **/\nabstract contract Attester is IAttester {\n // Registry where all attestations are stored\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(Request calldata request, bytes calldata proofData)\n external\n override\n returns (Attestation[] memory)\n {\n // Verify if request is valid by verifying against proof\n _verifyRequest(request, proofData);\n\n // Generate the actual attestations from user request\n Attestation[] memory attestations = buildAttestations(request, proofData);\n\n _beforeRecordAttestations(request, proofData);\n\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n\n _afterRecordAttestations(attestations);\n\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationGenerated(attestations[i]);\n }\n\n return attestations;\n }\n\n /**\n * @dev External facing function. Allows to delete attestations by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that were deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n // fetch attestations from the registry\n Attestation[] memory attestationsToDelete;\n for (uint256 i = 0; i < collectionIds.length; i++) {\n (\n address issuer,\n uint256 attestationValue,\n uint32 timestamp,\n bytes memory extraData\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\n\n attestationsToDelete[i] = (\n Attestation(\n collectionIds[i],\n attestationsOwner,\n issuer,\n attestationValue,\n timestamp,\n extraData\n )\n );\n }\n\n _verifyAttestationsDeletionRequest(attestationsToDelete, proofData);\n\n _beforeDeleteAttestations(attestationsToDelete, proofData);\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationsToDelete);\n\n _afterDeleteAttestations(attestationsToDelete, proofData);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n emit AttestationDeleted(attestationsToDelete[i]);\n }\n return attestationsToDelete;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n public\n view\n virtual\n returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry getter\n * @return attestationRegistry\n */\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\n return ATTESTATIONS_REGISTRY;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should verify the user request is valid\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\n\n /**\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\n * Default behavior: throws\n * It should verify attestations deletion request is valid\n * @param attestations Attestations that will be deleted\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyAttestationsDeletionRequest(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {\n revert AttestationDeletionNotImplemented();\n }\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before recording attestations in the registry\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n {}\n\n /**\n * @dev (Optional) Can be overridden in attesters inheriting this contract\n * Will be called after recording an attestation\n * @param attestations Recorded attestations\n */\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n virtual\n {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called after deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n virtual\n {}\n}\n" - }, - "contracts/core/interfaces/IAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\n\n/**\n * @title IAttester\n * @author Sismo\n * @notice This is the interface for the attesters in Sismo Protocol\n */\ninterface IAttester {\n event AttestationGenerated(Attestation attestation);\n\n event AttestationDeleted(Attestation attestation);\n\n error AttestationDeletionNotImplemented();\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(Request calldata request, bytes calldata proofData)\n external\n returns (Attestation[] memory);\n\n /**\n * @dev External facing function. Allows to delete an attestation by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that was deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n external\n view\n returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry address getter\n * @return attestationRegistry Address of the registry\n */\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\n\n/**\n * @title IAttestationsRegistry\n * @author Sismo\n * @notice This is the interface of the AttestationRegistry\n */\ninterface IAttestationsRegistry {\n event AttestationRecorded(Attestation attestation);\n event AttestationDeleted(Attestation attestation);\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external;\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param attestations Attestations to be deleted\n */\n function deleteAttestations(Attestation[] calldata attestations) external;\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(uint256 collectionId, address owner)\n external\n view\n returns (AttestationData memory);\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(uint256 collectionId, address owner)\n external\n view\n returns (\n address,\n uint256,\n uint32,\n bytes memory\n );\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(uint256 collectionId, address owner)\n external\n view\n returns (bytes memory);\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(uint256 collectionId, address owner)\n external\n view\n returns (address);\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(uint256 collectionId, address owner)\n external\n view\n returns (uint32);\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n returns (AttestationData[] memory);\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n returns (uint256[] memory);\n}\n" - }, - "contracts/tests/MockAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\nimport {Attestation, Request} from '../core/libs/Structs.sol';\nimport {Attester} from '../core/Attester.sol';\nimport {IAttester} from '../core/interfaces/IAttester.sol';\n\ncontract MockAttester is IAttester, Attester {\n uint256 public immutable ATTESTATION_ID_MIN;\n uint256 public immutable ATTESTATION_ID_MAX;\n\n constructor(\n address ATTESTATION_REGISTRY_ADDRESS,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n ) Attester(ATTESTATION_REGISTRY_ADDRESS) {\n ATTESTATION_ID_MIN = collectionIdFirst;\n ATTESTATION_ID_MAX = collectionIdLast;\n }\n\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {}\n\n function buildAttestations(\n Request calldata request,\n bytes calldata /*data*/\n ) public view virtual override(Attester, IAttester) returns (Attestation[] memory) {\n uint256 collectionId = ATTESTATION_ID_MIN + request.claims[0].groupId;\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n collectionId,\n request.destination,\n address(this),\n request.claims[0].claimedValue,\n abi.decode(request.claims[0].extraData, (uint32)),\n 'Mock Attester v0'\n );\n return (attestations);\n }\n}\n" - }, - "contracts/core/Front.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IFront} from './interfaces/IFront.sol';\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation} from './libs/Structs.sol';\n\n/**\n * @title Front\n * @author Sismo\n * @notice This is the Front contract of the Sismo protocol\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\n\n * For more information: https://front.docs.sismo.io\n */\ncontract Front is IFront {\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\n uint256 public constant EARLY_USER_COLLECTION = 0;\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress Attestations registry contract address\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n Attestation[] memory attestations = _forwardAttestationsGeneration(\n attester,\n request,\n proofData\n );\n _generateEarlyUserAttestation(request.destination);\n return attestations;\n }\n\n /**\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n address destination = requests[0].destination;\n for (uint256 i = 0; i < attesters.length; i++) {\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\n attestations[i] = _forwardAttestationsGeneration(\n attesters[i],\n requests[i],\n proofDataArray[i]\n );\n }\n _generateEarlyUserAttestation(destination);\n return attestations;\n }\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view override returns (Attestation[] memory) {\n return _forwardAttestationsBuild(attester, request, proofData);\n }\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function of targeted attester\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n\n for (uint256 i = 0; i < attesters.length; i++) {\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\n }\n return attestations;\n }\n\n function _forwardAttestationsBuild(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal view returns (Attestation[] memory) {\n return IAttester(attester).buildAttestations(request, proofData);\n }\n\n function _forwardAttestationsGeneration(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal returns (Attestation[] memory) {\n return IAttester(attester).generateAttestations(request, proofData);\n }\n\n function _generateEarlyUserAttestation(address destination) internal {\n uint32 currentTimestamp = uint32(block.timestamp);\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\n EARLY_USER_COLLECTION,\n destination\n );\n\n if (!alreadyHasAttestation) {\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n EARLY_USER_COLLECTION,\n destination,\n address(this),\n 1,\n currentTimestamp,\n 'With strong love from Sismo'\n );\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n emit EarlyUserAttestationGenerated(destination);\n }\n }\n }\n}\n" - }, - "contracts/core/interfaces/IFront.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\n\n/**\n * @title IFront\n * @author Sismo\n * @notice This is the interface of the Front Contract\n */\ninterface IFront {\n error DifferentRequestsDestinations();\n event EarlyUserAttestationGenerated(address destination);\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev generate multiple attestations at once, to the same destination\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external returns (Attestation[][] memory);\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function(s) of targeted attester(s)\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view returns (Attestation[][] memory);\n}\n" - }, - "contracts/tests/MockAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttestationsRegistry} from '../core/interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from '../core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from '../core/libs/attestations-registry/AttestationsRegistryState.sol';\nimport {IBadges} from '../core/interfaces/IBadges.sol';\nimport {Attestation, AttestationData} from '../core/libs/Structs.sol';\n\ncontract MockAttestationsRegistry {\n uint256 immutable ATTESTATION_VALUE;\n\n event AttestationRecorded(Attestation attestation);\n\n constructor(uint256 attestationValue) {\n ATTESTATION_VALUE = attestationValue;\n }\n\n function getAttestationValue(uint256 collectionId, address owner)\n external\n view\n returns (uint256)\n {\n return ATTESTATION_VALUE;\n }\n\n function recordAttestations(Attestation[] calldata attestations) external {\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationRecorded(attestations[i]);\n }\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport './OwnableLogic.sol';\nimport './PausableLogic.sol';\nimport './InitializableLogic.sol';\nimport './AttestationsRegistryState.sol';\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\n\n/**\n * @title Attestations Registry Config Logic contract\n * @author Sismo\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\n **/\ncontract AttestationsRegistryConfigLogic is\n AttestationsRegistryState,\n IAttestationsRegistryConfigLogic,\n OwnableLogic,\n PausableLogic,\n InitializableLogic\n{\n using RangeUtils for Range[];\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\n for (uint256 i = 0; i < ranges.length; i++) {\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external override onlyOwner {\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\n return _isAuthorized(issuer, collectionId);\n }\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external override onlyOwner {\n _pause();\n }\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external override onlyOwner {\n _unpause();\n }\n\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\n return _authorizedRanges[issuer]._includes(collectionId);\n }\n\n function _authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal {\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\n _authorizedRanges[issuer].push(newRange);\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal onlyOwner {\n if (rangeIndex >= _authorizedRanges[issuer].length)\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\n\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\n revert IdsMismatch(\n issuer,\n rangeIndex,\n expectedFirstId,\n expectedLastId,\n firstCollectionId,\n lastCollectionId\n );\n\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\n _authorizedRanges[issuer].length - 1\n ];\n _authorizedRanges[issuer].pop();\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryState.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Range} from '../utils/RangeLib.sol';\nimport {Attestation, AttestationData} from '../Structs.sol';\n\ncontract AttestationsRegistryState {\n // main config\n bool internal _initialized;\n bool internal _initializing;\n bool internal _paused;\n address internal _owner;\n // keeping some space for future\n uint256[15] private _placeHolders;\n\n // storing the authorized ranges for each attesters\n mapping(address => Range[]) internal _authorizedRanges;\n // keeping some space for future\n uint256[15] private _placeHolders2;\n // storing the data of attestations\n // =collectionId=> =owner=> attestationData\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\n}\n" - }, - "contracts/core/interfaces/IBadges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Interface for Badges contract\n * @author Sismo\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n */\ninterface IBadges {\n error BadgesNonTransferrable();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n function initialize(string memory uri, address owner) external;\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external;\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry) external;\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external;\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view returns (address);\n}\n" - }, - "contracts/core/libs/attestations-registry/OwnableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n // This is the only diff with OZ contract\n // address private _owner;\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/PausableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableLogic is Context, AttestationsRegistryState {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n // this is the only diff with OZ contract\n // bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), 'Pausable: paused');\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), 'Pausable: not paused');\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/InitializableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Address.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract InitializableLogic is AttestationsRegistryState {\n // only diff with oz\n // /**\n // * @dev Indicates that the contract has been initialized.\n // */\n // bool private _initialized;\n\n // /**\n // * @dev Indicates that the contract is in the process of being initialized.\n // */\n // bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(\n _initializing ? _isConstructor() : !_initialized,\n 'Initializable: contract is already initialized'\n );\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, 'Initializable: contract is not initializing');\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\n\ninterface IAttestationsRegistryConfigLogic {\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\n error AttesterNotFound(address issuer);\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\n error IdsMismatch(\n address issuer,\n uint256 rangeIndex,\n uint256 expectedFirstId,\n uint256 expectedLastId,\n uint256 FirstId,\n uint256 lastCollectionId\n );\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external;\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external;\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external;\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external;\n}\n" - }, - "contracts/core/libs/utils/RangeLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nstruct Range {\n uint256 min;\n uint256 max;\n}\n\n// Range [0;3] includees 0 and 3\nlibrary RangeUtils {\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\n for (uint256 i = 0; i < ranges.length; i++) {\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\n return true;\n }\n }\n return false;\n }\n}\n" - }, - "contracts/core/libs/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.14;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "contracts/core/libs/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, 'Address: insufficient balance');\n\n (bool success, ) = recipient.call{value: amount}('');\n require(success, 'Address: unable to send value, recipient may have reverted');\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, 'Address: low-level call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, 'Address: insufficient balance for call');\n require(isContract(target), 'Address: call to non-contract');\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data)\n internal\n view\n returns (bytes memory)\n {\n return functionStaticCall(target, data, 'Address: low-level static call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), 'Address: static call to non-contract');\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), 'Address: delegate call to non-contract');\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/core/Badges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Badges contract\n * @author Sismo\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n * For more information: https://badges.docs.sismo.io\n */\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\n IAttestationsRegistry internal _attestationsRegistry;\n\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\n\n /**\n * @dev Constructor\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n constructor(\n string memory uri,\n address owner // This is Sismo Frontend Contract\n ) ERC1155(uri) {\n initialize(uri, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n function initialize(string memory uri, address owner) public initializer {\n _setURI(uri);\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n }\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id)\n public\n view\n virtual\n override(ERC1155, IBadges)\n returns (uint256)\n {\n return _attestationsRegistry.getAttestationValue(id, account);\n }\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\n emit TransferSingle(operator, from, to, id, value);\n }\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry)\n external\n override\n onlyRole(DEFAULT_ADMIN_ROLE)\n {\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\n }\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _setURI(uri);\n }\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view override returns (address) {\n return address(_attestationsRegistry);\n }\n\n /**\n * @dev ERC165\n */\n function supportsInterface(bytes4 interfaceId)\n public\n view\n virtual\n override(AccessControl, ERC1155)\n returns (bool)\n {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n revert BadgesNonTransferrable();\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/ERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC1155.sol\";\nimport \"./IERC1155Receiver.sol\";\nimport \"./extensions/IERC1155MetadataURI.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of the basic standard multi-token.\n * See https://eips.ethereum.org/EIPS/eip-1155\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\n *\n * _Available since v3.1._\n */\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\n using Address for address;\n\n // Mapping from token ID to account balances\n mapping(uint256 => mapping(address => uint256)) private _balances;\n\n // Mapping from account to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n string private _uri;\n\n /**\n * @dev See {_setURI}.\n */\n constructor(string memory uri_) {\n _setURI(uri_);\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155).interfaceId ||\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC1155MetadataURI-uri}.\n *\n * This implementation returns the same URI for *all* token types. It relies\n * on the token type ID substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * Clients calling this function must replace the `\\{id\\}` substring with the\n * actual token type ID.\n */\n function uri(uint256) public view virtual override returns (string memory) {\n return _uri;\n }\n\n /**\n * @dev See {IERC1155-balanceOf}.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\n require(account != address(0), \"ERC1155: balance query for the zero address\");\n return _balances[id][account];\n }\n\n /**\n * @dev See {IERC1155-balanceOfBatch}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\n public\n view\n virtual\n override\n returns (uint256[] memory)\n {\n require(accounts.length == ids.length, \"ERC1155: accounts and ids length mismatch\");\n\n uint256[] memory batchBalances = new uint256[](accounts.length);\n\n for (uint256 i = 0; i < accounts.length; ++i) {\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\n }\n\n return batchBalances;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev See {IERC1155-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not owner nor approved\"\n );\n _safeTransferFrom(from, to, id, amount, data);\n }\n\n /**\n * @dev See {IERC1155-safeBatchTransferFrom}.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: transfer caller is not owner nor approved\"\n );\n _safeBatchTransferFrom(from, to, ids, amounts, data);\n }\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n\n emit TransferSingle(operator, from, to, id, amount);\n\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; ++i) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n }\n\n emit TransferBatch(operator, from, to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\n }\n\n /**\n * @dev Sets a new URI for all token types, by relying on the token type ID\n * substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * By this mechanism, any occurrence of the `\\{id\\}` substring in either the\n * URI or any of the amounts in the JSON file at said URI will be replaced by\n * clients with the token type ID.\n *\n * For example, the `https://token-cdn-domain/\\{id\\}.json` URI would be\n * interpreted by clients as\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\n * for token type ID 0x4cce0.\n *\n * See {uri}.\n *\n * Because these URIs cannot be meaningfully represented by the {URI} event,\n * this function emits no events.\n */\n function _setURI(string memory newuri) internal virtual {\n _uri = newuri;\n }\n\n /**\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _mint(\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);\n\n _balances[id][to] += amount;\n emit TransferSingle(operator, address(0), to, id, amount);\n\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _mintBatch(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; i++) {\n _balances[ids[i]][to] += amounts[i];\n }\n\n emit TransferBatch(operator, address(0), to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\n }\n\n /**\n * @dev Destroys `amount` tokens of token type `id` from `from`\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `from` must have at least `amount` tokens of token type `id`.\n */\n function _burn(\n address from,\n uint256 id,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), \"\");\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n\n emit TransferSingle(operator, from, address(0), id, amount);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n */\n function _burnBatch(\n address from,\n uint256[] memory ids,\n uint256[] memory amounts\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n for (uint256 i = 0; i < ids.length; i++) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n }\n\n emit TransferBatch(operator, from, address(0), ids, amounts);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits a {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC1155: setting approval status for self\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `id` and `amount` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n function _doSafeTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\n if (response != IERC1155Receiver.onERC1155Received.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\n bytes4 response\n ) {\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\n uint256[] memory array = new uint256[](1);\n array[0] = element;\n\n return array;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1155.sol\";\nimport \"../../../security/Pausable.sol\";\n\n/**\n * @dev ERC1155 token with pausable token transfers, minting and burning.\n *\n * Useful for scenarios such as preventing trades until the end of an evaluation\n * period, or having an emergency switch for freezing all token transfers in the\n * event of a large bug.\n *\n * _Available since v3.1._\n */\nabstract contract ERC1155Pausable is ERC1155, Pausable {\n /**\n * @dev See {ERC1155-_beforeTokenTransfer}.\n *\n * Requirements:\n *\n * - the contract must not be paused.\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n require(!paused(), \"ERC1155Pausable: token transfer while paused\");\n }\n}\n" - }, - "@openzeppelin/contracts/access/AccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role, _msgSender());\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(uint160(account), 20),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155MetadataURI is IERC1155 {\n /**\n * @dev Returns the URI for token type `id`.\n *\n * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n * clients with the actual token type ID.\n */\n function uri(uint256 id) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/ERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/security/Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), \"Pausable: paused\");\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), \"Pausable: not paused\");\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "@openzeppelin/contracts/access/IAccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" - }, - "@openzeppelin/contracts/utils/Strings.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n // Inspired by OraclizeAPI's implementation - MIT licence\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0x00\";\n }\n uint256 temp = value;\n uint256 length = 0;\n while (temp != 0) {\n length++;\n temp >>= 8;\n }\n return toHexString(value, length);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n}\n" - }, - "contracts/periphery/badges-examples/BAYCOwnershipBadgeExample.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC721} from '@openzeppelin/contracts/token/ERC721/ERC721.sol';\nimport {IAttestationsRegistry} from '../../core/interfaces/IAttestationsRegistry.sol';\n\ncontract BAYCOwnershipBadge is ERC721 {\n IAttestationsRegistry immutable ATTESTATIONS_REGISTRY;\n uint256 constant HydraS1_BAYC_ATTESTATION_COLLECTION_ID = 100000001;\n uint256 constant SMPS_BAYC_ATTESTATION_COLLECTION_ID = 30000000000003;\n\n constructor(\n address attestationsRegistryAddress,\n string memory name,\n string memory symbol\n ) ERC721(name, symbol) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n function balanceOf(address account) public view virtual override returns (uint256) {\n bool hasZKAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n HydraS1_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n bool hasDoxingAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n SMPS_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n return hasZKAttestation || hasDoxingAttestation ? 1 : 0;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/ERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"./extensions/IERC721Metadata.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/Strings.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: balance query for the zero address\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _owners[tokenId];\n require(owner != address(0), \"ERC721: owner query for nonexistent token\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n require(_exists(tokenId), \"ERC721Metadata: URI query for nonexistent token\");\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overriden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not owner nor approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n require(_exists(tokenId), \"ERC721: approved query for nonexistent token\");\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: transfer caller is not owner nor approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: transfer caller is not owner nor approved\");\n _safeTransfer(from, to, tokenId, _data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `_data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, _data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _owners[tokenId] != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n require(_exists(tokenId), \"ERC721: operator query for nonexistent token\");\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, _data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId);\n\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId);\n\n // Clear approvals\n _approve(address(0), tokenId);\n\n _balances[owner] -= 1;\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId);\n\n // Clear approvals from the previous owner\n _approve(address(0), tokenId);\n\n _balances[from] -= 1;\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits a {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits a {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param _data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, ``from``'s `tokenId` will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" - }, - "@openzeppelin/contracts/utils/StorageSlot.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" - }, - "contracts/periphery/utils/TransparentUpgradeableProxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n// Note: we just copied so that we can see the contract used\npragma solidity ^0.8.14;\n\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(''), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n ifAdmin\n {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(\n msg.sender != _getAdmin(),\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\n );\n super._beforeFallback();\n }\n}\n" - }, - "contracts/attesters/pythia-1/base/Pythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IPythia1Base} from './IPythia1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Pythia 1 ZK Proving Scheme\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\n\n/**\n * @title Pythia-1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \n * without anyone being able to make the link between the offchain service and the onchain service.\n * It is inherited by the family of Pythia-1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n \n \n **/\nabstract contract Pythia1Base is IPythia1Base, Initializable {\n using Pythia1Lib for Pythia1ProofData;\n\n // ZK-SNARK Verifier\n Pythia1Verifier immutable VERIFIER;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\n */\n constructor(address Pythia1VerifierAddress) {\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\n }\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of the Commitment signer Eddsa Public key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\n return _getCommitmentSignerPubKey();\n }\n\n /*******************************************************\n Pythia-1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * the secretHash is a number only known by the user and is used in \n * the zero knowledge as a private input which guarantees privacy\n\n * This function MUST be implemented by Pythia-1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Pythia-1 Simple Attester for an example\n * @param claim user claim: a particular claim that a user have that he can prove s right.\n */\n function _getTicketIdentifierOfClaim(Pythia1Claim memory claim)\n internal\n view\n virtual\n returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\n * prove the claim was correctly issued for the user.\n */\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(Pythia1Claim memory claim, Pythia1ProofInput memory input)\n internal\n view\n virtual\n {\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (claim.destination != msg.sender)\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\n if (\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\n )\n revert CommitmentSignerPubKeyMismatch(\n commitmentSignerPubKey[0],\n commitmentSignerPubKey[1],\n input.commitmentSignerPubKey[0],\n input.commitmentSignerPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the plonk mathematical proof using the circom verifier contract\n * @param proofData snark public input\n */\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(\n uint256 /*errorCode*/\n ) {\n revert InvalidGroth16Proof('');\n } catch (\n bytes memory /*lowLevelData*/\n ) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/pythia-1/base/IPythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\n\ninterface IPythia1Base {\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error UserShouldOwnItsDestination(address sender, address inputdestination);\n error CommitmentSignerPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier);\n\n /**\n * @dev Getter of the Commitment Signer EdDSA Public Key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\n}\n" - }, - "contracts/attesters/pythia-1/libs/Pythia1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\n\n// user Pythia-1 claim retrieved form his request\nstruct Pythia1Claim {\n uint256 groupId; // user claims be part of this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct Pythia1GroupProperties {\n uint128 internalCollectionId;\n bool isScore;\n}\n\nstruct Pythia1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct Pythia1ProofData {\n Pythia1CircomSnarkProof proof;\n uint256[9] input;\n // destination;\n // chainId;\n // commitmentSignerPubKey.x;\n // commitmentSignerPubKey.y;\n // groupId;\n // ticketIdentifier;\n // userTicket;\n // value;\n // isStrict;\n}\n\nstruct Pythia1ProofInput {\n address destination;\n uint256 chainId;\n uint256 groupId;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n bool isStrict;\n uint256[2] commitmentSignerPubKey;\n}\n\nlibrary Pythia1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\n return\n Pythia1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getGroupId(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n Pythia1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (Pythia1GroupProperties)\n );\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(Pythia1ProofData memory self)\n internal\n pure\n returns (\n uint256[2] memory,\n uint256[2][2] memory,\n uint256[2] memory,\n uint256[9] memory\n )\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(Pythia1ProofData memory self)\n internal\n pure\n returns (uint256[2] memory)\n {\n return [self.input[2], self.input[3]];\n }\n\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(Pythia1ProofData memory self)\n internal\n pure\n returns (uint256)\n {\n return self.input[5];\n }\n\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\n return self.input[8] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(uint128 internalCollectionId, bool isScore)\n internal\n pure\n returns (uint256)\n {\n return\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(uint128 internalCollectionId, bool isScore)\n internal\n pure\n returns (bytes memory)\n {\n return abi.encode(internalCollectionId, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "@sismo-core/pythia-1/contracts/Pythia1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract Pythia1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\n );\n vk.IC = new Pairing.G1Point[](10);\n \n vk.IC[0] = Pairing.G1Point( \n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 104028078850975554065172701281783302003220555203883119831575537681421753151,\n 19148240629904598794948591359118971959790791697910953160820265703277306346\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[9] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to Pythia1 Proving Scheme\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\n\n/**\n * @title Pythia-1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Pythia-1 Attesters.\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \n * offchain service in a privacy preserving way. \n * That means no-one can make the link between the account used in the offchain service\n * and the onchain account where the attestation is stored.\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each users gets one userTicket per claim\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n **/\n\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\n using Pythia1Lib for Pythia1ProofData;\n using Pythia1Lib for bytes;\n using Pythia1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n uint256[2] internal _commitmentSignerPubKey;\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\n * @param owner The owner of the contract that can update the commitment signer pub key\n */\n constructor(\n address attestationsRegistryAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address pythia1VerifierAddress,\n uint256[2] memory commitmentSignerPubKey,\n address owner\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n initialize(commitmentSignerPubKey, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) public initializer {\n _transferOwnership(owner);\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into Pythia1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\n Pythia1ProofInput memory snarkInput = snarkProof._input();\n Pythia1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(Request calldata request, bytes calldata)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n Pythia1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.internalCollectionId;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n uint32(block.timestamp),\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used\n * @param request users request. Claim of beiing part of a group.\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0)) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * users bring secretHash as private input in snark which guarantees privacy\n * the secretHash is only known by the user and never escape the user's browser\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(Pythia1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.internalCollectionId\n );\n return ticketIdentifier;\n }\n\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\n return _commitmentSignerPubKey;\n }\n\n /*******************************************************\n Pythia-1 Attester Specific Functions\n *******************************************************/\n\n function updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey)\n external\n onlyOwner\n {\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\n _commitmentSignerPubKey = commitmentSignerPubKey;\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\n }\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\n\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\n error TicketUsed(uint256 userTicket);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n// todo: explain well what is specific to this attester\ninterface IHydraS1SimpleAttester is IHydraS1Base, IAttester {\n error TicketUsed(uint256 userTicket);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - Renewable\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew their attestations\n **/\n\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base, Attester {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(Request calldata request, bytes calldata)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n HydraS1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used and not a renewal (e.g destination different that last)\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0) && currentDestination != request.destination) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\n return ticketIdentifier;\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/core/AttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\nimport {Attestation, AttestationData} from './libs/Structs.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Attestations Registry\n * @author Sismo\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\n * Only authorized attestations issuers can record attestation in the registry\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\n * For more information: https://attestations-registry.docs.sismo.io\n\n * For each attestation recorded, a badge is received by the user\n * The badge is the Non transferrable NFT representation of an attestation \n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\n * It enables off-chain apps such as opensea to catch the \"shadow mint\" of the badge\n **/\ncontract AttestationsRegistry is\n AttestationsRegistryState,\n IAttestationsRegistry,\n AttestationsRegistryConfigLogic\n{\n IBadges immutable BADGES;\n\n /**\n * @dev Constructor.\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @param badgesAddress Stateless ERC1155 Badges contract\n */\n constructor(address owner, address badgesAddress) {\n initialize(owner);\n BADGES = IBadges(badgesAddress);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n */\n function initialize(address owner) public initializer {\n _transferOwnership(owner);\n }\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\n address issuer = _msgSender();\n for (uint256 i = 0; i < attestations.length; i++) {\n if (!_isAuthorized(issuer, attestations[i].collectionId))\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\n\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\n attestations[i].owner\n ].value;\n\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\n attestations[i].issuer,\n attestations[i].value,\n attestations[i].timestamp,\n attestations[i].extraData\n );\n\n _triggerBadgeTransferEvent(\n attestations[i].collectionId,\n attestations[i].owner,\n previousAttestationValue,\n attestations[i].value\n );\n emit AttestationRecorded(attestations[i]);\n }\n }\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param attestations Attestations to be deleted\n */\n function deleteAttestations(Attestation[] memory attestations) external override whenNotPaused {\n address issuer = _msgSender();\n for (uint256 i = 0; i < attestations.length; i++) {\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\n attestations[i].owner\n ].value;\n\n if (!_isAuthorized(issuer, attestations[i].collectionId))\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\n delete _attestationsData[attestations[i].collectionId][attestations[i].owner];\n\n _triggerBadgeTransferEvent(\n attestations[i].collectionId,\n attestations[i].owner,\n previousAttestationValue,\n 0\n );\n\n emit AttestationDeleted(\n Attestation(\n attestations[i].collectionId,\n attestations[i].owner,\n attestations[i].issuer,\n attestations[i].value,\n attestations[i].timestamp,\n attestations[i].extraData\n )\n );\n }\n }\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner)\n external\n view\n override\n returns (bool)\n {\n return _getAttestationValue(collectionId, owner) != 0;\n }\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(uint256 collectionId, address owner)\n external\n view\n override\n returns (AttestationData memory)\n {\n return _getAttestationData(collectionId, owner);\n }\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner)\n external\n view\n override\n returns (uint256)\n {\n return _getAttestationValue(collectionId, owner);\n }\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(uint256 collectionId, address owner)\n external\n view\n override\n returns (\n address,\n uint256,\n uint32,\n bytes memory\n )\n {\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\n return (\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n );\n }\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(uint256 collectionId, address owner)\n external\n view\n override\n returns (bytes memory)\n {\n return _attestationsData[collectionId][owner].extraData;\n }\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(uint256 collectionId, address owner)\n external\n view\n override\n returns (address)\n {\n return _attestationsData[collectionId][owner].issuer;\n }\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(uint256 collectionId, address owner)\n external\n view\n override\n returns (uint32)\n {\n return _attestationsData[collectionId][owner].timestamp;\n }\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n override\n returns (AttestationData[] memory)\n {\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\n }\n return attestationsDataArray;\n }\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n override\n returns (uint256[] memory)\n {\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\n }\n return attestationsValues;\n }\n\n /**\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\n * It enables off-chain apps such as opensea to catch the \"shadow mints/burns\" of badges\n */\n function _triggerBadgeTransferEvent(\n uint256 badgeTokenId,\n address owner,\n uint256 previousValue,\n uint256 newValue\n ) internal {\n bool isGreaterValue = newValue > previousValue;\n address operator = address(this);\n address from = isGreaterValue ? address(0) : owner;\n address to = isGreaterValue ? owner : address(0);\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\n\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\n }\n\n function _getAttestationData(uint256 collectionId, address owner)\n internal\n view\n returns (AttestationData memory)\n {\n return (_attestationsData[collectionId][owner]);\n }\n\n function _getAttestationValue(uint256 collectionId, address owner)\n internal\n view\n returns (uint256)\n {\n return _attestationsData[collectionId][owner].value;\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/goerli/solcInputs/7e84cd39af8dda1388150d22fc6a7983.json b/deployments/goerli/solcInputs/7e84cd39af8dda1388150d22fc6a7983.json deleted file mode 100644 index 811c07d..0000000 --- a/deployments/goerli/solcInputs/7e84cd39af8dda1388150d22fc6a7983.json +++ /dev/null @@ -1,230 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/attesters/hydra-s1/base/HydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1Base} from './IHydraS1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Hydra S1 ZK Proving Scheme\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n \n \n **/\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\n using HydraS1Lib for HydraS1ProofData;\n\n // ZK-SNARK Verifier\n HydraS1Verifier immutable VERIFIER;\n // Registry storing the Commitment Mapper EdDSA Public key\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\n * @param commitmentMapperAddress Commitment mapper's public key registry\n */\n constructor(\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress\n ) {\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\n }\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\n return COMMITMENT_MAPPER_REGISTRY;\n }\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\n return AVAILABLE_ROOTS_REGISTRY;\n }\n\n /*******************************************************\n Hydra-S1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input which guarantees privacy\n\n * This function MUST be implemented by Hydra-S1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Hydra-S1 Simple Attester for an example\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\n */\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n virtual\n returns (uint256);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\n internal\n view\n virtual\n {\n if (input.accountsTreeValue != claim.groupId)\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\n revert RegistryRootMismatch(input.registryRoot);\n\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\n if (\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\n )\n revert CommitmentMapperPubKeyMismatch(\n commitmentMapperPubKey[0],\n commitmentMapperPubKey[1],\n input.commitmentMapperPubKey[0],\n input.commitmentMapperPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the groth16 mathematical proof\n * @param proofData snark public input\n */\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(\n uint256 /*errorCode*/\n ) {\n revert InvalidGroth16Proof('');\n } catch (\n bytes memory /*lowLevelData*/\n ) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/IHydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n// todo: explain well what is specific to this attester\ninterface IHydraS1Base {\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\n error RegistryRootMismatch(uint256 inputRoot);\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error CommitmentMapperPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error AccountsTreeValueMismatch(\n uint256 expectedAccountsTreeValue,\n uint256 inputAccountsTreeValue\n );\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier);\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\n}\n" - }, - "@openzeppelin/contracts/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" - }, - "contracts/core/libs/Structs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Attestations Registry State\n * @author Sismo\n * @notice This contract holds all of the storage variables and data\n * structures used by the AttestationsRegistry and parent\n * contracts.\n */\n\n// User Attestation Request, can be made by any user\n// The context of an Attestation Request is a specific attester contract\n// Each attester has groups of accounts in its available data\n// eg: for a specific attester:\n// group 1 <=> accounts that sent txs on mainnet\n// group 2 <=> accounts that sent txs on polygon\n// eg: for another attester:\n// group 1 <=> accounts that sent eth txs in 2022\n// group 2 <=> accounts sent eth txs in 2021\nstruct Request {\n // implicit address attester;\n // implicit uint256 chainId;\n Claim[] claims;\n address destination; // destination that will receive the end attestation\n}\n\nstruct Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\n}\n\n/**\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\n * @param collectionId Attestation collection\n * @param owner Attestation collection\n * @param issuer Attestation collection\n * @param value Attestation collection\n * @param timestamp Attestation collection\n * @param extraData Attestation collection\n */\nstruct Attestation {\n // implicit uint256 chainId;\n uint256 collectionId; // Id of the attestation collection (in the registry)\n address owner; // Owner of the attestation\n address issuer; // Contract that created or last updated the record.\n uint256 value; // Value of the attestation\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\n // it is different from the recording timestamp (date when the attestation was recorded)\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\n bytes extraData; // arbitrary data that can be added by the attester\n}\n\n// Attestation Data, stored in the registry\n// The context is a specific owner of a specific collection\nstruct AttestationData {\n // implicit uint256 chainId\n // implicit uint256 collectionId - from context\n // implicit owner\n address issuer; // Address of the contract that recorded the attestation\n uint256 value; // Value of the attestation\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\n bytes extraData; // arbitrary data that can be added by the attester\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1GroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n bool isScore;\n}\n\nstruct HydraS1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct HydraS1ProofData {\n HydraS1CircomSnarkProof proof;\n uint256[10] input;\n // destination\n // chainId\n // commitmentMapperPubKey.x\n // commitmentMapperPubKey.y\n // registryTreeRoot\n // ticketIdentifier\n // ticket\n // claimedValue\n // accountsTreeValue\n // isStrict\n}\n\nstruct HydraS1ProofInput {\n address destination;\n uint256 chainId;\n uint256 registryRoot;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n uint256 accountsTreeValue;\n bool isStrict;\n uint256[2] commitmentMapperPubKey;\n}\n\nlibrary HydraS1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\n return\n HydraS1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getRegistryRoot(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getAccountsTreeValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1GroupProperties)\n );\n\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(HydraS1ProofData memory self)\n internal\n pure\n returns (\n uint256[2] memory,\n uint256[2][2] memory,\n uint256[2] memory,\n uint256[10] memory\n )\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\n internal\n pure\n returns (uint256[2] memory)\n {\n return [self.input[2], self.input[3]];\n }\n\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\n internal\n pure\n returns (uint256)\n {\n return self.input[5];\n }\n\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[8];\n }\n\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\n return self.input[9] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\n );\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(groupIndex, generationTimestamp, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/periphery/utils/CommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\n\n/**\n * @title Commitment Mapper Registry Contract\n * @author Sismo\n * @notice This contract stores information about the commitment mapper.\n * Its ethereum address and its EdDSA public key\n * For more information: https://commitment-mapper.docs.sismo.io\n *\n **/\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\n uint256[2] internal _commitmentMapperPubKey;\n address _commitmentMapperAddress;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n constructor(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) {\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) public initializer {\n _transferOwnership(owner);\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\n _updateCommitmentMapperAddress(commitmentMapperAddress);\n }\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\n }\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\n _updateCommitmentMapperAddress(newAddress);\n }\n\n /**\n * @dev Getter of the EdDSA public key of the commitment mapper\n */\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\n return _commitmentMapperPubKey;\n }\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view override returns (address) {\n return _commitmentMapperAddress;\n }\n\n function _updateCommitmentMapperAddress(address newAddress) internal {\n _commitmentMapperAddress = newAddress;\n emit UpdatedCommitmentMapperAddress(newAddress);\n }\n\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\n _commitmentMapperPubKey = pubKey;\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\n }\n}\n" - }, - "contracts/periphery/utils/AvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n/**\n * @title Attesters Groups Registry\n * @author Sismo\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\n * For more information: https://available-roots-registry.docs.sismo.io\n *\n **/\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\n mapping(address => mapping(uint256 => bool)) public _roots;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can register/ unregister roots\n */\n constructor(address owner) {\n initialize(owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) public initializer {\n _transferOwnership(owner);\n }\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\n _registerRootForAttester(attester, root);\n }\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\n _unregisterRootForAttester(attester, root);\n }\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external onlyOwner {\n _registerRootForAttester(address(0), root);\n }\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external onlyOwner {\n _unregisterRootForAttester(address(0), root);\n }\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\n return _roots[_msgSender()][root] || _roots[address(0)][root];\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\n return _roots[attester][root] || _roots[address(0)][root];\n }\n\n function _registerRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = true;\n if (attester == address(0)) {\n emit RegisteredRootForAll(root);\n } else {\n emit RegisteredRootForAttester(attester, root);\n }\n }\n\n function _unregisterRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = false;\n if (attester == address(0)) {\n emit UnregisteredRootForAll(root);\n } else {\n emit UnregisteredRootForAttester(attester, root);\n }\n }\n}\n" - }, - "@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract HydraS1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\n );\n vk.IC = new Pairing.G1Point[](11);\n \n vk.IC[0] = Pairing.G1Point( \n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\n 546002182798634190282541153661423157791776194062719045593389981526666716416\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\n 181057165072599074288983745076121344893296348827576905983079816835912241514\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\n ); \n \n vk.IC[10] = Pairing.G1Point( \n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[10] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "@openzeppelin/contracts/access/Ownable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\ninterface ICommitmentMapperRegistry {\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\n event UpdatedCommitmentMapperAddress(address newAddress);\n error PubKeyNotValid(uint256[2] pubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) external;\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external;\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getEdDSAPubKey() external view returns (uint256[2] memory);\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\n/**\n * @title IAvailableRootsRegistry\n * @author Sismo\n * @notice Interface for (Merkle) Roots Registry\n */\ninterface IAvailableRootsRegistry {\n event RegisteredRootForAttester(address attester, uint256 root);\n event RegisteredRootForAll(uint256 root);\n event UnregisteredRootForAttester(address attester, uint256 root);\n event UnregisteredRootForAll(uint256 root);\n\n error CannotRegisterForZeroAddress();\n error CannotUnregisterForZeroAddress();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) external;\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external;\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external;\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\n}\n" - }, - "contracts/attesters/hydra-s1/variants/HydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1AccountboundAttester} from '../interfaces/IHydraS1AccountboundAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from '../../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from '../base/HydraS1Base.sol';\nimport {HydraS1AccountboundLib, HydraS1AccountboundClaim} from '../libs/HydraS1AccountboundLib.sol';\n\n/**\n * @title Hydra-S1 Accountbound Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - Accountbound (with cooldown period)\n * A user can chose to delete attestations or generate attestation to a new destination.\n * When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional\n * User will need to wait until the end of the cooldown period before being able to delete or switch destination again\n * One can however know that the former and the new destinations were created using the same userTicket\n \n * - Renewable\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew or update their attestations\n **/\ncontract HydraS1AccountboundAttester is IHydraS1AccountboundAttester, HydraS1Base, Attester {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1AccountboundLib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n mapping(uint256 => TicketData) internal _userTicketsData;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user attestations request is invalid\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark proof backing the claim\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._hydraS1claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns the actual attestations constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark public input as well as snark proof\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n HydraS1AccountboundClaim memory claim = request._hydraS1Accountboundclaim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n // The issuer of attestations is the attester\n address issuer = address(this);\n // user sends the ticket as input in the data\n uint256 userTicket = proofData._getTicket();\n TicketData memory userTicketData = _userTicketsData[userTicket];\n\n uint16 burnCount = userTicketData.burnCount;\n // If the attestation is minted on a new destination address\n // the burnCount encoded in the extraData of the Attestation should be incremented\n if (\n userTicketData.destination != address(0) && userTicketData.destination != request.destination\n ) {\n burnCount+=1;\n }\n\n attestations[0] = Attestation(\n attestationCollectionId,\n request.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n abi.encode(userTicket, burnCount)\n );\n\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used, not a renewal, and ticket on cooldown.\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n uint256 userTicket = proofData._getTicket();\n TicketData memory userTicketData = _userTicketsData[userTicket];\n\n if (\n userTicketData.destination != address(0) && userTicketData.destination != request.destination\n ) {\n HydraS1AccountboundClaim memory claim = request._hydraS1Accountboundclaim();\n if (_isOnCooldown(userTicketData, claim.groupProperties.cooldownDuration)) \n revert TicketOnCooldown(userTicketData, claim.groupProperties.cooldownDuration);\n\n // Delete the old Attestation on the account before recording the new one\n address[] memory attestationOwners = new address[](1);\n uint256[] memory attestationCollectionIds = new uint256[](1);\n\n attestationOwners[0] = userTicketData.destination;\n attestationCollectionIds[0] =\n AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n\n emit AttestationDeleted(\n Attestation(\n AUTHORIZED_COLLECTION_ID_FIRST + claim.groupProperties.groupIndex,\n userTicketData.destination,\n address(this),\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n abi.encode(userTicket, userTicketData.burnCount)\n )\n );\n _setTicketOnCooldown(userTicket);\n }\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\n return ticketIdentifier;\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n /**\n * @dev Getter, returns the data linked to a ticket\n * @param userTicket ticket used\n **/\n function getTicketData(uint256 userTicket) external view override returns (TicketData memory) {\n return _getTicketData(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _userTicketsData[userTicket].destination = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _setTicketOnCooldown(uint256 userTicket) internal {\n _userTicketsData[userTicket].cooldownStart = uint32(block.timestamp);\n _userTicketsData[userTicket].burnCount += 1;\n emit TicketSetOnCooldown(\n userTicket,\n _userTicketsData[userTicket].burnCount\n );\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _userTicketsData[userTicket].destination;\n }\n\n function _isOnCooldown(TicketData memory userTicketData, uint32 cooldownDuration) internal view returns (bool) {\n return userTicketData.cooldownStart + cooldownDuration > block.timestamp;\n }\n\n function _getTicketData(uint256 userTicket) internal view returns (TicketData memory) {\n return _userTicketsData[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n// todo: explain well what is specific to this attester\ninterface IHydraS1AccountboundAttester is IHydraS1Base, IAttester {\n struct TicketData {\n address destination;\n uint32 cooldownStart;\n uint16 burnCount;\n }\n error TicketOnCooldown(TicketData ticketData, uint32 cooldownDuration);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n event TicketSetOnCooldown(uint256 ticket, uint16 burnCount);\n\n /**\n * @dev Getter, returns the data linked to a ticket\n * @param userTicket ticket used\n **/\n function getTicketData(uint256 userTicket) external view returns (TicketData memory);\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/core/Attester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\n\n/**\n * @title Attester Abstract Contract\n * @author Sismo\n * @notice Contract to be inherited by Attesters\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\n * are recommended to implemented this abstract contract\n\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\n *\n * This contracts is built around two main external standard functions.\n * They must NOT be override them, unless your really know what you are doing\n \n * - generateAttestations(request, proof) => will write attestations in the registry\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\n\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\n\n * For more information: https://attesters.docs.sismo.io\n **/\nabstract contract Attester is IAttester {\n // Registry where all attestations are stored\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(Request calldata request, bytes calldata proofData)\n external\n override\n returns (Attestation[] memory)\n {\n // Verify if request is valid by verifying against proof\n _verifyRequest(request, proofData);\n\n // Generate the actual attestations from user request\n Attestation[] memory attestations = buildAttestations(request, proofData);\n\n _beforeRecordAttestations(request, proofData);\n\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n\n _afterRecordAttestations(attestations);\n\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationGenerated(attestations[i]);\n }\n\n return attestations;\n }\n\n /**\n * @dev External facing function. Allows to delete attestations by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that were deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n address[] memory attestationOwners = new address[](collectionIds.length);\n\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\n\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n // fetch attestations from the registry\n (\n address issuer,\n uint256 attestationValue,\n uint32 timestamp,\n bytes memory extraData\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\n\n attestationOwners[i] = attestationsOwner;\n attestationCollectionIds[i] = collectionIds[i];\n\n attestations[i] = (\n Attestation(\n collectionIds[i],\n attestationsOwner,\n issuer,\n attestationValue,\n timestamp,\n extraData\n )\n );\n }\n\n _verifyAttestationsDeletionRequest(attestations, proofData);\n\n _beforeDeleteAttestations(attestations, proofData);\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n\n _afterDeleteAttestations(attestations, proofData);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n emit AttestationDeleted(attestations[i]);\n }\n return attestations;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n public\n view\n virtual\n returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry getter\n * @return attestationRegistry\n */\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\n return ATTESTATIONS_REGISTRY;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should verify the user request is valid\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\n\n /**\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\n * Default behavior: throws\n * It should verify attestations deletion request is valid\n * @param attestations Attestations that will be deleted\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyAttestationsDeletionRequest(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {\n revert AttestationDeletionNotImplemented();\n }\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before recording attestations in the registry\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n {}\n\n /**\n * @dev (Optional) Can be overridden in attesters inheriting this contract\n * Will be called after recording an attestation\n * @param attestations Recorded attestations\n */\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n virtual\n {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called after deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n virtual\n {}\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1AccountboundLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Lib, HydraS1Claim, HydraS1GroupProperties} from './HydraS1Lib.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1AccountboundClaim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1AccountboundGroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1AccountboundGroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n uint32 cooldownDuration;\n bool isScore;\n}\n\nlibrary HydraS1AccountboundLib {\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _hydraS1claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n HydraS1GroupProperties memory hydraS1GroupProperties = HydraS1GroupProperties(\n groupProperties.groupIndex,\n groupProperties.generationTimestamp,\n groupProperties.isScore\n );\n\n return (\n HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, hydraS1GroupProperties)\n );\n }\n\n function _hydraS1Accountboundclaim(Request memory self)\n internal\n pure\n returns (HydraS1AccountboundClaim memory)\n {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory hydraS1AccountboundGroupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n return (\n HydraS1AccountboundClaim(\n claim.groupId,\n claim.claimedValue,\n self.destination,\n hydraS1AccountboundGroupProperties\n )\n );\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/core/interfaces/IAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\n\n/**\n * @title IAttester\n * @author Sismo\n * @notice This is the interface for the attesters in Sismo Protocol\n */\ninterface IAttester {\n event AttestationGenerated(Attestation attestation);\n\n event AttestationDeleted(Attestation attestation);\n\n error AttestationDeletionNotImplemented();\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(Request calldata request, bytes calldata proofData)\n external\n returns (Attestation[] memory);\n\n /**\n * @dev External facing function. Allows to delete an attestation by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that was deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n external\n view\n returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry address getter\n * @return attestationRegistry Address of the registry\n */\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\n\n/**\n * @title IAttestationsRegistry\n * @author Sismo\n * @notice This is the interface of the AttestationRegistry\n */\ninterface IAttestationsRegistry {\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\n event AttestationRecorded(Attestation attestation);\n event AttestationDeleted(Attestation attestation);\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external;\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(uint256 collectionId, address owner)\n external\n view\n returns (AttestationData memory);\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(uint256 collectionId, address owner)\n external\n view\n returns (\n address,\n uint256,\n uint32,\n bytes memory\n );\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(uint256 collectionId, address owner)\n external\n view\n returns (bytes memory);\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(uint256 collectionId, address owner)\n external\n view\n returns (address);\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(uint256 collectionId, address owner)\n external\n view\n returns (uint32);\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n returns (AttestationData[] memory);\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n returns (uint256[] memory);\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n// todo: explain well what is specific to this attester\ninterface IHydraS1SimpleAttester is IHydraS1Base, IAttester {\n error TicketUsed(uint256 userTicket);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/core/Badges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Badges contract\n * @author Sismo\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n * For more information: https://badges.docs.sismo.io\n */\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\n IAttestationsRegistry internal _attestationsRegistry;\n\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\n\n /**\n * @dev Constructor\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n constructor(\n string memory uri,\n address owner // This is Sismo Frontend Contract\n ) ERC1155(uri) {\n initialize(uri, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n function initialize(string memory uri, address owner) public initializer {\n _setURI(uri);\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n }\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id)\n public\n view\n virtual\n override(ERC1155, IBadges)\n returns (uint256)\n {\n return _attestationsRegistry.getAttestationValue(id, account);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function isApprovedForAll(address account, address operator)\n public\n view\n virtual\n override\n returns (bool)\n {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\n emit TransferSingle(operator, from, to, id, value);\n }\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry)\n external\n override\n onlyRole(DEFAULT_ADMIN_ROLE)\n {\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\n }\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _setURI(uri);\n }\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view override returns (address) {\n return address(_attestationsRegistry);\n }\n\n /**\n * @dev ERC165\n */\n function supportsInterface(bytes4 interfaceId)\n public\n view\n virtual\n override(AccessControl, ERC1155)\n returns (bool)\n {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n revert BadgesNonTransferrable();\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/ERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC1155.sol\";\nimport \"./IERC1155Receiver.sol\";\nimport \"./extensions/IERC1155MetadataURI.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of the basic standard multi-token.\n * See https://eips.ethereum.org/EIPS/eip-1155\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\n *\n * _Available since v3.1._\n */\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\n using Address for address;\n\n // Mapping from token ID to account balances\n mapping(uint256 => mapping(address => uint256)) private _balances;\n\n // Mapping from account to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n string private _uri;\n\n /**\n * @dev See {_setURI}.\n */\n constructor(string memory uri_) {\n _setURI(uri_);\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155).interfaceId ||\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC1155MetadataURI-uri}.\n *\n * This implementation returns the same URI for *all* token types. It relies\n * on the token type ID substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * Clients calling this function must replace the `\\{id\\}` substring with the\n * actual token type ID.\n */\n function uri(uint256) public view virtual override returns (string memory) {\n return _uri;\n }\n\n /**\n * @dev See {IERC1155-balanceOf}.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\n require(account != address(0), \"ERC1155: balance query for the zero address\");\n return _balances[id][account];\n }\n\n /**\n * @dev See {IERC1155-balanceOfBatch}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\n public\n view\n virtual\n override\n returns (uint256[] memory)\n {\n require(accounts.length == ids.length, \"ERC1155: accounts and ids length mismatch\");\n\n uint256[] memory batchBalances = new uint256[](accounts.length);\n\n for (uint256 i = 0; i < accounts.length; ++i) {\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\n }\n\n return batchBalances;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev See {IERC1155-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not owner nor approved\"\n );\n _safeTransferFrom(from, to, id, amount, data);\n }\n\n /**\n * @dev See {IERC1155-safeBatchTransferFrom}.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: transfer caller is not owner nor approved\"\n );\n _safeBatchTransferFrom(from, to, ids, amounts, data);\n }\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n\n emit TransferSingle(operator, from, to, id, amount);\n\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; ++i) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n }\n\n emit TransferBatch(operator, from, to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\n }\n\n /**\n * @dev Sets a new URI for all token types, by relying on the token type ID\n * substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * By this mechanism, any occurrence of the `\\{id\\}` substring in either the\n * URI or any of the amounts in the JSON file at said URI will be replaced by\n * clients with the token type ID.\n *\n * For example, the `https://token-cdn-domain/\\{id\\}.json` URI would be\n * interpreted by clients as\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\n * for token type ID 0x4cce0.\n *\n * See {uri}.\n *\n * Because these URIs cannot be meaningfully represented by the {URI} event,\n * this function emits no events.\n */\n function _setURI(string memory newuri) internal virtual {\n _uri = newuri;\n }\n\n /**\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _mint(\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);\n\n _balances[id][to] += amount;\n emit TransferSingle(operator, address(0), to, id, amount);\n\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _mintBatch(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; i++) {\n _balances[ids[i]][to] += amounts[i];\n }\n\n emit TransferBatch(operator, address(0), to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\n }\n\n /**\n * @dev Destroys `amount` tokens of token type `id` from `from`\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `from` must have at least `amount` tokens of token type `id`.\n */\n function _burn(\n address from,\n uint256 id,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), \"\");\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n\n emit TransferSingle(operator, from, address(0), id, amount);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n */\n function _burnBatch(\n address from,\n uint256[] memory ids,\n uint256[] memory amounts\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n for (uint256 i = 0; i < ids.length; i++) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n }\n\n emit TransferBatch(operator, from, address(0), ids, amounts);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits a {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC1155: setting approval status for self\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `id` and `amount` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n function _doSafeTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\n if (response != IERC1155Receiver.onERC1155Received.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\n bytes4 response\n ) {\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\n uint256[] memory array = new uint256[](1);\n array[0] = element;\n\n return array;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1155.sol\";\nimport \"../../../security/Pausable.sol\";\n\n/**\n * @dev ERC1155 token with pausable token transfers, minting and burning.\n *\n * Useful for scenarios such as preventing trades until the end of an evaluation\n * period, or having an emergency switch for freezing all token transfers in the\n * event of a large bug.\n *\n * _Available since v3.1._\n */\nabstract contract ERC1155Pausable is ERC1155, Pausable {\n /**\n * @dev See {ERC1155-_beforeTokenTransfer}.\n *\n * Requirements:\n *\n * - the contract must not be paused.\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n require(!paused(), \"ERC1155Pausable: token transfer while paused\");\n }\n}\n" - }, - "@openzeppelin/contracts/access/AccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role, _msgSender());\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(uint160(account), 20),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" - }, - "contracts/core/interfaces/IBadges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Interface for Badges contract\n * @author Sismo\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n */\ninterface IBadges {\n error BadgesNonTransferrable();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n function initialize(string memory uri, address owner) external;\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external;\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry) external;\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external;\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155MetadataURI is IERC1155 {\n /**\n * @dev Returns the URI for token type `id`.\n *\n * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n * clients with the actual token type ID.\n */\n function uri(uint256 id) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/ERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/security/Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), \"Pausable: paused\");\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), \"Pausable: not paused\");\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "@openzeppelin/contracts/access/IAccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" - }, - "@openzeppelin/contracts/utils/Strings.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n // Inspired by OraclizeAPI's implementation - MIT licence\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0x00\";\n }\n uint256 temp = value;\n uint256 length = 0;\n while (temp != 0) {\n length++;\n temp >>= 8;\n }\n return toHexString(value, length);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n}\n" - }, - "contracts/tests/MockAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttestationsRegistry} from '../core/interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from '../core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from '../core/libs/attestations-registry/AttestationsRegistryState.sol';\nimport {IBadges} from '../core/interfaces/IBadges.sol';\nimport {Attestation, AttestationData} from '../core/libs/Structs.sol';\n\ncontract MockAttestationsRegistry {\n uint256 immutable ATTESTATION_VALUE;\n\n event AttestationRecorded(Attestation attestation);\n\n constructor(uint256 attestationValue) {\n ATTESTATION_VALUE = attestationValue;\n }\n\n function getAttestationValue(uint256 collectionId, address owner)\n external\n view\n returns (uint256)\n {\n return ATTESTATION_VALUE;\n }\n\n function recordAttestations(Attestation[] calldata attestations) external {\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationRecorded(attestations[i]);\n }\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport './OwnableLogic.sol';\nimport './PausableLogic.sol';\nimport './InitializableLogic.sol';\nimport './AttestationsRegistryState.sol';\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\n\n/**\n * @title Attestations Registry Config Logic contract\n * @author Sismo\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\n **/\ncontract AttestationsRegistryConfigLogic is\n AttestationsRegistryState,\n IAttestationsRegistryConfigLogic,\n OwnableLogic,\n PausableLogic,\n InitializableLogic\n{\n using RangeUtils for Range[];\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\n for (uint256 i = 0; i < ranges.length; i++) {\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external override onlyOwner {\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\n return _isAuthorized(issuer, collectionId);\n }\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external override onlyOwner {\n _pause();\n }\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external override onlyOwner {\n _unpause();\n }\n\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\n return _authorizedRanges[issuer]._includes(collectionId);\n }\n\n function _authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal {\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\n _authorizedRanges[issuer].push(newRange);\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal onlyOwner {\n if (rangeIndex >= _authorizedRanges[issuer].length)\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\n\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\n revert IdsMismatch(\n issuer,\n rangeIndex,\n expectedFirstId,\n expectedLastId,\n firstCollectionId,\n lastCollectionId\n );\n\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\n _authorizedRanges[issuer].length - 1\n ];\n _authorizedRanges[issuer].pop();\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryState.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Range} from '../utils/RangeLib.sol';\nimport {Attestation, AttestationData} from '../Structs.sol';\n\ncontract AttestationsRegistryState {\n // main config\n bool internal _initialized;\n bool internal _initializing;\n bool internal _paused;\n address internal _owner;\n // keeping some space for future\n uint256[15] private _placeHolders;\n\n // storing the authorized ranges for each attesters\n mapping(address => Range[]) internal _authorizedRanges;\n // keeping some space for future\n uint256[15] private _placeHolders2;\n // storing the data of attestations\n // =collectionId=> =owner=> attestationData\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\n}\n" - }, - "contracts/core/libs/attestations-registry/OwnableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n // This is the only diff with OZ contract\n // address private _owner;\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/PausableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableLogic is Context, AttestationsRegistryState {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n // this is the only diff with OZ contract\n // bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), 'Pausable: paused');\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), 'Pausable: not paused');\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/InitializableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Address.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract InitializableLogic is AttestationsRegistryState {\n // only diff with oz\n // /**\n // * @dev Indicates that the contract has been initialized.\n // */\n // bool private _initialized;\n\n // /**\n // * @dev Indicates that the contract is in the process of being initialized.\n // */\n // bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(\n _initializing ? _isConstructor() : !_initialized,\n 'Initializable: contract is already initialized'\n );\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, 'Initializable: contract is not initializing');\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\n\ninterface IAttestationsRegistryConfigLogic {\n error AttesterNotFound(address issuer);\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\n error IdsMismatch(\n address issuer,\n uint256 rangeIndex,\n uint256 expectedFirstId,\n uint256 expectedLastId,\n uint256 FirstId,\n uint256 lastCollectionId\n );\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external;\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external;\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external;\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external;\n}\n" - }, - "contracts/core/libs/utils/RangeLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nstruct Range {\n uint256 min;\n uint256 max;\n}\n\n// Range [0;3] includees 0 and 3\nlibrary RangeUtils {\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\n for (uint256 i = 0; i < ranges.length; i++) {\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\n return true;\n }\n }\n return false;\n }\n}\n" - }, - "contracts/core/libs/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.14;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "contracts/core/libs/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, 'Address: insufficient balance');\n\n (bool success, ) = recipient.call{value: amount}('');\n require(success, 'Address: unable to send value, recipient may have reverted');\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, 'Address: low-level call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, 'Address: insufficient balance for call');\n require(isContract(target), 'Address: call to non-contract');\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data)\n internal\n view\n returns (bytes memory)\n {\n return functionStaticCall(target, data, 'Address: low-level static call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), 'Address: static call to non-contract');\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), 'Address: delegate call to non-contract');\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/tests/MockAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\nimport {Attestation, Request} from '../core/libs/Structs.sol';\nimport {Attester} from '../core/Attester.sol';\nimport {IAttester} from '../core/interfaces/IAttester.sol';\n\ncontract MockAttester is IAttester, Attester {\n uint256 public immutable ATTESTATION_ID_MIN;\n uint256 public immutable ATTESTATION_ID_MAX;\n\n constructor(\n address ATTESTATION_REGISTRY_ADDRESS,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n ) Attester(ATTESTATION_REGISTRY_ADDRESS) {\n ATTESTATION_ID_MIN = collectionIdFirst;\n ATTESTATION_ID_MAX = collectionIdLast;\n }\n\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {}\n\n function buildAttestations(\n Request calldata request,\n bytes calldata /*data*/\n ) public view virtual override(Attester, IAttester) returns (Attestation[] memory) {\n uint256 collectionId = ATTESTATION_ID_MIN + request.claims[0].groupId;\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n collectionId,\n request.destination,\n address(this),\n request.claims[0].claimedValue,\n abi.decode(request.claims[0].extraData, (uint32)),\n 'Mock Attester v0'\n );\n return (attestations);\n }\n}\n" - }, - "contracts/core/Front.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IFront} from './interfaces/IFront.sol';\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation} from './libs/Structs.sol';\n\n/**\n * @title Front\n * @author Sismo\n * @notice This is the Front contract of the Sismo protocol\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\n\n * For more information: https://front.docs.sismo.io\n */\ncontract Front is IFront {\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\n uint256 public constant EARLY_USER_COLLECTION = 0;\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress Attestations registry contract address\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n Attestation[] memory attestations = _forwardAttestationsGeneration(\n attester,\n request,\n proofData\n );\n _generateEarlyUserAttestation(request.destination);\n return attestations;\n }\n\n /**\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n address destination = requests[0].destination;\n for (uint256 i = 0; i < attesters.length; i++) {\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\n attestations[i] = _forwardAttestationsGeneration(\n attesters[i],\n requests[i],\n proofDataArray[i]\n );\n }\n _generateEarlyUserAttestation(destination);\n return attestations;\n }\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view override returns (Attestation[] memory) {\n return _forwardAttestationsBuild(attester, request, proofData);\n }\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function of targeted attester\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n\n for (uint256 i = 0; i < attesters.length; i++) {\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\n }\n return attestations;\n }\n\n function _forwardAttestationsBuild(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal view returns (Attestation[] memory) {\n return IAttester(attester).buildAttestations(request, proofData);\n }\n\n function _forwardAttestationsGeneration(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal returns (Attestation[] memory) {\n return IAttester(attester).generateAttestations(request, proofData);\n }\n\n function _generateEarlyUserAttestation(address destination) internal {\n uint32 currentTimestamp = uint32(block.timestamp);\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\n EARLY_USER_COLLECTION,\n destination\n );\n\n if (!alreadyHasAttestation) {\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n EARLY_USER_COLLECTION,\n destination,\n address(this),\n 1,\n currentTimestamp,\n 'With strong love from Sismo'\n );\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n emit EarlyUserAttestationGenerated(destination);\n }\n }\n }\n}\n" - }, - "contracts/core/interfaces/IFront.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\n\n/**\n * @title IFront\n * @author Sismo\n * @notice This is the interface of the Front Contract\n */\ninterface IFront {\n error DifferentRequestsDestinations();\n event EarlyUserAttestationGenerated(address destination);\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev generate multiple attestations at once, to the same destination\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external returns (Attestation[][] memory);\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function(s) of targeted attester(s)\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view returns (Attestation[][] memory);\n}\n" - }, - "contracts/periphery/badges-examples/BAYCOwnershipBadgeExample.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC721} from '@openzeppelin/contracts/token/ERC721/ERC721.sol';\nimport {IAttestationsRegistry} from '../../core/interfaces/IAttestationsRegistry.sol';\n\ncontract BAYCOwnershipBadge is ERC721 {\n IAttestationsRegistry immutable ATTESTATIONS_REGISTRY;\n uint256 constant HydraS1_BAYC_ATTESTATION_COLLECTION_ID = 100000001;\n uint256 constant SMPS_BAYC_ATTESTATION_COLLECTION_ID = 30000000000003;\n\n constructor(\n address attestationsRegistryAddress,\n string memory name,\n string memory symbol\n ) ERC721(name, symbol) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n function balanceOf(address account) public view virtual override returns (uint256) {\n bool hasZKAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n HydraS1_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n bool hasDoxingAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n SMPS_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n return hasZKAttestation || hasDoxingAttestation ? 1 : 0;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/ERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"./extensions/IERC721Metadata.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/Strings.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: balance query for the zero address\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _owners[tokenId];\n require(owner != address(0), \"ERC721: owner query for nonexistent token\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n require(_exists(tokenId), \"ERC721Metadata: URI query for nonexistent token\");\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overriden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not owner nor approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n require(_exists(tokenId), \"ERC721: approved query for nonexistent token\");\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: transfer caller is not owner nor approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: transfer caller is not owner nor approved\");\n _safeTransfer(from, to, tokenId, _data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `_data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, _data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _owners[tokenId] != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n require(_exists(tokenId), \"ERC721: operator query for nonexistent token\");\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, _data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId);\n\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId);\n\n // Clear approvals\n _approve(address(0), tokenId);\n\n _balances[owner] -= 1;\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId);\n\n // Clear approvals from the previous owner\n _approve(address(0), tokenId);\n\n _balances[from] -= 1;\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits a {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits a {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param _data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, ``from``'s `tokenId` will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" - }, - "@openzeppelin/contracts/utils/StorageSlot.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" - }, - "contracts/periphery/utils/TransparentUpgradeableProxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n// Note: we just copied so that we can see the contract used\npragma solidity ^0.8.14;\n\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(''), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n ifAdmin\n {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(\n msg.sender != _getAdmin(),\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\n );\n super._beforeFallback();\n }\n}\n" - }, - "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to Pythia1 Proving Scheme\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\n\n/**\n * @title Pythia-1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Pythia-1 Attesters.\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \n * offchain service in a privacy preserving way. \n * That means no-one can make the link between the account used in the offchain service\n * and the onchain account where the attestation is stored.\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each users gets one userTicket per claim\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n **/\n\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\n using Pythia1Lib for Pythia1ProofData;\n using Pythia1Lib for bytes;\n using Pythia1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n uint256[2] internal _commitmentSignerPubKey;\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\n * @param owner The owner of the contract that can update the commitment signer pub key\n */\n constructor(\n address attestationsRegistryAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address pythia1VerifierAddress,\n uint256[2] memory commitmentSignerPubKey,\n address owner\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n initialize(commitmentSignerPubKey, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) public initializer {\n _transferOwnership(owner);\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into Pythia1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\n Pythia1ProofInput memory snarkInput = snarkProof._input();\n Pythia1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(Request calldata request, bytes calldata)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n Pythia1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.internalCollectionId;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n uint32(block.timestamp),\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used\n * @param request users request. Claim of beiing part of a group.\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0)) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * users bring secretHash as private input in snark which guarantees privacy\n * the secretHash is only known by the user and never escape the user's browser\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(Pythia1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.internalCollectionId\n );\n return ticketIdentifier;\n }\n\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\n return _commitmentSignerPubKey;\n }\n\n /*******************************************************\n Pythia-1 Attester Specific Functions\n *******************************************************/\n\n function updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey)\n external\n onlyOwner\n {\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\n _commitmentSignerPubKey = commitmentSignerPubKey;\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\n }\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\n\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\n error TicketUsed(uint256 userTicket);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/pythia-1/base/Pythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IPythia1Base} from './IPythia1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Pythia 1 ZK Proving Scheme\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\n\n/**\n * @title Pythia-1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \n * without anyone being able to make the link between the offchain service and the onchain service.\n * It is inherited by the family of Pythia-1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n \n \n **/\nabstract contract Pythia1Base is IPythia1Base, Initializable {\n using Pythia1Lib for Pythia1ProofData;\n\n // ZK-SNARK Verifier\n Pythia1Verifier immutable VERIFIER;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\n */\n constructor(address Pythia1VerifierAddress) {\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\n }\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of the Commitment signer Eddsa Public key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\n return _getCommitmentSignerPubKey();\n }\n\n /*******************************************************\n Pythia-1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * the secretHash is a number only known by the user and is used in \n * the zero knowledge as a private input which guarantees privacy\n\n * This function MUST be implemented by Pythia-1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Pythia-1 Simple Attester for an example\n * @param claim user claim: a particular claim that a user have that he can prove s right.\n */\n function _getTicketIdentifierOfClaim(Pythia1Claim memory claim)\n internal\n view\n virtual\n returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\n * prove the claim was correctly issued for the user.\n */\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(Pythia1Claim memory claim, Pythia1ProofInput memory input)\n internal\n view\n virtual\n {\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (claim.destination != msg.sender)\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\n if (\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\n )\n revert CommitmentSignerPubKeyMismatch(\n commitmentSignerPubKey[0],\n commitmentSignerPubKey[1],\n input.commitmentSignerPubKey[0],\n input.commitmentSignerPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the plonk mathematical proof using the circom verifier contract\n * @param proofData snark public input\n */\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(\n uint256 /*errorCode*/\n ) {\n revert InvalidGroth16Proof('');\n } catch (\n bytes memory /*lowLevelData*/\n ) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/pythia-1/libs/Pythia1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\n\n// user Pythia-1 claim retrieved form his request\nstruct Pythia1Claim {\n uint256 groupId; // user claims be part of this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct Pythia1GroupProperties {\n uint128 internalCollectionId;\n bool isScore;\n}\n\nstruct Pythia1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct Pythia1ProofData {\n Pythia1CircomSnarkProof proof;\n uint256[9] input;\n // destination;\n // chainId;\n // commitmentSignerPubKey.x;\n // commitmentSignerPubKey.y;\n // groupId;\n // ticketIdentifier;\n // userTicket;\n // value;\n // isStrict;\n}\n\nstruct Pythia1ProofInput {\n address destination;\n uint256 chainId;\n uint256 groupId;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n bool isStrict;\n uint256[2] commitmentSignerPubKey;\n}\n\nlibrary Pythia1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\n return\n Pythia1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getGroupId(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n Pythia1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (Pythia1GroupProperties)\n );\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(Pythia1ProofData memory self)\n internal\n pure\n returns (\n uint256[2] memory,\n uint256[2][2] memory,\n uint256[2] memory,\n uint256[9] memory\n )\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(Pythia1ProofData memory self)\n internal\n pure\n returns (uint256[2] memory)\n {\n return [self.input[2], self.input[3]];\n }\n\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(Pythia1ProofData memory self)\n internal\n pure\n returns (uint256)\n {\n return self.input[5];\n }\n\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\n return self.input[8] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(uint128 internalCollectionId, bool isScore)\n internal\n pure\n returns (uint256)\n {\n return\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(uint128 internalCollectionId, bool isScore)\n internal\n pure\n returns (bytes memory)\n {\n return abi.encode(internalCollectionId, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/pythia-1/base/IPythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\n\ninterface IPythia1Base {\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error UserShouldOwnItsDestination(address sender, address inputdestination);\n error CommitmentSignerPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier);\n\n /**\n * @dev Getter of the Commitment Signer EdDSA Public Key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\n}\n" - }, - "@sismo-core/pythia-1/contracts/Pythia1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract Pythia1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\n );\n vk.IC = new Pairing.G1Point[](10);\n \n vk.IC[0] = Pairing.G1Point( \n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 104028078850975554065172701281783302003220555203883119831575537681421753151,\n 19148240629904598794948591359118971959790791697910953160820265703277306346\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[9] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - Renewable\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew their attestations\n **/\n\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base, Attester {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(Request calldata request, bytes calldata)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n HydraS1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used and not a renewal (e.g destination different that last)\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0) && currentDestination != request.destination) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\n return ticketIdentifier;\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/core/AttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\nimport {Attestation, AttestationData} from './libs/Structs.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Attestations Registry\n * @author Sismo\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\n * Only authorized attestations issuers can record attestation in the registry\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\n * For more information: https://attestations-registry.docs.sismo.io\n\n * For each attestation recorded, a badge is received by the user\n * The badge is the Non transferrable NFT representation of an attestation \n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\n * It enables off-chain apps such as opensea to catch the \"shadow mint\" of the badge\n **/\ncontract AttestationsRegistry is\n AttestationsRegistryState,\n IAttestationsRegistry,\n AttestationsRegistryConfigLogic\n{\n IBadges immutable BADGES;\n\n /**\n * @dev Constructor.\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @param badgesAddress Stateless ERC1155 Badges contract\n */\n constructor(address owner, address badgesAddress) {\n initialize(owner);\n BADGES = IBadges(badgesAddress);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n */\n function initialize(address owner) public initializer {\n _transferOwnership(owner);\n }\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\n address issuer = _msgSender();\n for (uint256 i = 0; i < attestations.length; i++) {\n if (!_isAuthorized(issuer, attestations[i].collectionId))\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\n\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\n attestations[i].owner\n ].value;\n\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\n attestations[i].issuer,\n attestations[i].value,\n attestations[i].timestamp,\n attestations[i].extraData\n );\n\n _triggerBadgeTransferEvent(\n attestations[i].collectionId,\n attestations[i].owner,\n previousAttestationValue,\n attestations[i].value\n );\n emit AttestationRecorded(attestations[i]);\n }\n }\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds)\n external\n override\n whenNotPaused\n {\n if (owners.length != collectionIds.length)\n revert OwnersAndCollectionIdsLengthMismatch(owners, collectionIds);\n\n address issuer = _msgSender();\n for (uint256 i = 0; i < owners.length; i++) {\n AttestationData memory attestationData = _attestationsData[collectionIds[i]][owners[i]];\n\n if (!_isAuthorized(issuer, collectionIds[i]))\n revert IssuerNotAuthorized(issuer, collectionIds[i]);\n delete _attestationsData[collectionIds[i]][owners[i]];\n\n _triggerBadgeTransferEvent(collectionIds[i], owners[i], attestationData.value, 0);\n\n emit AttestationDeleted(\n Attestation(\n collectionIds[i],\n owners[i],\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n )\n );\n }\n }\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner)\n external\n view\n override\n returns (bool)\n {\n return _getAttestationValue(collectionId, owner) != 0;\n }\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(uint256 collectionId, address owner)\n external\n view\n override\n returns (AttestationData memory)\n {\n return _getAttestationData(collectionId, owner);\n }\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner)\n external\n view\n override\n returns (uint256)\n {\n return _getAttestationValue(collectionId, owner);\n }\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(uint256 collectionId, address owner)\n external\n view\n override\n returns (\n address,\n uint256,\n uint32,\n bytes memory\n )\n {\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\n return (\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n );\n }\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(uint256 collectionId, address owner)\n external\n view\n override\n returns (bytes memory)\n {\n return _attestationsData[collectionId][owner].extraData;\n }\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(uint256 collectionId, address owner)\n external\n view\n override\n returns (address)\n {\n return _attestationsData[collectionId][owner].issuer;\n }\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(uint256 collectionId, address owner)\n external\n view\n override\n returns (uint32)\n {\n return _attestationsData[collectionId][owner].timestamp;\n }\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n override\n returns (AttestationData[] memory)\n {\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\n }\n return attestationsDataArray;\n }\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n override\n returns (uint256[] memory)\n {\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\n }\n return attestationsValues;\n }\n\n /**\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\n * It enables off-chain apps such as opensea to catch the \"shadow mints/burns\" of badges\n */\n function _triggerBadgeTransferEvent(\n uint256 badgeTokenId,\n address owner,\n uint256 previousValue,\n uint256 newValue\n ) internal {\n bool isGreaterValue = newValue > previousValue;\n address operator = address(this);\n address from = isGreaterValue ? address(0) : owner;\n address to = isGreaterValue ? owner : address(0);\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\n\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\n }\n\n function _getAttestationData(uint256 collectionId, address owner)\n internal\n view\n returns (AttestationData memory)\n {\n return (_attestationsData[collectionId][owner]);\n }\n\n function _getAttestationValue(uint256 collectionId, address owner)\n internal\n view\n returns (uint256)\n {\n return _attestationsData[collectionId][owner].value;\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/goerli/solcInputs/c7c67c4a1ddf53de4ef76f8a114dfc39.json b/deployments/goerli/solcInputs/c7c67c4a1ddf53de4ef76f8a114dfc39.json deleted file mode 100644 index 74d45b0..0000000 --- a/deployments/goerli/solcInputs/c7c67c4a1ddf53de4ef76f8a114dfc39.json +++ /dev/null @@ -1,230 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/attesters/hydra-s1/base/HydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1Base} from './IHydraS1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Hydra S1 ZK Proving Scheme\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to the following:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n **/\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\n using HydraS1Lib for HydraS1ProofData;\n\n // ZK-SNARK Verifier\n HydraS1Verifier immutable VERIFIER;\n // Registry storing the Commitment Mapper EdDSA Public key\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\n * @param commitmentMapperAddress Commitment mapper's public key registry\n */\n constructor(\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress\n ) {\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\n }\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\n return COMMITMENT_MAPPER_REGISTRY;\n }\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\n return AVAILABLE_ROOTS_REGISTRY;\n }\n\n /*******************************************************\n Hydra-S1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input which guarantees privacy\n\n * This function MUST be implemented by Hydra-S1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Hydra-S1 Simple Attester for an example\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\n */\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n virtual\n returns (uint256);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\n internal\n view\n virtual\n {\n if (input.accountsTreeValue != claim.groupId)\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\n revert RegistryRootMismatch(input.registryRoot);\n\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\n if (\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\n )\n revert CommitmentMapperPubKeyMismatch(\n commitmentMapperPubKey[0],\n commitmentMapperPubKey[1],\n input.commitmentMapperPubKey[0],\n input.commitmentMapperPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the groth16 mathematical proof\n * @param proofData snark public input\n */\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(\n uint256 /*errorCode*/\n ) {\n revert InvalidGroth16Proof('');\n } catch (\n bytes memory /*lowLevelData*/\n ) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/IHydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Interface\n * @author Sismo\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\n * We invite readers to refer to the following:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n **/\ninterface IHydraS1Base {\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\n error RegistryRootMismatch(uint256 inputRoot);\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error CommitmentMapperPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error AccountsTreeValueMismatch(\n uint256 expectedAccountsTreeValue,\n uint256 inputAccountsTreeValue\n );\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier);\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\n}\n" - }, - "@openzeppelin/contracts/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" - }, - "contracts/core/libs/Structs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Attestations Registry State\n * @author Sismo\n * @notice This contract holds all of the storage variables and data\n * structures used by the AttestationsRegistry and parent\n * contracts.\n */\n\n// User Attestation Request, can be made by any user\n// The context of an Attestation Request is a specific attester contract\n// Each attester has groups of accounts in its available data\n// eg: for a specific attester:\n// group 1 <=> accounts that sent txs on mainnet\n// group 2 <=> accounts that sent txs on polygon\n// eg: for another attester:\n// group 1 <=> accounts that sent eth txs in 2022\n// group 2 <=> accounts sent eth txs in 2021\nstruct Request {\n // implicit address attester;\n // implicit uint256 chainId;\n Claim[] claims;\n address destination; // destination that will receive the end attestation\n}\n\nstruct Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\n}\n\n/**\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\n * @param collectionId Attestation collection\n * @param owner Attestation collection\n * @param issuer Attestation collection\n * @param value Attestation collection\n * @param timestamp Attestation collection\n * @param extraData Attestation collection\n */\nstruct Attestation {\n // implicit uint256 chainId;\n uint256 collectionId; // Id of the attestation collection (in the registry)\n address owner; // Owner of the attestation\n address issuer; // Contract that created or last updated the record.\n uint256 value; // Value of the attestation\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\n // it is different from the recording timestamp (date when the attestation was recorded)\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\n bytes extraData; // arbitrary data that can be added by the attester\n}\n\n// Attestation Data, stored in the registry\n// The context is a specific owner of a specific collection\nstruct AttestationData {\n // implicit uint256 chainId\n // implicit uint256 collectionId - from context\n // implicit owner\n address issuer; // Address of the contract that recorded the attestation\n uint256 value; // Value of the attestation\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\n bytes extraData; // arbitrary data that can be added by the attester\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1GroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n bool isScore;\n}\n\nstruct HydraS1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct HydraS1ProofData {\n HydraS1CircomSnarkProof proof;\n uint256[10] input;\n // destination\n // chainId\n // commitmentMapperPubKey.x\n // commitmentMapperPubKey.y\n // registryTreeRoot\n // ticketIdentifier\n // ticket\n // claimedValue\n // accountsTreeValue\n // isStrict\n}\n\nstruct HydraS1ProofInput {\n address destination;\n uint256 chainId;\n uint256 registryRoot;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n uint256 accountsTreeValue;\n bool isStrict;\n uint256[2] commitmentMapperPubKey;\n}\n\nlibrary HydraS1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\n return\n HydraS1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getRegistryRoot(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getAccountsTreeValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1GroupProperties)\n );\n\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(HydraS1ProofData memory self)\n internal\n pure\n returns (\n uint256[2] memory,\n uint256[2][2] memory,\n uint256[2] memory,\n uint256[10] memory\n )\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\n internal\n pure\n returns (uint256[2] memory)\n {\n return [self.input[2], self.input[3]];\n }\n\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\n internal\n pure\n returns (uint256)\n {\n return self.input[5];\n }\n\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[8];\n }\n\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\n return self.input[9] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\n );\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(groupIndex, generationTimestamp, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/periphery/utils/CommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\n\n/**\n * @title Commitment Mapper Registry Contract\n * @author Sismo\n * @notice This contract stores information about the commitment mapper.\n * Its ethereum address and its EdDSA public key\n * For more information: https://commitment-mapper.docs.sismo.io\n *\n **/\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\n uint256[2] internal _commitmentMapperPubKey;\n address _commitmentMapperAddress;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n constructor(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) {\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) public initializer {\n _transferOwnership(owner);\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\n _updateCommitmentMapperAddress(commitmentMapperAddress);\n }\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\n }\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\n _updateCommitmentMapperAddress(newAddress);\n }\n\n /**\n * @dev Getter of the EdDSA public key of the commitment mapper\n */\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\n return _commitmentMapperPubKey;\n }\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view override returns (address) {\n return _commitmentMapperAddress;\n }\n\n function _updateCommitmentMapperAddress(address newAddress) internal {\n _commitmentMapperAddress = newAddress;\n emit UpdatedCommitmentMapperAddress(newAddress);\n }\n\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\n _commitmentMapperPubKey = pubKey;\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\n }\n}\n" - }, - "contracts/periphery/utils/AvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n/**\n * @title Attesters Groups Registry\n * @author Sismo\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\n * For more information: https://available-roots-registry.docs.sismo.io\n *\n **/\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\n mapping(address => mapping(uint256 => bool)) public _roots;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can register/ unregister roots\n */\n constructor(address owner) {\n initialize(owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) public initializer {\n _transferOwnership(owner);\n }\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\n _registerRootForAttester(attester, root);\n }\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\n _unregisterRootForAttester(attester, root);\n }\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external onlyOwner {\n _registerRootForAttester(address(0), root);\n }\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external onlyOwner {\n _unregisterRootForAttester(address(0), root);\n }\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\n return _roots[_msgSender()][root] || _roots[address(0)][root];\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\n return _roots[attester][root] || _roots[address(0)][root];\n }\n\n function _registerRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = true;\n if (attester == address(0)) {\n emit RegisteredRootForAll(root);\n } else {\n emit RegisteredRootForAttester(attester, root);\n }\n }\n\n function _unregisterRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = false;\n if (attester == address(0)) {\n emit UnregisteredRootForAll(root);\n } else {\n emit UnregisteredRootForAttester(attester, root);\n }\n }\n}\n" - }, - "@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract HydraS1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\n );\n vk.IC = new Pairing.G1Point[](11);\n \n vk.IC[0] = Pairing.G1Point( \n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\n 546002182798634190282541153661423157791776194062719045593389981526666716416\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\n 181057165072599074288983745076121344893296348827576905983079816835912241514\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\n ); \n \n vk.IC[10] = Pairing.G1Point( \n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[10] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "@openzeppelin/contracts/access/Ownable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\ninterface ICommitmentMapperRegistry {\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\n event UpdatedCommitmentMapperAddress(address newAddress);\n error PubKeyNotValid(uint256[2] pubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) external;\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external;\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getEdDSAPubKey() external view returns (uint256[2] memory);\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\n/**\n * @title IAvailableRootsRegistry\n * @author Sismo\n * @notice Interface for (Merkle) Roots Registry\n */\ninterface IAvailableRootsRegistry {\n event RegisteredRootForAttester(address attester, uint256 root);\n event RegisteredRootForAll(uint256 root);\n event UnregisteredRootForAttester(address attester, uint256 root);\n event UnregisteredRootForAll(uint256 root);\n\n error CannotRegisterForZeroAddress();\n error CannotUnregisterForZeroAddress();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) external;\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external;\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external;\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\n}\n" - }, - "contracts/attesters/hydra-s1/variants/HydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1AccountboundAttester} from '../interfaces/IHydraS1AccountboundAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from '../../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from '../base/HydraS1Base.sol';\nimport {HydraS1AccountboundLib, HydraS1AccountboundClaim} from '../libs/HydraS1AccountboundLib.sol';\n\n/**\n * @title Hydra-S1 Accountbound Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - Accountbound (with cooldown period)\n * Users can choose to delete or generate attestations to a new destination using their source account.\n * The attestation is \"Accountbound\" to the source account.\n * When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional\n * User will need to wait until the end of the cooldown period before being able to delete or switch destination again\n * One can however know that the former and the new destinations were created using the same userTicket\n \n * - Renewable\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew or update their attestations\n **/\ncontract HydraS1AccountboundAttester is IHydraS1AccountboundAttester, HydraS1Base, Attester {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1AccountboundLib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n mapping(uint256 => TicketData) internal _userTicketsData;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user attestations request is invalid\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark proof backing the claim\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._hydraS1claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns the actual attestations constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark public input as well as snark proof\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n HydraS1AccountboundClaim memory claim = request._hydraS1Accountboundclaim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n // The issuer of attestations is the attester\n address issuer = address(this);\n // user sends the ticket as input in the data\n uint256 userTicket = proofData._getTicket();\n TicketData memory userTicketData = _userTicketsData[userTicket];\n\n uint16 burnCount = userTicketData.burnCount;\n // If the attestation is minted on a new destination address\n // the burnCount encoded in the extraData of the Attestation should be incremented\n if (\n userTicketData.destination != address(0) && userTicketData.destination != request.destination\n ) {\n burnCount += 1;\n }\n\n attestations[0] = Attestation(\n attestationCollectionId,\n request.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n abi.encode(userTicket, burnCount)\n );\n\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used, not a renewal, and ticket on cooldown.\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n uint256 userTicket = proofData._getTicket();\n TicketData memory userTicketData = _userTicketsData[userTicket];\n\n if (\n userTicketData.destination != address(0) && userTicketData.destination != request.destination\n ) {\n HydraS1AccountboundClaim memory claim = request._hydraS1Accountboundclaim();\n if (_isOnCooldown(userTicketData, claim.groupProperties.cooldownDuration))\n revert TicketOnCooldown(userTicketData, claim.groupProperties.cooldownDuration);\n\n // Delete the old Attestation on the account before recording the new one\n address[] memory attestationOwners = new address[](1);\n uint256[] memory attestationCollectionIds = new uint256[](1);\n\n attestationOwners[0] = userTicketData.destination;\n attestationCollectionIds[0] =\n AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n\n emit AttestationDeleted(\n Attestation(\n AUTHORIZED_COLLECTION_ID_FIRST + claim.groupProperties.groupIndex,\n userTicketData.destination,\n address(this),\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n abi.encode(userTicket, userTicketData.burnCount)\n )\n );\n _setTicketOnCooldown(userTicket);\n }\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\n return ticketIdentifier;\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n /**\n * @dev Getter, returns the data linked to a ticket\n * @param userTicket ticket used\n **/\n function getTicketData(uint256 userTicket) external view override returns (TicketData memory) {\n return _getTicketData(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _userTicketsData[userTicket].destination = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _setTicketOnCooldown(uint256 userTicket) internal {\n _userTicketsData[userTicket].cooldownStart = uint32(block.timestamp);\n _userTicketsData[userTicket].burnCount += 1;\n emit TicketSetOnCooldown(userTicket, _userTicketsData[userTicket].burnCount);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _userTicketsData[userTicket].destination;\n }\n\n function _isOnCooldown(TicketData memory userTicketData, uint32 cooldownDuration)\n internal\n view\n returns (bool)\n {\n return userTicketData.cooldownStart + cooldownDuration > block.timestamp;\n }\n\n function _getTicketData(uint256 userTicket) internal view returns (TicketData memory) {\n return _userTicketsData[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Accountbound Interface\n * @author Sismo\n * @notice Interface with the errors, events and methods specific to the HydraS1AcountboundAttester.\n **/\ninterface IHydraS1AccountboundAttester is IHydraS1Base, IAttester {\n struct TicketData {\n address destination;\n uint32 cooldownStart;\n uint16 burnCount;\n }\n\n /**\n * @dev Error when the userTicket is on cooldown. The user have to wait the cooldownDuration\n * before being able to change again the destination address.\n **/\n error TicketOnCooldown(TicketData ticketData, uint32 cooldownDuration);\n\n /**\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\n **/\n error CollectionIdOutOfBound(uint256 collectionId);\n\n /**\n * @dev Event emitted when the userTicket (or nullifierHash) is associated to a destination address.\n **/\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n\n /**\n * @dev Event emitted when the userTicket has been set on cooldown. This happens when the\n * attestation destination of a ticket has been changed\n **/\n event TicketSetOnCooldown(uint256 ticket, uint16 burnCount);\n\n /**\n * @dev Getter, returns the data linked to a ticket\n * @param userTicket ticket used\n **/\n function getTicketData(uint256 userTicket) external view returns (TicketData memory);\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/core/Attester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\n\n/**\n * @title Attester Abstract Contract\n * @author Sismo\n * @notice Contract to be inherited by Attesters\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\n * are recommended to implemented this abstract contract\n\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\n *\n * This contracts is built around two main external standard functions.\n * They must NOT be override them, unless your really know what you are doing\n \n * - generateAttestations(request, proof) => will write attestations in the registry\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\n\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\n\n * For more information: https://attesters.docs.sismo.io\n **/\nabstract contract Attester is IAttester {\n // Registry where all attestations are stored\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(Request calldata request, bytes calldata proofData)\n external\n override\n returns (Attestation[] memory)\n {\n // Verify if request is valid by verifying against proof\n _verifyRequest(request, proofData);\n\n // Generate the actual attestations from user request\n Attestation[] memory attestations = buildAttestations(request, proofData);\n\n _beforeRecordAttestations(request, proofData);\n\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n\n _afterRecordAttestations(attestations);\n\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationGenerated(attestations[i]);\n }\n\n return attestations;\n }\n\n /**\n * @dev External facing function. Allows to delete attestations by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that were deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n address[] memory attestationOwners = new address[](collectionIds.length);\n\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\n\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n // fetch attestations from the registry\n (\n address issuer,\n uint256 attestationValue,\n uint32 timestamp,\n bytes memory extraData\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\n\n attestationOwners[i] = attestationsOwner;\n attestationCollectionIds[i] = collectionIds[i];\n\n attestations[i] = (\n Attestation(\n collectionIds[i],\n attestationsOwner,\n issuer,\n attestationValue,\n timestamp,\n extraData\n )\n );\n }\n\n _verifyAttestationsDeletionRequest(attestations, proofData);\n\n _beforeDeleteAttestations(attestations, proofData);\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n\n _afterDeleteAttestations(attestations, proofData);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n emit AttestationDeleted(attestations[i]);\n }\n return attestations;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n public\n view\n virtual\n returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry getter\n * @return attestationRegistry\n */\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\n return ATTESTATIONS_REGISTRY;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should verify the user request is valid\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\n\n /**\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\n * Default behavior: throws\n * It should verify attestations deletion request is valid\n * @param attestations Attestations that will be deleted\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyAttestationsDeletionRequest(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {\n revert AttestationDeletionNotImplemented();\n }\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before recording attestations in the registry\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n {}\n\n /**\n * @dev (Optional) Can be overridden in attesters inheriting this contract\n * Will be called after recording an attestation\n * @param attestations Recorded attestations\n */\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n virtual\n {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called after deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n virtual\n {}\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1AccountboundLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Lib, HydraS1Claim, HydraS1GroupProperties} from './HydraS1Lib.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1AccountboundClaim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1AccountboundGroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1AccountboundGroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n uint32 cooldownDuration;\n bool isScore;\n}\n\nlibrary HydraS1AccountboundLib {\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _hydraS1claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n HydraS1GroupProperties memory hydraS1GroupProperties = HydraS1GroupProperties(\n groupProperties.groupIndex,\n groupProperties.generationTimestamp,\n groupProperties.isScore\n );\n\n return (\n HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, hydraS1GroupProperties)\n );\n }\n\n function _hydraS1Accountboundclaim(Request memory self)\n internal\n pure\n returns (HydraS1AccountboundClaim memory)\n {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory hydraS1AccountboundGroupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n return (\n HydraS1AccountboundClaim(\n claim.groupId,\n claim.claimedValue,\n self.destination,\n hydraS1AccountboundGroupProperties\n )\n );\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/core/interfaces/IAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\n\n/**\n * @title IAttester\n * @author Sismo\n * @notice This is the interface for the attesters in Sismo Protocol\n */\ninterface IAttester {\n event AttestationGenerated(Attestation attestation);\n\n event AttestationDeleted(Attestation attestation);\n\n error AttestationDeletionNotImplemented();\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(Request calldata request, bytes calldata proofData)\n external\n returns (Attestation[] memory);\n\n /**\n * @dev External facing function. Allows to delete an attestation by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that was deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n external\n view\n returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry address getter\n * @return attestationRegistry Address of the registry\n */\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\n\n/**\n * @title IAttestationsRegistry\n * @author Sismo\n * @notice This is the interface of the AttestationRegistry\n */\ninterface IAttestationsRegistry {\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\n event AttestationRecorded(Attestation attestation);\n event AttestationDeleted(Attestation attestation);\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external;\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(uint256 collectionId, address owner)\n external\n view\n returns (AttestationData memory);\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(uint256 collectionId, address owner)\n external\n view\n returns (\n address,\n uint256,\n uint32,\n bytes memory\n );\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(uint256 collectionId, address owner)\n external\n view\n returns (bytes memory);\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(uint256 collectionId, address owner)\n external\n view\n returns (address);\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(uint256 collectionId, address owner)\n external\n view\n returns (uint32);\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n returns (AttestationData[] memory);\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n returns (uint256[] memory);\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Accountbound Interface\n * @author Sismo\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\n **/\ninterface IHydraS1SimpleAttester is IHydraS1Base, IAttester {\n /**\n * @dev Error when the userTicket (or nullifierHash) is already used for a destination address\n **/\n error TicketUsed(uint256 userTicket);\n\n /**\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\n **/\n error CollectionIdOutOfBound(uint256 collectionId);\n\n /**\n * @dev Event emitted when the userTicket (or nullifierHash) is associated to a destination address.\n **/\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/core/Badges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Badges contract\n * @author Sismo\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n * For more information: https://badges.docs.sismo.io\n */\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\n IAttestationsRegistry internal _attestationsRegistry;\n\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\n\n /**\n * @dev Constructor\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n constructor(\n string memory uri,\n address owner // This is Sismo Frontend Contract\n ) ERC1155(uri) {\n initialize(uri, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n function initialize(string memory uri, address owner) public initializer {\n _setURI(uri);\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n }\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id)\n public\n view\n virtual\n override(ERC1155, IBadges)\n returns (uint256)\n {\n return _attestationsRegistry.getAttestationValue(id, account);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function isApprovedForAll(address account, address operator)\n public\n view\n virtual\n override\n returns (bool)\n {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\n emit TransferSingle(operator, from, to, id, value);\n }\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry)\n external\n override\n onlyRole(DEFAULT_ADMIN_ROLE)\n {\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\n }\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _setURI(uri);\n }\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view override returns (address) {\n return address(_attestationsRegistry);\n }\n\n /**\n * @dev ERC165\n */\n function supportsInterface(bytes4 interfaceId)\n public\n view\n virtual\n override(AccessControl, ERC1155)\n returns (bool)\n {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n revert BadgesNonTransferrable();\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/ERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC1155.sol\";\nimport \"./IERC1155Receiver.sol\";\nimport \"./extensions/IERC1155MetadataURI.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of the basic standard multi-token.\n * See https://eips.ethereum.org/EIPS/eip-1155\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\n *\n * _Available since v3.1._\n */\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\n using Address for address;\n\n // Mapping from token ID to account balances\n mapping(uint256 => mapping(address => uint256)) private _balances;\n\n // Mapping from account to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n string private _uri;\n\n /**\n * @dev See {_setURI}.\n */\n constructor(string memory uri_) {\n _setURI(uri_);\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155).interfaceId ||\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC1155MetadataURI-uri}.\n *\n * This implementation returns the same URI for *all* token types. It relies\n * on the token type ID substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * Clients calling this function must replace the `\\{id\\}` substring with the\n * actual token type ID.\n */\n function uri(uint256) public view virtual override returns (string memory) {\n return _uri;\n }\n\n /**\n * @dev See {IERC1155-balanceOf}.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\n require(account != address(0), \"ERC1155: balance query for the zero address\");\n return _balances[id][account];\n }\n\n /**\n * @dev See {IERC1155-balanceOfBatch}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\n public\n view\n virtual\n override\n returns (uint256[] memory)\n {\n require(accounts.length == ids.length, \"ERC1155: accounts and ids length mismatch\");\n\n uint256[] memory batchBalances = new uint256[](accounts.length);\n\n for (uint256 i = 0; i < accounts.length; ++i) {\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\n }\n\n return batchBalances;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev See {IERC1155-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not owner nor approved\"\n );\n _safeTransferFrom(from, to, id, amount, data);\n }\n\n /**\n * @dev See {IERC1155-safeBatchTransferFrom}.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: transfer caller is not owner nor approved\"\n );\n _safeBatchTransferFrom(from, to, ids, amounts, data);\n }\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n\n emit TransferSingle(operator, from, to, id, amount);\n\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; ++i) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n }\n\n emit TransferBatch(operator, from, to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\n }\n\n /**\n * @dev Sets a new URI for all token types, by relying on the token type ID\n * substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * By this mechanism, any occurrence of the `\\{id\\}` substring in either the\n * URI or any of the amounts in the JSON file at said URI will be replaced by\n * clients with the token type ID.\n *\n * For example, the `https://token-cdn-domain/\\{id\\}.json` URI would be\n * interpreted by clients as\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\n * for token type ID 0x4cce0.\n *\n * See {uri}.\n *\n * Because these URIs cannot be meaningfully represented by the {URI} event,\n * this function emits no events.\n */\n function _setURI(string memory newuri) internal virtual {\n _uri = newuri;\n }\n\n /**\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _mint(\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);\n\n _balances[id][to] += amount;\n emit TransferSingle(operator, address(0), to, id, amount);\n\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _mintBatch(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; i++) {\n _balances[ids[i]][to] += amounts[i];\n }\n\n emit TransferBatch(operator, address(0), to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\n }\n\n /**\n * @dev Destroys `amount` tokens of token type `id` from `from`\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `from` must have at least `amount` tokens of token type `id`.\n */\n function _burn(\n address from,\n uint256 id,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), \"\");\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n\n emit TransferSingle(operator, from, address(0), id, amount);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n */\n function _burnBatch(\n address from,\n uint256[] memory ids,\n uint256[] memory amounts\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n for (uint256 i = 0; i < ids.length; i++) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n }\n\n emit TransferBatch(operator, from, address(0), ids, amounts);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits a {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC1155: setting approval status for self\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `id` and `amount` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n function _doSafeTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\n if (response != IERC1155Receiver.onERC1155Received.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\n bytes4 response\n ) {\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\n uint256[] memory array = new uint256[](1);\n array[0] = element;\n\n return array;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1155.sol\";\nimport \"../../../security/Pausable.sol\";\n\n/**\n * @dev ERC1155 token with pausable token transfers, minting and burning.\n *\n * Useful for scenarios such as preventing trades until the end of an evaluation\n * period, or having an emergency switch for freezing all token transfers in the\n * event of a large bug.\n *\n * _Available since v3.1._\n */\nabstract contract ERC1155Pausable is ERC1155, Pausable {\n /**\n * @dev See {ERC1155-_beforeTokenTransfer}.\n *\n * Requirements:\n *\n * - the contract must not be paused.\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n require(!paused(), \"ERC1155Pausable: token transfer while paused\");\n }\n}\n" - }, - "@openzeppelin/contracts/access/AccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role, _msgSender());\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(uint160(account), 20),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" - }, - "contracts/core/interfaces/IBadges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Interface for Badges contract\n * @author Sismo\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n */\ninterface IBadges {\n error BadgesNonTransferrable();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n function initialize(string memory uri, address owner) external;\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external;\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry) external;\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external;\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155MetadataURI is IERC1155 {\n /**\n * @dev Returns the URI for token type `id`.\n *\n * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n * clients with the actual token type ID.\n */\n function uri(uint256 id) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/ERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/security/Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), \"Pausable: paused\");\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), \"Pausable: not paused\");\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "@openzeppelin/contracts/access/IAccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" - }, - "@openzeppelin/contracts/utils/Strings.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n // Inspired by OraclizeAPI's implementation - MIT licence\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0x00\";\n }\n uint256 temp = value;\n uint256 length = 0;\n while (temp != 0) {\n length++;\n temp >>= 8;\n }\n return toHexString(value, length);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n}\n" - }, - "contracts/tests/MockAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttestationsRegistry} from '../core/interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from '../core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from '../core/libs/attestations-registry/AttestationsRegistryState.sol';\nimport {IBadges} from '../core/interfaces/IBadges.sol';\nimport {Attestation, AttestationData} from '../core/libs/Structs.sol';\n\ncontract MockAttestationsRegistry {\n uint256 immutable ATTESTATION_VALUE;\n\n event AttestationRecorded(Attestation attestation);\n\n constructor(uint256 attestationValue) {\n ATTESTATION_VALUE = attestationValue;\n }\n\n function getAttestationValue(uint256 collectionId, address owner)\n external\n view\n returns (uint256)\n {\n return ATTESTATION_VALUE;\n }\n\n function recordAttestations(Attestation[] calldata attestations) external {\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationRecorded(attestations[i]);\n }\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport './OwnableLogic.sol';\nimport './PausableLogic.sol';\nimport './InitializableLogic.sol';\nimport './AttestationsRegistryState.sol';\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\n\n/**\n * @title Attestations Registry Config Logic contract\n * @author Sismo\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\n **/\ncontract AttestationsRegistryConfigLogic is\n AttestationsRegistryState,\n IAttestationsRegistryConfigLogic,\n OwnableLogic,\n PausableLogic,\n InitializableLogic\n{\n using RangeUtils for Range[];\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\n for (uint256 i = 0; i < ranges.length; i++) {\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external override onlyOwner {\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\n return _isAuthorized(issuer, collectionId);\n }\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external override onlyOwner {\n _pause();\n }\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external override onlyOwner {\n _unpause();\n }\n\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\n return _authorizedRanges[issuer]._includes(collectionId);\n }\n\n function _authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal {\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\n _authorizedRanges[issuer].push(newRange);\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal onlyOwner {\n if (rangeIndex >= _authorizedRanges[issuer].length)\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\n\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\n revert IdsMismatch(\n issuer,\n rangeIndex,\n expectedFirstId,\n expectedLastId,\n firstCollectionId,\n lastCollectionId\n );\n\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\n _authorizedRanges[issuer].length - 1\n ];\n _authorizedRanges[issuer].pop();\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryState.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Range} from '../utils/RangeLib.sol';\nimport {Attestation, AttestationData} from '../Structs.sol';\n\ncontract AttestationsRegistryState {\n // main config\n bool internal _initialized;\n bool internal _initializing;\n bool internal _paused;\n address internal _owner;\n // keeping some space for future\n uint256[15] private _placeHolders;\n\n // storing the authorized ranges for each attesters\n mapping(address => Range[]) internal _authorizedRanges;\n // keeping some space for future\n uint256[15] private _placeHolders2;\n // storing the data of attestations\n // =collectionId=> =owner=> attestationData\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\n}\n" - }, - "contracts/core/libs/attestations-registry/OwnableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n // This is the only diff with OZ contract\n // address private _owner;\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/PausableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableLogic is Context, AttestationsRegistryState {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n // this is the only diff with OZ contract\n // bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), 'Pausable: paused');\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), 'Pausable: not paused');\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/InitializableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Address.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract InitializableLogic is AttestationsRegistryState {\n // only diff with oz\n // /**\n // * @dev Indicates that the contract has been initialized.\n // */\n // bool private _initialized;\n\n // /**\n // * @dev Indicates that the contract is in the process of being initialized.\n // */\n // bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(\n _initializing ? _isConstructor() : !_initialized,\n 'Initializable: contract is already initialized'\n );\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, 'Initializable: contract is not initializing');\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\n\ninterface IAttestationsRegistryConfigLogic {\n error AttesterNotFound(address issuer);\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\n error IdsMismatch(\n address issuer,\n uint256 rangeIndex,\n uint256 expectedFirstId,\n uint256 expectedLastId,\n uint256 FirstId,\n uint256 lastCollectionId\n );\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external;\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external;\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external;\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external;\n}\n" - }, - "contracts/core/libs/utils/RangeLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nstruct Range {\n uint256 min;\n uint256 max;\n}\n\n// Range [0;3] includees 0 and 3\nlibrary RangeUtils {\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\n for (uint256 i = 0; i < ranges.length; i++) {\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\n return true;\n }\n }\n return false;\n }\n}\n" - }, - "contracts/core/libs/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.14;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "contracts/core/libs/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, 'Address: insufficient balance');\n\n (bool success, ) = recipient.call{value: amount}('');\n require(success, 'Address: unable to send value, recipient may have reverted');\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, 'Address: low-level call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, 'Address: insufficient balance for call');\n require(isContract(target), 'Address: call to non-contract');\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data)\n internal\n view\n returns (bytes memory)\n {\n return functionStaticCall(target, data, 'Address: low-level static call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), 'Address: static call to non-contract');\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), 'Address: delegate call to non-contract');\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/tests/MockAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\nimport {Attestation, Request} from '../core/libs/Structs.sol';\nimport {Attester} from '../core/Attester.sol';\nimport {IAttester} from '../core/interfaces/IAttester.sol';\n\ncontract MockAttester is IAttester, Attester {\n uint256 public immutable ATTESTATION_ID_MIN;\n uint256 public immutable ATTESTATION_ID_MAX;\n\n constructor(\n address ATTESTATION_REGISTRY_ADDRESS,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n ) Attester(ATTESTATION_REGISTRY_ADDRESS) {\n ATTESTATION_ID_MIN = collectionIdFirst;\n ATTESTATION_ID_MAX = collectionIdLast;\n }\n\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {}\n\n function buildAttestations(\n Request calldata request,\n bytes calldata /*data*/\n ) public view virtual override(Attester, IAttester) returns (Attestation[] memory) {\n uint256 collectionId = ATTESTATION_ID_MIN + request.claims[0].groupId;\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n collectionId,\n request.destination,\n address(this),\n request.claims[0].claimedValue,\n abi.decode(request.claims[0].extraData, (uint32)),\n 'Mock Attester v0'\n );\n return (attestations);\n }\n}\n" - }, - "contracts/core/Front.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IFront} from './interfaces/IFront.sol';\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation} from './libs/Structs.sol';\n\n/**\n * @title Front\n * @author Sismo\n * @notice This is the Front contract of the Sismo protocol\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\n\n * For more information: https://front.docs.sismo.io\n */\ncontract Front is IFront {\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\n uint256 public constant EARLY_USER_COLLECTION = 0;\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress Attestations registry contract address\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n Attestation[] memory attestations = _forwardAttestationsGeneration(\n attester,\n request,\n proofData\n );\n _generateEarlyUserAttestation(request.destination);\n return attestations;\n }\n\n /**\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n address destination = requests[0].destination;\n for (uint256 i = 0; i < attesters.length; i++) {\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\n attestations[i] = _forwardAttestationsGeneration(\n attesters[i],\n requests[i],\n proofDataArray[i]\n );\n }\n _generateEarlyUserAttestation(destination);\n return attestations;\n }\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view override returns (Attestation[] memory) {\n return _forwardAttestationsBuild(attester, request, proofData);\n }\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function of targeted attester\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n\n for (uint256 i = 0; i < attesters.length; i++) {\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\n }\n return attestations;\n }\n\n function _forwardAttestationsBuild(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal view returns (Attestation[] memory) {\n return IAttester(attester).buildAttestations(request, proofData);\n }\n\n function _forwardAttestationsGeneration(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal returns (Attestation[] memory) {\n return IAttester(attester).generateAttestations(request, proofData);\n }\n\n function _generateEarlyUserAttestation(address destination) internal {\n uint32 currentTimestamp = uint32(block.timestamp);\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\n EARLY_USER_COLLECTION,\n destination\n );\n\n if (!alreadyHasAttestation) {\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n EARLY_USER_COLLECTION,\n destination,\n address(this),\n 1,\n currentTimestamp,\n 'With strong love from Sismo'\n );\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n emit EarlyUserAttestationGenerated(destination);\n }\n }\n }\n}\n" - }, - "contracts/core/interfaces/IFront.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\n\n/**\n * @title IFront\n * @author Sismo\n * @notice This is the interface of the Front Contract\n */\ninterface IFront {\n error DifferentRequestsDestinations();\n event EarlyUserAttestationGenerated(address destination);\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev generate multiple attestations at once, to the same destination\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external returns (Attestation[][] memory);\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function(s) of targeted attester(s)\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view returns (Attestation[][] memory);\n}\n" - }, - "contracts/periphery/badges-examples/BAYCOwnershipBadgeExample.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC721} from '@openzeppelin/contracts/token/ERC721/ERC721.sol';\nimport {IAttestationsRegistry} from '../../core/interfaces/IAttestationsRegistry.sol';\n\ncontract BAYCOwnershipBadge is ERC721 {\n IAttestationsRegistry immutable ATTESTATIONS_REGISTRY;\n uint256 constant HydraS1_BAYC_ATTESTATION_COLLECTION_ID = 100000001;\n uint256 constant SMPS_BAYC_ATTESTATION_COLLECTION_ID = 30000000000003;\n\n constructor(\n address attestationsRegistryAddress,\n string memory name,\n string memory symbol\n ) ERC721(name, symbol) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n function balanceOf(address account) public view virtual override returns (uint256) {\n bool hasZKAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n HydraS1_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n bool hasDoxingAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n SMPS_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n return hasZKAttestation || hasDoxingAttestation ? 1 : 0;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/ERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"./extensions/IERC721Metadata.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/Strings.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: balance query for the zero address\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _owners[tokenId];\n require(owner != address(0), \"ERC721: owner query for nonexistent token\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n require(_exists(tokenId), \"ERC721Metadata: URI query for nonexistent token\");\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overriden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not owner nor approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n require(_exists(tokenId), \"ERC721: approved query for nonexistent token\");\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: transfer caller is not owner nor approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: transfer caller is not owner nor approved\");\n _safeTransfer(from, to, tokenId, _data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `_data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, _data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _owners[tokenId] != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n require(_exists(tokenId), \"ERC721: operator query for nonexistent token\");\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, _data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId);\n\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId);\n\n // Clear approvals\n _approve(address(0), tokenId);\n\n _balances[owner] -= 1;\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId);\n\n // Clear approvals from the previous owner\n _approve(address(0), tokenId);\n\n _balances[from] -= 1;\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits a {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits a {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param _data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, ``from``'s `tokenId` will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" - }, - "@openzeppelin/contracts/utils/StorageSlot.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" - }, - "contracts/periphery/utils/TransparentUpgradeableProxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n// Note: we just copied so that we can see the contract used\npragma solidity ^0.8.14;\n\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(''), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n ifAdmin\n {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(\n msg.sender != _getAdmin(),\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\n );\n super._beforeFallback();\n }\n}\n" - }, - "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to Pythia1 Proving Scheme\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\n\n/**\n * @title Pythia-1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Pythia-1 Attesters.\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \n * offchain service in a privacy preserving way. \n * That means no-one can make the link between the account used in the offchain service\n * and the onchain account where the attestation is stored.\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each users gets one userTicket per claim\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n **/\n\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\n using Pythia1Lib for Pythia1ProofData;\n using Pythia1Lib for bytes;\n using Pythia1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n uint256[2] internal _commitmentSignerPubKey;\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\n * @param owner The owner of the contract that can update the commitment signer pub key\n */\n constructor(\n address attestationsRegistryAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address pythia1VerifierAddress,\n uint256[2] memory commitmentSignerPubKey,\n address owner\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n initialize(commitmentSignerPubKey, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) public initializer {\n _transferOwnership(owner);\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into Pythia1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\n Pythia1ProofInput memory snarkInput = snarkProof._input();\n Pythia1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(Request calldata request, bytes calldata)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n Pythia1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.internalCollectionId;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n uint32(block.timestamp),\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used\n * @param request users request. Claim of beiing part of a group.\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0)) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * users bring secretHash as private input in snark which guarantees privacy\n * the secretHash is only known by the user and never escape the user's browser\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(Pythia1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.internalCollectionId\n );\n return ticketIdentifier;\n }\n\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\n return _commitmentSignerPubKey;\n }\n\n /*******************************************************\n Pythia-1 Attester Specific Functions\n *******************************************************/\n\n function updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey)\n external\n onlyOwner\n {\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\n _commitmentSignerPubKey = commitmentSignerPubKey;\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\n }\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\n\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\n error TicketUsed(uint256 userTicket);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/pythia-1/base/Pythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IPythia1Base} from './IPythia1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Pythia 1 ZK Proving Scheme\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\n\n/**\n * @title Pythia-1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \n * without anyone being able to make the link between the offchain service and the onchain service.\n * It is inherited by the family of Pythia-1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n \n \n **/\nabstract contract Pythia1Base is IPythia1Base, Initializable {\n using Pythia1Lib for Pythia1ProofData;\n\n // ZK-SNARK Verifier\n Pythia1Verifier immutable VERIFIER;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\n */\n constructor(address Pythia1VerifierAddress) {\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\n }\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of the Commitment signer Eddsa Public key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\n return _getCommitmentSignerPubKey();\n }\n\n /*******************************************************\n Pythia-1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * the secretHash is a number only known by the user and is used in \n * the zero knowledge as a private input which guarantees privacy\n\n * This function MUST be implemented by Pythia-1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Pythia-1 Simple Attester for an example\n * @param claim user claim: a particular claim that a user have that he can prove s right.\n */\n function _getTicketIdentifierOfClaim(Pythia1Claim memory claim)\n internal\n view\n virtual\n returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\n * prove the claim was correctly issued for the user.\n */\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(Pythia1Claim memory claim, Pythia1ProofInput memory input)\n internal\n view\n virtual\n {\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (claim.destination != msg.sender)\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\n if (\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\n )\n revert CommitmentSignerPubKeyMismatch(\n commitmentSignerPubKey[0],\n commitmentSignerPubKey[1],\n input.commitmentSignerPubKey[0],\n input.commitmentSignerPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the plonk mathematical proof using the circom verifier contract\n * @param proofData snark public input\n */\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(\n uint256 /*errorCode*/\n ) {\n revert InvalidGroth16Proof('');\n } catch (\n bytes memory /*lowLevelData*/\n ) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/pythia-1/libs/Pythia1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\n\n// user Pythia-1 claim retrieved form his request\nstruct Pythia1Claim {\n uint256 groupId; // user claims be part of this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct Pythia1GroupProperties {\n uint128 internalCollectionId;\n bool isScore;\n}\n\nstruct Pythia1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct Pythia1ProofData {\n Pythia1CircomSnarkProof proof;\n uint256[9] input;\n // destination;\n // chainId;\n // commitmentSignerPubKey.x;\n // commitmentSignerPubKey.y;\n // groupId;\n // ticketIdentifier;\n // userTicket;\n // value;\n // isStrict;\n}\n\nstruct Pythia1ProofInput {\n address destination;\n uint256 chainId;\n uint256 groupId;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n bool isStrict;\n uint256[2] commitmentSignerPubKey;\n}\n\nlibrary Pythia1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\n return\n Pythia1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getGroupId(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n Pythia1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (Pythia1GroupProperties)\n );\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(Pythia1ProofData memory self)\n internal\n pure\n returns (\n uint256[2] memory,\n uint256[2][2] memory,\n uint256[2] memory,\n uint256[9] memory\n )\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(Pythia1ProofData memory self)\n internal\n pure\n returns (uint256[2] memory)\n {\n return [self.input[2], self.input[3]];\n }\n\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(Pythia1ProofData memory self)\n internal\n pure\n returns (uint256)\n {\n return self.input[5];\n }\n\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\n return self.input[8] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(uint128 internalCollectionId, bool isScore)\n internal\n pure\n returns (uint256)\n {\n return\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(uint128 internalCollectionId, bool isScore)\n internal\n pure\n returns (bytes memory)\n {\n return abi.encode(internalCollectionId, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/pythia-1/base/IPythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\n\ninterface IPythia1Base {\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error UserShouldOwnItsDestination(address sender, address inputdestination);\n error CommitmentSignerPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier);\n\n /**\n * @dev Getter of the Commitment Signer EdDSA Public Key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\n}\n" - }, - "@sismo-core/pythia-1/contracts/Pythia1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract Pythia1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\n );\n vk.IC = new Pairing.G1Point[](10);\n \n vk.IC[0] = Pairing.G1Point( \n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 104028078850975554065172701281783302003220555203883119831575537681421753151,\n 19148240629904598794948591359118971959790791697910953160820265703277306346\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[9] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - Renewable\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew their attestations\n **/\n\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base, Attester {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(Request calldata request, bytes calldata)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n HydraS1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used and not a renewal (e.g destination different that last)\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0) && currentDestination != request.destination) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\n return ticketIdentifier;\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/core/AttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\nimport {Attestation, AttestationData} from './libs/Structs.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Attestations Registry\n * @author Sismo\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\n * Only authorized attestations issuers can record attestation in the registry\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\n * For more information: https://attestations-registry.docs.sismo.io\n\n * For each attestation recorded, a badge is received by the user\n * The badge is the Non transferrable NFT representation of an attestation \n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\n * It enables off-chain apps such as opensea to catch the \"shadow mint\" of the badge\n **/\ncontract AttestationsRegistry is\n AttestationsRegistryState,\n IAttestationsRegistry,\n AttestationsRegistryConfigLogic\n{\n IBadges immutable BADGES;\n\n /**\n * @dev Constructor.\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @param badgesAddress Stateless ERC1155 Badges contract\n */\n constructor(address owner, address badgesAddress) {\n initialize(owner);\n BADGES = IBadges(badgesAddress);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n */\n function initialize(address owner) public initializer {\n _transferOwnership(owner);\n }\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\n address issuer = _msgSender();\n for (uint256 i = 0; i < attestations.length; i++) {\n if (!_isAuthorized(issuer, attestations[i].collectionId))\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\n\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\n attestations[i].owner\n ].value;\n\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\n attestations[i].issuer,\n attestations[i].value,\n attestations[i].timestamp,\n attestations[i].extraData\n );\n\n _triggerBadgeTransferEvent(\n attestations[i].collectionId,\n attestations[i].owner,\n previousAttestationValue,\n attestations[i].value\n );\n emit AttestationRecorded(attestations[i]);\n }\n }\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds)\n external\n override\n whenNotPaused\n {\n if (owners.length != collectionIds.length)\n revert OwnersAndCollectionIdsLengthMismatch(owners, collectionIds);\n\n address issuer = _msgSender();\n for (uint256 i = 0; i < owners.length; i++) {\n AttestationData memory attestationData = _attestationsData[collectionIds[i]][owners[i]];\n\n if (!_isAuthorized(issuer, collectionIds[i]))\n revert IssuerNotAuthorized(issuer, collectionIds[i]);\n delete _attestationsData[collectionIds[i]][owners[i]];\n\n _triggerBadgeTransferEvent(collectionIds[i], owners[i], attestationData.value, 0);\n\n emit AttestationDeleted(\n Attestation(\n collectionIds[i],\n owners[i],\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n )\n );\n }\n }\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner)\n external\n view\n override\n returns (bool)\n {\n return _getAttestationValue(collectionId, owner) != 0;\n }\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(uint256 collectionId, address owner)\n external\n view\n override\n returns (AttestationData memory)\n {\n return _getAttestationData(collectionId, owner);\n }\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner)\n external\n view\n override\n returns (uint256)\n {\n return _getAttestationValue(collectionId, owner);\n }\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(uint256 collectionId, address owner)\n external\n view\n override\n returns (\n address,\n uint256,\n uint32,\n bytes memory\n )\n {\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\n return (\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n );\n }\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(uint256 collectionId, address owner)\n external\n view\n override\n returns (bytes memory)\n {\n return _attestationsData[collectionId][owner].extraData;\n }\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(uint256 collectionId, address owner)\n external\n view\n override\n returns (address)\n {\n return _attestationsData[collectionId][owner].issuer;\n }\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(uint256 collectionId, address owner)\n external\n view\n override\n returns (uint32)\n {\n return _attestationsData[collectionId][owner].timestamp;\n }\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n override\n returns (AttestationData[] memory)\n {\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\n }\n return attestationsDataArray;\n }\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n override\n returns (uint256[] memory)\n {\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\n }\n return attestationsValues;\n }\n\n /**\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\n * It enables off-chain apps such as opensea to catch the \"shadow mints/burns\" of badges\n */\n function _triggerBadgeTransferEvent(\n uint256 badgeTokenId,\n address owner,\n uint256 previousValue,\n uint256 newValue\n ) internal {\n bool isGreaterValue = newValue > previousValue;\n address operator = address(this);\n address from = isGreaterValue ? address(0) : owner;\n address to = isGreaterValue ? owner : address(0);\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\n\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\n }\n\n function _getAttestationData(uint256 collectionId, address owner)\n internal\n view\n returns (AttestationData memory)\n {\n return (_attestationsData[collectionId][owner]);\n }\n\n function _getAttestationValue(uint256 collectionId, address owner)\n internal\n view\n returns (uint256)\n {\n return _attestationsData[collectionId][owner].value;\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/mumbai/AttestationsRegistry.json b/deployments/mumbai/AttestationsRegistry.json deleted file mode 100644 index ce1c3d3..0000000 --- a/deployments/mumbai/AttestationsRegistry.json +++ /dev/null @@ -1,1812 +0,0 @@ -{ - "address": "0xf576E42E5b2682B8f606B1840c3A982610C29a3f", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "badgesAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "ArgsLengthDoesNotMatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - } - ], - "name": "AttesterNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - } - ], - "name": "AttributeAlreadyExists", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - } - ], - "name": "AttributeDoesNotExist", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "rangeIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedFirstId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedLastId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "FirstId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "IdsMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "IndexOutOfBounds", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "IssuerNotAuthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "owners", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - } - ], - "name": "OwnersAndCollectionIdsLengthMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "expectedArrayLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rangeIndex", - "type": "uint256" - } - ], - "name": "RangeIndexOutOfBounds", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "value", - "type": "uint8" - } - ], - "name": "ValueOutOfBounds", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationRecorded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "attributeValue", - "type": "uint8" - } - ], - "name": "AttestationsCollectionAttributeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "deletedAttributeName", - "type": "bytes32" - } - ], - "name": "AttributeDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "newAttributeName", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "previousAttributeName", - "type": "bytes32" - } - ], - "name": "AttributeNameUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "firstCollectionId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "IssuerAuthorized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "firstCollectionId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "IssuerUnauthorized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "attributeName", - "type": "bytes32" - } - ], - "name": "NewAttributeCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Unpaused", - "type": "event" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "attestationsCollectionHasAttribute", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - } - ], - "name": "attestationsCollectionHasAttributes", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "firstCollectionId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "authorizeRange", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Range[]", - "name": "ranges", - "type": "tuple[]" - } - ], - "name": "authorizeRanges", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "name", - "type": "bytes32" - } - ], - "name": "createNewAttribute", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - }, - { - "internalType": "bytes32[]", - "name": "names", - "type": "bytes32[]" - } - ], - "name": "createNewAttributes", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "owners", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - } - ], - "name": "deleteAttestations", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "deleteAttribute", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - } - ], - "name": "deleteAttributes", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationData", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct AttestationData", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "owners", - "type": "address[]" - } - ], - "name": "getAttestationDataBatch", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct AttestationData[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationDataTuple", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationExtraData", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationIssuer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationTimestamp", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationValue", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "owners", - "type": "address[]" - } - ], - "name": "getAttestationValueBatch", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "getAttributeValueForAttestationsCollection", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "getAttributesNamesAndValuesForAttestationsCollection", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - }, - { - "internalType": "uint8[]", - "name": "", - "type": "uint8[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - } - ], - "name": "getAttributesValuesForAttestationsCollection", - "outputs": [ - { - "internalType": "uint8[]", - "name": "", - "type": "uint8[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "hasAttestation", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "isAuthorized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "paused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "attestations", - "type": "tuple[]" - } - ], - "name": "recordAttestations", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "value", - "type": "uint8" - } - ], - "name": "setAttributeValueForAttestationsCollection", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - }, - { - "internalType": "uint8[]", - "name": "values", - "type": "uint8[]" - } - ], - "name": "setAttributesValuesForAttestationsCollections", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "rangeIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "firstCollectionId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "unauthorizeRange", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Range[]", - "name": "ranges", - "type": "tuple[]" - }, - { - "internalType": "uint256[]", - "name": "rangeIndexes", - "type": "uint256[]" - } - ], - "name": "unauthorizeRanges", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "unpause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "newName", - "type": "bytes32" - } - ], - "name": "updateAttributeName", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - }, - { - "internalType": "bytes32[]", - "name": "newNames", - "type": "bytes32[]" - } - ], - "name": "updateAttributesName", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x23ead6ee5b2b09647afa2e281d6cb93a084f26cc05fb59708bf0b291222cfaf7", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x219aEB9920E8528C2664EC673c2df0E55DEEc26E", - "transactionIndex": 11, - "gasUsed": "3121566", - "logsBloom": "0x00000000000000000000000000020000000000000000000000800000000000000000000000000000000000000000000000008000002000000000000000000000000000000000000000000000000000800001000000000000040100000000000000000000020000000000200000000800002000000000000080000000000000400000000000000000000000000000000000000010000080000000000000008000200000000000000000000000800400000000000000000000000040000000004000000000000000000001000000040000000800000000000000100000000020000000000000000002000000000000000000000000000000000020000000100000", - "blockHash": "0x655bddf3573ec82ece82fb6dc8dfc789151c1afcc549317e790c1eca4dc5568c", - "transactionHash": "0x23ead6ee5b2b09647afa2e281d6cb93a084f26cc05fb59708bf0b291222cfaf7", - "logs": [ - { - "transactionIndex": 11, - "blockNumber": 29540661, - "transactionHash": "0x23ead6ee5b2b09647afa2e281d6cb93a084f26cc05fb59708bf0b291222cfaf7", - "address": "0x219aEB9920E8528C2664EC673c2df0E55DEEc26E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" - ], - "data": "0x", - "logIndex": 32, - "blockHash": "0x655bddf3573ec82ece82fb6dc8dfc789151c1afcc549317e790c1eca4dc5568c" - }, - { - "transactionIndex": 11, - "blockNumber": 29540661, - "transactionHash": "0x23ead6ee5b2b09647afa2e281d6cb93a084f26cc05fb59708bf0b291222cfaf7", - "address": "0x219aEB9920E8528C2664EC673c2df0E55DEEc26E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954" - ], - "data": "0x", - "logIndex": 33, - "blockHash": "0x655bddf3573ec82ece82fb6dc8dfc789151c1afcc549317e790c1eca4dc5568c" - }, - { - "transactionIndex": 11, - "blockNumber": 29540661, - "transactionHash": "0x23ead6ee5b2b09647afa2e281d6cb93a084f26cc05fb59708bf0b291222cfaf7", - "address": "0x219aEB9920E8528C2664EC673c2df0E55DEEc26E", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 34, - "blockHash": "0x655bddf3573ec82ece82fb6dc8dfc789151c1afcc549317e790c1eca4dc5568c" - }, - { - "transactionIndex": 11, - "blockNumber": 29540661, - "transactionHash": "0x23ead6ee5b2b09647afa2e281d6cb93a084f26cc05fb59708bf0b291222cfaf7", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000c275dc8be39f50d12f66b6a63629c39da5bae5bd" - ], - "data": "0x000000000000000000000000000000000000000000000000000ed690e9d737dc0000000000000000000000000000000000000000000000007d35c1e8683d9f52000000000000000000000000000000000000000000000b8e6f62240848713dbc0000000000000000000000000000000000000000000000007d26eb577e666776000000000000000000000000000000000000000000000b8e6f70fa9932487598", - "logIndex": 35, - "blockHash": "0x655bddf3573ec82ece82fb6dc8dfc789151c1afcc549317e790c1eca4dc5568c" - } - ], - "blockNumber": 29540661, - "cumulativeGasUsed": "4966184", - "status": 1, - "byzantium": true - }, - "args": [ - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954", - "0x5722fEa81027533721BA161964622271560da1aC" - ], - "numDeployments": 4, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"badgesAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ArgsLengthDoesNotMatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"}],\"name\":\"AttesterNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"}],\"name\":\"AttributeAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"}],\"name\":\"AttributeDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rangeIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedFirstId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedLastId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"FirstId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"IdsMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"IndexOutOfBounds\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"IssuerNotAuthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"}],\"name\":\"OwnersAndCollectionIdsLengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"expectedArrayLength\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rangeIndex\",\"type\":\"uint256\"}],\"name\":\"RangeIndexOutOfBounds\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"value\",\"type\":\"uint8\"}],\"name\":\"ValueOutOfBounds\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationRecorded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeValue\",\"type\":\"uint8\"}],\"name\":\"AttestationsCollectionAttributeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"deletedAttributeName\",\"type\":\"bytes32\"}],\"name\":\"AttributeDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"newAttributeName\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"previousAttributeName\",\"type\":\"bytes32\"}],\"name\":\"AttributeNameUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"IssuerAuthorized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"IssuerUnauthorized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"attributeName\",\"type\":\"bytes32\"}],\"name\":\"NewAttributeCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"attestationsCollectionHasAttribute\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"}],\"name\":\"attestationsCollectionHasAttributes\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"authorizeRange\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"internalType\":\"struct Range[]\",\"name\":\"ranges\",\"type\":\"tuple[]\"}],\"name\":\"authorizeRanges\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"createNewAttribute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"names\",\"type\":\"bytes32[]\"}],\"name\":\"createNewAttributes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"}],\"name\":\"deleteAttestations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"deleteAttribute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"}],\"name\":\"deleteAttributes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationData\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct AttestationData\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"}],\"name\":\"getAttestationDataBatch\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct AttestationData[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationDataTuple\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationIssuer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationTimestamp\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationValue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"}],\"name\":\"getAttestationValueBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"getAttributeValueForAttestationsCollection\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"getAttributesNamesAndValuesForAttestationsCollection\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"}],\"name\":\"getAttributesValuesForAttestationsCollection\",\"outputs\":[{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"hasAttestation\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"isAuthorized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"attestations\",\"type\":\"tuple[]\"}],\"name\":\"recordAttestations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"value\",\"type\":\"uint8\"}],\"name\":\"setAttributeValueForAttestationsCollection\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"},{\"internalType\":\"uint8[]\",\"name\":\"values\",\"type\":\"uint8[]\"}],\"name\":\"setAttributesValuesForAttestationsCollections\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rangeIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"unauthorizeRange\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"internalType\":\"struct Range[]\",\"name\":\"ranges\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256[]\",\"name\":\"rangeIndexes\",\"type\":\"uint256[]\"}],\"name\":\"unauthorizeRanges\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"newName\",\"type\":\"bytes32\"}],\"name\":\"updateAttributeName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"newNames\",\"type\":\"bytes32[]\"}],\"name\":\"updateAttributesName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"attestationsCollectionHasAttribute(uint256,uint8)\":{\"details\":\"Returns whether an attestationsCollection has a specific attribute referenced by its index\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\",\"index\":\"Index of the attribute. Can go from 0 to 63.\"}},\"authorizeRange(address,uint256,uint256)\":{\"details\":\"Authorize an issuer for a specific range\",\"params\":{\"firstCollectionId\":\"First collection Id of the range for which the issuer will be authorized\",\"issuer\":\"Issuer that will be authorized\",\"lastCollectionId\":\"Last collection Id of the range for which the issuer will be authorized\"}},\"authorizeRanges(address,(uint256,uint256)[])\":{\"details\":\"Authorize an issuer for specific ranges\",\"params\":{\"issuer\":\"Issuer that will be authorized\",\"ranges\":\"Ranges for which the issuer will be authorized\"}},\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"badgesAddress\":\"Stateless ERC1155 Badges contract\",\"owner\":\"Owner of the contract, has the right to authorize/unauthorize attestations issuers\"}},\"createNewAttribute(uint8,bytes32)\":{\"details\":\"Create a new attribute.\",\"params\":{\"index\":\"Index of the attribute. Can go from 0 to 63.\",\"name\":\"Name in bytes32 of the attribute\"}},\"deleteAttestations(address[],uint256[])\":{\"details\":\"Delete function to be called by authorized issuers\",\"params\":{\"collectionIds\":\"The collection ids of the attestations to be deleted\",\"owners\":\"The owners of the attestations to be deleted\"}},\"deleteAttribute(uint8)\":{\"details\":\"Delete an existing attribute\",\"params\":{\"index\":\"Index of the attribute. Can go from 0 to 63. The attribute must already exist\"}},\"getAttestationData(uint256,address)\":{\"details\":\"Getter of the data of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationDataBatch(uint256[],address[])\":{\"details\":\"Getter of the data of specific attestations\",\"params\":{\"collectionIds\":\"Collection identifiers of the targeted attestations\",\"owners\":\"Owners of the targeted attestations\"}},\"getAttestationDataTuple(uint256,address)\":{\"details\":\"Getter of the data of a specific attestation as tuple\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationExtraData(uint256,address)\":{\"details\":\"Getter of the extraData of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationIssuer(uint256,address)\":{\"details\":\"Getter of the issuer of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationTimestamp(uint256,address)\":{\"details\":\"Getter of the timestamp of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationValue(uint256,address)\":{\"details\":\"Getter of the value of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationValueBatch(uint256[],address[])\":{\"details\":\"Getter of the values of specific attestations\",\"params\":{\"collectionIds\":\"Collection identifiers of the targeted attestations\",\"owners\":\"Owners of the targeted attestations\"}},\"getAttributeValueForAttestationsCollection(uint256,uint8)\":{\"details\":\"Returns the attribute's value (from 0 to 15) of an attestationsCollection\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\",\"index\":\"Index of the attribute. Can go from 0 to 63.\"}},\"getAttributesNamesAndValuesForAttestationsCollection(uint256)\":{\"details\":\"Returns all the enabled attributes names and their values for a specific attestationsCollection\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\"}},\"hasAttestation(uint256,address)\":{\"details\":\"Returns whether a user has an attestation from a collection\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"initialize(address)\":{\"details\":\"Initialize function, to be called by the proxy delegating calls to this implementation\",\"params\":{\"ownerAddress\":\"Owner of the contract, has the right to authorize/unauthorize attestations issuers\"}},\"isAuthorized(address,uint256)\":{\"details\":\"Returns whether a specific issuer is authorized or not to record in a specific attestations collection\",\"params\":{\"collectionId\":\"Collection Id for which the issuer will be checked\",\"issuer\":\"Issuer to be checked\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pause()\":{\"details\":\"Pauses the registry. Issuers can no longer record or delete attestations\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"recordAttestations((uint256,address,address,uint256,uint32,bytes)[])\":{\"details\":\"Main function to be called by authorized issuers\",\"params\":{\"attestations\":\"Attestations to be recorded (creates a new one or overrides an existing one)\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAttributeValueForAttestationsCollection(uint256,uint8,uint8)\":{\"details\":\"Set a value for an attribute of an attestationsCollection. The attribute should already be created.\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\",\"index\":\"Index of the attribute (must be between 0 and 63)\",\"value\":\"Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unauthorizeRange(address,uint256,uint256,uint256)\":{\"details\":\"Unauthorize an issuer for a specific range\",\"params\":{\"firstCollectionId\":\"First collection Id of the range for which the issuer will be unauthorized\",\"issuer\":\"Issuer that will be unauthorized\",\"lastCollectionId\":\"Last collection Id of the range for which the issuer will be unauthorized\",\"rangeIndex\":\"Index of the range to be unauthorized\"}},\"unauthorizeRanges(address,(uint256,uint256)[],uint256[])\":{\"details\":\"Unauthorize an issuer for specific ranges\",\"params\":{\"issuer\":\"Issuer that will be unauthorized\",\"ranges\":\"Ranges for which the issuer will be unauthorized\"}},\"unpause()\":{\"details\":\"Unpauses the registry\"},\"updateAttributeName(uint8,bytes32)\":{\"details\":\"Update the name of an existing attribute\",\"params\":{\"index\":\"Index of the attribute. Can go from 0 to 63. The attribute must exist\",\"newName\":\"new name in bytes32 of the attribute\"}}},\"title\":\"Attestations Registry\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"Main contract of Sismo, stores all recorded attestations in attestations collections Only authorized attestations issuers can record attestation in the registry Attesters that expect to record in the Attestations Registry must be authorized issuers For more information: https://attestations-registry.docs.sismo.io For each attestation recorded, a badge is received by the user The badge is the Non transferrable NFT representation of an attestation Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts It enables off-chain apps such as opensea to catch the \\\"shadow mint\\\" of the badge*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/AttestationsRegistry.sol\":\"AttestationsRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/core/AttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\\nimport {Attestation, AttestationData} from './libs/Structs.sol';\\nimport {IBadges} from './interfaces/IBadges.sol';\\n\\n/**\\n * @title Attestations Registry\\n * @author Sismo\\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\\n * Only authorized attestations issuers can record attestation in the registry\\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\\n * For more information: https://attestations-registry.docs.sismo.io\\n\\n * For each attestation recorded, a badge is received by the user\\n * The badge is the Non transferrable NFT representation of an attestation \\n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\\n * It enables off-chain apps such as opensea to catch the \\\"shadow mint\\\" of the badge\\n **/\\ncontract AttestationsRegistry is\\n AttestationsRegistryState,\\n IAttestationsRegistry,\\n AttestationsRegistryConfigLogic\\n{\\n uint8 public constant IMPLEMENTATION_VERSION = 3;\\n IBadges immutable BADGES;\\n\\n /**\\n * @dev Constructor.\\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @param badgesAddress Stateless ERC1155 Badges contract\\n */\\n constructor(address owner, address badgesAddress) {\\n BADGES = IBadges(badgesAddress);\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\\n address issuer = _msgSender();\\n for (uint256 i = 0; i < attestations.length; i++) {\\n if (!_isAuthorized(issuer, attestations[i].collectionId))\\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\\n\\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\\n attestations[i].owner\\n ].value;\\n\\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\\n attestations[i].issuer,\\n attestations[i].value,\\n attestations[i].timestamp,\\n attestations[i].extraData\\n );\\n\\n _triggerBadgeTransferEvent(\\n attestations[i].collectionId,\\n attestations[i].owner,\\n previousAttestationValue,\\n attestations[i].value\\n );\\n emit AttestationRecorded(attestations[i]);\\n }\\n }\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(\\n address[] calldata owners,\\n uint256[] calldata collectionIds\\n ) external override whenNotPaused {\\n if (owners.length != collectionIds.length)\\n revert OwnersAndCollectionIdsLengthMismatch(owners, collectionIds);\\n\\n address issuer = _msgSender();\\n for (uint256 i = 0; i < owners.length; i++) {\\n AttestationData memory attestationData = _attestationsData[collectionIds[i]][owners[i]];\\n\\n if (!_isAuthorized(issuer, collectionIds[i]))\\n revert IssuerNotAuthorized(issuer, collectionIds[i]);\\n delete _attestationsData[collectionIds[i]][owners[i]];\\n\\n _triggerBadgeTransferEvent(collectionIds[i], owners[i], attestationData.value, 0);\\n\\n emit AttestationDeleted(\\n Attestation(\\n collectionIds[i],\\n owners[i],\\n attestationData.issuer,\\n attestationData.value,\\n attestationData.timestamp,\\n attestationData.extraData\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (bool) {\\n return _getAttestationValue(collectionId, owner) != 0;\\n }\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (AttestationData memory) {\\n return _getAttestationData(collectionId, owner);\\n }\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (uint256) {\\n return _getAttestationValue(collectionId, owner);\\n }\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (address, uint256, uint32, bytes memory) {\\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\\n return (\\n attestationData.issuer,\\n attestationData.value,\\n attestationData.timestamp,\\n attestationData.extraData\\n );\\n }\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (bytes memory) {\\n return _attestationsData[collectionId][owner].extraData;\\n }\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (address) {\\n return _attestationsData[collectionId][owner].issuer;\\n }\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (uint32) {\\n return _attestationsData[collectionId][owner].timestamp;\\n }\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view override returns (AttestationData[] memory) {\\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\\n }\\n return attestationsDataArray;\\n }\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view override returns (uint256[] memory) {\\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\\n }\\n return attestationsValues;\\n }\\n\\n /**\\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\\n * It enables off-chain apps such as opensea to catch the \\\"shadow mints/burns\\\" of badges\\n */\\n function _triggerBadgeTransferEvent(\\n uint256 badgeTokenId,\\n address owner,\\n uint256 previousValue,\\n uint256 newValue\\n ) internal {\\n bool isGreaterValue = newValue > previousValue;\\n address operator = address(this);\\n address from = isGreaterValue ? address(0) : owner;\\n address to = isGreaterValue ? owner : address(0);\\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\\n\\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\\n }\\n\\n function _getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) internal view returns (AttestationData memory) {\\n return (_attestationsData[collectionId][owner]);\\n }\\n\\n function _getAttestationValue(\\n uint256 collectionId,\\n address owner\\n ) internal view returns (uint256) {\\n return _attestationsData[collectionId][owner].value;\\n }\\n}\\n\",\"keccak256\":\"0xc21afe30d8096d2bab3683ca28b2533f99f53fa20a1f2c13aa44f1d46ecb9ae6\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IBadges.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Interface for Badges contract\\n * @author Sismo\\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\\n * The associated attestations registry triggers TransferSingle events from this contract\\n * It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms\\n */\\ninterface IBadges {\\n error BadgesNonTransferrable();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(string memory uri, address owner) external;\\n\\n /**\\n * @dev Main function of the ERC1155 badge\\n * The balance of a user is equal to the value of the underlying attestation.\\n * attestationCollectionId == badgeId\\n * @param account Address to check badge balance (= value of attestation)\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\\n * @param operator who is calling the TransferEvent\\n * @param from address(0) if minting, address of the badge holder if burning\\n * @param to address of the badge holder is minting, address(0) if burning\\n * @param id badgeId for which to trigger the event\\n * @param value minted/burned balance\\n */\\n function triggerTransferEvent(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 value\\n ) external;\\n\\n /**\\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\\n * @param attestationsRegistry new attestations registry address\\n */\\n function setAttestationsRegistry(address attestationsRegistry) external;\\n\\n /**\\n * @dev Set the URI. Can only be called by owner (default admin)\\n * @param uri new attestations registry address\\n */\\n function setUri(string memory uri) external;\\n\\n /**\\n * @dev Getter of the attestations registry\\n */\\n function getAttestationsRegistry() external view returns (address);\\n\\n /**\\n * @dev Getter of the badge issuer\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeIssuer(address account, uint256 id) external view returns (address);\\n\\n /**\\n * @dev Getter of the badge timestamp\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the value of a specific badge attribute\\n * @param id Badge Id to check (= attestationCollectionId)\\n * @param index Index of the attribute\\n */\\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);\\n\\n /**\\n * @dev Getter of all badge attributes and their values for a specific badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getAttributesNamesAndValuesForBadge(\\n uint256 id\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n}\\n\",\"keccak256\":\"0xd6bdfc887ef15ee022eb05d89dbe2e2938ee6c0a55a55f8db527ef650242c6bb\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport './OwnableLogic.sol';\\nimport './PausableLogic.sol';\\nimport './InitializableLogic.sol';\\nimport './AttestationsRegistryState.sol';\\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\\nimport {Bitmap256Bit} from '../utils/Bitmap256Bit.sol';\\n\\n/**\\n * @title Attestations Registry Config Logic contract\\n * @author Sismo\\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\\n **/\\ncontract AttestationsRegistryConfigLogic is\\n AttestationsRegistryState,\\n IAttestationsRegistryConfigLogic,\\n OwnableLogic,\\n PausableLogic,\\n InitializableLogic\\n{\\n using RangeUtils for Range[];\\n using Bitmap256Bit for uint256;\\n using Bitmap256Bit for uint8;\\n\\n /******************************************\\n *\\n * ATTESTATION REGISTRY WRITE ACCESS MANAGEMENT (ISSUERS)\\n *\\n *****************************************/\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external override onlyOwner {\\n _pause();\\n }\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external override onlyOwner {\\n _unpause();\\n }\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external override onlyOwner {\\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\\n }\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external override onlyOwner {\\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\\n }\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\\n }\\n }\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external override onlyOwner {\\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\\n return _isAuthorized(issuer, collectionId);\\n }\\n\\n /******************************************\\n *\\n * ATTRIBUTES CONFIG LOGIC\\n *\\n *****************************************/\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) public onlyOwner {\\n index._checkIndexIsValid();\\n if (_isAttributeCreated(index)) {\\n revert AttributeAlreadyExists(index);\\n }\\n _createNewAttribute(index, name);\\n }\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external onlyOwner {\\n if (indices.length != names.length) {\\n revert ArgsLengthDoesNotMatch();\\n }\\n\\n for (uint256 i = 0; i < indices.length; i++) {\\n createNewAttribute(indices[i], names[i]);\\n }\\n }\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) public onlyOwner {\\n index._checkIndexIsValid();\\n if (!_isAttributeCreated(index)) {\\n revert AttributeDoesNotExist(index);\\n }\\n _updateAttributeName(index, newName);\\n }\\n\\n function updateAttributesName(\\n uint8[] memory indices,\\n bytes32[] memory newNames\\n ) external onlyOwner {\\n if (indices.length != newNames.length) {\\n revert ArgsLengthDoesNotMatch();\\n }\\n\\n for (uint256 i = 0; i < indices.length; i++) {\\n updateAttributeName(indices[i], newNames[i]);\\n }\\n }\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must already exist\\n */\\n function deleteAttribute(uint8 index) public onlyOwner {\\n index._checkIndexIsValid();\\n if (!_isAttributeCreated(index)) {\\n revert AttributeDoesNotExist(index);\\n }\\n _deleteAttribute(index);\\n }\\n\\n function deleteAttributes(uint8[] memory indices) external onlyOwner {\\n for (uint256 i = 0; i < indices.length; i++) {\\n deleteAttribute(indices[i]);\\n }\\n }\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) public onlyOwner {\\n index._checkIndexIsValid();\\n\\n if (!_isAttributeCreated(index)) {\\n revert AttributeDoesNotExist(index);\\n }\\n\\n _setAttributeForAttestationsCollection(collectionId, index, value);\\n }\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external onlyOwner {\\n if (collectionIds.length != indices.length || collectionIds.length != values.length) {\\n revert ArgsLengthDoesNotMatch();\\n }\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n setAttributeValueForAttestationsCollection(collectionIds[i], indices[i], values[i]);\\n }\\n }\\n\\n /**\\n * @dev Returns the attribute's value (from 0 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index\\n ) public view returns (uint8) {\\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\\n collectionId\\n );\\n return currentAttributesValues._get(index);\\n }\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory) {\\n uint8[] memory attributesValues = new uint8[](indices.length);\\n for (uint256 i = 0; i < indices.length; i++) {\\n attributesValues[i] = getAttributeValueForAttestationsCollection(collectionId, indices[i]);\\n }\\n return attributesValues;\\n }\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) public view returns (bool) {\\n uint256 currentAttributeValues = _getAttributesValuesBitmapForAttestationsCollection(\\n collectionId\\n );\\n return currentAttributeValues._get(index) > 0;\\n }\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool) {\\n for (uint256 i = 0; i < indices.length; i++) {\\n if (!attestationsCollectionHasAttribute(collectionId, indices[i])) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) public view returns (bytes32[] memory, uint8[] memory) {\\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\\n collectionId\\n );\\n\\n (\\n uint8[] memory indices,\\n uint8[] memory values,\\n uint8 nbOfNonZeroValues\\n ) = currentAttributesValues._getAllNonZeroValues();\\n\\n bytes32[] memory attributesNames = new bytes32[](nbOfNonZeroValues);\\n uint8[] memory attributesValues = new uint8[](nbOfNonZeroValues);\\n for (uint8 i = 0; i < nbOfNonZeroValues; i++) {\\n attributesNames[i] = _attributesNames[indices[i]];\\n attributesValues[i] = values[i];\\n }\\n\\n return (attributesNames, attributesValues);\\n }\\n\\n /*****************************\\n *\\n * INTERNAL FUNCTIONS\\n *\\n *****************************/\\n\\n function _authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) internal {\\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\\n _authorizedRanges[issuer].push(newRange);\\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\\n }\\n\\n function _unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) internal onlyOwner {\\n if (rangeIndex >= _authorizedRanges[issuer].length)\\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\\n\\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\\n revert IdsMismatch(\\n issuer,\\n rangeIndex,\\n expectedFirstId,\\n expectedLastId,\\n firstCollectionId,\\n lastCollectionId\\n );\\n\\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\\n _authorizedRanges[issuer].length - 1\\n ];\\n _authorizedRanges[issuer].pop();\\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\\n }\\n\\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\\n return _authorizedRanges[issuer]._includes(collectionId);\\n }\\n\\n function _setAttributeForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) internal {\\n uint256 currentAttributes = _getAttributesValuesBitmapForAttestationsCollection(collectionId);\\n\\n _attestationsCollectionAttributesValuesBitmap[collectionId] = currentAttributes._set(\\n index,\\n value\\n );\\n\\n emit AttestationsCollectionAttributeSet(collectionId, index, value);\\n }\\n\\n function _createNewAttribute(uint8 index, bytes32 name) internal {\\n _attributesNames[index] = name;\\n\\n emit NewAttributeCreated(index, name);\\n }\\n\\n function _updateAttributeName(uint8 index, bytes32 newName) internal {\\n bytes32 previousName = _attributesNames[index];\\n\\n _attributesNames[index] = newName;\\n\\n emit AttributeNameUpdated(index, newName, previousName);\\n }\\n\\n function _deleteAttribute(uint8 index) internal {\\n bytes32 deletedName = _attributesNames[index];\\n\\n delete _attributesNames[index];\\n\\n emit AttributeDeleted(index, deletedName);\\n }\\n\\n function _getAttributesValuesBitmapForAttestationsCollection(\\n uint256 collectionId\\n ) internal view returns (uint256) {\\n return _attestationsCollectionAttributesValuesBitmap[collectionId];\\n }\\n\\n function _isAttributeCreated(uint8 index) internal view returns (bool) {\\n if (_attributesNames[index] == 0) {\\n return false;\\n }\\n return true;\\n }\\n}\\n\",\"keccak256\":\"0xa48b3131a3870684389282cb863a34734c67194d7f50d266ed8421114b3d786a\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/AttestationsRegistryState.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Range} from '../utils/RangeLib.sol';\\nimport {Attestation, AttestationData} from '../Structs.sol';\\n\\ncontract AttestationsRegistryState {\\n /*******************************************************\\n Storage layout:\\n 19 slots for config\\n 4 currently used for _initialized, _initializing, _paused, _owner\\n 15 place holders\\n 16 slots for logic\\n 3 currently used for _authorizedRanges, _attestationsCollectionAttributesValuesBitmap, _attributesNames\\n 13 place holders\\n 1 slot for _attestationsData \\n *******************************************************/\\n\\n // main config\\n // changed `_initialized` from bool to uint8\\n // as we were using OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n // and changed to OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n // PR: https://github.com/sismo-core/sismo-protocol/pull/41\\n uint8 internal _initialized;\\n bool internal _initializing;\\n bool internal _paused;\\n address internal _owner;\\n // keeping some space for future\\n uint256[15] private _placeHoldersAdmin;\\n\\n // storing the authorized ranges for each attesters\\n mapping(address => Range[]) internal _authorizedRanges;\\n // Storing the attributes values used for each attestations collection\\n // Each attribute value is an hexadecimal\\n mapping(uint256 => uint256) internal _attestationsCollectionAttributesValuesBitmap;\\n // Storing the attribute name for each attributes index\\n mapping(uint8 => bytes32) internal _attributesNames;\\n // keeping some space for future\\n uint256[13] private _placeHoldersConfig;\\n // storing the data of attestations\\n // =collectionId=> =owner=> attestationData\\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\\n}\\n\",\"keccak256\":\"0xabd7a629901a128cc32f80102ce06db228a76bd04f27818ccaf54827921eb149\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/InitializableLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport '../utils/Address.sol';\\nimport './AttestationsRegistryState.sol';\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract InitializableLogic is AttestationsRegistryState {\\n // only diff with oz\\n // /**\\n // * @dev Indicates that the contract has been initialized.\\n // */\\n // bool private _initialized;\\n\\n // /**\\n // * @dev Indicates that the contract is in the process of being initialized.\\n // */\\n // bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) ||\\n (!Address.isContract(address(this)) && _initialized == 1),\\n 'Initializable: contract is already initialized'\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(\\n !_initializing && _initialized < version,\\n 'Initializable: contract is already initialized'\\n );\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, 'Initializable: contract is not initializing');\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, 'Initializable: contract is initializing');\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x64d931c5e29318bd4ae2ec44b3be45783ad7ad20431594bbcb9ae4e2014bc5ef\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/OwnableLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport '../utils/Context.sol';\\nimport './AttestationsRegistryState.sol';\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n // This is the only diff with OZ contract\\n // address private _owner;\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x74ff8ebdd6ad706a45354f1045ef623840aa1dbde37874dde2b6bfa498e0bdb3\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/PausableLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport '../utils/Context.sol';\\nimport './AttestationsRegistryState.sol';\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableLogic is Context, AttestationsRegistryState {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n // this is the only diff with OZ contract\\n // bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n require(!paused(), 'Pausable: paused');\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n require(paused(), 'Pausable: not paused');\\n _;\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0x234c48f5eb48bb15b6c2535428f1e28e172bc2c6fbf58c99ba7b3ca75e884c60\",\"license\":\"MIT\"},\"contracts/core/libs/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, 'Address: insufficient balance');\\n\\n (bool success, ) = recipient.call{value: amount}('');\\n require(success, 'Address: unable to send value, recipient may have reverted');\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, 'Address: low-level call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, 'Address: insufficient balance for call');\\n require(isContract(target), 'Address: call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data\\n ) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, 'Address: low-level static call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), 'Address: static call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), 'Address: delegate call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xdbca640e165333604a6121b07d206eea2b596dd3c3bb4d62caa436a05ac1d91d\",\"license\":\"MIT\"},\"contracts/core/libs/utils/Bitmap256Bit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/*\\n * The 256-bit bitmap is structured in 64 chuncks of 4 bits each.\\n * The 4 bits can encode any value from 0 to 15.\\n\\n chunck63 chunck2 chunck1 chunck0\\n bits bits bits bits \\n \\u250c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510 \\u250c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u252c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u252c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510\\n \\u2502 1 1 1 1 \\u2502 .... \\u2502 1 0 1 1 \\u2502 0 0 0 0 \\u2502 0 0 0 1 \\u2502\\n \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518 \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2534\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2534\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518\\n value 15 value 11 value 0 value 1\\n\\n * A chunck index must be between 0 and 63.\\n * A value must be between 0 and 15.\\n **/\\n\\nlibrary Bitmap256Bit {\\n uint256 constant MAX_INT = 2 ** 256 - 1;\\n\\n error IndexOutOfBounds(uint8 index);\\n error ValueOutOfBounds(uint8 value);\\n\\n /**\\n * @dev Return the value at a given index of a 256-bit bitmap\\n * @param index index where the value can be found. Can be between 0 and 63\\n */\\n function _get(uint256 self, uint8 index) internal pure returns (uint8) {\\n uint256 currentValues = self;\\n // Get the encoded 4-bit value by right shifting to the `index` position\\n uint256 shifted = currentValues >> (4 * index);\\n // Get the value by only masking the last 4 bits with an AND operator\\n return uint8(shifted & (2 ** 4 - 1));\\n }\\n\\n /**\\n * @dev Set a value at a chosen index in a 256-bit bitmap\\n * @param index index where the value will be stored. Can be between 0 and 63\\n * @param value value to store. Can be between 0 and 15\\n */\\n function _set(uint256 self, uint8 index, uint8 value) internal pure returns (uint256) {\\n _checkIndexIsValid(index);\\n _checkValueIsValid(value);\\n\\n uint256 currentValues = self;\\n // 1. first we need to remove the current value for the inputed `index`\\n // Left Shift 4 bits mask (1111 mask) to the `index` position\\n uint256 mask = (2 ** 4 - 1) << (4 * index);\\n // Apply a XOR operation to obtain a mask with all bits set to 1 except the 4 bits that we want to remove\\n uint256 negativeMask = MAX_INT ^ mask;\\n // Apply a AND operation between the current values and the negative mask to remove the wanted bits\\n uint256 newValues = currentValues & negativeMask;\\n\\n // 2. We set the new value wanted at the `index` position\\n // Create the 4 bits encoding the new value and left shift them to the `index` position\\n uint256 newValueMask = uint256(value) << (4 * index);\\n // Apply an OR operation between the current values and the newValueMask to reference new value\\n return newValues | newValueMask;\\n }\\n\\n /**\\n * @dev Get all the non-zero values in a 256-bit bitmap\\n * @param self a 256-bit bitmap\\n */\\n function _getAllNonZeroValues(\\n uint256 self\\n ) internal pure returns (uint8[] memory, uint8[] memory, uint8) {\\n uint8[] memory indices = new uint8[](64);\\n uint8[] memory values = new uint8[](64);\\n uint8 nbOfNonZeroValues = 0;\\n for (uint8 i = 0; i < 63; i++) {\\n uint8 value = _get(self, i);\\n if (value > 0) {\\n indices[nbOfNonZeroValues] = i;\\n values[nbOfNonZeroValues] = value;\\n nbOfNonZeroValues++;\\n }\\n }\\n return (indices, values, nbOfNonZeroValues);\\n }\\n\\n /**\\n * @dev Check if the index is valid (is between 0 and 63)\\n * @param index index of a chunck\\n */\\n function _checkIndexIsValid(uint8 index) internal pure {\\n if (index > 63) {\\n revert IndexOutOfBounds(index);\\n }\\n }\\n\\n /**\\n * @dev Check if the value is valid (is between 0 and 15)\\n * @param value value to encode in a chunck\\n */\\n function _checkValueIsValid(uint8 value) internal pure {\\n if (value > 15) {\\n revert ValueOutOfBounds(value);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xac6ca38e106fb9e999b0c765dba0f8894697c3aead9459ffeab6b32e3560b39e\",\"license\":\"MIT\"},\"contracts/core/libs/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2dba7215628ceb3bb6f28422c7ca48d79615dd7aa8ba54978d4d8cad996f57e\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60a06040523480156200001157600080fd5b506040516200393538038062003935833981016040819052620000349162000209565b6200003f336200006b565b6000805462ff0000191690556001600160a01b0381166080526200006382620000c8565b505062000241565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600390610100900460ff16158015620000eb575060005460ff8083169116105b620001535760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff83161761010017815562000181600054630100000090046001600160a01b031690565b6001600160a01b03161480620001965750303b155b15620001a757620001a7826200006b565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b80516001600160a01b03811681146200020457600080fd5b919050565b600080604083850312156200021d57600080fd5b6200022883620001ec565b91506200023860208401620001ec565b90509250929050565b6080516136d86200025d600039600061258301526136d86000f3fe608060405234801561001057600080fd5b50600436106102275760003560e01c80637ffe93fc11610130578063b8865673116100b8578063dc873d011161007c578063dc873d0114610566578063e78d54bb14610586578063e972f91014610599578063ebc5c093146105ac578063f2fde38b146105bf57600080fd5b8063b8865673146104e5578063c06d5db6146104f8578063c4d66de81461050b578063c7da9aa61461051e578063da5d314b1461055357600080fd5b806384c2ad82116100ff57806384c2ad821461044d5780638c3c9e321461046d5780638da5cb5b1461048e578063aad9a979146104bf578063b1cb1662146104d257600080fd5b80637ffe93fc1461040c578063811a6af71461041f57806381213f22146104325780638456cb591461044557600080fd5b8063436a76f3116101b35780636d7fbb67116101825780636d7fbb67146103a4578063715018a6146103c4578063754b377c146103cc5780637cc920b4146103e65780637cde0fe2146103f957600080fd5b8063436a76f31461033f5780635657f0361461035f5780635c975abb1461038057806364fff83c1461039157600080fd5b80631538ff08116101fa5780631538ff08146102db578063181dfdff146102ee5780632972b0f0146103015780633be1ced7146103145780633f4ba83a1461033757600080fd5b8063011023901461022c57806305b374211461025457806314067f8b1461026957806315027bda146102bb575b600080fd5b61023f61023a366004612932565b6105d2565b60405190151581526020015b60405180910390f35b61026761026236600461296f565b6105e9565b005b6102a6610277366004612932565b6000918252602080805260408084206001600160a01b0393909316845291905290206002015463ffffffff1690565b60405163ffffffff909116815260200161024b565b6102ce6102c9366004612a95565b610669565b60405161024b9190612be4565b6102676102e9366004612ca8565b61075a565b6102676102fc366004612dd2565b61080d565b61023f61030f366004612e45565b6108cd565b610327610322366004612932565b6108e0565b60405161024b9493929190612e61565b6102676109f6565b61035261034d366004612e9e565b610a32565b60405161024b9190612f22565b61037261036d366004612f35565b610ae0565b60405161024b929190612f4e565b60005462010000900460ff1661023f565b61026761039f366004612f9b565b610c65565b6103b76103b2366004612932565b610cd7565b60405161024b9190612fcf565b610267610d8f565b6103d4600381565b60405160ff909116815260200161024b565b6102676103f4366004612fe2565b610dcb565b61026761040736600461305f565b610ea2565b61026761041a366004613092565b610edf565b61026761042d3660046130f8565b610f54565b61023f610440366004612e9e565b611330565b61026761138a565b61046061045b366004612932565b6113c4565b60405161024b9190613163565b61048061047b366004612932565b6113f1565b60405190815260200161024b565b6104a7600054630100000090046001600160a01b031690565b6040516001600160a01b03909116815260200161024b565b6102676104cd36600461296f565b6113fd565b6102676104e0366004612ca8565b611471565b6102676104f3366004613176565b61151f565b6102676105063660046131b9565b6115b4565b6102676105193660046131f2565b6115f2565b6104a761052c366004612932565b6000918252602080805260408084206001600160a01b039384168552909152909120541690565b61023f61056136600461320d565b61170c565b610579610574366004612a95565b611733565b60405161024b9190613230565b610267610594366004613274565b6117f3565b6103d46105a736600461320d565b611867565b6102676105ba3660046132b0565b611888565b6102676105cd3660046131f2565b611ce0565b60006105de8383611d80565b151590505b92915050565b6000546001600160a01b0363010000009091041633146106245760405162461bcd60e51b815260040161061b906132f1565b60405180910390fd5b6106308260ff16611da9565b61063982611dd3565b61065b5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6106658282611dfc565b5050565b6060600083516001600160401b0381111561068657610686612999565b6040519080825280602002602001820160405280156106d757816020015b60408051608081018252600080825260208083018290529282015260608082015282526000199092019101816106a45790505b50905060005b8451811015610752576107228582815181106106fb576106fb613326565b602002602001015185838151811061071557610715613326565b6020026020010151611e5c565b82828151811061073457610734613326565b6020026020010181905250808061074a90613352565b9150506106dd565b509392505050565b6000546001600160a01b03630100000090910416331461078c5760405162461bcd60e51b815260040161061b906132f1565b80518251146107ae57604051636e37235160e11b815260040160405180910390fd5b60005b8251811015610808576107f68382815181106107cf576107cf613326565b60200260200101518383815181106107e9576107e9613326565b60200260200101516105e9565b8061080081613352565b9150506107b1565b505050565b6000546001600160a01b03630100000090910416331461083f5760405162461bcd60e51b815260040161061b906132f1565b60005b81518110156108c7576108b5848284848151811061086257610862613326565b6020026020010151610874919061336b565b85848151811061088657610886613326565b6020026020010151600001518685815181106108a4576108a4613326565b602002602001015160200151611f6b565b806108bf81613352565b915050610842565b50505050565b60006108d9838361220a565b9392505050565b6000828152602080805260408083206001600160a01b038086168552908352818420825160808101845281549092168252600181015493820193909352600283015463ffffffff1691810191909152600382018054849384936060938593919291838601919061094f90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461097b90613382565b80156109c85780601f1061099d576101008083540402835291602001916109c8565b820191906000526020600020905b8154815290600101906020018083116109ab57829003601f168201915b505050919092525050815160208301516040840151606090940151919b909a50929850965090945050505050565b6000546001600160a01b036301000000909104163314610a285760405162461bcd60e51b815260040161061b906132f1565b610a3061222c565b565b6060600082516001600160401b03811115610a4f57610a4f612999565b604051908082528060200260200182016040528015610a78578160200160208202803683370190505b50905060005b835181101561075257610aaa85858381518110610a9d57610a9d613326565b6020026020010151611867565b828281518110610abc57610abc613326565b60ff9092166020928302919091019091015280610ad881613352565b915050610a7e565b6000818152601160205260408120546060918291908080610b00846122c7565b92509250925060008160ff166001600160401b03811115610b2357610b23612999565b604051908082528060200260200182016040528015610b4c578160200160208202803683370190505b50905060008260ff166001600160401b03811115610b6c57610b6c612999565b604051908082528060200260200182016040528015610b95578160200160208202803683370190505b50905060005b8360ff168160ff161015610c565760126000878360ff1681518110610bc257610bc2613326565b602002602001015160ff1660ff16815260200190815260200160002054838260ff1681518110610bf457610bf4613326565b602002602001018181525050848160ff1681518110610c1557610c15613326565b6020026020010151828260ff1681518110610c3257610c32613326565b60ff9092166020928302919091019091015280610c4e816133bc565b915050610b9b565b50909890975095505050505050565b6000546001600160a01b036301000000909104163314610c975760405162461bcd60e51b815260040161061b906132f1565b60005b815181101561066557610cc5828281518110610cb857610cb8613326565b6020026020010151610edf565b80610ccf81613352565b915050610c9a565b6000828152602080805260408083206001600160a01b03851684529091529020600301805460609190610d0990613382565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3590613382565b8015610d825780601f10610d5757610100808354040283529160200191610d82565b820191906000526020600020905b815481529060010190602001808311610d6557829003601f168201915b5050505050905092915050565b6000546001600160a01b036301000000909104163314610dc15760405162461bcd60e51b815260040161061b906132f1565b610a3060006123bc565b6000546001600160a01b036301000000909104163314610dfd5760405162461bcd60e51b815260040161061b906132f1565b81518351141580610e1057508051835114155b15610e2e57604051636e37235160e11b815260040160405180910390fd5b60005b83518110156108c757610e90848281518110610e4f57610e4f613326565b6020026020010151848381518110610e6957610e69613326565b6020026020010151848481518110610e8357610e83613326565b60200260200101516117f3565b80610e9a81613352565b915050610e31565b6000546001600160a01b036301000000909104163314610ed45760405162461bcd60e51b815260040161061b906132f1565b610808838383612419565b6000546001600160a01b036301000000909104163314610f115760405162461bcd60e51b815260040161061b906132f1565b610f1d8160ff16611da9565b610f2681611dd3565b610f485760405163eabeadd360e01b815260ff8216600482015260240161061b565b610f51816124ac565b50565b60005462010000900460ff1615610f7d5760405162461bcd60e51b815260040161061b906133db565b828114610fa55783838383604051638ceb003d60e01b815260040161061b9493929190613405565b3360005b8481101561132857600060206000868685818110610fc957610fc9613326565b9050602002013581526020019081526020016000206000888885818110610ff257610ff2613326565b905060200201602081019061100791906131f2565b6001600160a01b0390811682526020808301939093526040918201600020825160808101845281549092168252600181015493820193909352600283015463ffffffff169181019190915260038201805491929160608401919061106a90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461109690613382565b80156110e35780601f106110b8576101008083540402835291602001916110e3565b820191906000526020600020905b8154815290600101906020018083116110c657829003601f168201915b50505050508152505090506111108386868581811061110457611104613326565b9050602002013561220a565b61115a578285858481811061112757611127613326565b60405163c522f21160e01b81526001600160a01b039094166004850152602002919091013560248301525060440161061b565b6020600086868581811061117057611170613326565b905060200201358152602001908152602001600020600088888581811061119957611199613326565b90506020020160208101906111ae91906131f2565b6001600160a01b031681526020810191909152604001600090812080546001600160a01b03191681556001810182905560028101805463ffffffff19169055906111fb6003830182612843565b505061124c85858481811061121257611212613326565b9050602002013588888581811061122b5761122b613326565b905060200201602081019061124091906131f2565b836020015160006124fb565b7f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b6040518060c0016040528087878681811061128a5761128a613326565b9050602002013581526020018989868181106112a8576112a8613326565b90506020020160208101906112bd91906131f2565b6001600160a01b0316815260200183600001516001600160a01b0316815260200183602001518152602001836040015163ffffffff168152602001836060015181525060405161130d9190613487565b60405180910390a1508061132081613352565b915050610fa9565b505050505050565b6000805b8251811015611380576113608484838151811061135357611353613326565b602002602001015161170c565b61136e5760009150506105e3565b8061137881613352565b915050611334565b5060019392505050565b6000546001600160a01b0363010000009091041633146113bc5760405162461bcd60e51b815260040161061b906132f1565b610a306125ec565b60408051608081018252600080825260208201819052918101919091526060808201526108d98383611e5c565b60006108d98383611d80565b6000546001600160a01b03630100000090910416331461142f5760405162461bcd60e51b815260040161061b906132f1565b61143b8260ff16611da9565b61144482611dd3565b1561146757604051635d04d75160e01b815260ff8316600482015260240161061b565b610665828261264e565b6000546001600160a01b0363010000009091041633146114a35760405162461bcd60e51b815260040161061b906132f1565b80518251146114c557604051636e37235160e11b815260040160405180910390fd5b60005b82518110156108085761150d8382815181106114e6576114e6613326565b602002602001015183838151811061150057611500613326565b60200260200101516113fd565b8061151781613352565b9150506114c8565b6000546001600160a01b0363010000009091041633146115515760405162461bcd60e51b815260040161061b906132f1565b60005b8151811015610808576115a28383838151811061157357611573613326565b60200260200101516000015184848151811061159157611591613326565b602002602001015160200151612419565b806115ac81613352565b915050611554565b6000546001600160a01b0363010000009091041633146115e65760405162461bcd60e51b815260040161061b906132f1565b6108c784848484611f6b565b600054600390610100900460ff16158015611614575060005460ff8083169116105b6116775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161061b565b6000805461ffff191660ff8316176101001781556116a4600054630100000090046001600160a01b031690565b6001600160a01b031614806116b85750303b155b156116c6576116c6826123bc565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60008281526011602052604081205460006117278285612699565b60ff1611949350505050565b6060600083516001600160401b0381111561175057611750612999565b604051908082528060200260200182016040528015611779578160200160208202803683370190505b50905060005b8451811015610752576117c485828151811061179d5761179d613326565b60200260200101518583815181106117b7576117b7613326565b6020026020010151611d80565b8282815181106117d6576117d6613326565b6020908102919091010152806117eb81613352565b91505061177f565b6000546001600160a01b0363010000009091041633146118255760405162461bcd60e51b815260040161061b906132f1565b6118318260ff16611da9565b61183a82611dd3565b61185c5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6108088383836126be565b6000828152601160205260408120546118808184612699565b949350505050565b60005462010000900460ff16156118b15760405162461bcd60e51b815260040161061b906133db565b3360005b828110156108c7576118eb828585848181106118d3576118d3613326565b90506020028101906118e591906134e8565b3561220a565b61193f578184848381811061190257611902613326565b905060200281019061191491906134e8565b60405163c522f21160e01b81526001600160a01b03909216600483015235602482015260440161061b565b60006020600086868581811061195757611957613326565b905060200281019061196991906134e8565b600001358152602001908152602001600020600086868581811061198f5761198f613326565b90506020028101906119a191906134e8565b6119b29060408101906020016131f2565b6001600160a01b03166001600160a01b0316815260200190815260200160002060010154905060405180608001604052808686858181106119f5576119f5613326565b9050602002810190611a0791906134e8565b611a189060608101906040016131f2565b6001600160a01b03168152602001868685818110611a3857611a38613326565b9050602002810190611a4a91906134e8565b606001358152602001868685818110611a6557611a65613326565b9050602002810190611a7791906134e8565b611a889060a081019060800161351c565b63ffffffff168152602001868685818110611aa557611aa5613326565b9050602002810190611ab791906134e8565b611ac59060a0810190613537565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250602092508890508786818110611b1257611b12613326565b9050602002810190611b2491906134e8565b6000013581526020019081526020016000206000878786818110611b4a57611b4a613326565b9050602002810190611b5c91906134e8565b611b6d9060408101906020016131f2565b6001600160a01b0390811682526020808301939093526040918201600020845181546001600160a01b03191692169190911781558383015160018201559083015160028201805463ffffffff191663ffffffff909216919091179055606083015180519192611be49260038501929091019061287d565b50905050611c73858584818110611bfd57611bfd613326565b9050602002810190611c0f91906134e8565b35868685818110611c2257611c22613326565b9050602002810190611c3491906134e8565b611c459060408101906020016131f2565b83888887818110611c5857611c58613326565b9050602002810190611c6a91906134e8565b606001356124fb565b7f8c20c3acb6b5208b7affea2fd90dabc8d47e77cee9766c855ce42730505cb205858584818110611ca657611ca6613326565b9050602002810190611cb891906134e8565b604051611cc591906135a6565b60405180910390a15080611cd881613352565b9150506118b5565b6000546001600160a01b036301000000909104163314611d125760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b038116611d775760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061b565b610f51816123bc565b6000918252602080805260408084206001600160a01b0393909316845291905290206001015490565b603f8160ff161115610f515760405163453e14b960e01b815260ff8216600482015260240161061b565b60ff81166000908152601260205260408120548103611df457506000919050565b506001919050565b60ff82166000818152601260209081526040918290208054908590558251938452908301849052908201819052907f0d3d8d66bac9b2a9f0e5c83181a30443294ab849472526080d03fffd7187f7169060600160405180910390a1505050565b60408051608081018252600080825260208201819052918101919091526060808201526000838152602080805260408083206001600160a01b03808716855290835292819020815160808101835281549094168452600181015492840192909252600282015463ffffffff1690830152600381018054606084019190611ee190613382565b80601f0160208091040260200160405190810160405280929190818152602001828054611f0d90613382565b8015611f5a5780601f10611f2f57610100808354040283529160200191611f5a565b820191906000526020600020905b815481529060010190602001808311611f3d57829003601f168201915b505050505081525050905092915050565b6000546001600160a01b036301000000909104163314611f9d5760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b0384166000908152601060205260409020548310611fff576001600160a01b038416600081815260106020526040908190205490516345e388eb60e01b8152600481019290925260248201526044810184905260640161061b565b6001600160a01b038416600090815260106020526040812080548590811061202957612029613326565b600091825260208083206002909202909101546001600160a01b03881683526010909152604082208054919350908690811061206757612067613326565b9060005260206000209060020201600101549050818414158061208a5750808314155b156120d657604051637a4dd76560e01b81526001600160a01b03871660048201526024810186905260448101839052606481018290526084810185905260a4810184905260c40161061b565b6001600160a01b038616600090815260106020526040902080546120fc9060019061336b565b8154811061210c5761210c613326565b906000526020600020906002020160106000886001600160a01b03166001600160a01b03168152602001908152602001600020868154811061215057612150613326565b60009182526020808320845460029093020191825560019384015493909101929092556001600160a01b038816815260109091526040902080548061219757612197613663565b6000828152602080822060026000199490940193840201828155600101919091559155604080516001600160a01b038916815291820186905281018490527f33cff58e54c3a8acae85cad63487b5dcf617521e33bb03f071299f374c29de1f9060600160405180910390a1505050505050565b6001600160a01b03821660009081526010602052604081206108d99083612732565b60005462010000900460ff1661227b5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161061b565b6000805462ff0000191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60408051818152610820810182526060918291600091829190602082016108008036833750506040805181815261082081018252929350600092915060208201610800803683370190505090506000805b603f8160ff1610156123ae5760006123308983612699565b905060ff81161561239b5781858460ff168151811061235157612351613326565b602002602001019060ff16908160ff168152505080848460ff168151811061237b5761237b613326565b60ff9092166020928302919091019091015282612397816133bc565b9350505b50806123a6816133bc565b915050612318565b509196909550909350915050565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60408051808201825283815260208082018481526001600160a01b03871660008181526010845285812080546001808201835591835291859020865160029093020191825592519201919091558351908152908101859052918201839052907fe7d6ac0b740347f7f96a97e6a9dc0f20f4f11eca65495315adc009a55b6762f8906060015b60405180910390a150505050565b60ff811660008181526012602090815260408083208054939055805193845290830182905290917feb82955a27e39ea7559b6ec7e7d8b371081ab0d8783c7b0d01597555e7dcadbf9101611700565b8181113060008261250c578561250f565b60005b905060008361251f576000612521565b865b905060008461253957612534868861336b565b612543565b612543878761336b565b604051633885984b60e11b81526001600160a01b03868116600483015285811660248301528481166044830152606482018c9052608482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063710b30969060a401600060405180830381600087803b1580156125c957600080fd5b505af11580156125dd573d6000803e3d6000fd5b50505050505050505050505050565b60005462010000900460ff16156126155760405162461bcd60e51b815260040161061b906133db565b6000805462ff00001916620100001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122aa3390565b60ff8216600081815260126020908152604091829020849055815192835282018390527f16f0bfe4b02efd5423ef8906906b049c0943f21df8f10347d319fddbc59222079101611700565b600082816126a8846004613679565b60ff1682901c905080600f169250505092915050565b6000838152601160205260409020546126d88184846127c0565b6000858152601160205260409081902091909155517f393b86c90799fa411201ae723a54e105823fcf7c6c8dffa90903fc44c03b4ac79061249e9086908690869092835260ff918216602084015216604082015260600190565b6000805b83548110156127b65783818154811061275157612751613326565b9060005260206000209060020201600001548310158015612795575083818154811061277f5761277f613326565b9060005260206000209060020201600101548311155b156127a45760019150506105e3565b806127ae81613352565b915050612736565b5060009392505050565b60006127cb83611da9565b6127d482612819565b8360006127e2856004613679565b600f60ff919091161b905060001981188281166000612802886004613679565b60ff97881697169690961b17979650505050505050565b600f8160ff161115610f51576040516329afd27b60e21b815260ff8216600482015260240161061b565b50805461284f90613382565b6000825580601f1061285f575050565b601f016020900490600052602060002090810190610f519190612901565b82805461288990613382565b90600052602060002090601f0160209004810192826128ab57600085556128f1565b82601f106128c457805160ff19168380011785556128f1565b828001600101855582156128f1579182015b828111156128f15782518255916020019190600101906128d6565b506128fd929150612901565b5090565b5b808211156128fd5760008155600101612902565b80356001600160a01b038116811461292d57600080fd5b919050565b6000806040838503121561294557600080fd5b8235915061295560208401612916565b90509250929050565b803560ff8116811461292d57600080fd5b6000806040838503121561298257600080fd5b61298b8361295e565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156129d1576129d1612999565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129ff576129ff612999565b604052919050565b60006001600160401b03821115612a2057612a20612999565b5060051b60200190565b600082601f830112612a3b57600080fd5b81356020612a50612a4b83612a07565b6129d7565b82815260059290921b84018101918181019086841115612a6f57600080fd5b8286015b84811015612a8a5780358352918301918301612a73565b509695505050505050565b60008060408385031215612aa857600080fd5b82356001600160401b0380821115612abf57600080fd5b612acb86838701612a2a565b9350602091508185013581811115612ae257600080fd5b85019050601f81018613612af557600080fd5b8035612b03612a4b82612a07565b81815260059190911b82018301908381019088831115612b2257600080fd5b928401925b82841015612b4757612b3884612916565b82529284019290840190612b27565b80955050505050509250929050565b6000815180845260005b81811015612b7c57602081850181015186830182015201612b60565b81811115612b8e576000602083870101525b50601f01601f19169290920160200192915050565b60018060a01b0381511682526020810151602083015263ffffffff604082015116604083015260006060820151608060608501526118806080850182612b56565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612c3957603f19888603018452612c27858351612ba3565b94509285019290850190600101612c0b565b5092979650505050505050565b600082601f830112612c5757600080fd5b81356020612c67612a4b83612a07565b82815260059290921b84018101918181019086841115612c8657600080fd5b8286015b84811015612a8a57612c9b8161295e565b8352918301918301612c8a565b60008060408385031215612cbb57600080fd5b82356001600160401b0380821115612cd257600080fd5b612cde86838701612c46565b9350602091508185013581811115612cf557600080fd5b85019050601f81018613612d0857600080fd5b8035612d16612a4b82612a07565b81815260059190911b82018301908381019088831115612d3557600080fd5b928401925b82841015612b4757833582529284019290840190612d3a565b600082601f830112612d6457600080fd5b81356020612d74612a4b83612a07565b82815260069290921b84018101918181019086841115612d9357600080fd5b8286015b84811015612a8a5760408189031215612db05760008081fd5b612db86129af565b813581528482013585820152835291830191604001612d97565b600080600060608486031215612de757600080fd5b612df084612916565b925060208401356001600160401b0380821115612e0c57600080fd5b612e1887838801612d53565b93506040860135915080821115612e2e57600080fd5b50612e3b86828701612a2a565b9150509250925092565b60008060408385031215612e5857600080fd5b61298b83612916565b60018060a01b038516815283602082015263ffffffff83166040820152608060608201526000612e946080830184612b56565b9695505050505050565b60008060408385031215612eb157600080fd5b8235915060208301356001600160401b03811115612ece57600080fd5b612eda85828601612c46565b9150509250929050565b600081518084526020808501945080840160005b83811015612f1757815160ff1687529582019590820190600101612ef8565b509495945050505050565b6020815260006108d96020830184612ee4565b600060208284031215612f4757600080fd5b5035919050565b604080825283519082018190526000906020906060840190828701845b82811015612f8757815184529284019290840190600101612f6b565b50505083810382850152612e948186612ee4565b600060208284031215612fad57600080fd5b81356001600160401b03811115612fc357600080fd5b61188084828501612c46565b6020815260006108d96020830184612b56565b600080600060608486031215612ff757600080fd5b83356001600160401b038082111561300e57600080fd5b61301a87838801612a2a565b9450602086013591508082111561303057600080fd5b61303c87838801612c46565b9350604086013591508082111561305257600080fd5b50612e3b86828701612c46565b60008060006060848603121561307457600080fd5b61307d84612916565b95602085013595506040909401359392505050565b6000602082840312156130a457600080fd5b6108d98261295e565b60008083601f8401126130bf57600080fd5b5081356001600160401b038111156130d657600080fd5b6020830191508360208260051b85010111156130f157600080fd5b9250929050565b6000806000806040858703121561310e57600080fd5b84356001600160401b038082111561312557600080fd5b613131888389016130ad565b9096509450602087013591508082111561314a57600080fd5b50613157878288016130ad565b95989497509550505050565b6020815260006108d96020830184612ba3565b6000806040838503121561318957600080fd5b61319283612916565b915060208301356001600160401b038111156131ad57600080fd5b612eda85828601612d53565b600080600080608085870312156131cf57600080fd5b6131d885612916565b966020860135965060408601359560600135945092505050565b60006020828403121561320457600080fd5b6108d982612916565b6000806040838503121561322057600080fd5b823591506129556020840161295e565b6020808252825182820181905260009190848201906040850190845b818110156132685783518352928401929184019160010161324c565b50909695505050505050565b60008060006060848603121561328957600080fd5b833592506132996020850161295e565b91506132a76040850161295e565b90509250925092565b600080602083850312156132c357600080fd5b82356001600160401b038111156132d957600080fd5b6132e5858286016130ad565b90969095509350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016133645761336461333c565b5060010190565b60008282101561337d5761337d61333c565b500390565b600181811c9082168061339657607f821691505b6020821081036133b657634e487b7160e01b600052602260045260246000fd5b50919050565b600060ff821660ff81036133d2576133d261333c565b60010192915050565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6040808252810184905260008560608301825b87811015613446576001600160a01b0361343184612916565b16825260209283019290910190600101613418565b5083810360208501528481526001600160fb1b0385111561346657600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b60208152815160208201526000602083015160018060a01b03808216604085015280604086015116606085015250506060830151608083015263ffffffff60808401511660a083015260a083015160c08084015261188060e0840182612b56565b6000823560be198336030181126134fe57600080fd5b9190910192915050565b803563ffffffff8116811461292d57600080fd5b60006020828403121561352e57600080fd5b6108d982613508565b6000808335601e1984360301811261354e57600080fd5b8301803591506001600160401b0382111561356857600080fd5b6020019150368190038213156130f157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b602081528135602082015260006135bf60208401612916565b60018060a01b038082166040850152806135db60408701612916565b16606085015250506060830135608083015263ffffffff6135fe60808501613508565b1660a083015260a0830135601e1984360301811261361b57600080fd5b83016020810190356001600160401b0381111561363757600080fd5b80360382131561364657600080fd5b60c08085015261365a60e08501828461357d565b95945050505050565b634e487b7160e01b600052603160045260246000fd5b600060ff821660ff84168160ff048111821515161561369a5761369a61333c565b02939250505056fea26469706673582212209714c1001d19740a655ea4426b52e9f5d8348f9df38d027a88d1f1095e244e9464736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102275760003560e01c80637ffe93fc11610130578063b8865673116100b8578063dc873d011161007c578063dc873d0114610566578063e78d54bb14610586578063e972f91014610599578063ebc5c093146105ac578063f2fde38b146105bf57600080fd5b8063b8865673146104e5578063c06d5db6146104f8578063c4d66de81461050b578063c7da9aa61461051e578063da5d314b1461055357600080fd5b806384c2ad82116100ff57806384c2ad821461044d5780638c3c9e321461046d5780638da5cb5b1461048e578063aad9a979146104bf578063b1cb1662146104d257600080fd5b80637ffe93fc1461040c578063811a6af71461041f57806381213f22146104325780638456cb591461044557600080fd5b8063436a76f3116101b35780636d7fbb67116101825780636d7fbb67146103a4578063715018a6146103c4578063754b377c146103cc5780637cc920b4146103e65780637cde0fe2146103f957600080fd5b8063436a76f31461033f5780635657f0361461035f5780635c975abb1461038057806364fff83c1461039157600080fd5b80631538ff08116101fa5780631538ff08146102db578063181dfdff146102ee5780632972b0f0146103015780633be1ced7146103145780633f4ba83a1461033757600080fd5b8063011023901461022c57806305b374211461025457806314067f8b1461026957806315027bda146102bb575b600080fd5b61023f61023a366004612932565b6105d2565b60405190151581526020015b60405180910390f35b61026761026236600461296f565b6105e9565b005b6102a6610277366004612932565b6000918252602080805260408084206001600160a01b0393909316845291905290206002015463ffffffff1690565b60405163ffffffff909116815260200161024b565b6102ce6102c9366004612a95565b610669565b60405161024b9190612be4565b6102676102e9366004612ca8565b61075a565b6102676102fc366004612dd2565b61080d565b61023f61030f366004612e45565b6108cd565b610327610322366004612932565b6108e0565b60405161024b9493929190612e61565b6102676109f6565b61035261034d366004612e9e565b610a32565b60405161024b9190612f22565b61037261036d366004612f35565b610ae0565b60405161024b929190612f4e565b60005462010000900460ff1661023f565b61026761039f366004612f9b565b610c65565b6103b76103b2366004612932565b610cd7565b60405161024b9190612fcf565b610267610d8f565b6103d4600381565b60405160ff909116815260200161024b565b6102676103f4366004612fe2565b610dcb565b61026761040736600461305f565b610ea2565b61026761041a366004613092565b610edf565b61026761042d3660046130f8565b610f54565b61023f610440366004612e9e565b611330565b61026761138a565b61046061045b366004612932565b6113c4565b60405161024b9190613163565b61048061047b366004612932565b6113f1565b60405190815260200161024b565b6104a7600054630100000090046001600160a01b031690565b6040516001600160a01b03909116815260200161024b565b6102676104cd36600461296f565b6113fd565b6102676104e0366004612ca8565b611471565b6102676104f3366004613176565b61151f565b6102676105063660046131b9565b6115b4565b6102676105193660046131f2565b6115f2565b6104a761052c366004612932565b6000918252602080805260408084206001600160a01b039384168552909152909120541690565b61023f61056136600461320d565b61170c565b610579610574366004612a95565b611733565b60405161024b9190613230565b610267610594366004613274565b6117f3565b6103d46105a736600461320d565b611867565b6102676105ba3660046132b0565b611888565b6102676105cd3660046131f2565b611ce0565b60006105de8383611d80565b151590505b92915050565b6000546001600160a01b0363010000009091041633146106245760405162461bcd60e51b815260040161061b906132f1565b60405180910390fd5b6106308260ff16611da9565b61063982611dd3565b61065b5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6106658282611dfc565b5050565b6060600083516001600160401b0381111561068657610686612999565b6040519080825280602002602001820160405280156106d757816020015b60408051608081018252600080825260208083018290529282015260608082015282526000199092019101816106a45790505b50905060005b8451811015610752576107228582815181106106fb576106fb613326565b602002602001015185838151811061071557610715613326565b6020026020010151611e5c565b82828151811061073457610734613326565b6020026020010181905250808061074a90613352565b9150506106dd565b509392505050565b6000546001600160a01b03630100000090910416331461078c5760405162461bcd60e51b815260040161061b906132f1565b80518251146107ae57604051636e37235160e11b815260040160405180910390fd5b60005b8251811015610808576107f68382815181106107cf576107cf613326565b60200260200101518383815181106107e9576107e9613326565b60200260200101516105e9565b8061080081613352565b9150506107b1565b505050565b6000546001600160a01b03630100000090910416331461083f5760405162461bcd60e51b815260040161061b906132f1565b60005b81518110156108c7576108b5848284848151811061086257610862613326565b6020026020010151610874919061336b565b85848151811061088657610886613326565b6020026020010151600001518685815181106108a4576108a4613326565b602002602001015160200151611f6b565b806108bf81613352565b915050610842565b50505050565b60006108d9838361220a565b9392505050565b6000828152602080805260408083206001600160a01b038086168552908352818420825160808101845281549092168252600181015493820193909352600283015463ffffffff1691810191909152600382018054849384936060938593919291838601919061094f90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461097b90613382565b80156109c85780601f1061099d576101008083540402835291602001916109c8565b820191906000526020600020905b8154815290600101906020018083116109ab57829003601f168201915b505050919092525050815160208301516040840151606090940151919b909a50929850965090945050505050565b6000546001600160a01b036301000000909104163314610a285760405162461bcd60e51b815260040161061b906132f1565b610a3061222c565b565b6060600082516001600160401b03811115610a4f57610a4f612999565b604051908082528060200260200182016040528015610a78578160200160208202803683370190505b50905060005b835181101561075257610aaa85858381518110610a9d57610a9d613326565b6020026020010151611867565b828281518110610abc57610abc613326565b60ff9092166020928302919091019091015280610ad881613352565b915050610a7e565b6000818152601160205260408120546060918291908080610b00846122c7565b92509250925060008160ff166001600160401b03811115610b2357610b23612999565b604051908082528060200260200182016040528015610b4c578160200160208202803683370190505b50905060008260ff166001600160401b03811115610b6c57610b6c612999565b604051908082528060200260200182016040528015610b95578160200160208202803683370190505b50905060005b8360ff168160ff161015610c565760126000878360ff1681518110610bc257610bc2613326565b602002602001015160ff1660ff16815260200190815260200160002054838260ff1681518110610bf457610bf4613326565b602002602001018181525050848160ff1681518110610c1557610c15613326565b6020026020010151828260ff1681518110610c3257610c32613326565b60ff9092166020928302919091019091015280610c4e816133bc565b915050610b9b565b50909890975095505050505050565b6000546001600160a01b036301000000909104163314610c975760405162461bcd60e51b815260040161061b906132f1565b60005b815181101561066557610cc5828281518110610cb857610cb8613326565b6020026020010151610edf565b80610ccf81613352565b915050610c9a565b6000828152602080805260408083206001600160a01b03851684529091529020600301805460609190610d0990613382565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3590613382565b8015610d825780601f10610d5757610100808354040283529160200191610d82565b820191906000526020600020905b815481529060010190602001808311610d6557829003601f168201915b5050505050905092915050565b6000546001600160a01b036301000000909104163314610dc15760405162461bcd60e51b815260040161061b906132f1565b610a3060006123bc565b6000546001600160a01b036301000000909104163314610dfd5760405162461bcd60e51b815260040161061b906132f1565b81518351141580610e1057508051835114155b15610e2e57604051636e37235160e11b815260040160405180910390fd5b60005b83518110156108c757610e90848281518110610e4f57610e4f613326565b6020026020010151848381518110610e6957610e69613326565b6020026020010151848481518110610e8357610e83613326565b60200260200101516117f3565b80610e9a81613352565b915050610e31565b6000546001600160a01b036301000000909104163314610ed45760405162461bcd60e51b815260040161061b906132f1565b610808838383612419565b6000546001600160a01b036301000000909104163314610f115760405162461bcd60e51b815260040161061b906132f1565b610f1d8160ff16611da9565b610f2681611dd3565b610f485760405163eabeadd360e01b815260ff8216600482015260240161061b565b610f51816124ac565b50565b60005462010000900460ff1615610f7d5760405162461bcd60e51b815260040161061b906133db565b828114610fa55783838383604051638ceb003d60e01b815260040161061b9493929190613405565b3360005b8481101561132857600060206000868685818110610fc957610fc9613326565b9050602002013581526020019081526020016000206000888885818110610ff257610ff2613326565b905060200201602081019061100791906131f2565b6001600160a01b0390811682526020808301939093526040918201600020825160808101845281549092168252600181015493820193909352600283015463ffffffff169181019190915260038201805491929160608401919061106a90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461109690613382565b80156110e35780601f106110b8576101008083540402835291602001916110e3565b820191906000526020600020905b8154815290600101906020018083116110c657829003601f168201915b50505050508152505090506111108386868581811061110457611104613326565b9050602002013561220a565b61115a578285858481811061112757611127613326565b60405163c522f21160e01b81526001600160a01b039094166004850152602002919091013560248301525060440161061b565b6020600086868581811061117057611170613326565b905060200201358152602001908152602001600020600088888581811061119957611199613326565b90506020020160208101906111ae91906131f2565b6001600160a01b031681526020810191909152604001600090812080546001600160a01b03191681556001810182905560028101805463ffffffff19169055906111fb6003830182612843565b505061124c85858481811061121257611212613326565b9050602002013588888581811061122b5761122b613326565b905060200201602081019061124091906131f2565b836020015160006124fb565b7f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b6040518060c0016040528087878681811061128a5761128a613326565b9050602002013581526020018989868181106112a8576112a8613326565b90506020020160208101906112bd91906131f2565b6001600160a01b0316815260200183600001516001600160a01b0316815260200183602001518152602001836040015163ffffffff168152602001836060015181525060405161130d9190613487565b60405180910390a1508061132081613352565b915050610fa9565b505050505050565b6000805b8251811015611380576113608484838151811061135357611353613326565b602002602001015161170c565b61136e5760009150506105e3565b8061137881613352565b915050611334565b5060019392505050565b6000546001600160a01b0363010000009091041633146113bc5760405162461bcd60e51b815260040161061b906132f1565b610a306125ec565b60408051608081018252600080825260208201819052918101919091526060808201526108d98383611e5c565b60006108d98383611d80565b6000546001600160a01b03630100000090910416331461142f5760405162461bcd60e51b815260040161061b906132f1565b61143b8260ff16611da9565b61144482611dd3565b1561146757604051635d04d75160e01b815260ff8316600482015260240161061b565b610665828261264e565b6000546001600160a01b0363010000009091041633146114a35760405162461bcd60e51b815260040161061b906132f1565b80518251146114c557604051636e37235160e11b815260040160405180910390fd5b60005b82518110156108085761150d8382815181106114e6576114e6613326565b602002602001015183838151811061150057611500613326565b60200260200101516113fd565b8061151781613352565b9150506114c8565b6000546001600160a01b0363010000009091041633146115515760405162461bcd60e51b815260040161061b906132f1565b60005b8151811015610808576115a28383838151811061157357611573613326565b60200260200101516000015184848151811061159157611591613326565b602002602001015160200151612419565b806115ac81613352565b915050611554565b6000546001600160a01b0363010000009091041633146115e65760405162461bcd60e51b815260040161061b906132f1565b6108c784848484611f6b565b600054600390610100900460ff16158015611614575060005460ff8083169116105b6116775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161061b565b6000805461ffff191660ff8316176101001781556116a4600054630100000090046001600160a01b031690565b6001600160a01b031614806116b85750303b155b156116c6576116c6826123bc565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60008281526011602052604081205460006117278285612699565b60ff1611949350505050565b6060600083516001600160401b0381111561175057611750612999565b604051908082528060200260200182016040528015611779578160200160208202803683370190505b50905060005b8451811015610752576117c485828151811061179d5761179d613326565b60200260200101518583815181106117b7576117b7613326565b6020026020010151611d80565b8282815181106117d6576117d6613326565b6020908102919091010152806117eb81613352565b91505061177f565b6000546001600160a01b0363010000009091041633146118255760405162461bcd60e51b815260040161061b906132f1565b6118318260ff16611da9565b61183a82611dd3565b61185c5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6108088383836126be565b6000828152601160205260408120546118808184612699565b949350505050565b60005462010000900460ff16156118b15760405162461bcd60e51b815260040161061b906133db565b3360005b828110156108c7576118eb828585848181106118d3576118d3613326565b90506020028101906118e591906134e8565b3561220a565b61193f578184848381811061190257611902613326565b905060200281019061191491906134e8565b60405163c522f21160e01b81526001600160a01b03909216600483015235602482015260440161061b565b60006020600086868581811061195757611957613326565b905060200281019061196991906134e8565b600001358152602001908152602001600020600086868581811061198f5761198f613326565b90506020028101906119a191906134e8565b6119b29060408101906020016131f2565b6001600160a01b03166001600160a01b0316815260200190815260200160002060010154905060405180608001604052808686858181106119f5576119f5613326565b9050602002810190611a0791906134e8565b611a189060608101906040016131f2565b6001600160a01b03168152602001868685818110611a3857611a38613326565b9050602002810190611a4a91906134e8565b606001358152602001868685818110611a6557611a65613326565b9050602002810190611a7791906134e8565b611a889060a081019060800161351c565b63ffffffff168152602001868685818110611aa557611aa5613326565b9050602002810190611ab791906134e8565b611ac59060a0810190613537565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250602092508890508786818110611b1257611b12613326565b9050602002810190611b2491906134e8565b6000013581526020019081526020016000206000878786818110611b4a57611b4a613326565b9050602002810190611b5c91906134e8565b611b6d9060408101906020016131f2565b6001600160a01b0390811682526020808301939093526040918201600020845181546001600160a01b03191692169190911781558383015160018201559083015160028201805463ffffffff191663ffffffff909216919091179055606083015180519192611be49260038501929091019061287d565b50905050611c73858584818110611bfd57611bfd613326565b9050602002810190611c0f91906134e8565b35868685818110611c2257611c22613326565b9050602002810190611c3491906134e8565b611c459060408101906020016131f2565b83888887818110611c5857611c58613326565b9050602002810190611c6a91906134e8565b606001356124fb565b7f8c20c3acb6b5208b7affea2fd90dabc8d47e77cee9766c855ce42730505cb205858584818110611ca657611ca6613326565b9050602002810190611cb891906134e8565b604051611cc591906135a6565b60405180910390a15080611cd881613352565b9150506118b5565b6000546001600160a01b036301000000909104163314611d125760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b038116611d775760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061b565b610f51816123bc565b6000918252602080805260408084206001600160a01b0393909316845291905290206001015490565b603f8160ff161115610f515760405163453e14b960e01b815260ff8216600482015260240161061b565b60ff81166000908152601260205260408120548103611df457506000919050565b506001919050565b60ff82166000818152601260209081526040918290208054908590558251938452908301849052908201819052907f0d3d8d66bac9b2a9f0e5c83181a30443294ab849472526080d03fffd7187f7169060600160405180910390a1505050565b60408051608081018252600080825260208201819052918101919091526060808201526000838152602080805260408083206001600160a01b03808716855290835292819020815160808101835281549094168452600181015492840192909252600282015463ffffffff1690830152600381018054606084019190611ee190613382565b80601f0160208091040260200160405190810160405280929190818152602001828054611f0d90613382565b8015611f5a5780601f10611f2f57610100808354040283529160200191611f5a565b820191906000526020600020905b815481529060010190602001808311611f3d57829003601f168201915b505050505081525050905092915050565b6000546001600160a01b036301000000909104163314611f9d5760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b0384166000908152601060205260409020548310611fff576001600160a01b038416600081815260106020526040908190205490516345e388eb60e01b8152600481019290925260248201526044810184905260640161061b565b6001600160a01b038416600090815260106020526040812080548590811061202957612029613326565b600091825260208083206002909202909101546001600160a01b03881683526010909152604082208054919350908690811061206757612067613326565b9060005260206000209060020201600101549050818414158061208a5750808314155b156120d657604051637a4dd76560e01b81526001600160a01b03871660048201526024810186905260448101839052606481018290526084810185905260a4810184905260c40161061b565b6001600160a01b038616600090815260106020526040902080546120fc9060019061336b565b8154811061210c5761210c613326565b906000526020600020906002020160106000886001600160a01b03166001600160a01b03168152602001908152602001600020868154811061215057612150613326565b60009182526020808320845460029093020191825560019384015493909101929092556001600160a01b038816815260109091526040902080548061219757612197613663565b6000828152602080822060026000199490940193840201828155600101919091559155604080516001600160a01b038916815291820186905281018490527f33cff58e54c3a8acae85cad63487b5dcf617521e33bb03f071299f374c29de1f9060600160405180910390a1505050505050565b6001600160a01b03821660009081526010602052604081206108d99083612732565b60005462010000900460ff1661227b5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161061b565b6000805462ff0000191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60408051818152610820810182526060918291600091829190602082016108008036833750506040805181815261082081018252929350600092915060208201610800803683370190505090506000805b603f8160ff1610156123ae5760006123308983612699565b905060ff81161561239b5781858460ff168151811061235157612351613326565b602002602001019060ff16908160ff168152505080848460ff168151811061237b5761237b613326565b60ff9092166020928302919091019091015282612397816133bc565b9350505b50806123a6816133bc565b915050612318565b509196909550909350915050565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60408051808201825283815260208082018481526001600160a01b03871660008181526010845285812080546001808201835591835291859020865160029093020191825592519201919091558351908152908101859052918201839052907fe7d6ac0b740347f7f96a97e6a9dc0f20f4f11eca65495315adc009a55b6762f8906060015b60405180910390a150505050565b60ff811660008181526012602090815260408083208054939055805193845290830182905290917feb82955a27e39ea7559b6ec7e7d8b371081ab0d8783c7b0d01597555e7dcadbf9101611700565b8181113060008261250c578561250f565b60005b905060008361251f576000612521565b865b905060008461253957612534868861336b565b612543565b612543878761336b565b604051633885984b60e11b81526001600160a01b03868116600483015285811660248301528481166044830152606482018c9052608482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063710b30969060a401600060405180830381600087803b1580156125c957600080fd5b505af11580156125dd573d6000803e3d6000fd5b50505050505050505050505050565b60005462010000900460ff16156126155760405162461bcd60e51b815260040161061b906133db565b6000805462ff00001916620100001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122aa3390565b60ff8216600081815260126020908152604091829020849055815192835282018390527f16f0bfe4b02efd5423ef8906906b049c0943f21df8f10347d319fddbc59222079101611700565b600082816126a8846004613679565b60ff1682901c905080600f169250505092915050565b6000838152601160205260409020546126d88184846127c0565b6000858152601160205260409081902091909155517f393b86c90799fa411201ae723a54e105823fcf7c6c8dffa90903fc44c03b4ac79061249e9086908690869092835260ff918216602084015216604082015260600190565b6000805b83548110156127b65783818154811061275157612751613326565b9060005260206000209060020201600001548310158015612795575083818154811061277f5761277f613326565b9060005260206000209060020201600101548311155b156127a45760019150506105e3565b806127ae81613352565b915050612736565b5060009392505050565b60006127cb83611da9565b6127d482612819565b8360006127e2856004613679565b600f60ff919091161b905060001981188281166000612802886004613679565b60ff97881697169690961b17979650505050505050565b600f8160ff161115610f51576040516329afd27b60e21b815260ff8216600482015260240161061b565b50805461284f90613382565b6000825580601f1061285f575050565b601f016020900490600052602060002090810190610f519190612901565b82805461288990613382565b90600052602060002090601f0160209004810192826128ab57600085556128f1565b82601f106128c457805160ff19168380011785556128f1565b828001600101855582156128f1579182015b828111156128f15782518255916020019190600101906128d6565b506128fd929150612901565b5090565b5b808211156128fd5760008155600101612902565b80356001600160a01b038116811461292d57600080fd5b919050565b6000806040838503121561294557600080fd5b8235915061295560208401612916565b90509250929050565b803560ff8116811461292d57600080fd5b6000806040838503121561298257600080fd5b61298b8361295e565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156129d1576129d1612999565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129ff576129ff612999565b604052919050565b60006001600160401b03821115612a2057612a20612999565b5060051b60200190565b600082601f830112612a3b57600080fd5b81356020612a50612a4b83612a07565b6129d7565b82815260059290921b84018101918181019086841115612a6f57600080fd5b8286015b84811015612a8a5780358352918301918301612a73565b509695505050505050565b60008060408385031215612aa857600080fd5b82356001600160401b0380821115612abf57600080fd5b612acb86838701612a2a565b9350602091508185013581811115612ae257600080fd5b85019050601f81018613612af557600080fd5b8035612b03612a4b82612a07565b81815260059190911b82018301908381019088831115612b2257600080fd5b928401925b82841015612b4757612b3884612916565b82529284019290840190612b27565b80955050505050509250929050565b6000815180845260005b81811015612b7c57602081850181015186830182015201612b60565b81811115612b8e576000602083870101525b50601f01601f19169290920160200192915050565b60018060a01b0381511682526020810151602083015263ffffffff604082015116604083015260006060820151608060608501526118806080850182612b56565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612c3957603f19888603018452612c27858351612ba3565b94509285019290850190600101612c0b565b5092979650505050505050565b600082601f830112612c5757600080fd5b81356020612c67612a4b83612a07565b82815260059290921b84018101918181019086841115612c8657600080fd5b8286015b84811015612a8a57612c9b8161295e565b8352918301918301612c8a565b60008060408385031215612cbb57600080fd5b82356001600160401b0380821115612cd257600080fd5b612cde86838701612c46565b9350602091508185013581811115612cf557600080fd5b85019050601f81018613612d0857600080fd5b8035612d16612a4b82612a07565b81815260059190911b82018301908381019088831115612d3557600080fd5b928401925b82841015612b4757833582529284019290840190612d3a565b600082601f830112612d6457600080fd5b81356020612d74612a4b83612a07565b82815260069290921b84018101918181019086841115612d9357600080fd5b8286015b84811015612a8a5760408189031215612db05760008081fd5b612db86129af565b813581528482013585820152835291830191604001612d97565b600080600060608486031215612de757600080fd5b612df084612916565b925060208401356001600160401b0380821115612e0c57600080fd5b612e1887838801612d53565b93506040860135915080821115612e2e57600080fd5b50612e3b86828701612a2a565b9150509250925092565b60008060408385031215612e5857600080fd5b61298b83612916565b60018060a01b038516815283602082015263ffffffff83166040820152608060608201526000612e946080830184612b56565b9695505050505050565b60008060408385031215612eb157600080fd5b8235915060208301356001600160401b03811115612ece57600080fd5b612eda85828601612c46565b9150509250929050565b600081518084526020808501945080840160005b83811015612f1757815160ff1687529582019590820190600101612ef8565b509495945050505050565b6020815260006108d96020830184612ee4565b600060208284031215612f4757600080fd5b5035919050565b604080825283519082018190526000906020906060840190828701845b82811015612f8757815184529284019290840190600101612f6b565b50505083810382850152612e948186612ee4565b600060208284031215612fad57600080fd5b81356001600160401b03811115612fc357600080fd5b61188084828501612c46565b6020815260006108d96020830184612b56565b600080600060608486031215612ff757600080fd5b83356001600160401b038082111561300e57600080fd5b61301a87838801612a2a565b9450602086013591508082111561303057600080fd5b61303c87838801612c46565b9350604086013591508082111561305257600080fd5b50612e3b86828701612c46565b60008060006060848603121561307457600080fd5b61307d84612916565b95602085013595506040909401359392505050565b6000602082840312156130a457600080fd5b6108d98261295e565b60008083601f8401126130bf57600080fd5b5081356001600160401b038111156130d657600080fd5b6020830191508360208260051b85010111156130f157600080fd5b9250929050565b6000806000806040858703121561310e57600080fd5b84356001600160401b038082111561312557600080fd5b613131888389016130ad565b9096509450602087013591508082111561314a57600080fd5b50613157878288016130ad565b95989497509550505050565b6020815260006108d96020830184612ba3565b6000806040838503121561318957600080fd5b61319283612916565b915060208301356001600160401b038111156131ad57600080fd5b612eda85828601612d53565b600080600080608085870312156131cf57600080fd5b6131d885612916565b966020860135965060408601359560600135945092505050565b60006020828403121561320457600080fd5b6108d982612916565b6000806040838503121561322057600080fd5b823591506129556020840161295e565b6020808252825182820181905260009190848201906040850190845b818110156132685783518352928401929184019160010161324c565b50909695505050505050565b60008060006060848603121561328957600080fd5b833592506132996020850161295e565b91506132a76040850161295e565b90509250925092565b600080602083850312156132c357600080fd5b82356001600160401b038111156132d957600080fd5b6132e5858286016130ad565b90969095509350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016133645761336461333c565b5060010190565b60008282101561337d5761337d61333c565b500390565b600181811c9082168061339657607f821691505b6020821081036133b657634e487b7160e01b600052602260045260246000fd5b50919050565b600060ff821660ff81036133d2576133d261333c565b60010192915050565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6040808252810184905260008560608301825b87811015613446576001600160a01b0361343184612916565b16825260209283019290910190600101613418565b5083810360208501528481526001600160fb1b0385111561346657600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b60208152815160208201526000602083015160018060a01b03808216604085015280604086015116606085015250506060830151608083015263ffffffff60808401511660a083015260a083015160c08084015261188060e0840182612b56565b6000823560be198336030181126134fe57600080fd5b9190910192915050565b803563ffffffff8116811461292d57600080fd5b60006020828403121561352e57600080fd5b6108d982613508565b6000808335601e1984360301811261354e57600080fd5b8301803591506001600160401b0382111561356857600080fd5b6020019150368190038213156130f157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b602081528135602082015260006135bf60208401612916565b60018060a01b038082166040850152806135db60408701612916565b16606085015250506060830135608083015263ffffffff6135fe60808501613508565b1660a083015260a0830135601e1984360301811261361b57600080fd5b83016020810190356001600160401b0381111561363757600080fd5b80360382131561364657600080fd5b60c08085015261365a60e08501828461357d565b95945050505050565b634e487b7160e01b600052603160045260246000fd5b600060ff821660ff84168160ff048111821515161561369a5761369a61333c565b02939250505056fea26469706673582212209714c1001d19740a655ea4426b52e9f5d8348f9df38d027a88d1f1095e244e9464736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "attestationsCollectionHasAttribute(uint256,uint8)": { - "details": "Returns whether an attestationsCollection has a specific attribute referenced by its index", - "params": { - "collectionId": "Collection Id of the targeted attestationsCollection", - "index": "Index of the attribute. Can go from 0 to 63." - } - }, - "authorizeRange(address,uint256,uint256)": { - "details": "Authorize an issuer for a specific range", - "params": { - "firstCollectionId": "First collection Id of the range for which the issuer will be authorized", - "issuer": "Issuer that will be authorized", - "lastCollectionId": "Last collection Id of the range for which the issuer will be authorized" - } - }, - "authorizeRanges(address,(uint256,uint256)[])": { - "details": "Authorize an issuer for specific ranges", - "params": { - "issuer": "Issuer that will be authorized", - "ranges": "Ranges for which the issuer will be authorized" - } - }, - "constructor": { - "details": "Constructor.", - "params": { - "badgesAddress": "Stateless ERC1155 Badges contract", - "owner": "Owner of the contract, has the right to authorize/unauthorize attestations issuers" - } - }, - "createNewAttribute(uint8,bytes32)": { - "details": "Create a new attribute.", - "params": { - "index": "Index of the attribute. Can go from 0 to 63.", - "name": "Name in bytes32 of the attribute" - } - }, - "deleteAttestations(address[],uint256[])": { - "details": "Delete function to be called by authorized issuers", - "params": { - "collectionIds": "The collection ids of the attestations to be deleted", - "owners": "The owners of the attestations to be deleted" - } - }, - "deleteAttribute(uint8)": { - "details": "Delete an existing attribute", - "params": { - "index": "Index of the attribute. Can go from 0 to 63. The attribute must already exist" - } - }, - "getAttestationData(uint256,address)": { - "details": "Getter of the data of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationDataBatch(uint256[],address[])": { - "details": "Getter of the data of specific attestations", - "params": { - "collectionIds": "Collection identifiers of the targeted attestations", - "owners": "Owners of the targeted attestations" - } - }, - "getAttestationDataTuple(uint256,address)": { - "details": "Getter of the data of a specific attestation as tuple", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationExtraData(uint256,address)": { - "details": "Getter of the extraData of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationIssuer(uint256,address)": { - "details": "Getter of the issuer of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationTimestamp(uint256,address)": { - "details": "Getter of the timestamp of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationValue(uint256,address)": { - "details": "Getter of the value of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationValueBatch(uint256[],address[])": { - "details": "Getter of the values of specific attestations", - "params": { - "collectionIds": "Collection identifiers of the targeted attestations", - "owners": "Owners of the targeted attestations" - } - }, - "getAttributeValueForAttestationsCollection(uint256,uint8)": { - "details": "Returns the attribute's value (from 0 to 15) of an attestationsCollection", - "params": { - "collectionId": "Collection Id of the targeted attestationsCollection", - "index": "Index of the attribute. Can go from 0 to 63." - } - }, - "getAttributesNamesAndValuesForAttestationsCollection(uint256)": { - "details": "Returns all the enabled attributes names and their values for a specific attestationsCollection", - "params": { - "collectionId": "Collection Id of the targeted attestationsCollection" - } - }, - "hasAttestation(uint256,address)": { - "details": "Returns whether a user has an attestation from a collection", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "initialize(address)": { - "details": "Initialize function, to be called by the proxy delegating calls to this implementation", - "params": { - "ownerAddress": "Owner of the contract, has the right to authorize/unauthorize attestations issuers" - } - }, - "isAuthorized(address,uint256)": { - "details": "Returns whether a specific issuer is authorized or not to record in a specific attestations collection", - "params": { - "collectionId": "Collection Id for which the issuer will be checked", - "issuer": "Issuer to be checked" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "pause()": { - "details": "Pauses the registry. Issuers can no longer record or delete attestations" - }, - "paused()": { - "details": "Returns true if the contract is paused, and false otherwise." - }, - "recordAttestations((uint256,address,address,uint256,uint32,bytes)[])": { - "details": "Main function to be called by authorized issuers", - "params": { - "attestations": "Attestations to be recorded (creates a new one or overrides an existing one)" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "setAttributeValueForAttestationsCollection(uint256,uint8,uint8)": { - "details": "Set a value for an attribute of an attestationsCollection. The attribute should already be created.", - "params": { - "collectionId": "Collection Id of the targeted attestationsCollection", - "index": "Index of the attribute (must be between 0 and 63)", - "value": "Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "unauthorizeRange(address,uint256,uint256,uint256)": { - "details": "Unauthorize an issuer for a specific range", - "params": { - "firstCollectionId": "First collection Id of the range for which the issuer will be unauthorized", - "issuer": "Issuer that will be unauthorized", - "lastCollectionId": "Last collection Id of the range for which the issuer will be unauthorized", - "rangeIndex": "Index of the range to be unauthorized" - } - }, - "unauthorizeRanges(address,(uint256,uint256)[],uint256[])": { - "details": "Unauthorize an issuer for specific ranges", - "params": { - "issuer": "Issuer that will be unauthorized", - "ranges": "Ranges for which the issuer will be unauthorized" - } - }, - "unpause()": { - "details": "Unpauses the registry" - }, - "updateAttributeName(uint8,bytes32)": { - "details": "Update the name of an existing attribute", - "params": { - "index": "Index of the attribute. Can go from 0 to 63. The attribute must exist", - "newName": "new name in bytes32 of the attribute" - } - } - }, - "title": "Attestations Registry", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "Main contract of Sismo, stores all recorded attestations in attestations collections Only authorized attestations issuers can record attestation in the registry Attesters that expect to record in the Attestations Registry must be authorized issuers For more information: https://attestations-registry.docs.sismo.io For each attestation recorded, a badge is received by the user The badge is the Non transferrable NFT representation of an attestation Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts It enables off-chain apps such as opensea to catch the \"shadow mint\" of the badge*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 14389, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 14391, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 14393, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_paused", - "offset": 2, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 14395, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_owner", - "offset": 3, - "slot": "0", - "type": "t_address" - }, - { - "astId": 14399, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_placeHoldersAdmin", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)15_storage" - }, - { - "astId": 14405, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_authorizedRanges", - "offset": 0, - "slot": "16", - "type": "t_mapping(t_address,t_array(t_struct(Range)15352_storage)dyn_storage)" - }, - { - "astId": 14409, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_attestationsCollectionAttributesValuesBitmap", - "offset": 0, - "slot": "17", - "type": "t_mapping(t_uint256,t_uint256)" - }, - { - "astId": 14413, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_attributesNames", - "offset": 0, - "slot": "18", - "type": "t_mapping(t_uint8,t_bytes32)" - }, - { - "astId": 14417, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_placeHoldersConfig", - "offset": 0, - "slot": "19", - "type": "t_array(t_uint256)13_storage" - }, - { - "astId": 14424, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_attestationsData", - "offset": 0, - "slot": "32", - "type": "t_mapping(t_uint256,t_mapping(t_address,t_struct(AttestationData)13388_storage))" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_struct(Range)15352_storage)dyn_storage": { - "base": "t_struct(Range)15352_storage", - "encoding": "dynamic_array", - "label": "struct Range[]", - "numberOfBytes": "32" - }, - "t_array(t_uint256)13_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[13]", - "numberOfBytes": "416" - }, - "t_array(t_uint256)15_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[15]", - "numberOfBytes": "480" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_bytes_storage": { - "encoding": "bytes", - "label": "bytes", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_array(t_struct(Range)15352_storage)dyn_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct Range[])", - "numberOfBytes": "32", - "value": "t_array(t_struct(Range)15352_storage)dyn_storage" - }, - "t_mapping(t_address,t_struct(AttestationData)13388_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct AttestationData)", - "numberOfBytes": "32", - "value": "t_struct(AttestationData)13388_storage" - }, - "t_mapping(t_uint256,t_mapping(t_address,t_struct(AttestationData)13388_storage))": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => mapping(address => struct AttestationData))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_struct(AttestationData)13388_storage)" - }, - "t_mapping(t_uint256,t_uint256)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_mapping(t_uint8,t_bytes32)": { - "encoding": "mapping", - "key": "t_uint8", - "label": "mapping(uint8 => bytes32)", - "numberOfBytes": "32", - "value": "t_bytes32" - }, - "t_struct(AttestationData)13388_storage": { - "encoding": "inplace", - "label": "struct AttestationData", - "members": [ - { - "astId": 13381, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "issuer", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 13383, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "value", - "offset": 0, - "slot": "1", - "type": "t_uint256" - }, - { - "astId": 13385, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "timestamp", - "offset": 0, - "slot": "2", - "type": "t_uint32" - }, - { - "astId": 13387, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "extraData", - "offset": 0, - "slot": "3", - "type": "t_bytes_storage" - } - ], - "numberOfBytes": "128" - }, - "t_struct(Range)15352_storage": { - "encoding": "inplace", - "label": "struct Range", - "members": [ - { - "astId": 15349, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "min", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 15351, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "max", - "offset": 0, - "slot": "1", - "type": "t_uint256" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/mumbai/AttestationsRegistryImplem.json b/deployments/mumbai/AttestationsRegistryImplem.json deleted file mode 100644 index 20e9254..0000000 --- a/deployments/mumbai/AttestationsRegistryImplem.json +++ /dev/null @@ -1,1812 +0,0 @@ -{ - "address": "0x219aEB9920E8528C2664EC673c2df0E55DEEc26E", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "badgesAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "ArgsLengthDoesNotMatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - } - ], - "name": "AttesterNotFound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - } - ], - "name": "AttributeAlreadyExists", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - } - ], - "name": "AttributeDoesNotExist", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "rangeIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedFirstId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedLastId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "FirstId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "IdsMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "IndexOutOfBounds", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "IssuerNotAuthorized", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "owners", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - } - ], - "name": "OwnersAndCollectionIdsLengthMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "expectedArrayLength", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "rangeIndex", - "type": "uint256" - } - ], - "name": "RangeIndexOutOfBounds", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "value", - "type": "uint8" - } - ], - "name": "ValueOutOfBounds", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationRecorded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "uint8", - "name": "attributeValue", - "type": "uint8" - } - ], - "name": "AttestationsCollectionAttributeSet", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "deletedAttributeName", - "type": "bytes32" - } - ], - "name": "AttributeDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "newAttributeName", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "previousAttributeName", - "type": "bytes32" - } - ], - "name": "AttributeNameUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "firstCollectionId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "IssuerAuthorized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "firstCollectionId", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "IssuerUnauthorized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "attributeIndex", - "type": "uint8" - }, - { - "indexed": false, - "internalType": "bytes32", - "name": "attributeName", - "type": "bytes32" - } - ], - "name": "NewAttributeCreated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Unpaused", - "type": "event" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "attestationsCollectionHasAttribute", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - } - ], - "name": "attestationsCollectionHasAttributes", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "firstCollectionId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "authorizeRange", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Range[]", - "name": "ranges", - "type": "tuple[]" - } - ], - "name": "authorizeRanges", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "name", - "type": "bytes32" - } - ], - "name": "createNewAttribute", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - }, - { - "internalType": "bytes32[]", - "name": "names", - "type": "bytes32[]" - } - ], - "name": "createNewAttributes", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "owners", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - } - ], - "name": "deleteAttestations", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "deleteAttribute", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - } - ], - "name": "deleteAttributes", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationData", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct AttestationData", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "owners", - "type": "address[]" - } - ], - "name": "getAttestationDataBatch", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct AttestationData[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationDataTuple", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationExtraData", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationIssuer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationTimestamp", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "getAttestationValue", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address[]", - "name": "owners", - "type": "address[]" - } - ], - "name": "getAttestationValueBatch", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "getAttributeValueForAttestationsCollection", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "getAttributesNamesAndValuesForAttestationsCollection", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - }, - { - "internalType": "uint8[]", - "name": "", - "type": "uint8[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - } - ], - "name": "getAttributesValuesForAttestationsCollection", - "outputs": [ - { - "internalType": "uint8[]", - "name": "", - "type": "uint8[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "hasAttestation", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "isAuthorized", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "paused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "attestations", - "type": "tuple[]" - } - ], - "name": "recordAttestations", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - }, - { - "internalType": "uint8", - "name": "value", - "type": "uint8" - } - ], - "name": "setAttributeValueForAttestationsCollection", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - }, - { - "internalType": "uint8[]", - "name": "values", - "type": "uint8[]" - } - ], - "name": "setAttributesValuesForAttestationsCollections", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "rangeIndex", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "firstCollectionId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "lastCollectionId", - "type": "uint256" - } - ], - "name": "unauthorizeRange", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "min", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "max", - "type": "uint256" - } - ], - "internalType": "struct Range[]", - "name": "ranges", - "type": "tuple[]" - }, - { - "internalType": "uint256[]", - "name": "rangeIndexes", - "type": "uint256[]" - } - ], - "name": "unauthorizeRanges", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "unpause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "newName", - "type": "bytes32" - } - ], - "name": "updateAttributeName", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint8[]", - "name": "indices", - "type": "uint8[]" - }, - { - "internalType": "bytes32[]", - "name": "newNames", - "type": "bytes32[]" - } - ], - "name": "updateAttributesName", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x23ead6ee5b2b09647afa2e281d6cb93a084f26cc05fb59708bf0b291222cfaf7", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x219aEB9920E8528C2664EC673c2df0E55DEEc26E", - "transactionIndex": 11, - "gasUsed": "3121566", - "logsBloom": "0x00000000000000000000000000020000000000000000000000800000000000000000000000000000000000000000000000008000002000000000000000000000000000000000000000000000000000800001000000000000040100000000000000000000020000000000200000000800002000000000000080000000000000400000000000000000000000000000000000000010000080000000000000008000200000000000000000000000800400000000000000000000000040000000004000000000000000000001000000040000000800000000000000100000000020000000000000000002000000000000000000000000000000000020000000100000", - "blockHash": "0x655bddf3573ec82ece82fb6dc8dfc789151c1afcc549317e790c1eca4dc5568c", - "transactionHash": "0x23ead6ee5b2b09647afa2e281d6cb93a084f26cc05fb59708bf0b291222cfaf7", - "logs": [ - { - "transactionIndex": 11, - "blockNumber": 29540661, - "transactionHash": "0x23ead6ee5b2b09647afa2e281d6cb93a084f26cc05fb59708bf0b291222cfaf7", - "address": "0x219aEB9920E8528C2664EC673c2df0E55DEEc26E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" - ], - "data": "0x", - "logIndex": 32, - "blockHash": "0x655bddf3573ec82ece82fb6dc8dfc789151c1afcc549317e790c1eca4dc5568c" - }, - { - "transactionIndex": 11, - "blockNumber": 29540661, - "transactionHash": "0x23ead6ee5b2b09647afa2e281d6cb93a084f26cc05fb59708bf0b291222cfaf7", - "address": "0x219aEB9920E8528C2664EC673c2df0E55DEEc26E", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954" - ], - "data": "0x", - "logIndex": 33, - "blockHash": "0x655bddf3573ec82ece82fb6dc8dfc789151c1afcc549317e790c1eca4dc5568c" - }, - { - "transactionIndex": 11, - "blockNumber": 29540661, - "transactionHash": "0x23ead6ee5b2b09647afa2e281d6cb93a084f26cc05fb59708bf0b291222cfaf7", - "address": "0x219aEB9920E8528C2664EC673c2df0E55DEEc26E", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 34, - "blockHash": "0x655bddf3573ec82ece82fb6dc8dfc789151c1afcc549317e790c1eca4dc5568c" - }, - { - "transactionIndex": 11, - "blockNumber": 29540661, - "transactionHash": "0x23ead6ee5b2b09647afa2e281d6cb93a084f26cc05fb59708bf0b291222cfaf7", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000c275dc8be39f50d12f66b6a63629c39da5bae5bd" - ], - "data": "0x000000000000000000000000000000000000000000000000000ed690e9d737dc0000000000000000000000000000000000000000000000007d35c1e8683d9f52000000000000000000000000000000000000000000000b8e6f62240848713dbc0000000000000000000000000000000000000000000000007d26eb577e666776000000000000000000000000000000000000000000000b8e6f70fa9932487598", - "logIndex": 35, - "blockHash": "0x655bddf3573ec82ece82fb6dc8dfc789151c1afcc549317e790c1eca4dc5568c" - } - ], - "blockNumber": 29540661, - "cumulativeGasUsed": "4966184", - "status": 1, - "byzantium": true - }, - "args": [ - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954", - "0x5722fEa81027533721BA161964622271560da1aC" - ], - "numDeployments": 2, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"badgesAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ArgsLengthDoesNotMatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"}],\"name\":\"AttesterNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"}],\"name\":\"AttributeAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"}],\"name\":\"AttributeDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rangeIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedFirstId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedLastId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"FirstId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"IdsMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"IndexOutOfBounds\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"IssuerNotAuthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"}],\"name\":\"OwnersAndCollectionIdsLengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"expectedArrayLength\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rangeIndex\",\"type\":\"uint256\"}],\"name\":\"RangeIndexOutOfBounds\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"value\",\"type\":\"uint8\"}],\"name\":\"ValueOutOfBounds\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationRecorded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeValue\",\"type\":\"uint8\"}],\"name\":\"AttestationsCollectionAttributeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"deletedAttributeName\",\"type\":\"bytes32\"}],\"name\":\"AttributeDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"newAttributeName\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"previousAttributeName\",\"type\":\"bytes32\"}],\"name\":\"AttributeNameUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"IssuerAuthorized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"IssuerUnauthorized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"attributeName\",\"type\":\"bytes32\"}],\"name\":\"NewAttributeCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"attestationsCollectionHasAttribute\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"}],\"name\":\"attestationsCollectionHasAttributes\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"authorizeRange\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"internalType\":\"struct Range[]\",\"name\":\"ranges\",\"type\":\"tuple[]\"}],\"name\":\"authorizeRanges\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"createNewAttribute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"names\",\"type\":\"bytes32[]\"}],\"name\":\"createNewAttributes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"}],\"name\":\"deleteAttestations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"deleteAttribute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"}],\"name\":\"deleteAttributes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationData\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct AttestationData\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"}],\"name\":\"getAttestationDataBatch\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct AttestationData[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationDataTuple\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationIssuer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationTimestamp\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationValue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"}],\"name\":\"getAttestationValueBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"getAttributeValueForAttestationsCollection\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"getAttributesNamesAndValuesForAttestationsCollection\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"}],\"name\":\"getAttributesValuesForAttestationsCollection\",\"outputs\":[{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"hasAttestation\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"isAuthorized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"attestations\",\"type\":\"tuple[]\"}],\"name\":\"recordAttestations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"value\",\"type\":\"uint8\"}],\"name\":\"setAttributeValueForAttestationsCollection\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"},{\"internalType\":\"uint8[]\",\"name\":\"values\",\"type\":\"uint8[]\"}],\"name\":\"setAttributesValuesForAttestationsCollections\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rangeIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"unauthorizeRange\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"internalType\":\"struct Range[]\",\"name\":\"ranges\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256[]\",\"name\":\"rangeIndexes\",\"type\":\"uint256[]\"}],\"name\":\"unauthorizeRanges\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"newName\",\"type\":\"bytes32\"}],\"name\":\"updateAttributeName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"newNames\",\"type\":\"bytes32[]\"}],\"name\":\"updateAttributesName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"attestationsCollectionHasAttribute(uint256,uint8)\":{\"details\":\"Returns whether an attestationsCollection has a specific attribute referenced by its index\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\",\"index\":\"Index of the attribute. Can go from 0 to 63.\"}},\"authorizeRange(address,uint256,uint256)\":{\"details\":\"Authorize an issuer for a specific range\",\"params\":{\"firstCollectionId\":\"First collection Id of the range for which the issuer will be authorized\",\"issuer\":\"Issuer that will be authorized\",\"lastCollectionId\":\"Last collection Id of the range for which the issuer will be authorized\"}},\"authorizeRanges(address,(uint256,uint256)[])\":{\"details\":\"Authorize an issuer for specific ranges\",\"params\":{\"issuer\":\"Issuer that will be authorized\",\"ranges\":\"Ranges for which the issuer will be authorized\"}},\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"badgesAddress\":\"Stateless ERC1155 Badges contract\",\"owner\":\"Owner of the contract, has the right to authorize/unauthorize attestations issuers\"}},\"createNewAttribute(uint8,bytes32)\":{\"details\":\"Create a new attribute.\",\"params\":{\"index\":\"Index of the attribute. Can go from 0 to 63.\",\"name\":\"Name in bytes32 of the attribute\"}},\"deleteAttestations(address[],uint256[])\":{\"details\":\"Delete function to be called by authorized issuers\",\"params\":{\"collectionIds\":\"The collection ids of the attestations to be deleted\",\"owners\":\"The owners of the attestations to be deleted\"}},\"deleteAttribute(uint8)\":{\"details\":\"Delete an existing attribute\",\"params\":{\"index\":\"Index of the attribute. Can go from 0 to 63. The attribute must already exist\"}},\"getAttestationData(uint256,address)\":{\"details\":\"Getter of the data of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationDataBatch(uint256[],address[])\":{\"details\":\"Getter of the data of specific attestations\",\"params\":{\"collectionIds\":\"Collection identifiers of the targeted attestations\",\"owners\":\"Owners of the targeted attestations\"}},\"getAttestationDataTuple(uint256,address)\":{\"details\":\"Getter of the data of a specific attestation as tuple\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationExtraData(uint256,address)\":{\"details\":\"Getter of the extraData of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationIssuer(uint256,address)\":{\"details\":\"Getter of the issuer of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationTimestamp(uint256,address)\":{\"details\":\"Getter of the timestamp of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationValue(uint256,address)\":{\"details\":\"Getter of the value of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationValueBatch(uint256[],address[])\":{\"details\":\"Getter of the values of specific attestations\",\"params\":{\"collectionIds\":\"Collection identifiers of the targeted attestations\",\"owners\":\"Owners of the targeted attestations\"}},\"getAttributeValueForAttestationsCollection(uint256,uint8)\":{\"details\":\"Returns the attribute's value (from 0 to 15) of an attestationsCollection\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\",\"index\":\"Index of the attribute. Can go from 0 to 63.\"}},\"getAttributesNamesAndValuesForAttestationsCollection(uint256)\":{\"details\":\"Returns all the enabled attributes names and their values for a specific attestationsCollection\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\"}},\"hasAttestation(uint256,address)\":{\"details\":\"Returns whether a user has an attestation from a collection\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"initialize(address)\":{\"details\":\"Initialize function, to be called by the proxy delegating calls to this implementation\",\"params\":{\"ownerAddress\":\"Owner of the contract, has the right to authorize/unauthorize attestations issuers\"}},\"isAuthorized(address,uint256)\":{\"details\":\"Returns whether a specific issuer is authorized or not to record in a specific attestations collection\",\"params\":{\"collectionId\":\"Collection Id for which the issuer will be checked\",\"issuer\":\"Issuer to be checked\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pause()\":{\"details\":\"Pauses the registry. Issuers can no longer record or delete attestations\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"recordAttestations((uint256,address,address,uint256,uint32,bytes)[])\":{\"details\":\"Main function to be called by authorized issuers\",\"params\":{\"attestations\":\"Attestations to be recorded (creates a new one or overrides an existing one)\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAttributeValueForAttestationsCollection(uint256,uint8,uint8)\":{\"details\":\"Set a value for an attribute of an attestationsCollection. The attribute should already be created.\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\",\"index\":\"Index of the attribute (must be between 0 and 63)\",\"value\":\"Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unauthorizeRange(address,uint256,uint256,uint256)\":{\"details\":\"Unauthorize an issuer for a specific range\",\"params\":{\"firstCollectionId\":\"First collection Id of the range for which the issuer will be unauthorized\",\"issuer\":\"Issuer that will be unauthorized\",\"lastCollectionId\":\"Last collection Id of the range for which the issuer will be unauthorized\",\"rangeIndex\":\"Index of the range to be unauthorized\"}},\"unauthorizeRanges(address,(uint256,uint256)[],uint256[])\":{\"details\":\"Unauthorize an issuer for specific ranges\",\"params\":{\"issuer\":\"Issuer that will be unauthorized\",\"ranges\":\"Ranges for which the issuer will be unauthorized\"}},\"unpause()\":{\"details\":\"Unpauses the registry\"},\"updateAttributeName(uint8,bytes32)\":{\"details\":\"Update the name of an existing attribute\",\"params\":{\"index\":\"Index of the attribute. Can go from 0 to 63. The attribute must exist\",\"newName\":\"new name in bytes32 of the attribute\"}}},\"title\":\"Attestations Registry\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"Main contract of Sismo, stores all recorded attestations in attestations collections Only authorized attestations issuers can record attestation in the registry Attesters that expect to record in the Attestations Registry must be authorized issuers For more information: https://attestations-registry.docs.sismo.io For each attestation recorded, a badge is received by the user The badge is the Non transferrable NFT representation of an attestation Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts It enables off-chain apps such as opensea to catch the \\\"shadow mint\\\" of the badge*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/AttestationsRegistry.sol\":\"AttestationsRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/core/AttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\\nimport {Attestation, AttestationData} from './libs/Structs.sol';\\nimport {IBadges} from './interfaces/IBadges.sol';\\n\\n/**\\n * @title Attestations Registry\\n * @author Sismo\\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\\n * Only authorized attestations issuers can record attestation in the registry\\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\\n * For more information: https://attestations-registry.docs.sismo.io\\n\\n * For each attestation recorded, a badge is received by the user\\n * The badge is the Non transferrable NFT representation of an attestation \\n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\\n * It enables off-chain apps such as opensea to catch the \\\"shadow mint\\\" of the badge\\n **/\\ncontract AttestationsRegistry is\\n AttestationsRegistryState,\\n IAttestationsRegistry,\\n AttestationsRegistryConfigLogic\\n{\\n uint8 public constant IMPLEMENTATION_VERSION = 3;\\n IBadges immutable BADGES;\\n\\n /**\\n * @dev Constructor.\\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @param badgesAddress Stateless ERC1155 Badges contract\\n */\\n constructor(address owner, address badgesAddress) {\\n BADGES = IBadges(badgesAddress);\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\\n address issuer = _msgSender();\\n for (uint256 i = 0; i < attestations.length; i++) {\\n if (!_isAuthorized(issuer, attestations[i].collectionId))\\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\\n\\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\\n attestations[i].owner\\n ].value;\\n\\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\\n attestations[i].issuer,\\n attestations[i].value,\\n attestations[i].timestamp,\\n attestations[i].extraData\\n );\\n\\n _triggerBadgeTransferEvent(\\n attestations[i].collectionId,\\n attestations[i].owner,\\n previousAttestationValue,\\n attestations[i].value\\n );\\n emit AttestationRecorded(attestations[i]);\\n }\\n }\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(\\n address[] calldata owners,\\n uint256[] calldata collectionIds\\n ) external override whenNotPaused {\\n if (owners.length != collectionIds.length)\\n revert OwnersAndCollectionIdsLengthMismatch(owners, collectionIds);\\n\\n address issuer = _msgSender();\\n for (uint256 i = 0; i < owners.length; i++) {\\n AttestationData memory attestationData = _attestationsData[collectionIds[i]][owners[i]];\\n\\n if (!_isAuthorized(issuer, collectionIds[i]))\\n revert IssuerNotAuthorized(issuer, collectionIds[i]);\\n delete _attestationsData[collectionIds[i]][owners[i]];\\n\\n _triggerBadgeTransferEvent(collectionIds[i], owners[i], attestationData.value, 0);\\n\\n emit AttestationDeleted(\\n Attestation(\\n collectionIds[i],\\n owners[i],\\n attestationData.issuer,\\n attestationData.value,\\n attestationData.timestamp,\\n attestationData.extraData\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (bool) {\\n return _getAttestationValue(collectionId, owner) != 0;\\n }\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (AttestationData memory) {\\n return _getAttestationData(collectionId, owner);\\n }\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (uint256) {\\n return _getAttestationValue(collectionId, owner);\\n }\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (address, uint256, uint32, bytes memory) {\\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\\n return (\\n attestationData.issuer,\\n attestationData.value,\\n attestationData.timestamp,\\n attestationData.extraData\\n );\\n }\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (bytes memory) {\\n return _attestationsData[collectionId][owner].extraData;\\n }\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (address) {\\n return _attestationsData[collectionId][owner].issuer;\\n }\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (uint32) {\\n return _attestationsData[collectionId][owner].timestamp;\\n }\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view override returns (AttestationData[] memory) {\\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\\n }\\n return attestationsDataArray;\\n }\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view override returns (uint256[] memory) {\\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\\n }\\n return attestationsValues;\\n }\\n\\n /**\\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\\n * It enables off-chain apps such as opensea to catch the \\\"shadow mints/burns\\\" of badges\\n */\\n function _triggerBadgeTransferEvent(\\n uint256 badgeTokenId,\\n address owner,\\n uint256 previousValue,\\n uint256 newValue\\n ) internal {\\n bool isGreaterValue = newValue > previousValue;\\n address operator = address(this);\\n address from = isGreaterValue ? address(0) : owner;\\n address to = isGreaterValue ? owner : address(0);\\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\\n\\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\\n }\\n\\n function _getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) internal view returns (AttestationData memory) {\\n return (_attestationsData[collectionId][owner]);\\n }\\n\\n function _getAttestationValue(\\n uint256 collectionId,\\n address owner\\n ) internal view returns (uint256) {\\n return _attestationsData[collectionId][owner].value;\\n }\\n}\\n\",\"keccak256\":\"0xc21afe30d8096d2bab3683ca28b2533f99f53fa20a1f2c13aa44f1d46ecb9ae6\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IBadges.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Interface for Badges contract\\n * @author Sismo\\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\\n * The associated attestations registry triggers TransferSingle events from this contract\\n * It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms\\n */\\ninterface IBadges {\\n error BadgesNonTransferrable();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(string memory uri, address owner) external;\\n\\n /**\\n * @dev Main function of the ERC1155 badge\\n * The balance of a user is equal to the value of the underlying attestation.\\n * attestationCollectionId == badgeId\\n * @param account Address to check badge balance (= value of attestation)\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\\n * @param operator who is calling the TransferEvent\\n * @param from address(0) if minting, address of the badge holder if burning\\n * @param to address of the badge holder is minting, address(0) if burning\\n * @param id badgeId for which to trigger the event\\n * @param value minted/burned balance\\n */\\n function triggerTransferEvent(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 value\\n ) external;\\n\\n /**\\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\\n * @param attestationsRegistry new attestations registry address\\n */\\n function setAttestationsRegistry(address attestationsRegistry) external;\\n\\n /**\\n * @dev Set the URI. Can only be called by owner (default admin)\\n * @param uri new attestations registry address\\n */\\n function setUri(string memory uri) external;\\n\\n /**\\n * @dev Getter of the attestations registry\\n */\\n function getAttestationsRegistry() external view returns (address);\\n\\n /**\\n * @dev Getter of the badge issuer\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeIssuer(address account, uint256 id) external view returns (address);\\n\\n /**\\n * @dev Getter of the badge timestamp\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the value of a specific badge attribute\\n * @param id Badge Id to check (= attestationCollectionId)\\n * @param index Index of the attribute\\n */\\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);\\n\\n /**\\n * @dev Getter of all badge attributes and their values for a specific badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getAttributesNamesAndValuesForBadge(\\n uint256 id\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n}\\n\",\"keccak256\":\"0xd6bdfc887ef15ee022eb05d89dbe2e2938ee6c0a55a55f8db527ef650242c6bb\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport './OwnableLogic.sol';\\nimport './PausableLogic.sol';\\nimport './InitializableLogic.sol';\\nimport './AttestationsRegistryState.sol';\\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\\nimport {Bitmap256Bit} from '../utils/Bitmap256Bit.sol';\\n\\n/**\\n * @title Attestations Registry Config Logic contract\\n * @author Sismo\\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\\n **/\\ncontract AttestationsRegistryConfigLogic is\\n AttestationsRegistryState,\\n IAttestationsRegistryConfigLogic,\\n OwnableLogic,\\n PausableLogic,\\n InitializableLogic\\n{\\n using RangeUtils for Range[];\\n using Bitmap256Bit for uint256;\\n using Bitmap256Bit for uint8;\\n\\n /******************************************\\n *\\n * ATTESTATION REGISTRY WRITE ACCESS MANAGEMENT (ISSUERS)\\n *\\n *****************************************/\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external override onlyOwner {\\n _pause();\\n }\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external override onlyOwner {\\n _unpause();\\n }\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external override onlyOwner {\\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\\n }\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external override onlyOwner {\\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\\n }\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\\n }\\n }\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external override onlyOwner {\\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\\n return _isAuthorized(issuer, collectionId);\\n }\\n\\n /******************************************\\n *\\n * ATTRIBUTES CONFIG LOGIC\\n *\\n *****************************************/\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) public onlyOwner {\\n index._checkIndexIsValid();\\n if (_isAttributeCreated(index)) {\\n revert AttributeAlreadyExists(index);\\n }\\n _createNewAttribute(index, name);\\n }\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external onlyOwner {\\n if (indices.length != names.length) {\\n revert ArgsLengthDoesNotMatch();\\n }\\n\\n for (uint256 i = 0; i < indices.length; i++) {\\n createNewAttribute(indices[i], names[i]);\\n }\\n }\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) public onlyOwner {\\n index._checkIndexIsValid();\\n if (!_isAttributeCreated(index)) {\\n revert AttributeDoesNotExist(index);\\n }\\n _updateAttributeName(index, newName);\\n }\\n\\n function updateAttributesName(\\n uint8[] memory indices,\\n bytes32[] memory newNames\\n ) external onlyOwner {\\n if (indices.length != newNames.length) {\\n revert ArgsLengthDoesNotMatch();\\n }\\n\\n for (uint256 i = 0; i < indices.length; i++) {\\n updateAttributeName(indices[i], newNames[i]);\\n }\\n }\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must already exist\\n */\\n function deleteAttribute(uint8 index) public onlyOwner {\\n index._checkIndexIsValid();\\n if (!_isAttributeCreated(index)) {\\n revert AttributeDoesNotExist(index);\\n }\\n _deleteAttribute(index);\\n }\\n\\n function deleteAttributes(uint8[] memory indices) external onlyOwner {\\n for (uint256 i = 0; i < indices.length; i++) {\\n deleteAttribute(indices[i]);\\n }\\n }\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) public onlyOwner {\\n index._checkIndexIsValid();\\n\\n if (!_isAttributeCreated(index)) {\\n revert AttributeDoesNotExist(index);\\n }\\n\\n _setAttributeForAttestationsCollection(collectionId, index, value);\\n }\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external onlyOwner {\\n if (collectionIds.length != indices.length || collectionIds.length != values.length) {\\n revert ArgsLengthDoesNotMatch();\\n }\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n setAttributeValueForAttestationsCollection(collectionIds[i], indices[i], values[i]);\\n }\\n }\\n\\n /**\\n * @dev Returns the attribute's value (from 0 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index\\n ) public view returns (uint8) {\\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\\n collectionId\\n );\\n return currentAttributesValues._get(index);\\n }\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory) {\\n uint8[] memory attributesValues = new uint8[](indices.length);\\n for (uint256 i = 0; i < indices.length; i++) {\\n attributesValues[i] = getAttributeValueForAttestationsCollection(collectionId, indices[i]);\\n }\\n return attributesValues;\\n }\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) public view returns (bool) {\\n uint256 currentAttributeValues = _getAttributesValuesBitmapForAttestationsCollection(\\n collectionId\\n );\\n return currentAttributeValues._get(index) > 0;\\n }\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool) {\\n for (uint256 i = 0; i < indices.length; i++) {\\n if (!attestationsCollectionHasAttribute(collectionId, indices[i])) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) public view returns (bytes32[] memory, uint8[] memory) {\\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\\n collectionId\\n );\\n\\n (\\n uint8[] memory indices,\\n uint8[] memory values,\\n uint8 nbOfNonZeroValues\\n ) = currentAttributesValues._getAllNonZeroValues();\\n\\n bytes32[] memory attributesNames = new bytes32[](nbOfNonZeroValues);\\n uint8[] memory attributesValues = new uint8[](nbOfNonZeroValues);\\n for (uint8 i = 0; i < nbOfNonZeroValues; i++) {\\n attributesNames[i] = _attributesNames[indices[i]];\\n attributesValues[i] = values[i];\\n }\\n\\n return (attributesNames, attributesValues);\\n }\\n\\n /*****************************\\n *\\n * INTERNAL FUNCTIONS\\n *\\n *****************************/\\n\\n function _authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) internal {\\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\\n _authorizedRanges[issuer].push(newRange);\\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\\n }\\n\\n function _unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) internal onlyOwner {\\n if (rangeIndex >= _authorizedRanges[issuer].length)\\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\\n\\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\\n revert IdsMismatch(\\n issuer,\\n rangeIndex,\\n expectedFirstId,\\n expectedLastId,\\n firstCollectionId,\\n lastCollectionId\\n );\\n\\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\\n _authorizedRanges[issuer].length - 1\\n ];\\n _authorizedRanges[issuer].pop();\\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\\n }\\n\\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\\n return _authorizedRanges[issuer]._includes(collectionId);\\n }\\n\\n function _setAttributeForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) internal {\\n uint256 currentAttributes = _getAttributesValuesBitmapForAttestationsCollection(collectionId);\\n\\n _attestationsCollectionAttributesValuesBitmap[collectionId] = currentAttributes._set(\\n index,\\n value\\n );\\n\\n emit AttestationsCollectionAttributeSet(collectionId, index, value);\\n }\\n\\n function _createNewAttribute(uint8 index, bytes32 name) internal {\\n _attributesNames[index] = name;\\n\\n emit NewAttributeCreated(index, name);\\n }\\n\\n function _updateAttributeName(uint8 index, bytes32 newName) internal {\\n bytes32 previousName = _attributesNames[index];\\n\\n _attributesNames[index] = newName;\\n\\n emit AttributeNameUpdated(index, newName, previousName);\\n }\\n\\n function _deleteAttribute(uint8 index) internal {\\n bytes32 deletedName = _attributesNames[index];\\n\\n delete _attributesNames[index];\\n\\n emit AttributeDeleted(index, deletedName);\\n }\\n\\n function _getAttributesValuesBitmapForAttestationsCollection(\\n uint256 collectionId\\n ) internal view returns (uint256) {\\n return _attestationsCollectionAttributesValuesBitmap[collectionId];\\n }\\n\\n function _isAttributeCreated(uint8 index) internal view returns (bool) {\\n if (_attributesNames[index] == 0) {\\n return false;\\n }\\n return true;\\n }\\n}\\n\",\"keccak256\":\"0xa48b3131a3870684389282cb863a34734c67194d7f50d266ed8421114b3d786a\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/AttestationsRegistryState.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Range} from '../utils/RangeLib.sol';\\nimport {Attestation, AttestationData} from '../Structs.sol';\\n\\ncontract AttestationsRegistryState {\\n /*******************************************************\\n Storage layout:\\n 19 slots for config\\n 4 currently used for _initialized, _initializing, _paused, _owner\\n 15 place holders\\n 16 slots for logic\\n 3 currently used for _authorizedRanges, _attestationsCollectionAttributesValuesBitmap, _attributesNames\\n 13 place holders\\n 1 slot for _attestationsData \\n *******************************************************/\\n\\n // main config\\n // changed `_initialized` from bool to uint8\\n // as we were using OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n // and changed to OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n // PR: https://github.com/sismo-core/sismo-protocol/pull/41\\n uint8 internal _initialized;\\n bool internal _initializing;\\n bool internal _paused;\\n address internal _owner;\\n // keeping some space for future\\n uint256[15] private _placeHoldersAdmin;\\n\\n // storing the authorized ranges for each attesters\\n mapping(address => Range[]) internal _authorizedRanges;\\n // Storing the attributes values used for each attestations collection\\n // Each attribute value is an hexadecimal\\n mapping(uint256 => uint256) internal _attestationsCollectionAttributesValuesBitmap;\\n // Storing the attribute name for each attributes index\\n mapping(uint8 => bytes32) internal _attributesNames;\\n // keeping some space for future\\n uint256[13] private _placeHoldersConfig;\\n // storing the data of attestations\\n // =collectionId=> =owner=> attestationData\\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\\n}\\n\",\"keccak256\":\"0xabd7a629901a128cc32f80102ce06db228a76bd04f27818ccaf54827921eb149\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/InitializableLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport '../utils/Address.sol';\\nimport './AttestationsRegistryState.sol';\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract InitializableLogic is AttestationsRegistryState {\\n // only diff with oz\\n // /**\\n // * @dev Indicates that the contract has been initialized.\\n // */\\n // bool private _initialized;\\n\\n // /**\\n // * @dev Indicates that the contract is in the process of being initialized.\\n // */\\n // bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) ||\\n (!Address.isContract(address(this)) && _initialized == 1),\\n 'Initializable: contract is already initialized'\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(\\n !_initializing && _initialized < version,\\n 'Initializable: contract is already initialized'\\n );\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, 'Initializable: contract is not initializing');\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, 'Initializable: contract is initializing');\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x64d931c5e29318bd4ae2ec44b3be45783ad7ad20431594bbcb9ae4e2014bc5ef\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/OwnableLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport '../utils/Context.sol';\\nimport './AttestationsRegistryState.sol';\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n // This is the only diff with OZ contract\\n // address private _owner;\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x74ff8ebdd6ad706a45354f1045ef623840aa1dbde37874dde2b6bfa498e0bdb3\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/PausableLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport '../utils/Context.sol';\\nimport './AttestationsRegistryState.sol';\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableLogic is Context, AttestationsRegistryState {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n // this is the only diff with OZ contract\\n // bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n require(!paused(), 'Pausable: paused');\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n require(paused(), 'Pausable: not paused');\\n _;\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0x234c48f5eb48bb15b6c2535428f1e28e172bc2c6fbf58c99ba7b3ca75e884c60\",\"license\":\"MIT\"},\"contracts/core/libs/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, 'Address: insufficient balance');\\n\\n (bool success, ) = recipient.call{value: amount}('');\\n require(success, 'Address: unable to send value, recipient may have reverted');\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, 'Address: low-level call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, 'Address: insufficient balance for call');\\n require(isContract(target), 'Address: call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data\\n ) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, 'Address: low-level static call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), 'Address: static call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), 'Address: delegate call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xdbca640e165333604a6121b07d206eea2b596dd3c3bb4d62caa436a05ac1d91d\",\"license\":\"MIT\"},\"contracts/core/libs/utils/Bitmap256Bit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/*\\n * The 256-bit bitmap is structured in 64 chuncks of 4 bits each.\\n * The 4 bits can encode any value from 0 to 15.\\n\\n chunck63 chunck2 chunck1 chunck0\\n bits bits bits bits \\n \\u250c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510 \\u250c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u252c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u252c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510\\n \\u2502 1 1 1 1 \\u2502 .... \\u2502 1 0 1 1 \\u2502 0 0 0 0 \\u2502 0 0 0 1 \\u2502\\n \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518 \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2534\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2534\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518\\n value 15 value 11 value 0 value 1\\n\\n * A chunck index must be between 0 and 63.\\n * A value must be between 0 and 15.\\n **/\\n\\nlibrary Bitmap256Bit {\\n uint256 constant MAX_INT = 2 ** 256 - 1;\\n\\n error IndexOutOfBounds(uint8 index);\\n error ValueOutOfBounds(uint8 value);\\n\\n /**\\n * @dev Return the value at a given index of a 256-bit bitmap\\n * @param index index where the value can be found. Can be between 0 and 63\\n */\\n function _get(uint256 self, uint8 index) internal pure returns (uint8) {\\n uint256 currentValues = self;\\n // Get the encoded 4-bit value by right shifting to the `index` position\\n uint256 shifted = currentValues >> (4 * index);\\n // Get the value by only masking the last 4 bits with an AND operator\\n return uint8(shifted & (2 ** 4 - 1));\\n }\\n\\n /**\\n * @dev Set a value at a chosen index in a 256-bit bitmap\\n * @param index index where the value will be stored. Can be between 0 and 63\\n * @param value value to store. Can be between 0 and 15\\n */\\n function _set(uint256 self, uint8 index, uint8 value) internal pure returns (uint256) {\\n _checkIndexIsValid(index);\\n _checkValueIsValid(value);\\n\\n uint256 currentValues = self;\\n // 1. first we need to remove the current value for the inputed `index`\\n // Left Shift 4 bits mask (1111 mask) to the `index` position\\n uint256 mask = (2 ** 4 - 1) << (4 * index);\\n // Apply a XOR operation to obtain a mask with all bits set to 1 except the 4 bits that we want to remove\\n uint256 negativeMask = MAX_INT ^ mask;\\n // Apply a AND operation between the current values and the negative mask to remove the wanted bits\\n uint256 newValues = currentValues & negativeMask;\\n\\n // 2. We set the new value wanted at the `index` position\\n // Create the 4 bits encoding the new value and left shift them to the `index` position\\n uint256 newValueMask = uint256(value) << (4 * index);\\n // Apply an OR operation between the current values and the newValueMask to reference new value\\n return newValues | newValueMask;\\n }\\n\\n /**\\n * @dev Get all the non-zero values in a 256-bit bitmap\\n * @param self a 256-bit bitmap\\n */\\n function _getAllNonZeroValues(\\n uint256 self\\n ) internal pure returns (uint8[] memory, uint8[] memory, uint8) {\\n uint8[] memory indices = new uint8[](64);\\n uint8[] memory values = new uint8[](64);\\n uint8 nbOfNonZeroValues = 0;\\n for (uint8 i = 0; i < 63; i++) {\\n uint8 value = _get(self, i);\\n if (value > 0) {\\n indices[nbOfNonZeroValues] = i;\\n values[nbOfNonZeroValues] = value;\\n nbOfNonZeroValues++;\\n }\\n }\\n return (indices, values, nbOfNonZeroValues);\\n }\\n\\n /**\\n * @dev Check if the index is valid (is between 0 and 63)\\n * @param index index of a chunck\\n */\\n function _checkIndexIsValid(uint8 index) internal pure {\\n if (index > 63) {\\n revert IndexOutOfBounds(index);\\n }\\n }\\n\\n /**\\n * @dev Check if the value is valid (is between 0 and 15)\\n * @param value value to encode in a chunck\\n */\\n function _checkValueIsValid(uint8 value) internal pure {\\n if (value > 15) {\\n revert ValueOutOfBounds(value);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xac6ca38e106fb9e999b0c765dba0f8894697c3aead9459ffeab6b32e3560b39e\",\"license\":\"MIT\"},\"contracts/core/libs/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2dba7215628ceb3bb6f28422c7ca48d79615dd7aa8ba54978d4d8cad996f57e\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60a06040523480156200001157600080fd5b506040516200393538038062003935833981016040819052620000349162000209565b6200003f336200006b565b6000805462ff0000191690556001600160a01b0381166080526200006382620000c8565b505062000241565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600390610100900460ff16158015620000eb575060005460ff8083169116105b620001535760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff83161761010017815562000181600054630100000090046001600160a01b031690565b6001600160a01b03161480620001965750303b155b15620001a757620001a7826200006b565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b80516001600160a01b03811681146200020457600080fd5b919050565b600080604083850312156200021d57600080fd5b6200022883620001ec565b91506200023860208401620001ec565b90509250929050565b6080516136d86200025d600039600061258301526136d86000f3fe608060405234801561001057600080fd5b50600436106102275760003560e01c80637ffe93fc11610130578063b8865673116100b8578063dc873d011161007c578063dc873d0114610566578063e78d54bb14610586578063e972f91014610599578063ebc5c093146105ac578063f2fde38b146105bf57600080fd5b8063b8865673146104e5578063c06d5db6146104f8578063c4d66de81461050b578063c7da9aa61461051e578063da5d314b1461055357600080fd5b806384c2ad82116100ff57806384c2ad821461044d5780638c3c9e321461046d5780638da5cb5b1461048e578063aad9a979146104bf578063b1cb1662146104d257600080fd5b80637ffe93fc1461040c578063811a6af71461041f57806381213f22146104325780638456cb591461044557600080fd5b8063436a76f3116101b35780636d7fbb67116101825780636d7fbb67146103a4578063715018a6146103c4578063754b377c146103cc5780637cc920b4146103e65780637cde0fe2146103f957600080fd5b8063436a76f31461033f5780635657f0361461035f5780635c975abb1461038057806364fff83c1461039157600080fd5b80631538ff08116101fa5780631538ff08146102db578063181dfdff146102ee5780632972b0f0146103015780633be1ced7146103145780633f4ba83a1461033757600080fd5b8063011023901461022c57806305b374211461025457806314067f8b1461026957806315027bda146102bb575b600080fd5b61023f61023a366004612932565b6105d2565b60405190151581526020015b60405180910390f35b61026761026236600461296f565b6105e9565b005b6102a6610277366004612932565b6000918252602080805260408084206001600160a01b0393909316845291905290206002015463ffffffff1690565b60405163ffffffff909116815260200161024b565b6102ce6102c9366004612a95565b610669565b60405161024b9190612be4565b6102676102e9366004612ca8565b61075a565b6102676102fc366004612dd2565b61080d565b61023f61030f366004612e45565b6108cd565b610327610322366004612932565b6108e0565b60405161024b9493929190612e61565b6102676109f6565b61035261034d366004612e9e565b610a32565b60405161024b9190612f22565b61037261036d366004612f35565b610ae0565b60405161024b929190612f4e565b60005462010000900460ff1661023f565b61026761039f366004612f9b565b610c65565b6103b76103b2366004612932565b610cd7565b60405161024b9190612fcf565b610267610d8f565b6103d4600381565b60405160ff909116815260200161024b565b6102676103f4366004612fe2565b610dcb565b61026761040736600461305f565b610ea2565b61026761041a366004613092565b610edf565b61026761042d3660046130f8565b610f54565b61023f610440366004612e9e565b611330565b61026761138a565b61046061045b366004612932565b6113c4565b60405161024b9190613163565b61048061047b366004612932565b6113f1565b60405190815260200161024b565b6104a7600054630100000090046001600160a01b031690565b6040516001600160a01b03909116815260200161024b565b6102676104cd36600461296f565b6113fd565b6102676104e0366004612ca8565b611471565b6102676104f3366004613176565b61151f565b6102676105063660046131b9565b6115b4565b6102676105193660046131f2565b6115f2565b6104a761052c366004612932565b6000918252602080805260408084206001600160a01b039384168552909152909120541690565b61023f61056136600461320d565b61170c565b610579610574366004612a95565b611733565b60405161024b9190613230565b610267610594366004613274565b6117f3565b6103d46105a736600461320d565b611867565b6102676105ba3660046132b0565b611888565b6102676105cd3660046131f2565b611ce0565b60006105de8383611d80565b151590505b92915050565b6000546001600160a01b0363010000009091041633146106245760405162461bcd60e51b815260040161061b906132f1565b60405180910390fd5b6106308260ff16611da9565b61063982611dd3565b61065b5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6106658282611dfc565b5050565b6060600083516001600160401b0381111561068657610686612999565b6040519080825280602002602001820160405280156106d757816020015b60408051608081018252600080825260208083018290529282015260608082015282526000199092019101816106a45790505b50905060005b8451811015610752576107228582815181106106fb576106fb613326565b602002602001015185838151811061071557610715613326565b6020026020010151611e5c565b82828151811061073457610734613326565b6020026020010181905250808061074a90613352565b9150506106dd565b509392505050565b6000546001600160a01b03630100000090910416331461078c5760405162461bcd60e51b815260040161061b906132f1565b80518251146107ae57604051636e37235160e11b815260040160405180910390fd5b60005b8251811015610808576107f68382815181106107cf576107cf613326565b60200260200101518383815181106107e9576107e9613326565b60200260200101516105e9565b8061080081613352565b9150506107b1565b505050565b6000546001600160a01b03630100000090910416331461083f5760405162461bcd60e51b815260040161061b906132f1565b60005b81518110156108c7576108b5848284848151811061086257610862613326565b6020026020010151610874919061336b565b85848151811061088657610886613326565b6020026020010151600001518685815181106108a4576108a4613326565b602002602001015160200151611f6b565b806108bf81613352565b915050610842565b50505050565b60006108d9838361220a565b9392505050565b6000828152602080805260408083206001600160a01b038086168552908352818420825160808101845281549092168252600181015493820193909352600283015463ffffffff1691810191909152600382018054849384936060938593919291838601919061094f90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461097b90613382565b80156109c85780601f1061099d576101008083540402835291602001916109c8565b820191906000526020600020905b8154815290600101906020018083116109ab57829003601f168201915b505050919092525050815160208301516040840151606090940151919b909a50929850965090945050505050565b6000546001600160a01b036301000000909104163314610a285760405162461bcd60e51b815260040161061b906132f1565b610a3061222c565b565b6060600082516001600160401b03811115610a4f57610a4f612999565b604051908082528060200260200182016040528015610a78578160200160208202803683370190505b50905060005b835181101561075257610aaa85858381518110610a9d57610a9d613326565b6020026020010151611867565b828281518110610abc57610abc613326565b60ff9092166020928302919091019091015280610ad881613352565b915050610a7e565b6000818152601160205260408120546060918291908080610b00846122c7565b92509250925060008160ff166001600160401b03811115610b2357610b23612999565b604051908082528060200260200182016040528015610b4c578160200160208202803683370190505b50905060008260ff166001600160401b03811115610b6c57610b6c612999565b604051908082528060200260200182016040528015610b95578160200160208202803683370190505b50905060005b8360ff168160ff161015610c565760126000878360ff1681518110610bc257610bc2613326565b602002602001015160ff1660ff16815260200190815260200160002054838260ff1681518110610bf457610bf4613326565b602002602001018181525050848160ff1681518110610c1557610c15613326565b6020026020010151828260ff1681518110610c3257610c32613326565b60ff9092166020928302919091019091015280610c4e816133bc565b915050610b9b565b50909890975095505050505050565b6000546001600160a01b036301000000909104163314610c975760405162461bcd60e51b815260040161061b906132f1565b60005b815181101561066557610cc5828281518110610cb857610cb8613326565b6020026020010151610edf565b80610ccf81613352565b915050610c9a565b6000828152602080805260408083206001600160a01b03851684529091529020600301805460609190610d0990613382565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3590613382565b8015610d825780601f10610d5757610100808354040283529160200191610d82565b820191906000526020600020905b815481529060010190602001808311610d6557829003601f168201915b5050505050905092915050565b6000546001600160a01b036301000000909104163314610dc15760405162461bcd60e51b815260040161061b906132f1565b610a3060006123bc565b6000546001600160a01b036301000000909104163314610dfd5760405162461bcd60e51b815260040161061b906132f1565b81518351141580610e1057508051835114155b15610e2e57604051636e37235160e11b815260040160405180910390fd5b60005b83518110156108c757610e90848281518110610e4f57610e4f613326565b6020026020010151848381518110610e6957610e69613326565b6020026020010151848481518110610e8357610e83613326565b60200260200101516117f3565b80610e9a81613352565b915050610e31565b6000546001600160a01b036301000000909104163314610ed45760405162461bcd60e51b815260040161061b906132f1565b610808838383612419565b6000546001600160a01b036301000000909104163314610f115760405162461bcd60e51b815260040161061b906132f1565b610f1d8160ff16611da9565b610f2681611dd3565b610f485760405163eabeadd360e01b815260ff8216600482015260240161061b565b610f51816124ac565b50565b60005462010000900460ff1615610f7d5760405162461bcd60e51b815260040161061b906133db565b828114610fa55783838383604051638ceb003d60e01b815260040161061b9493929190613405565b3360005b8481101561132857600060206000868685818110610fc957610fc9613326565b9050602002013581526020019081526020016000206000888885818110610ff257610ff2613326565b905060200201602081019061100791906131f2565b6001600160a01b0390811682526020808301939093526040918201600020825160808101845281549092168252600181015493820193909352600283015463ffffffff169181019190915260038201805491929160608401919061106a90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461109690613382565b80156110e35780601f106110b8576101008083540402835291602001916110e3565b820191906000526020600020905b8154815290600101906020018083116110c657829003601f168201915b50505050508152505090506111108386868581811061110457611104613326565b9050602002013561220a565b61115a578285858481811061112757611127613326565b60405163c522f21160e01b81526001600160a01b039094166004850152602002919091013560248301525060440161061b565b6020600086868581811061117057611170613326565b905060200201358152602001908152602001600020600088888581811061119957611199613326565b90506020020160208101906111ae91906131f2565b6001600160a01b031681526020810191909152604001600090812080546001600160a01b03191681556001810182905560028101805463ffffffff19169055906111fb6003830182612843565b505061124c85858481811061121257611212613326565b9050602002013588888581811061122b5761122b613326565b905060200201602081019061124091906131f2565b836020015160006124fb565b7f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b6040518060c0016040528087878681811061128a5761128a613326565b9050602002013581526020018989868181106112a8576112a8613326565b90506020020160208101906112bd91906131f2565b6001600160a01b0316815260200183600001516001600160a01b0316815260200183602001518152602001836040015163ffffffff168152602001836060015181525060405161130d9190613487565b60405180910390a1508061132081613352565b915050610fa9565b505050505050565b6000805b8251811015611380576113608484838151811061135357611353613326565b602002602001015161170c565b61136e5760009150506105e3565b8061137881613352565b915050611334565b5060019392505050565b6000546001600160a01b0363010000009091041633146113bc5760405162461bcd60e51b815260040161061b906132f1565b610a306125ec565b60408051608081018252600080825260208201819052918101919091526060808201526108d98383611e5c565b60006108d98383611d80565b6000546001600160a01b03630100000090910416331461142f5760405162461bcd60e51b815260040161061b906132f1565b61143b8260ff16611da9565b61144482611dd3565b1561146757604051635d04d75160e01b815260ff8316600482015260240161061b565b610665828261264e565b6000546001600160a01b0363010000009091041633146114a35760405162461bcd60e51b815260040161061b906132f1565b80518251146114c557604051636e37235160e11b815260040160405180910390fd5b60005b82518110156108085761150d8382815181106114e6576114e6613326565b602002602001015183838151811061150057611500613326565b60200260200101516113fd565b8061151781613352565b9150506114c8565b6000546001600160a01b0363010000009091041633146115515760405162461bcd60e51b815260040161061b906132f1565b60005b8151811015610808576115a28383838151811061157357611573613326565b60200260200101516000015184848151811061159157611591613326565b602002602001015160200151612419565b806115ac81613352565b915050611554565b6000546001600160a01b0363010000009091041633146115e65760405162461bcd60e51b815260040161061b906132f1565b6108c784848484611f6b565b600054600390610100900460ff16158015611614575060005460ff8083169116105b6116775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161061b565b6000805461ffff191660ff8316176101001781556116a4600054630100000090046001600160a01b031690565b6001600160a01b031614806116b85750303b155b156116c6576116c6826123bc565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60008281526011602052604081205460006117278285612699565b60ff1611949350505050565b6060600083516001600160401b0381111561175057611750612999565b604051908082528060200260200182016040528015611779578160200160208202803683370190505b50905060005b8451811015610752576117c485828151811061179d5761179d613326565b60200260200101518583815181106117b7576117b7613326565b6020026020010151611d80565b8282815181106117d6576117d6613326565b6020908102919091010152806117eb81613352565b91505061177f565b6000546001600160a01b0363010000009091041633146118255760405162461bcd60e51b815260040161061b906132f1565b6118318260ff16611da9565b61183a82611dd3565b61185c5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6108088383836126be565b6000828152601160205260408120546118808184612699565b949350505050565b60005462010000900460ff16156118b15760405162461bcd60e51b815260040161061b906133db565b3360005b828110156108c7576118eb828585848181106118d3576118d3613326565b90506020028101906118e591906134e8565b3561220a565b61193f578184848381811061190257611902613326565b905060200281019061191491906134e8565b60405163c522f21160e01b81526001600160a01b03909216600483015235602482015260440161061b565b60006020600086868581811061195757611957613326565b905060200281019061196991906134e8565b600001358152602001908152602001600020600086868581811061198f5761198f613326565b90506020028101906119a191906134e8565b6119b29060408101906020016131f2565b6001600160a01b03166001600160a01b0316815260200190815260200160002060010154905060405180608001604052808686858181106119f5576119f5613326565b9050602002810190611a0791906134e8565b611a189060608101906040016131f2565b6001600160a01b03168152602001868685818110611a3857611a38613326565b9050602002810190611a4a91906134e8565b606001358152602001868685818110611a6557611a65613326565b9050602002810190611a7791906134e8565b611a889060a081019060800161351c565b63ffffffff168152602001868685818110611aa557611aa5613326565b9050602002810190611ab791906134e8565b611ac59060a0810190613537565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250602092508890508786818110611b1257611b12613326565b9050602002810190611b2491906134e8565b6000013581526020019081526020016000206000878786818110611b4a57611b4a613326565b9050602002810190611b5c91906134e8565b611b6d9060408101906020016131f2565b6001600160a01b0390811682526020808301939093526040918201600020845181546001600160a01b03191692169190911781558383015160018201559083015160028201805463ffffffff191663ffffffff909216919091179055606083015180519192611be49260038501929091019061287d565b50905050611c73858584818110611bfd57611bfd613326565b9050602002810190611c0f91906134e8565b35868685818110611c2257611c22613326565b9050602002810190611c3491906134e8565b611c459060408101906020016131f2565b83888887818110611c5857611c58613326565b9050602002810190611c6a91906134e8565b606001356124fb565b7f8c20c3acb6b5208b7affea2fd90dabc8d47e77cee9766c855ce42730505cb205858584818110611ca657611ca6613326565b9050602002810190611cb891906134e8565b604051611cc591906135a6565b60405180910390a15080611cd881613352565b9150506118b5565b6000546001600160a01b036301000000909104163314611d125760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b038116611d775760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061b565b610f51816123bc565b6000918252602080805260408084206001600160a01b0393909316845291905290206001015490565b603f8160ff161115610f515760405163453e14b960e01b815260ff8216600482015260240161061b565b60ff81166000908152601260205260408120548103611df457506000919050565b506001919050565b60ff82166000818152601260209081526040918290208054908590558251938452908301849052908201819052907f0d3d8d66bac9b2a9f0e5c83181a30443294ab849472526080d03fffd7187f7169060600160405180910390a1505050565b60408051608081018252600080825260208201819052918101919091526060808201526000838152602080805260408083206001600160a01b03808716855290835292819020815160808101835281549094168452600181015492840192909252600282015463ffffffff1690830152600381018054606084019190611ee190613382565b80601f0160208091040260200160405190810160405280929190818152602001828054611f0d90613382565b8015611f5a5780601f10611f2f57610100808354040283529160200191611f5a565b820191906000526020600020905b815481529060010190602001808311611f3d57829003601f168201915b505050505081525050905092915050565b6000546001600160a01b036301000000909104163314611f9d5760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b0384166000908152601060205260409020548310611fff576001600160a01b038416600081815260106020526040908190205490516345e388eb60e01b8152600481019290925260248201526044810184905260640161061b565b6001600160a01b038416600090815260106020526040812080548590811061202957612029613326565b600091825260208083206002909202909101546001600160a01b03881683526010909152604082208054919350908690811061206757612067613326565b9060005260206000209060020201600101549050818414158061208a5750808314155b156120d657604051637a4dd76560e01b81526001600160a01b03871660048201526024810186905260448101839052606481018290526084810185905260a4810184905260c40161061b565b6001600160a01b038616600090815260106020526040902080546120fc9060019061336b565b8154811061210c5761210c613326565b906000526020600020906002020160106000886001600160a01b03166001600160a01b03168152602001908152602001600020868154811061215057612150613326565b60009182526020808320845460029093020191825560019384015493909101929092556001600160a01b038816815260109091526040902080548061219757612197613663565b6000828152602080822060026000199490940193840201828155600101919091559155604080516001600160a01b038916815291820186905281018490527f33cff58e54c3a8acae85cad63487b5dcf617521e33bb03f071299f374c29de1f9060600160405180910390a1505050505050565b6001600160a01b03821660009081526010602052604081206108d99083612732565b60005462010000900460ff1661227b5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161061b565b6000805462ff0000191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60408051818152610820810182526060918291600091829190602082016108008036833750506040805181815261082081018252929350600092915060208201610800803683370190505090506000805b603f8160ff1610156123ae5760006123308983612699565b905060ff81161561239b5781858460ff168151811061235157612351613326565b602002602001019060ff16908160ff168152505080848460ff168151811061237b5761237b613326565b60ff9092166020928302919091019091015282612397816133bc565b9350505b50806123a6816133bc565b915050612318565b509196909550909350915050565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60408051808201825283815260208082018481526001600160a01b03871660008181526010845285812080546001808201835591835291859020865160029093020191825592519201919091558351908152908101859052918201839052907fe7d6ac0b740347f7f96a97e6a9dc0f20f4f11eca65495315adc009a55b6762f8906060015b60405180910390a150505050565b60ff811660008181526012602090815260408083208054939055805193845290830182905290917feb82955a27e39ea7559b6ec7e7d8b371081ab0d8783c7b0d01597555e7dcadbf9101611700565b8181113060008261250c578561250f565b60005b905060008361251f576000612521565b865b905060008461253957612534868861336b565b612543565b612543878761336b565b604051633885984b60e11b81526001600160a01b03868116600483015285811660248301528481166044830152606482018c9052608482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063710b30969060a401600060405180830381600087803b1580156125c957600080fd5b505af11580156125dd573d6000803e3d6000fd5b50505050505050505050505050565b60005462010000900460ff16156126155760405162461bcd60e51b815260040161061b906133db565b6000805462ff00001916620100001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122aa3390565b60ff8216600081815260126020908152604091829020849055815192835282018390527f16f0bfe4b02efd5423ef8906906b049c0943f21df8f10347d319fddbc59222079101611700565b600082816126a8846004613679565b60ff1682901c905080600f169250505092915050565b6000838152601160205260409020546126d88184846127c0565b6000858152601160205260409081902091909155517f393b86c90799fa411201ae723a54e105823fcf7c6c8dffa90903fc44c03b4ac79061249e9086908690869092835260ff918216602084015216604082015260600190565b6000805b83548110156127b65783818154811061275157612751613326565b9060005260206000209060020201600001548310158015612795575083818154811061277f5761277f613326565b9060005260206000209060020201600101548311155b156127a45760019150506105e3565b806127ae81613352565b915050612736565b5060009392505050565b60006127cb83611da9565b6127d482612819565b8360006127e2856004613679565b600f60ff919091161b905060001981188281166000612802886004613679565b60ff97881697169690961b17979650505050505050565b600f8160ff161115610f51576040516329afd27b60e21b815260ff8216600482015260240161061b565b50805461284f90613382565b6000825580601f1061285f575050565b601f016020900490600052602060002090810190610f519190612901565b82805461288990613382565b90600052602060002090601f0160209004810192826128ab57600085556128f1565b82601f106128c457805160ff19168380011785556128f1565b828001600101855582156128f1579182015b828111156128f15782518255916020019190600101906128d6565b506128fd929150612901565b5090565b5b808211156128fd5760008155600101612902565b80356001600160a01b038116811461292d57600080fd5b919050565b6000806040838503121561294557600080fd5b8235915061295560208401612916565b90509250929050565b803560ff8116811461292d57600080fd5b6000806040838503121561298257600080fd5b61298b8361295e565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156129d1576129d1612999565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129ff576129ff612999565b604052919050565b60006001600160401b03821115612a2057612a20612999565b5060051b60200190565b600082601f830112612a3b57600080fd5b81356020612a50612a4b83612a07565b6129d7565b82815260059290921b84018101918181019086841115612a6f57600080fd5b8286015b84811015612a8a5780358352918301918301612a73565b509695505050505050565b60008060408385031215612aa857600080fd5b82356001600160401b0380821115612abf57600080fd5b612acb86838701612a2a565b9350602091508185013581811115612ae257600080fd5b85019050601f81018613612af557600080fd5b8035612b03612a4b82612a07565b81815260059190911b82018301908381019088831115612b2257600080fd5b928401925b82841015612b4757612b3884612916565b82529284019290840190612b27565b80955050505050509250929050565b6000815180845260005b81811015612b7c57602081850181015186830182015201612b60565b81811115612b8e576000602083870101525b50601f01601f19169290920160200192915050565b60018060a01b0381511682526020810151602083015263ffffffff604082015116604083015260006060820151608060608501526118806080850182612b56565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612c3957603f19888603018452612c27858351612ba3565b94509285019290850190600101612c0b565b5092979650505050505050565b600082601f830112612c5757600080fd5b81356020612c67612a4b83612a07565b82815260059290921b84018101918181019086841115612c8657600080fd5b8286015b84811015612a8a57612c9b8161295e565b8352918301918301612c8a565b60008060408385031215612cbb57600080fd5b82356001600160401b0380821115612cd257600080fd5b612cde86838701612c46565b9350602091508185013581811115612cf557600080fd5b85019050601f81018613612d0857600080fd5b8035612d16612a4b82612a07565b81815260059190911b82018301908381019088831115612d3557600080fd5b928401925b82841015612b4757833582529284019290840190612d3a565b600082601f830112612d6457600080fd5b81356020612d74612a4b83612a07565b82815260069290921b84018101918181019086841115612d9357600080fd5b8286015b84811015612a8a5760408189031215612db05760008081fd5b612db86129af565b813581528482013585820152835291830191604001612d97565b600080600060608486031215612de757600080fd5b612df084612916565b925060208401356001600160401b0380821115612e0c57600080fd5b612e1887838801612d53565b93506040860135915080821115612e2e57600080fd5b50612e3b86828701612a2a565b9150509250925092565b60008060408385031215612e5857600080fd5b61298b83612916565b60018060a01b038516815283602082015263ffffffff83166040820152608060608201526000612e946080830184612b56565b9695505050505050565b60008060408385031215612eb157600080fd5b8235915060208301356001600160401b03811115612ece57600080fd5b612eda85828601612c46565b9150509250929050565b600081518084526020808501945080840160005b83811015612f1757815160ff1687529582019590820190600101612ef8565b509495945050505050565b6020815260006108d96020830184612ee4565b600060208284031215612f4757600080fd5b5035919050565b604080825283519082018190526000906020906060840190828701845b82811015612f8757815184529284019290840190600101612f6b565b50505083810382850152612e948186612ee4565b600060208284031215612fad57600080fd5b81356001600160401b03811115612fc357600080fd5b61188084828501612c46565b6020815260006108d96020830184612b56565b600080600060608486031215612ff757600080fd5b83356001600160401b038082111561300e57600080fd5b61301a87838801612a2a565b9450602086013591508082111561303057600080fd5b61303c87838801612c46565b9350604086013591508082111561305257600080fd5b50612e3b86828701612c46565b60008060006060848603121561307457600080fd5b61307d84612916565b95602085013595506040909401359392505050565b6000602082840312156130a457600080fd5b6108d98261295e565b60008083601f8401126130bf57600080fd5b5081356001600160401b038111156130d657600080fd5b6020830191508360208260051b85010111156130f157600080fd5b9250929050565b6000806000806040858703121561310e57600080fd5b84356001600160401b038082111561312557600080fd5b613131888389016130ad565b9096509450602087013591508082111561314a57600080fd5b50613157878288016130ad565b95989497509550505050565b6020815260006108d96020830184612ba3565b6000806040838503121561318957600080fd5b61319283612916565b915060208301356001600160401b038111156131ad57600080fd5b612eda85828601612d53565b600080600080608085870312156131cf57600080fd5b6131d885612916565b966020860135965060408601359560600135945092505050565b60006020828403121561320457600080fd5b6108d982612916565b6000806040838503121561322057600080fd5b823591506129556020840161295e565b6020808252825182820181905260009190848201906040850190845b818110156132685783518352928401929184019160010161324c565b50909695505050505050565b60008060006060848603121561328957600080fd5b833592506132996020850161295e565b91506132a76040850161295e565b90509250925092565b600080602083850312156132c357600080fd5b82356001600160401b038111156132d957600080fd5b6132e5858286016130ad565b90969095509350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016133645761336461333c565b5060010190565b60008282101561337d5761337d61333c565b500390565b600181811c9082168061339657607f821691505b6020821081036133b657634e487b7160e01b600052602260045260246000fd5b50919050565b600060ff821660ff81036133d2576133d261333c565b60010192915050565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6040808252810184905260008560608301825b87811015613446576001600160a01b0361343184612916565b16825260209283019290910190600101613418565b5083810360208501528481526001600160fb1b0385111561346657600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b60208152815160208201526000602083015160018060a01b03808216604085015280604086015116606085015250506060830151608083015263ffffffff60808401511660a083015260a083015160c08084015261188060e0840182612b56565b6000823560be198336030181126134fe57600080fd5b9190910192915050565b803563ffffffff8116811461292d57600080fd5b60006020828403121561352e57600080fd5b6108d982613508565b6000808335601e1984360301811261354e57600080fd5b8301803591506001600160401b0382111561356857600080fd5b6020019150368190038213156130f157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b602081528135602082015260006135bf60208401612916565b60018060a01b038082166040850152806135db60408701612916565b16606085015250506060830135608083015263ffffffff6135fe60808501613508565b1660a083015260a0830135601e1984360301811261361b57600080fd5b83016020810190356001600160401b0381111561363757600080fd5b80360382131561364657600080fd5b60c08085015261365a60e08501828461357d565b95945050505050565b634e487b7160e01b600052603160045260246000fd5b600060ff821660ff84168160ff048111821515161561369a5761369a61333c565b02939250505056fea26469706673582212209714c1001d19740a655ea4426b52e9f5d8348f9df38d027a88d1f1095e244e9464736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102275760003560e01c80637ffe93fc11610130578063b8865673116100b8578063dc873d011161007c578063dc873d0114610566578063e78d54bb14610586578063e972f91014610599578063ebc5c093146105ac578063f2fde38b146105bf57600080fd5b8063b8865673146104e5578063c06d5db6146104f8578063c4d66de81461050b578063c7da9aa61461051e578063da5d314b1461055357600080fd5b806384c2ad82116100ff57806384c2ad821461044d5780638c3c9e321461046d5780638da5cb5b1461048e578063aad9a979146104bf578063b1cb1662146104d257600080fd5b80637ffe93fc1461040c578063811a6af71461041f57806381213f22146104325780638456cb591461044557600080fd5b8063436a76f3116101b35780636d7fbb67116101825780636d7fbb67146103a4578063715018a6146103c4578063754b377c146103cc5780637cc920b4146103e65780637cde0fe2146103f957600080fd5b8063436a76f31461033f5780635657f0361461035f5780635c975abb1461038057806364fff83c1461039157600080fd5b80631538ff08116101fa5780631538ff08146102db578063181dfdff146102ee5780632972b0f0146103015780633be1ced7146103145780633f4ba83a1461033757600080fd5b8063011023901461022c57806305b374211461025457806314067f8b1461026957806315027bda146102bb575b600080fd5b61023f61023a366004612932565b6105d2565b60405190151581526020015b60405180910390f35b61026761026236600461296f565b6105e9565b005b6102a6610277366004612932565b6000918252602080805260408084206001600160a01b0393909316845291905290206002015463ffffffff1690565b60405163ffffffff909116815260200161024b565b6102ce6102c9366004612a95565b610669565b60405161024b9190612be4565b6102676102e9366004612ca8565b61075a565b6102676102fc366004612dd2565b61080d565b61023f61030f366004612e45565b6108cd565b610327610322366004612932565b6108e0565b60405161024b9493929190612e61565b6102676109f6565b61035261034d366004612e9e565b610a32565b60405161024b9190612f22565b61037261036d366004612f35565b610ae0565b60405161024b929190612f4e565b60005462010000900460ff1661023f565b61026761039f366004612f9b565b610c65565b6103b76103b2366004612932565b610cd7565b60405161024b9190612fcf565b610267610d8f565b6103d4600381565b60405160ff909116815260200161024b565b6102676103f4366004612fe2565b610dcb565b61026761040736600461305f565b610ea2565b61026761041a366004613092565b610edf565b61026761042d3660046130f8565b610f54565b61023f610440366004612e9e565b611330565b61026761138a565b61046061045b366004612932565b6113c4565b60405161024b9190613163565b61048061047b366004612932565b6113f1565b60405190815260200161024b565b6104a7600054630100000090046001600160a01b031690565b6040516001600160a01b03909116815260200161024b565b6102676104cd36600461296f565b6113fd565b6102676104e0366004612ca8565b611471565b6102676104f3366004613176565b61151f565b6102676105063660046131b9565b6115b4565b6102676105193660046131f2565b6115f2565b6104a761052c366004612932565b6000918252602080805260408084206001600160a01b039384168552909152909120541690565b61023f61056136600461320d565b61170c565b610579610574366004612a95565b611733565b60405161024b9190613230565b610267610594366004613274565b6117f3565b6103d46105a736600461320d565b611867565b6102676105ba3660046132b0565b611888565b6102676105cd3660046131f2565b611ce0565b60006105de8383611d80565b151590505b92915050565b6000546001600160a01b0363010000009091041633146106245760405162461bcd60e51b815260040161061b906132f1565b60405180910390fd5b6106308260ff16611da9565b61063982611dd3565b61065b5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6106658282611dfc565b5050565b6060600083516001600160401b0381111561068657610686612999565b6040519080825280602002602001820160405280156106d757816020015b60408051608081018252600080825260208083018290529282015260608082015282526000199092019101816106a45790505b50905060005b8451811015610752576107228582815181106106fb576106fb613326565b602002602001015185838151811061071557610715613326565b6020026020010151611e5c565b82828151811061073457610734613326565b6020026020010181905250808061074a90613352565b9150506106dd565b509392505050565b6000546001600160a01b03630100000090910416331461078c5760405162461bcd60e51b815260040161061b906132f1565b80518251146107ae57604051636e37235160e11b815260040160405180910390fd5b60005b8251811015610808576107f68382815181106107cf576107cf613326565b60200260200101518383815181106107e9576107e9613326565b60200260200101516105e9565b8061080081613352565b9150506107b1565b505050565b6000546001600160a01b03630100000090910416331461083f5760405162461bcd60e51b815260040161061b906132f1565b60005b81518110156108c7576108b5848284848151811061086257610862613326565b6020026020010151610874919061336b565b85848151811061088657610886613326565b6020026020010151600001518685815181106108a4576108a4613326565b602002602001015160200151611f6b565b806108bf81613352565b915050610842565b50505050565b60006108d9838361220a565b9392505050565b6000828152602080805260408083206001600160a01b038086168552908352818420825160808101845281549092168252600181015493820193909352600283015463ffffffff1691810191909152600382018054849384936060938593919291838601919061094f90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461097b90613382565b80156109c85780601f1061099d576101008083540402835291602001916109c8565b820191906000526020600020905b8154815290600101906020018083116109ab57829003601f168201915b505050919092525050815160208301516040840151606090940151919b909a50929850965090945050505050565b6000546001600160a01b036301000000909104163314610a285760405162461bcd60e51b815260040161061b906132f1565b610a3061222c565b565b6060600082516001600160401b03811115610a4f57610a4f612999565b604051908082528060200260200182016040528015610a78578160200160208202803683370190505b50905060005b835181101561075257610aaa85858381518110610a9d57610a9d613326565b6020026020010151611867565b828281518110610abc57610abc613326565b60ff9092166020928302919091019091015280610ad881613352565b915050610a7e565b6000818152601160205260408120546060918291908080610b00846122c7565b92509250925060008160ff166001600160401b03811115610b2357610b23612999565b604051908082528060200260200182016040528015610b4c578160200160208202803683370190505b50905060008260ff166001600160401b03811115610b6c57610b6c612999565b604051908082528060200260200182016040528015610b95578160200160208202803683370190505b50905060005b8360ff168160ff161015610c565760126000878360ff1681518110610bc257610bc2613326565b602002602001015160ff1660ff16815260200190815260200160002054838260ff1681518110610bf457610bf4613326565b602002602001018181525050848160ff1681518110610c1557610c15613326565b6020026020010151828260ff1681518110610c3257610c32613326565b60ff9092166020928302919091019091015280610c4e816133bc565b915050610b9b565b50909890975095505050505050565b6000546001600160a01b036301000000909104163314610c975760405162461bcd60e51b815260040161061b906132f1565b60005b815181101561066557610cc5828281518110610cb857610cb8613326565b6020026020010151610edf565b80610ccf81613352565b915050610c9a565b6000828152602080805260408083206001600160a01b03851684529091529020600301805460609190610d0990613382565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3590613382565b8015610d825780601f10610d5757610100808354040283529160200191610d82565b820191906000526020600020905b815481529060010190602001808311610d6557829003601f168201915b5050505050905092915050565b6000546001600160a01b036301000000909104163314610dc15760405162461bcd60e51b815260040161061b906132f1565b610a3060006123bc565b6000546001600160a01b036301000000909104163314610dfd5760405162461bcd60e51b815260040161061b906132f1565b81518351141580610e1057508051835114155b15610e2e57604051636e37235160e11b815260040160405180910390fd5b60005b83518110156108c757610e90848281518110610e4f57610e4f613326565b6020026020010151848381518110610e6957610e69613326565b6020026020010151848481518110610e8357610e83613326565b60200260200101516117f3565b80610e9a81613352565b915050610e31565b6000546001600160a01b036301000000909104163314610ed45760405162461bcd60e51b815260040161061b906132f1565b610808838383612419565b6000546001600160a01b036301000000909104163314610f115760405162461bcd60e51b815260040161061b906132f1565b610f1d8160ff16611da9565b610f2681611dd3565b610f485760405163eabeadd360e01b815260ff8216600482015260240161061b565b610f51816124ac565b50565b60005462010000900460ff1615610f7d5760405162461bcd60e51b815260040161061b906133db565b828114610fa55783838383604051638ceb003d60e01b815260040161061b9493929190613405565b3360005b8481101561132857600060206000868685818110610fc957610fc9613326565b9050602002013581526020019081526020016000206000888885818110610ff257610ff2613326565b905060200201602081019061100791906131f2565b6001600160a01b0390811682526020808301939093526040918201600020825160808101845281549092168252600181015493820193909352600283015463ffffffff169181019190915260038201805491929160608401919061106a90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461109690613382565b80156110e35780601f106110b8576101008083540402835291602001916110e3565b820191906000526020600020905b8154815290600101906020018083116110c657829003601f168201915b50505050508152505090506111108386868581811061110457611104613326565b9050602002013561220a565b61115a578285858481811061112757611127613326565b60405163c522f21160e01b81526001600160a01b039094166004850152602002919091013560248301525060440161061b565b6020600086868581811061117057611170613326565b905060200201358152602001908152602001600020600088888581811061119957611199613326565b90506020020160208101906111ae91906131f2565b6001600160a01b031681526020810191909152604001600090812080546001600160a01b03191681556001810182905560028101805463ffffffff19169055906111fb6003830182612843565b505061124c85858481811061121257611212613326565b9050602002013588888581811061122b5761122b613326565b905060200201602081019061124091906131f2565b836020015160006124fb565b7f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b6040518060c0016040528087878681811061128a5761128a613326565b9050602002013581526020018989868181106112a8576112a8613326565b90506020020160208101906112bd91906131f2565b6001600160a01b0316815260200183600001516001600160a01b0316815260200183602001518152602001836040015163ffffffff168152602001836060015181525060405161130d9190613487565b60405180910390a1508061132081613352565b915050610fa9565b505050505050565b6000805b8251811015611380576113608484838151811061135357611353613326565b602002602001015161170c565b61136e5760009150506105e3565b8061137881613352565b915050611334565b5060019392505050565b6000546001600160a01b0363010000009091041633146113bc5760405162461bcd60e51b815260040161061b906132f1565b610a306125ec565b60408051608081018252600080825260208201819052918101919091526060808201526108d98383611e5c565b60006108d98383611d80565b6000546001600160a01b03630100000090910416331461142f5760405162461bcd60e51b815260040161061b906132f1565b61143b8260ff16611da9565b61144482611dd3565b1561146757604051635d04d75160e01b815260ff8316600482015260240161061b565b610665828261264e565b6000546001600160a01b0363010000009091041633146114a35760405162461bcd60e51b815260040161061b906132f1565b80518251146114c557604051636e37235160e11b815260040160405180910390fd5b60005b82518110156108085761150d8382815181106114e6576114e6613326565b602002602001015183838151811061150057611500613326565b60200260200101516113fd565b8061151781613352565b9150506114c8565b6000546001600160a01b0363010000009091041633146115515760405162461bcd60e51b815260040161061b906132f1565b60005b8151811015610808576115a28383838151811061157357611573613326565b60200260200101516000015184848151811061159157611591613326565b602002602001015160200151612419565b806115ac81613352565b915050611554565b6000546001600160a01b0363010000009091041633146115e65760405162461bcd60e51b815260040161061b906132f1565b6108c784848484611f6b565b600054600390610100900460ff16158015611614575060005460ff8083169116105b6116775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161061b565b6000805461ffff191660ff8316176101001781556116a4600054630100000090046001600160a01b031690565b6001600160a01b031614806116b85750303b155b156116c6576116c6826123bc565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60008281526011602052604081205460006117278285612699565b60ff1611949350505050565b6060600083516001600160401b0381111561175057611750612999565b604051908082528060200260200182016040528015611779578160200160208202803683370190505b50905060005b8451811015610752576117c485828151811061179d5761179d613326565b60200260200101518583815181106117b7576117b7613326565b6020026020010151611d80565b8282815181106117d6576117d6613326565b6020908102919091010152806117eb81613352565b91505061177f565b6000546001600160a01b0363010000009091041633146118255760405162461bcd60e51b815260040161061b906132f1565b6118318260ff16611da9565b61183a82611dd3565b61185c5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6108088383836126be565b6000828152601160205260408120546118808184612699565b949350505050565b60005462010000900460ff16156118b15760405162461bcd60e51b815260040161061b906133db565b3360005b828110156108c7576118eb828585848181106118d3576118d3613326565b90506020028101906118e591906134e8565b3561220a565b61193f578184848381811061190257611902613326565b905060200281019061191491906134e8565b60405163c522f21160e01b81526001600160a01b03909216600483015235602482015260440161061b565b60006020600086868581811061195757611957613326565b905060200281019061196991906134e8565b600001358152602001908152602001600020600086868581811061198f5761198f613326565b90506020028101906119a191906134e8565b6119b29060408101906020016131f2565b6001600160a01b03166001600160a01b0316815260200190815260200160002060010154905060405180608001604052808686858181106119f5576119f5613326565b9050602002810190611a0791906134e8565b611a189060608101906040016131f2565b6001600160a01b03168152602001868685818110611a3857611a38613326565b9050602002810190611a4a91906134e8565b606001358152602001868685818110611a6557611a65613326565b9050602002810190611a7791906134e8565b611a889060a081019060800161351c565b63ffffffff168152602001868685818110611aa557611aa5613326565b9050602002810190611ab791906134e8565b611ac59060a0810190613537565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250602092508890508786818110611b1257611b12613326565b9050602002810190611b2491906134e8565b6000013581526020019081526020016000206000878786818110611b4a57611b4a613326565b9050602002810190611b5c91906134e8565b611b6d9060408101906020016131f2565b6001600160a01b0390811682526020808301939093526040918201600020845181546001600160a01b03191692169190911781558383015160018201559083015160028201805463ffffffff191663ffffffff909216919091179055606083015180519192611be49260038501929091019061287d565b50905050611c73858584818110611bfd57611bfd613326565b9050602002810190611c0f91906134e8565b35868685818110611c2257611c22613326565b9050602002810190611c3491906134e8565b611c459060408101906020016131f2565b83888887818110611c5857611c58613326565b9050602002810190611c6a91906134e8565b606001356124fb565b7f8c20c3acb6b5208b7affea2fd90dabc8d47e77cee9766c855ce42730505cb205858584818110611ca657611ca6613326565b9050602002810190611cb891906134e8565b604051611cc591906135a6565b60405180910390a15080611cd881613352565b9150506118b5565b6000546001600160a01b036301000000909104163314611d125760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b038116611d775760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061b565b610f51816123bc565b6000918252602080805260408084206001600160a01b0393909316845291905290206001015490565b603f8160ff161115610f515760405163453e14b960e01b815260ff8216600482015260240161061b565b60ff81166000908152601260205260408120548103611df457506000919050565b506001919050565b60ff82166000818152601260209081526040918290208054908590558251938452908301849052908201819052907f0d3d8d66bac9b2a9f0e5c83181a30443294ab849472526080d03fffd7187f7169060600160405180910390a1505050565b60408051608081018252600080825260208201819052918101919091526060808201526000838152602080805260408083206001600160a01b03808716855290835292819020815160808101835281549094168452600181015492840192909252600282015463ffffffff1690830152600381018054606084019190611ee190613382565b80601f0160208091040260200160405190810160405280929190818152602001828054611f0d90613382565b8015611f5a5780601f10611f2f57610100808354040283529160200191611f5a565b820191906000526020600020905b815481529060010190602001808311611f3d57829003601f168201915b505050505081525050905092915050565b6000546001600160a01b036301000000909104163314611f9d5760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b0384166000908152601060205260409020548310611fff576001600160a01b038416600081815260106020526040908190205490516345e388eb60e01b8152600481019290925260248201526044810184905260640161061b565b6001600160a01b038416600090815260106020526040812080548590811061202957612029613326565b600091825260208083206002909202909101546001600160a01b03881683526010909152604082208054919350908690811061206757612067613326565b9060005260206000209060020201600101549050818414158061208a5750808314155b156120d657604051637a4dd76560e01b81526001600160a01b03871660048201526024810186905260448101839052606481018290526084810185905260a4810184905260c40161061b565b6001600160a01b038616600090815260106020526040902080546120fc9060019061336b565b8154811061210c5761210c613326565b906000526020600020906002020160106000886001600160a01b03166001600160a01b03168152602001908152602001600020868154811061215057612150613326565b60009182526020808320845460029093020191825560019384015493909101929092556001600160a01b038816815260109091526040902080548061219757612197613663565b6000828152602080822060026000199490940193840201828155600101919091559155604080516001600160a01b038916815291820186905281018490527f33cff58e54c3a8acae85cad63487b5dcf617521e33bb03f071299f374c29de1f9060600160405180910390a1505050505050565b6001600160a01b03821660009081526010602052604081206108d99083612732565b60005462010000900460ff1661227b5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161061b565b6000805462ff0000191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60408051818152610820810182526060918291600091829190602082016108008036833750506040805181815261082081018252929350600092915060208201610800803683370190505090506000805b603f8160ff1610156123ae5760006123308983612699565b905060ff81161561239b5781858460ff168151811061235157612351613326565b602002602001019060ff16908160ff168152505080848460ff168151811061237b5761237b613326565b60ff9092166020928302919091019091015282612397816133bc565b9350505b50806123a6816133bc565b915050612318565b509196909550909350915050565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60408051808201825283815260208082018481526001600160a01b03871660008181526010845285812080546001808201835591835291859020865160029093020191825592519201919091558351908152908101859052918201839052907fe7d6ac0b740347f7f96a97e6a9dc0f20f4f11eca65495315adc009a55b6762f8906060015b60405180910390a150505050565b60ff811660008181526012602090815260408083208054939055805193845290830182905290917feb82955a27e39ea7559b6ec7e7d8b371081ab0d8783c7b0d01597555e7dcadbf9101611700565b8181113060008261250c578561250f565b60005b905060008361251f576000612521565b865b905060008461253957612534868861336b565b612543565b612543878761336b565b604051633885984b60e11b81526001600160a01b03868116600483015285811660248301528481166044830152606482018c9052608482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063710b30969060a401600060405180830381600087803b1580156125c957600080fd5b505af11580156125dd573d6000803e3d6000fd5b50505050505050505050505050565b60005462010000900460ff16156126155760405162461bcd60e51b815260040161061b906133db565b6000805462ff00001916620100001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122aa3390565b60ff8216600081815260126020908152604091829020849055815192835282018390527f16f0bfe4b02efd5423ef8906906b049c0943f21df8f10347d319fddbc59222079101611700565b600082816126a8846004613679565b60ff1682901c905080600f169250505092915050565b6000838152601160205260409020546126d88184846127c0565b6000858152601160205260409081902091909155517f393b86c90799fa411201ae723a54e105823fcf7c6c8dffa90903fc44c03b4ac79061249e9086908690869092835260ff918216602084015216604082015260600190565b6000805b83548110156127b65783818154811061275157612751613326565b9060005260206000209060020201600001548310158015612795575083818154811061277f5761277f613326565b9060005260206000209060020201600101548311155b156127a45760019150506105e3565b806127ae81613352565b915050612736565b5060009392505050565b60006127cb83611da9565b6127d482612819565b8360006127e2856004613679565b600f60ff919091161b905060001981188281166000612802886004613679565b60ff97881697169690961b17979650505050505050565b600f8160ff161115610f51576040516329afd27b60e21b815260ff8216600482015260240161061b565b50805461284f90613382565b6000825580601f1061285f575050565b601f016020900490600052602060002090810190610f519190612901565b82805461288990613382565b90600052602060002090601f0160209004810192826128ab57600085556128f1565b82601f106128c457805160ff19168380011785556128f1565b828001600101855582156128f1579182015b828111156128f15782518255916020019190600101906128d6565b506128fd929150612901565b5090565b5b808211156128fd5760008155600101612902565b80356001600160a01b038116811461292d57600080fd5b919050565b6000806040838503121561294557600080fd5b8235915061295560208401612916565b90509250929050565b803560ff8116811461292d57600080fd5b6000806040838503121561298257600080fd5b61298b8361295e565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156129d1576129d1612999565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129ff576129ff612999565b604052919050565b60006001600160401b03821115612a2057612a20612999565b5060051b60200190565b600082601f830112612a3b57600080fd5b81356020612a50612a4b83612a07565b6129d7565b82815260059290921b84018101918181019086841115612a6f57600080fd5b8286015b84811015612a8a5780358352918301918301612a73565b509695505050505050565b60008060408385031215612aa857600080fd5b82356001600160401b0380821115612abf57600080fd5b612acb86838701612a2a565b9350602091508185013581811115612ae257600080fd5b85019050601f81018613612af557600080fd5b8035612b03612a4b82612a07565b81815260059190911b82018301908381019088831115612b2257600080fd5b928401925b82841015612b4757612b3884612916565b82529284019290840190612b27565b80955050505050509250929050565b6000815180845260005b81811015612b7c57602081850181015186830182015201612b60565b81811115612b8e576000602083870101525b50601f01601f19169290920160200192915050565b60018060a01b0381511682526020810151602083015263ffffffff604082015116604083015260006060820151608060608501526118806080850182612b56565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612c3957603f19888603018452612c27858351612ba3565b94509285019290850190600101612c0b565b5092979650505050505050565b600082601f830112612c5757600080fd5b81356020612c67612a4b83612a07565b82815260059290921b84018101918181019086841115612c8657600080fd5b8286015b84811015612a8a57612c9b8161295e565b8352918301918301612c8a565b60008060408385031215612cbb57600080fd5b82356001600160401b0380821115612cd257600080fd5b612cde86838701612c46565b9350602091508185013581811115612cf557600080fd5b85019050601f81018613612d0857600080fd5b8035612d16612a4b82612a07565b81815260059190911b82018301908381019088831115612d3557600080fd5b928401925b82841015612b4757833582529284019290840190612d3a565b600082601f830112612d6457600080fd5b81356020612d74612a4b83612a07565b82815260069290921b84018101918181019086841115612d9357600080fd5b8286015b84811015612a8a5760408189031215612db05760008081fd5b612db86129af565b813581528482013585820152835291830191604001612d97565b600080600060608486031215612de757600080fd5b612df084612916565b925060208401356001600160401b0380821115612e0c57600080fd5b612e1887838801612d53565b93506040860135915080821115612e2e57600080fd5b50612e3b86828701612a2a565b9150509250925092565b60008060408385031215612e5857600080fd5b61298b83612916565b60018060a01b038516815283602082015263ffffffff83166040820152608060608201526000612e946080830184612b56565b9695505050505050565b60008060408385031215612eb157600080fd5b8235915060208301356001600160401b03811115612ece57600080fd5b612eda85828601612c46565b9150509250929050565b600081518084526020808501945080840160005b83811015612f1757815160ff1687529582019590820190600101612ef8565b509495945050505050565b6020815260006108d96020830184612ee4565b600060208284031215612f4757600080fd5b5035919050565b604080825283519082018190526000906020906060840190828701845b82811015612f8757815184529284019290840190600101612f6b565b50505083810382850152612e948186612ee4565b600060208284031215612fad57600080fd5b81356001600160401b03811115612fc357600080fd5b61188084828501612c46565b6020815260006108d96020830184612b56565b600080600060608486031215612ff757600080fd5b83356001600160401b038082111561300e57600080fd5b61301a87838801612a2a565b9450602086013591508082111561303057600080fd5b61303c87838801612c46565b9350604086013591508082111561305257600080fd5b50612e3b86828701612c46565b60008060006060848603121561307457600080fd5b61307d84612916565b95602085013595506040909401359392505050565b6000602082840312156130a457600080fd5b6108d98261295e565b60008083601f8401126130bf57600080fd5b5081356001600160401b038111156130d657600080fd5b6020830191508360208260051b85010111156130f157600080fd5b9250929050565b6000806000806040858703121561310e57600080fd5b84356001600160401b038082111561312557600080fd5b613131888389016130ad565b9096509450602087013591508082111561314a57600080fd5b50613157878288016130ad565b95989497509550505050565b6020815260006108d96020830184612ba3565b6000806040838503121561318957600080fd5b61319283612916565b915060208301356001600160401b038111156131ad57600080fd5b612eda85828601612d53565b600080600080608085870312156131cf57600080fd5b6131d885612916565b966020860135965060408601359560600135945092505050565b60006020828403121561320457600080fd5b6108d982612916565b6000806040838503121561322057600080fd5b823591506129556020840161295e565b6020808252825182820181905260009190848201906040850190845b818110156132685783518352928401929184019160010161324c565b50909695505050505050565b60008060006060848603121561328957600080fd5b833592506132996020850161295e565b91506132a76040850161295e565b90509250925092565b600080602083850312156132c357600080fd5b82356001600160401b038111156132d957600080fd5b6132e5858286016130ad565b90969095509350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016133645761336461333c565b5060010190565b60008282101561337d5761337d61333c565b500390565b600181811c9082168061339657607f821691505b6020821081036133b657634e487b7160e01b600052602260045260246000fd5b50919050565b600060ff821660ff81036133d2576133d261333c565b60010192915050565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6040808252810184905260008560608301825b87811015613446576001600160a01b0361343184612916565b16825260209283019290910190600101613418565b5083810360208501528481526001600160fb1b0385111561346657600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b60208152815160208201526000602083015160018060a01b03808216604085015280604086015116606085015250506060830151608083015263ffffffff60808401511660a083015260a083015160c08084015261188060e0840182612b56565b6000823560be198336030181126134fe57600080fd5b9190910192915050565b803563ffffffff8116811461292d57600080fd5b60006020828403121561352e57600080fd5b6108d982613508565b6000808335601e1984360301811261354e57600080fd5b8301803591506001600160401b0382111561356857600080fd5b6020019150368190038213156130f157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b602081528135602082015260006135bf60208401612916565b60018060a01b038082166040850152806135db60408701612916565b16606085015250506060830135608083015263ffffffff6135fe60808501613508565b1660a083015260a0830135601e1984360301811261361b57600080fd5b83016020810190356001600160401b0381111561363757600080fd5b80360382131561364657600080fd5b60c08085015261365a60e08501828461357d565b95945050505050565b634e487b7160e01b600052603160045260246000fd5b600060ff821660ff84168160ff048111821515161561369a5761369a61333c565b02939250505056fea26469706673582212209714c1001d19740a655ea4426b52e9f5d8348f9df38d027a88d1f1095e244e9464736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "attestationsCollectionHasAttribute(uint256,uint8)": { - "details": "Returns whether an attestationsCollection has a specific attribute referenced by its index", - "params": { - "collectionId": "Collection Id of the targeted attestationsCollection", - "index": "Index of the attribute. Can go from 0 to 63." - } - }, - "authorizeRange(address,uint256,uint256)": { - "details": "Authorize an issuer for a specific range", - "params": { - "firstCollectionId": "First collection Id of the range for which the issuer will be authorized", - "issuer": "Issuer that will be authorized", - "lastCollectionId": "Last collection Id of the range for which the issuer will be authorized" - } - }, - "authorizeRanges(address,(uint256,uint256)[])": { - "details": "Authorize an issuer for specific ranges", - "params": { - "issuer": "Issuer that will be authorized", - "ranges": "Ranges for which the issuer will be authorized" - } - }, - "constructor": { - "details": "Constructor.", - "params": { - "badgesAddress": "Stateless ERC1155 Badges contract", - "owner": "Owner of the contract, has the right to authorize/unauthorize attestations issuers" - } - }, - "createNewAttribute(uint8,bytes32)": { - "details": "Create a new attribute.", - "params": { - "index": "Index of the attribute. Can go from 0 to 63.", - "name": "Name in bytes32 of the attribute" - } - }, - "deleteAttestations(address[],uint256[])": { - "details": "Delete function to be called by authorized issuers", - "params": { - "collectionIds": "The collection ids of the attestations to be deleted", - "owners": "The owners of the attestations to be deleted" - } - }, - "deleteAttribute(uint8)": { - "details": "Delete an existing attribute", - "params": { - "index": "Index of the attribute. Can go from 0 to 63. The attribute must already exist" - } - }, - "getAttestationData(uint256,address)": { - "details": "Getter of the data of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationDataBatch(uint256[],address[])": { - "details": "Getter of the data of specific attestations", - "params": { - "collectionIds": "Collection identifiers of the targeted attestations", - "owners": "Owners of the targeted attestations" - } - }, - "getAttestationDataTuple(uint256,address)": { - "details": "Getter of the data of a specific attestation as tuple", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationExtraData(uint256,address)": { - "details": "Getter of the extraData of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationIssuer(uint256,address)": { - "details": "Getter of the issuer of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationTimestamp(uint256,address)": { - "details": "Getter of the timestamp of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationValue(uint256,address)": { - "details": "Getter of the value of a specific attestation", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "getAttestationValueBatch(uint256[],address[])": { - "details": "Getter of the values of specific attestations", - "params": { - "collectionIds": "Collection identifiers of the targeted attestations", - "owners": "Owners of the targeted attestations" - } - }, - "getAttributeValueForAttestationsCollection(uint256,uint8)": { - "details": "Returns the attribute's value (from 0 to 15) of an attestationsCollection", - "params": { - "collectionId": "Collection Id of the targeted attestationsCollection", - "index": "Index of the attribute. Can go from 0 to 63." - } - }, - "getAttributesNamesAndValuesForAttestationsCollection(uint256)": { - "details": "Returns all the enabled attributes names and their values for a specific attestationsCollection", - "params": { - "collectionId": "Collection Id of the targeted attestationsCollection" - } - }, - "hasAttestation(uint256,address)": { - "details": "Returns whether a user has an attestation from a collection", - "params": { - "collectionId": "Collection identifier of the targeted attestation", - "owner": "Owner of the targeted attestation" - } - }, - "initialize(address)": { - "details": "Initialize function, to be called by the proxy delegating calls to this implementation", - "params": { - "ownerAddress": "Owner of the contract, has the right to authorize/unauthorize attestations issuers" - } - }, - "isAuthorized(address,uint256)": { - "details": "Returns whether a specific issuer is authorized or not to record in a specific attestations collection", - "params": { - "collectionId": "Collection Id for which the issuer will be checked", - "issuer": "Issuer to be checked" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "pause()": { - "details": "Pauses the registry. Issuers can no longer record or delete attestations" - }, - "paused()": { - "details": "Returns true if the contract is paused, and false otherwise." - }, - "recordAttestations((uint256,address,address,uint256,uint32,bytes)[])": { - "details": "Main function to be called by authorized issuers", - "params": { - "attestations": "Attestations to be recorded (creates a new one or overrides an existing one)" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "setAttributeValueForAttestationsCollection(uint256,uint8,uint8)": { - "details": "Set a value for an attribute of an attestationsCollection. The attribute should already be created.", - "params": { - "collectionId": "Collection Id of the targeted attestationsCollection", - "index": "Index of the attribute (must be between 0 and 63)", - "value": "Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "unauthorizeRange(address,uint256,uint256,uint256)": { - "details": "Unauthorize an issuer for a specific range", - "params": { - "firstCollectionId": "First collection Id of the range for which the issuer will be unauthorized", - "issuer": "Issuer that will be unauthorized", - "lastCollectionId": "Last collection Id of the range for which the issuer will be unauthorized", - "rangeIndex": "Index of the range to be unauthorized" - } - }, - "unauthorizeRanges(address,(uint256,uint256)[],uint256[])": { - "details": "Unauthorize an issuer for specific ranges", - "params": { - "issuer": "Issuer that will be unauthorized", - "ranges": "Ranges for which the issuer will be unauthorized" - } - }, - "unpause()": { - "details": "Unpauses the registry" - }, - "updateAttributeName(uint8,bytes32)": { - "details": "Update the name of an existing attribute", - "params": { - "index": "Index of the attribute. Can go from 0 to 63. The attribute must exist", - "newName": "new name in bytes32 of the attribute" - } - } - }, - "title": "Attestations Registry", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "Main contract of Sismo, stores all recorded attestations in attestations collections Only authorized attestations issuers can record attestation in the registry Attesters that expect to record in the Attestations Registry must be authorized issuers For more information: https://attestations-registry.docs.sismo.io For each attestation recorded, a badge is received by the user The badge is the Non transferrable NFT representation of an attestation Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts It enables off-chain apps such as opensea to catch the \"shadow mint\" of the badge*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 14389, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 14391, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 14393, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_paused", - "offset": 2, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 14395, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_owner", - "offset": 3, - "slot": "0", - "type": "t_address" - }, - { - "astId": 14399, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_placeHoldersAdmin", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)15_storage" - }, - { - "astId": 14405, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_authorizedRanges", - "offset": 0, - "slot": "16", - "type": "t_mapping(t_address,t_array(t_struct(Range)15352_storage)dyn_storage)" - }, - { - "astId": 14409, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_attestationsCollectionAttributesValuesBitmap", - "offset": 0, - "slot": "17", - "type": "t_mapping(t_uint256,t_uint256)" - }, - { - "astId": 14413, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_attributesNames", - "offset": 0, - "slot": "18", - "type": "t_mapping(t_uint8,t_bytes32)" - }, - { - "astId": 14417, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_placeHoldersConfig", - "offset": 0, - "slot": "19", - "type": "t_array(t_uint256)13_storage" - }, - { - "astId": 14424, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "_attestationsData", - "offset": 0, - "slot": "32", - "type": "t_mapping(t_uint256,t_mapping(t_address,t_struct(AttestationData)13388_storage))" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_struct(Range)15352_storage)dyn_storage": { - "base": "t_struct(Range)15352_storage", - "encoding": "dynamic_array", - "label": "struct Range[]", - "numberOfBytes": "32" - }, - "t_array(t_uint256)13_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[13]", - "numberOfBytes": "416" - }, - "t_array(t_uint256)15_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[15]", - "numberOfBytes": "480" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_bytes_storage": { - "encoding": "bytes", - "label": "bytes", - "numberOfBytes": "32" - }, - "t_mapping(t_address,t_array(t_struct(Range)15352_storage)dyn_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct Range[])", - "numberOfBytes": "32", - "value": "t_array(t_struct(Range)15352_storage)dyn_storage" - }, - "t_mapping(t_address,t_struct(AttestationData)13388_storage)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => struct AttestationData)", - "numberOfBytes": "32", - "value": "t_struct(AttestationData)13388_storage" - }, - "t_mapping(t_uint256,t_mapping(t_address,t_struct(AttestationData)13388_storage))": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => mapping(address => struct AttestationData))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_struct(AttestationData)13388_storage)" - }, - "t_mapping(t_uint256,t_uint256)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_mapping(t_uint8,t_bytes32)": { - "encoding": "mapping", - "key": "t_uint8", - "label": "mapping(uint8 => bytes32)", - "numberOfBytes": "32", - "value": "t_bytes32" - }, - "t_struct(AttestationData)13388_storage": { - "encoding": "inplace", - "label": "struct AttestationData", - "members": [ - { - "astId": 13381, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "issuer", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 13383, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "value", - "offset": 0, - "slot": "1", - "type": "t_uint256" - }, - { - "astId": 13385, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "timestamp", - "offset": 0, - "slot": "2", - "type": "t_uint32" - }, - { - "astId": 13387, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "extraData", - "offset": 0, - "slot": "3", - "type": "t_bytes_storage" - } - ], - "numberOfBytes": "128" - }, - "t_struct(Range)15352_storage": { - "encoding": "inplace", - "label": "struct Range", - "members": [ - { - "astId": 15349, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "min", - "offset": 0, - "slot": "0", - "type": "t_uint256" - }, - { - "astId": 15351, - "contract": "contracts/core/AttestationsRegistry.sol:AttestationsRegistry", - "label": "max", - "offset": 0, - "slot": "1", - "type": "t_uint256" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/mumbai/AttestationsRegistryProxy.json b/deployments/mumbai/AttestationsRegistryProxy.json deleted file mode 100644 index 76c4bc4..0000000 --- a/deployments/mumbai/AttestationsRegistryProxy.json +++ /dev/null @@ -1,264 +0,0 @@ -{ - "address": "0xf576E42E5b2682B8f606B1840c3A982610C29a3f", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0xe5d46301c5952f0b32bfa41dfa0b381473ae3b333b935c3ae490a28b7d7ff8cc", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0xf576E42E5b2682B8f606B1840c3A982610C29a3f", - "transactionIndex": 3, - "gasUsed": "609955", - "logsBloom": "0x00000000000000000000000000000000400000000000000000800000000000000000000000000000000000000000000000008010002000000000000800000000000000000000000000000000000002800001000000000000040100000000000000000000020000008000000000000800000000800000000080000000000000400000000000000000000000000000000000000010000000000000000000808000200000200000000000000000000200000000000000000000000040000000004000000020000000000001000000000000080000000400000000100000000020000000000000000000000000000000000000000000000000000020000000100000", - "blockHash": "0xee799f9ea78169bc31ba0fcb9d4bde2d16f82649acb27f1876466cb397239cf1", - "transactionHash": "0xe5d46301c5952f0b32bfa41dfa0b381473ae3b333b935c3ae490a28b7d7ff8cc", - "logs": [ - { - "transactionIndex": 3, - "blockNumber": 28599984, - "transactionHash": "0xe5d46301c5952f0b32bfa41dfa0b381473ae3b333b935c3ae490a28b7d7ff8cc", - "address": "0xf576E42E5b2682B8f606B1840c3A982610C29a3f", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000f2cfb43d86ae0d4932888fe51ed6b430222e32e8" - ], - "data": "0x", - "logIndex": 7, - "blockHash": "0xee799f9ea78169bc31ba0fcb9d4bde2d16f82649acb27f1876466cb397239cf1" - }, - { - "transactionIndex": 3, - "blockNumber": 28599984, - "transactionHash": "0xe5d46301c5952f0b32bfa41dfa0b381473ae3b333b935c3ae490a28b7d7ff8cc", - "address": "0xf576E42E5b2682B8f606B1840c3A982610C29a3f", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" - ], - "data": "0x", - "logIndex": 8, - "blockHash": "0xee799f9ea78169bc31ba0fcb9d4bde2d16f82649acb27f1876466cb397239cf1" - }, - { - "transactionIndex": 3, - "blockNumber": 28599984, - "transactionHash": "0xe5d46301c5952f0b32bfa41dfa0b381473ae3b333b935c3ae490a28b7d7ff8cc", - "address": "0xf576E42E5b2682B8f606B1840c3A982610C29a3f", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000246e71bc2a257f4be9c7fad4664e6d7444844adc", - "logIndex": 9, - "blockHash": "0xee799f9ea78169bc31ba0fcb9d4bde2d16f82649acb27f1876466cb397239cf1" - }, - { - "transactionIndex": 3, - "blockNumber": 28599984, - "transactionHash": "0xe5d46301c5952f0b32bfa41dfa0b381473ae3b333b935c3ae490a28b7d7ff8cc", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000c275dc8be39f50d12f66b6a63629c39da5bae5bd" - ], - "data": "0x0000000000000000000000000000000000000000000000000008d21e3e9a74fa000000000000000000000000000000000000000000000000880243668d6bb1b0000000000000000000000000000000000000000000000a08d1bafbd83b045e7e00000000000000000000000000000000000000000000000087f971484ed13cb6000000000000000000000000000000000000000000000a08d1c3cdf6799ed378", - "logIndex": 10, - "blockHash": "0xee799f9ea78169bc31ba0fcb9d4bde2d16f82649acb27f1876466cb397239cf1" - } - ], - "blockNumber": 28599984, - "cumulativeGasUsed": "1109769", - "status": 1, - "byzantium": true - }, - "args": [ - "0xF2cFB43D86aE0D4932888fe51ed6B430222e32e8", - "0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc", - "0xc4d66de8000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/mumbai/AvailableRootsRegistry.json b/deployments/mumbai/AvailableRootsRegistry.json deleted file mode 100644 index 84e70cd..0000000 --- a/deployments/mumbai/AvailableRootsRegistry.json +++ /dev/null @@ -1,540 +0,0 @@ -{ - "address": "0x2c17e335d131dfd21238475Dd545B9B29Fb5A27D", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "CannotRegisterForZeroAddress", - "type": "error" - }, - { - "inputs": [], - "name": "CannotUnregisterForZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "RegisteredRootForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "RegisteredRootForAttester", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "UnregisteredRootForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "UnregisteredRootForAttester", - "type": "event" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "_roots", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "isRootAvailableForAttester", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "isRootAvailableForMe", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "registerRootForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "registerRootForAttester", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "unregisterRootForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "unregisterRootForAttester", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xd4d8bf8963341d8c192d4aba4a53d6fcb53479a76eedb6d5a2bae8e1f866a532", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x376147a7DaBEEF3fDE8d3aa455562121053b496C", - "transactionIndex": 14, - "gasUsed": "508612", - "logsBloom": "0x00000000000000000000000000000000000040000000000000800010000000000000000000000020000000000000000000008000000000010000000000000010000000000000000000000000000000800001000000000000000100000000000000000000020000000000000000000800000000000000000080000000000000400000000000000000000000000000000000000010000080000000000000008000200000000000000000000000000400000000020000000000000000000000004000000000200000000001000000040000000000000000000000100000001020000000000000000000000000000000000000000000000000000020000000100020", - "blockHash": "0xdec0658810259e3963d1be28c01bcc6454e5e7e1cbcc0a24b93c90e16d5e4665", - "transactionHash": "0xd4d8bf8963341d8c192d4aba4a53d6fcb53479a76eedb6d5a2bae8e1f866a532", - "logs": [ - { - "transactionIndex": 14, - "blockNumber": 29540722, - "transactionHash": "0xd4d8bf8963341d8c192d4aba4a53d6fcb53479a76eedb6d5a2bae8e1f866a532", - "address": "0x376147a7DaBEEF3fDE8d3aa455562121053b496C", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" - ], - "data": "0x", - "logIndex": 76, - "blockHash": "0xdec0658810259e3963d1be28c01bcc6454e5e7e1cbcc0a24b93c90e16d5e4665" - }, - { - "transactionIndex": 14, - "blockNumber": 29540722, - "transactionHash": "0xd4d8bf8963341d8c192d4aba4a53d6fcb53479a76eedb6d5a2bae8e1f866a532", - "address": "0x376147a7DaBEEF3fDE8d3aa455562121053b496C", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x00000000000000000000000063f08f8f13126b9eadc76dd683902c61c5115138" - ], - "data": "0x", - "logIndex": 77, - "blockHash": "0xdec0658810259e3963d1be28c01bcc6454e5e7e1cbcc0a24b93c90e16d5e4665" - }, - { - "transactionIndex": 14, - "blockNumber": 29540722, - "transactionHash": "0xd4d8bf8963341d8c192d4aba4a53d6fcb53479a76eedb6d5a2bae8e1f866a532", - "address": "0x376147a7DaBEEF3fDE8d3aa455562121053b496C", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000002", - "logIndex": 78, - "blockHash": "0xdec0658810259e3963d1be28c01bcc6454e5e7e1cbcc0a24b93c90e16d5e4665" - }, - { - "transactionIndex": 14, - "blockNumber": 29540722, - "transactionHash": "0xd4d8bf8963341d8c192d4aba4a53d6fcb53479a76eedb6d5a2bae8e1f866a532", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000f903ba9e006193c1527bfbe65fe2123704ea3f99" - ], - "data": "0x0000000000000000000000000000000000000000000000000002b3ae14c288080000000000000000000000000000000000000000000000007c9d719f120ecb6c00000000000000000000000000000000000000000000093b3d66ff0dd51d08eb0000000000000000000000000000000000000000000000007c9abdf0fd4c436400000000000000000000000000000000000000000000093b3d69b2bbe9df90f3", - "logIndex": 79, - "blockHash": "0xdec0658810259e3963d1be28c01bcc6454e5e7e1cbcc0a24b93c90e16d5e4665" - } - ], - "blockNumber": 29540722, - "cumulativeGasUsed": "2262216", - "status": 1, - "byzantium": true - }, - "args": [ - "0x63f08f8f13126b9eadc76dd683902c61c5115138" - ], - "numDeployments": 3, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CannotRegisterForZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotUnregisterForZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"RegisteredRootForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"RegisteredRootForAttester\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"UnregisteredRootForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"UnregisteredRootForAttester\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"_roots\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"isRootAvailableForAttester\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"isRootAvailableForMe\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"registerRootForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"registerRootForAttester\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"unregisterRootForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"unregisterRootForAttester\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"owner\":\"Owner of the contract, can register/ unregister roots\"}},\"initialize(address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"ownerAddress\":\"Owner of the contract, can update public key and address\"}},\"isRootAvailableForAttester(address,uint256)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"attester\":\"Owner of the contract, can update public key and address\",\"root\":\"Owner of the contract, can update public key and address\"}},\"isRootAvailableForMe(uint256)\":{\"details\":\"returns whether a root is available for a caller (msg.sender)\",\"params\":{\"root\":\"root to check whether it is registered for me or not\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"registerRootForAll(uint256)\":{\"details\":\"Registers a root, available for all contracts\",\"params\":{\"root\":\"Root to register\"}},\"registerRootForAttester(address,uint256)\":{\"details\":\"Register a root available for an attester\",\"params\":{\"attester\":\"Attester which will have the root available\",\"root\":\"Root to register\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unregisterRootForAll(uint256)\":{\"details\":\"Unregister a root, available for all contracts\",\"params\":{\"root\":\"Root to unregister\"}},\"unregisterRootForAttester(address,uint256)\":{\"details\":\"Unregister a root for an attester\",\"params\":{\"attester\":\"Attester which will no longer have the root available\",\"root\":\"Root to unregister\"}}},\"title\":\"Attesters Groups Registry\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"This contract stores that data required by attesters to be available so they can verify user claims This contract is deployed behind a proxy and this implementation is focused on storing merkle roots For more information: https://available-roots-registry.docs.sismo.io*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/AvailableRootsRegistry.sol\":\"AvailableRootsRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3467998cbdb82b0c64aa8627efc5893d2b369f73e66e5d1095305e4609593cc5\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5e882d3091e816f1286837eef92ae17737abf66fdeece1282b752f27ba18492b\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5060405161099538038061099583398101604081905261002f916101be565b61003833610047565b610041816100a2565b506101ee565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600290610100900460ff161580156100c4575060005460ff8083169116105b61012b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff8316176101001781556101576000546201000090046001600160a01b031690565b6001600160a01b0316148061016b5750303b155b156101795761017982610047565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6000602082840312156101d057600080fd5b81516001600160a01b03811681146101e757600080fd5b9392505050565b610798806101fd6000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063be4a605611610071578063be4a605614610170578063c4d66de814610183578063e5e477a014610196578063ebea45cb146101a9578063f2fde38b146101bc578063fe7e7750146101cf57600080fd5b80632f56be56146100b95780634e473f8f146100ce578063715018a6146100f6578063754b377c146100fe57806380b404ce146101185780638da5cb5b14610146575b600080fd5b6100cc6100c7366004610704565b6101e2565b005b6100e16100dc366004610704565b61021f565b60405190151581526020015b60405180910390f35b6100cc610285565b610106600281565b60405160ff90911681526020016100ed565b6100e1610126366004610704565b600160209081526000928352604080842090915290825290205460ff1681565b6000546201000090046001600160a01b03166040516001600160a01b0390911681526020016100ed565b6100cc61017e36600461072e565b610299565b6100cc610191366004610747565b6102af565b6100e16101a436600461072e565b6103ce565b6100cc6101b7366004610704565b61042a565b6100cc6101ca366004610747565b610463565b6100cc6101dd36600461072e565b6104d9565b6101ea6104ec565b6001600160a01b03821661021157604051639e95e88b60e01b815260040160405180910390fd5b61021b828261054d565b5050565b6001600160a01b038216600090815260016020908152604080832084845290915281205460ff168061027e575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b9392505050565b61028d6104ec565b61029760006105ef565b565b6102a16104ec565b6102ac60008261054d565b50565b600054600290610100900460ff161580156102d1575060005460ff8083169116105b6103395760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556103666000546001600160a01b03620100009091041690565b6001600160a01b0316148061037a5750303b155b1561038857610388826105ef565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b33600090815260016020908152604080832084845290915281205460ff1680610424575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b92915050565b6104326104ec565b6001600160a01b03821661045957604051631b25a00160e31b815260040160405180910390fd5b61021b828261064a565b61046b6104ec565b6001600160a01b0381166104d05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610330565b6102ac816105ef565b6104e16104ec565b6102ac60008261064a565b6000546001600160a01b03620100009091041633146102975760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610330565b6001600160a01b0382166000818152600160208181526040808420868552909152909120805460ff191690911790556105b0576040518181527f22f0a171f00eeea3af5276d1f77587471dcc3bde32d62560046549b34bacd38a906020016103c2565b604080516001600160a01b0384168152602081018390527f21cdff046578afe71b78f95ac4891306af3a9b9eb71e2f0ef380b35b487d2f1291016103c2565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6001600160a01b03821660008181526001602090815260408083208584529091529020805460ff191690556106a9576040518181527f7261c2abe5e576aac50024de639315f10783f67935bf118bbb49b33c20ef70ef906020016103c2565b604080516001600160a01b0384168152602081018390527fba8195cc62a4086b7cd93d22db90e43ae42d8b5febd8c66b3453771e455b7a3391016103c2565b80356001600160a01b03811681146106ff57600080fd5b919050565b6000806040838503121561071757600080fd5b610720836106e8565b946020939093013593505050565b60006020828403121561074057600080fd5b5035919050565b60006020828403121561075957600080fd5b61027e826106e856fea264697066735822122096da5c8d33677e6203057d911bba2c609059e50119bb896ec169d0349a48641d64736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063be4a605611610071578063be4a605614610170578063c4d66de814610183578063e5e477a014610196578063ebea45cb146101a9578063f2fde38b146101bc578063fe7e7750146101cf57600080fd5b80632f56be56146100b95780634e473f8f146100ce578063715018a6146100f6578063754b377c146100fe57806380b404ce146101185780638da5cb5b14610146575b600080fd5b6100cc6100c7366004610704565b6101e2565b005b6100e16100dc366004610704565b61021f565b60405190151581526020015b60405180910390f35b6100cc610285565b610106600281565b60405160ff90911681526020016100ed565b6100e1610126366004610704565b600160209081526000928352604080842090915290825290205460ff1681565b6000546201000090046001600160a01b03166040516001600160a01b0390911681526020016100ed565b6100cc61017e36600461072e565b610299565b6100cc610191366004610747565b6102af565b6100e16101a436600461072e565b6103ce565b6100cc6101b7366004610704565b61042a565b6100cc6101ca366004610747565b610463565b6100cc6101dd36600461072e565b6104d9565b6101ea6104ec565b6001600160a01b03821661021157604051639e95e88b60e01b815260040160405180910390fd5b61021b828261054d565b5050565b6001600160a01b038216600090815260016020908152604080832084845290915281205460ff168061027e575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b9392505050565b61028d6104ec565b61029760006105ef565b565b6102a16104ec565b6102ac60008261054d565b50565b600054600290610100900460ff161580156102d1575060005460ff8083169116105b6103395760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556103666000546001600160a01b03620100009091041690565b6001600160a01b0316148061037a5750303b155b1561038857610388826105ef565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b33600090815260016020908152604080832084845290915281205460ff1680610424575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b92915050565b6104326104ec565b6001600160a01b03821661045957604051631b25a00160e31b815260040160405180910390fd5b61021b828261064a565b61046b6104ec565b6001600160a01b0381166104d05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610330565b6102ac816105ef565b6104e16104ec565b6102ac60008261064a565b6000546001600160a01b03620100009091041633146102975760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610330565b6001600160a01b0382166000818152600160208181526040808420868552909152909120805460ff191690911790556105b0576040518181527f22f0a171f00eeea3af5276d1f77587471dcc3bde32d62560046549b34bacd38a906020016103c2565b604080516001600160a01b0384168152602081018390527f21cdff046578afe71b78f95ac4891306af3a9b9eb71e2f0ef380b35b487d2f1291016103c2565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6001600160a01b03821660008181526001602090815260408083208584529091529020805460ff191690556106a9576040518181527f7261c2abe5e576aac50024de639315f10783f67935bf118bbb49b33c20ef70ef906020016103c2565b604080516001600160a01b0384168152602081018390527fba8195cc62a4086b7cd93d22db90e43ae42d8b5febd8c66b3453771e455b7a3391016103c2565b80356001600160a01b03811681146106ff57600080fd5b919050565b6000806040838503121561071757600080fd5b610720836106e8565b946020939093013593505050565b60006020828403121561074057600080fd5b5035919050565b60006020828403121561075957600080fd5b61027e826106e856fea264697066735822122096da5c8d33677e6203057d911bba2c609059e50119bb896ec169d0349a48641d64736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "constructor": { - "details": "Constructor", - "params": { - "owner": "Owner of the contract, can register/ unregister roots" - } - }, - "initialize(address)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "ownerAddress": "Owner of the contract, can update public key and address" - } - }, - "isRootAvailableForAttester(address,uint256)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "attester": "Owner of the contract, can update public key and address", - "root": "Owner of the contract, can update public key and address" - } - }, - "isRootAvailableForMe(uint256)": { - "details": "returns whether a root is available for a caller (msg.sender)", - "params": { - "root": "root to check whether it is registered for me or not" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "registerRootForAll(uint256)": { - "details": "Registers a root, available for all contracts", - "params": { - "root": "Root to register" - } - }, - "registerRootForAttester(address,uint256)": { - "details": "Register a root available for an attester", - "params": { - "attester": "Attester which will have the root available", - "root": "Root to register" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "unregisterRootForAll(uint256)": { - "details": "Unregister a root, available for all contracts", - "params": { - "root": "Root to unregister" - } - }, - "unregisterRootForAttester(address,uint256)": { - "details": "Unregister a root for an attester", - "params": { - "attester": "Attester which will no longer have the root available", - "root": "Root to unregister" - } - } - }, - "title": "Attesters Groups Registry", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "This contract stores that data required by attesters to be available so they can verify user claims This contract is deployed behind a proxy and this implementation is focused on storing merkle roots For more information: https://available-roots-registry.docs.sismo.io*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/periphery/utils/AvailableRootsRegistry.sol:AvailableRootsRegistry", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/periphery/utils/AvailableRootsRegistry.sol:AvailableRootsRegistry", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 396, - "contract": "contracts/periphery/utils/AvailableRootsRegistry.sol:AvailableRootsRegistry", - "label": "_owner", - "offset": 2, - "slot": "0", - "type": "t_address" - }, - { - "astId": 15495, - "contract": "contracts/periphery/utils/AvailableRootsRegistry.sol:AvailableRootsRegistry", - "label": "_roots", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_mapping(t_uint256,t_bool))" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_address,t_mapping(t_uint256,t_bool))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(uint256 => bool))", - "numberOfBytes": "32", - "value": "t_mapping(t_uint256,t_bool)" - }, - "t_mapping(t_uint256,t_bool)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/mumbai/AvailableRootsRegistryImplem.json b/deployments/mumbai/AvailableRootsRegistryImplem.json deleted file mode 100644 index 2abcf19..0000000 --- a/deployments/mumbai/AvailableRootsRegistryImplem.json +++ /dev/null @@ -1,540 +0,0 @@ -{ - "address": "0x376147a7DaBEEF3fDE8d3aa455562121053b496C", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "CannotRegisterForZeroAddress", - "type": "error" - }, - { - "inputs": [], - "name": "CannotUnregisterForZeroAddress", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "RegisteredRootForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "RegisteredRootForAttester", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "UnregisteredRootForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "UnregisteredRootForAttester", - "type": "event" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "_roots", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "isRootAvailableForAttester", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "isRootAvailableForMe", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "registerRootForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "registerRootForAttester", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "unregisterRootForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "internalType": "uint256", - "name": "root", - "type": "uint256" - } - ], - "name": "unregisterRootForAttester", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xd4d8bf8963341d8c192d4aba4a53d6fcb53479a76eedb6d5a2bae8e1f866a532", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x376147a7DaBEEF3fDE8d3aa455562121053b496C", - "transactionIndex": 14, - "gasUsed": "508612", - "logsBloom": "0x00000000000000000000000000000000000040000000000000800010000000000000000000000020000000000000000000008000000000010000000000000010000000000000000000000000000000800001000000000000000100000000000000000000020000000000000000000800000000000000000080000000000000400000000000000000000000000000000000000010000080000000000000008000200000000000000000000000000400000000020000000000000000000000004000000000200000000001000000040000000000000000000000100000001020000000000000000000000000000000000000000000000000000020000000100020", - "blockHash": "0xdec0658810259e3963d1be28c01bcc6454e5e7e1cbcc0a24b93c90e16d5e4665", - "transactionHash": "0xd4d8bf8963341d8c192d4aba4a53d6fcb53479a76eedb6d5a2bae8e1f866a532", - "logs": [ - { - "transactionIndex": 14, - "blockNumber": 29540722, - "transactionHash": "0xd4d8bf8963341d8c192d4aba4a53d6fcb53479a76eedb6d5a2bae8e1f866a532", - "address": "0x376147a7DaBEEF3fDE8d3aa455562121053b496C", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" - ], - "data": "0x", - "logIndex": 76, - "blockHash": "0xdec0658810259e3963d1be28c01bcc6454e5e7e1cbcc0a24b93c90e16d5e4665" - }, - { - "transactionIndex": 14, - "blockNumber": 29540722, - "transactionHash": "0xd4d8bf8963341d8c192d4aba4a53d6fcb53479a76eedb6d5a2bae8e1f866a532", - "address": "0x376147a7DaBEEF3fDE8d3aa455562121053b496C", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x00000000000000000000000063f08f8f13126b9eadc76dd683902c61c5115138" - ], - "data": "0x", - "logIndex": 77, - "blockHash": "0xdec0658810259e3963d1be28c01bcc6454e5e7e1cbcc0a24b93c90e16d5e4665" - }, - { - "transactionIndex": 14, - "blockNumber": 29540722, - "transactionHash": "0xd4d8bf8963341d8c192d4aba4a53d6fcb53479a76eedb6d5a2bae8e1f866a532", - "address": "0x376147a7DaBEEF3fDE8d3aa455562121053b496C", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000002", - "logIndex": 78, - "blockHash": "0xdec0658810259e3963d1be28c01bcc6454e5e7e1cbcc0a24b93c90e16d5e4665" - }, - { - "transactionIndex": 14, - "blockNumber": 29540722, - "transactionHash": "0xd4d8bf8963341d8c192d4aba4a53d6fcb53479a76eedb6d5a2bae8e1f866a532", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000f903ba9e006193c1527bfbe65fe2123704ea3f99" - ], - "data": "0x0000000000000000000000000000000000000000000000000002b3ae14c288080000000000000000000000000000000000000000000000007c9d719f120ecb6c00000000000000000000000000000000000000000000093b3d66ff0dd51d08eb0000000000000000000000000000000000000000000000007c9abdf0fd4c436400000000000000000000000000000000000000000000093b3d69b2bbe9df90f3", - "logIndex": 79, - "blockHash": "0xdec0658810259e3963d1be28c01bcc6454e5e7e1cbcc0a24b93c90e16d5e4665" - } - ], - "blockNumber": 29540722, - "cumulativeGasUsed": "2262216", - "status": 1, - "byzantium": true - }, - "args": [ - "0x63f08f8f13126b9eadc76dd683902c61c5115138" - ], - "numDeployments": 2, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CannotRegisterForZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotUnregisterForZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"RegisteredRootForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"RegisteredRootForAttester\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"UnregisteredRootForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"UnregisteredRootForAttester\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"_roots\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"isRootAvailableForAttester\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"isRootAvailableForMe\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"registerRootForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"registerRootForAttester\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"unregisterRootForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"unregisterRootForAttester\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"owner\":\"Owner of the contract, can register/ unregister roots\"}},\"initialize(address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"ownerAddress\":\"Owner of the contract, can update public key and address\"}},\"isRootAvailableForAttester(address,uint256)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"attester\":\"Owner of the contract, can update public key and address\",\"root\":\"Owner of the contract, can update public key and address\"}},\"isRootAvailableForMe(uint256)\":{\"details\":\"returns whether a root is available for a caller (msg.sender)\",\"params\":{\"root\":\"root to check whether it is registered for me or not\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"registerRootForAll(uint256)\":{\"details\":\"Registers a root, available for all contracts\",\"params\":{\"root\":\"Root to register\"}},\"registerRootForAttester(address,uint256)\":{\"details\":\"Register a root available for an attester\",\"params\":{\"attester\":\"Attester which will have the root available\",\"root\":\"Root to register\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unregisterRootForAll(uint256)\":{\"details\":\"Unregister a root, available for all contracts\",\"params\":{\"root\":\"Root to unregister\"}},\"unregisterRootForAttester(address,uint256)\":{\"details\":\"Unregister a root for an attester\",\"params\":{\"attester\":\"Attester which will no longer have the root available\",\"root\":\"Root to unregister\"}}},\"title\":\"Attesters Groups Registry\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"This contract stores that data required by attesters to be available so they can verify user claims This contract is deployed behind a proxy and this implementation is focused on storing merkle roots For more information: https://available-roots-registry.docs.sismo.io*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/AvailableRootsRegistry.sol\":\"AvailableRootsRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3467998cbdb82b0c64aa8627efc5893d2b369f73e66e5d1095305e4609593cc5\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5e882d3091e816f1286837eef92ae17737abf66fdeece1282b752f27ba18492b\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5060405161099538038061099583398101604081905261002f916101be565b61003833610047565b610041816100a2565b506101ee565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600290610100900460ff161580156100c4575060005460ff8083169116105b61012b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff8316176101001781556101576000546201000090046001600160a01b031690565b6001600160a01b0316148061016b5750303b155b156101795761017982610047565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6000602082840312156101d057600080fd5b81516001600160a01b03811681146101e757600080fd5b9392505050565b610798806101fd6000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063be4a605611610071578063be4a605614610170578063c4d66de814610183578063e5e477a014610196578063ebea45cb146101a9578063f2fde38b146101bc578063fe7e7750146101cf57600080fd5b80632f56be56146100b95780634e473f8f146100ce578063715018a6146100f6578063754b377c146100fe57806380b404ce146101185780638da5cb5b14610146575b600080fd5b6100cc6100c7366004610704565b6101e2565b005b6100e16100dc366004610704565b61021f565b60405190151581526020015b60405180910390f35b6100cc610285565b610106600281565b60405160ff90911681526020016100ed565b6100e1610126366004610704565b600160209081526000928352604080842090915290825290205460ff1681565b6000546201000090046001600160a01b03166040516001600160a01b0390911681526020016100ed565b6100cc61017e36600461072e565b610299565b6100cc610191366004610747565b6102af565b6100e16101a436600461072e565b6103ce565b6100cc6101b7366004610704565b61042a565b6100cc6101ca366004610747565b610463565b6100cc6101dd36600461072e565b6104d9565b6101ea6104ec565b6001600160a01b03821661021157604051639e95e88b60e01b815260040160405180910390fd5b61021b828261054d565b5050565b6001600160a01b038216600090815260016020908152604080832084845290915281205460ff168061027e575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b9392505050565b61028d6104ec565b61029760006105ef565b565b6102a16104ec565b6102ac60008261054d565b50565b600054600290610100900460ff161580156102d1575060005460ff8083169116105b6103395760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556103666000546001600160a01b03620100009091041690565b6001600160a01b0316148061037a5750303b155b1561038857610388826105ef565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b33600090815260016020908152604080832084845290915281205460ff1680610424575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b92915050565b6104326104ec565b6001600160a01b03821661045957604051631b25a00160e31b815260040160405180910390fd5b61021b828261064a565b61046b6104ec565b6001600160a01b0381166104d05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610330565b6102ac816105ef565b6104e16104ec565b6102ac60008261064a565b6000546001600160a01b03620100009091041633146102975760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610330565b6001600160a01b0382166000818152600160208181526040808420868552909152909120805460ff191690911790556105b0576040518181527f22f0a171f00eeea3af5276d1f77587471dcc3bde32d62560046549b34bacd38a906020016103c2565b604080516001600160a01b0384168152602081018390527f21cdff046578afe71b78f95ac4891306af3a9b9eb71e2f0ef380b35b487d2f1291016103c2565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6001600160a01b03821660008181526001602090815260408083208584529091529020805460ff191690556106a9576040518181527f7261c2abe5e576aac50024de639315f10783f67935bf118bbb49b33c20ef70ef906020016103c2565b604080516001600160a01b0384168152602081018390527fba8195cc62a4086b7cd93d22db90e43ae42d8b5febd8c66b3453771e455b7a3391016103c2565b80356001600160a01b03811681146106ff57600080fd5b919050565b6000806040838503121561071757600080fd5b610720836106e8565b946020939093013593505050565b60006020828403121561074057600080fd5b5035919050565b60006020828403121561075957600080fd5b61027e826106e856fea264697066735822122096da5c8d33677e6203057d911bba2c609059e50119bb896ec169d0349a48641d64736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063be4a605611610071578063be4a605614610170578063c4d66de814610183578063e5e477a014610196578063ebea45cb146101a9578063f2fde38b146101bc578063fe7e7750146101cf57600080fd5b80632f56be56146100b95780634e473f8f146100ce578063715018a6146100f6578063754b377c146100fe57806380b404ce146101185780638da5cb5b14610146575b600080fd5b6100cc6100c7366004610704565b6101e2565b005b6100e16100dc366004610704565b61021f565b60405190151581526020015b60405180910390f35b6100cc610285565b610106600281565b60405160ff90911681526020016100ed565b6100e1610126366004610704565b600160209081526000928352604080842090915290825290205460ff1681565b6000546201000090046001600160a01b03166040516001600160a01b0390911681526020016100ed565b6100cc61017e36600461072e565b610299565b6100cc610191366004610747565b6102af565b6100e16101a436600461072e565b6103ce565b6100cc6101b7366004610704565b61042a565b6100cc6101ca366004610747565b610463565b6100cc6101dd36600461072e565b6104d9565b6101ea6104ec565b6001600160a01b03821661021157604051639e95e88b60e01b815260040160405180910390fd5b61021b828261054d565b5050565b6001600160a01b038216600090815260016020908152604080832084845290915281205460ff168061027e575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b9392505050565b61028d6104ec565b61029760006105ef565b565b6102a16104ec565b6102ac60008261054d565b50565b600054600290610100900460ff161580156102d1575060005460ff8083169116105b6103395760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556103666000546001600160a01b03620100009091041690565b6001600160a01b0316148061037a5750303b155b1561038857610388826105ef565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b33600090815260016020908152604080832084845290915281205460ff1680610424575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b92915050565b6104326104ec565b6001600160a01b03821661045957604051631b25a00160e31b815260040160405180910390fd5b61021b828261064a565b61046b6104ec565b6001600160a01b0381166104d05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610330565b6102ac816105ef565b6104e16104ec565b6102ac60008261064a565b6000546001600160a01b03620100009091041633146102975760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610330565b6001600160a01b0382166000818152600160208181526040808420868552909152909120805460ff191690911790556105b0576040518181527f22f0a171f00eeea3af5276d1f77587471dcc3bde32d62560046549b34bacd38a906020016103c2565b604080516001600160a01b0384168152602081018390527f21cdff046578afe71b78f95ac4891306af3a9b9eb71e2f0ef380b35b487d2f1291016103c2565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6001600160a01b03821660008181526001602090815260408083208584529091529020805460ff191690556106a9576040518181527f7261c2abe5e576aac50024de639315f10783f67935bf118bbb49b33c20ef70ef906020016103c2565b604080516001600160a01b0384168152602081018390527fba8195cc62a4086b7cd93d22db90e43ae42d8b5febd8c66b3453771e455b7a3391016103c2565b80356001600160a01b03811681146106ff57600080fd5b919050565b6000806040838503121561071757600080fd5b610720836106e8565b946020939093013593505050565b60006020828403121561074057600080fd5b5035919050565b60006020828403121561075957600080fd5b61027e826106e856fea264697066735822122096da5c8d33677e6203057d911bba2c609059e50119bb896ec169d0349a48641d64736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "constructor": { - "details": "Constructor", - "params": { - "owner": "Owner of the contract, can register/ unregister roots" - } - }, - "initialize(address)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "ownerAddress": "Owner of the contract, can update public key and address" - } - }, - "isRootAvailableForAttester(address,uint256)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "attester": "Owner of the contract, can update public key and address", - "root": "Owner of the contract, can update public key and address" - } - }, - "isRootAvailableForMe(uint256)": { - "details": "returns whether a root is available for a caller (msg.sender)", - "params": { - "root": "root to check whether it is registered for me or not" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "registerRootForAll(uint256)": { - "details": "Registers a root, available for all contracts", - "params": { - "root": "Root to register" - } - }, - "registerRootForAttester(address,uint256)": { - "details": "Register a root available for an attester", - "params": { - "attester": "Attester which will have the root available", - "root": "Root to register" - } - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "unregisterRootForAll(uint256)": { - "details": "Unregister a root, available for all contracts", - "params": { - "root": "Root to unregister" - } - }, - "unregisterRootForAttester(address,uint256)": { - "details": "Unregister a root for an attester", - "params": { - "attester": "Attester which will no longer have the root available", - "root": "Root to unregister" - } - } - }, - "title": "Attesters Groups Registry", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "This contract stores that data required by attesters to be available so they can verify user claims This contract is deployed behind a proxy and this implementation is focused on storing merkle roots For more information: https://available-roots-registry.docs.sismo.io*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/periphery/utils/AvailableRootsRegistry.sol:AvailableRootsRegistry", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/periphery/utils/AvailableRootsRegistry.sol:AvailableRootsRegistry", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 396, - "contract": "contracts/periphery/utils/AvailableRootsRegistry.sol:AvailableRootsRegistry", - "label": "_owner", - "offset": 2, - "slot": "0", - "type": "t_address" - }, - { - "astId": 15495, - "contract": "contracts/periphery/utils/AvailableRootsRegistry.sol:AvailableRootsRegistry", - "label": "_roots", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_address,t_mapping(t_uint256,t_bool))" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_address,t_mapping(t_uint256,t_bool))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(uint256 => bool))", - "numberOfBytes": "32", - "value": "t_mapping(t_uint256,t_bool)" - }, - "t_mapping(t_uint256,t_bool)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/mumbai/AvailableRootsRegistryProxy.json b/deployments/mumbai/AvailableRootsRegistryProxy.json deleted file mode 100644 index 844ebd4..0000000 --- a/deployments/mumbai/AvailableRootsRegistryProxy.json +++ /dev/null @@ -1,264 +0,0 @@ -{ - "address": "0x2c17e335d131dfd21238475Dd545B9B29Fb5A27D", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0xbd75a6886538fc7e5f13d596ba5e843196688dfe148bddaa2cd83f45ed75a3e4", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x2c17e335d131dfd21238475Dd545B9B29Fb5A27D", - "transactionIndex": 86, - "gasUsed": "609954", - "logsBloom": "0x00000000000000020000004000000000400000000000000000800000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000002800001000000000000000100000000000000000004020000000000000000000800000000800000000080000000000000400000000000000000000000000000000000000010000000000000000000808000200000000000000020000000000000000001000000000000000000000000004000000220000000000001000000000000000000000400000000100000000020000000000000000000000000000001200400000000000000000020000000100000", - "blockHash": "0xd54ad40e9acd31c567b383cc55ee0d42882099c778bec3351db1be264cf8beec", - "transactionHash": "0xbd75a6886538fc7e5f13d596ba5e843196688dfe148bddaa2cd83f45ed75a3e4", - "logs": [ - { - "transactionIndex": 86, - "blockNumber": 28600012, - "transactionHash": "0xbd75a6886538fc7e5f13d596ba5e843196688dfe148bddaa2cd83f45ed75a3e4", - "address": "0x2c17e335d131dfd21238475Dd545B9B29Fb5A27D", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x0000000000000000000000000d12ceba1e25784731266625c9d5157a9c9b5934" - ], - "data": "0x", - "logIndex": 611, - "blockHash": "0xd54ad40e9acd31c567b383cc55ee0d42882099c778bec3351db1be264cf8beec" - }, - { - "transactionIndex": 86, - "blockNumber": 28600012, - "transactionHash": "0xbd75a6886538fc7e5f13d596ba5e843196688dfe148bddaa2cd83f45ed75a3e4", - "address": "0x2c17e335d131dfd21238475Dd545B9B29Fb5A27D", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" - ], - "data": "0x", - "logIndex": 612, - "blockHash": "0xd54ad40e9acd31c567b383cc55ee0d42882099c778bec3351db1be264cf8beec" - }, - { - "transactionIndex": 86, - "blockNumber": 28600012, - "transactionHash": "0xbd75a6886538fc7e5f13d596ba5e843196688dfe148bddaa2cd83f45ed75a3e4", - "address": "0x2c17e335d131dfd21238475Dd545B9B29Fb5A27D", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000246e71bc2a257f4be9c7fad4664e6d7444844adc", - "logIndex": 613, - "blockHash": "0xd54ad40e9acd31c567b383cc55ee0d42882099c778bec3351db1be264cf8beec" - }, - { - "transactionIndex": 86, - "blockNumber": 28600012, - "transactionHash": "0xbd75a6886538fc7e5f13d596ba5e843196688dfe148bddaa2cd83f45ed75a3e4", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" - ], - "data": "0x00000000000000000000000000000000000000000000000000040c27d4399bb8000000000000000000000000000000000000000000000000863bd104985b63b100000000000000000000000000000000000000000000167a233fcec11a0769350000000000000000000000000000000000000000000000008637c4dcc421c7f900000000000000000000000000000000000000000000167a2343dae8ee4104ed", - "logIndex": 614, - "blockHash": "0xd54ad40e9acd31c567b383cc55ee0d42882099c778bec3351db1be264cf8beec" - } - ], - "blockNumber": 28600012, - "cumulativeGasUsed": "19982440", - "status": 1, - "byzantium": true - }, - "args": [ - "0x0D12CeBa1e25784731266625c9d5157A9c9B5934", - "0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc", - "0xc4d66de8000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/mumbai/BadgesProxy.json b/deployments/mumbai/BadgesProxy.json deleted file mode 100644 index 75e2ad0..0000000 --- a/deployments/mumbai/BadgesProxy.json +++ /dev/null @@ -1,265 +0,0 @@ -{ - "address": "0x5722fEa81027533721BA161964622271560da1aC", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x518f8960b7fce385010404e16b2ff2e955d5ed3410398ba0ae8c8f62f4294096", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x5722fEa81027533721BA161964622271560da1aC", - "transactionIndex": 32, - "gasUsed": "701703", - "logsBloom": "0x00000004000000000000000000000000400000000000000000000000000000000000000000000000200000000000000000008000002000002000000000000000000000002000000000000000000002800000000000000000040100000000000000000000020000000000000000000800000000800002000080000000000000000000000000000000000000000000000000000010000200000000000000808000200000000000000000000000000000000000000000000000001040000000004000000020000000000001000000000000000000000400000100100000000020000000000000000000000000000000004000000000000000000020000000100000", - "blockHash": "0x52748358a861e561785d396857837a92f3b3f61dd78f53fb56984db291625075", - "transactionHash": "0x518f8960b7fce385010404e16b2ff2e955d5ed3410398ba0ae8c8f62f4294096", - "logs": [ - { - "transactionIndex": 32, - "blockNumber": 28599971, - "transactionHash": "0x518f8960b7fce385010404e16b2ff2e955d5ed3410398ba0ae8c8f62f4294096", - "address": "0x5722fEa81027533721BA161964622271560da1aC", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000ca9ef6c891b3f045bd4a200029fcc1c38b65cce3" - ], - "data": "0x", - "logIndex": 154, - "blockHash": "0x52748358a861e561785d396857837a92f3b3f61dd78f53fb56984db291625075" - }, - { - "transactionIndex": 32, - "blockNumber": 28599971, - "transactionHash": "0x518f8960b7fce385010404e16b2ff2e955d5ed3410398ba0ae8c8f62f4294096", - "address": "0x5722fEa81027533721BA161964622271560da1aC", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" - ], - "data": "0x", - "logIndex": 155, - "blockHash": "0x52748358a861e561785d396857837a92f3b3f61dd78f53fb56984db291625075" - }, - { - "transactionIndex": 32, - "blockNumber": 28599971, - "transactionHash": "0x518f8960b7fce385010404e16b2ff2e955d5ed3410398ba0ae8c8f62f4294096", - "address": "0x5722fEa81027533721BA161964622271560da1aC", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000246e71bc2a257f4be9c7fad4664e6d7444844adc", - "logIndex": 156, - "blockHash": "0x52748358a861e561785d396857837a92f3b3f61dd78f53fb56984db291625075" - }, - { - "transactionIndex": 32, - "blockNumber": 28599971, - "transactionHash": "0x518f8960b7fce385010404e16b2ff2e955d5ed3410398ba0ae8c8f62f4294096", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000c275dc8be39f50d12f66b6a63629c39da5bae5bd" - ], - "data": "0x0000000000000000000000000000000000000000000000000003bd4af114490000000000000000000000000000000000000000000000000089b8ef93cc639fe9000000000000000000000000000000000000000000000a08c86a6594f368101f00000000000000000000000000000000000000000000000089b53248db4f56e9000000000000000000000000000000000000000000000a08c86e22dfe47c591f", - "logIndex": 157, - "blockHash": "0x52748358a861e561785d396857837a92f3b3f61dd78f53fb56984db291625075" - } - ], - "blockNumber": 28599971, - "cumulativeGasUsed": "10783156", - "status": 1, - "byzantium": true - }, - "args": [ - "0xcA9EF6c891B3f045bd4a200029FCC1C38B65CCe3", - "0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc", - "0x7ab4339d0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6000000000000000000000000000000000000000000000000000000000000003568747470733a2f2f6875622e73746167696e672e7a696b6965732e696f2f6261646765732f6d756d6261692f7b69647d2e6a736f6e0000000000000000000000" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/mumbai/CommitmentMapperRegistry.json b/deployments/mumbai/CommitmentMapperRegistry.json deleted file mode 100644 index f9c2d45..0000000 --- a/deployments/mumbai/CommitmentMapperRegistry.json +++ /dev/null @@ -1,458 +0,0 @@ -{ - "address": "0x82B54988e4E3a2850501F91AC06CEA82bdb014D3", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256[2]", - "name": "commitmentMapperEdDSAPubKey", - "type": "uint256[2]" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "pubKey", - "type": "uint256[2]" - } - ], - "name": "PubKeyNotValid", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newAddress", - "type": "address" - } - ], - "name": "UpdatedCommitmentMapperAddress", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256[2]", - "name": "newEdDSAPubKey", - "type": "uint256[2]" - } - ], - "name": "UpdatedCommitmentMapperEdDSAPubKey", - "type": "event" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getEdDSAPubKey", - "outputs": [ - { - "internalType": "uint256[2]", - "name": "", - "type": "uint256[2]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - }, - { - "internalType": "uint256[2]", - "name": "commitmentMapperEdDSAPubKey", - "type": "uint256[2]" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAddress", - "type": "address" - } - ], - "name": "updateCommitmentMapperAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "newEdDSAPubKey", - "type": "uint256[2]" - } - ], - "name": "updateCommitmentMapperEdDSAPubKey", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xf3eba93abc7d8f2daa265d0f13551306b343444c3a53762c6edc78a0d1878ce0", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x542930ff08acEe13a54c0F46F32890d9B7f2E4A2", - "transactionIndex": 14, - "gasUsed": "520392", - "logsBloom": "0x00000000000000000000000000020000000000000000000000800000000000000000000000000000000000000000000000008000000000000000000004000000000000000000008002000010000400800801000000000000000100000000004000000000020000000000000000000800002000000000000084000000000000400000000000000000000000000000000000000010000080000000000000008000200000000000000000000000800400000000000000000000000000000000004000000004000000000001000000040000000000000000000000100040000020000000100000000000000000000000000000000000000000000020000000100000", - "blockHash": "0xc6b9da4b24eb2020ed01fd996150d75046257832efe3f20c881d5855cc25373a", - "transactionHash": "0xf3eba93abc7d8f2daa265d0f13551306b343444c3a53762c6edc78a0d1878ce0", - "logs": [ - { - "transactionIndex": 14, - "blockNumber": 29540743, - "transactionHash": "0xf3eba93abc7d8f2daa265d0f13551306b343444c3a53762c6edc78a0d1878ce0", - "address": "0x542930ff08acEe13a54c0F46F32890d9B7f2E4A2", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" - ], - "data": "0x", - "logIndex": 70, - "blockHash": "0xc6b9da4b24eb2020ed01fd996150d75046257832efe3f20c881d5855cc25373a" - }, - { - "transactionIndex": 14, - "blockNumber": 29540743, - "transactionHash": "0xf3eba93abc7d8f2daa265d0f13551306b343444c3a53762c6edc78a0d1878ce0", - "address": "0x542930ff08acEe13a54c0F46F32890d9B7f2E4A2", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954" - ], - "data": "0x", - "logIndex": 71, - "blockHash": "0xc6b9da4b24eb2020ed01fd996150d75046257832efe3f20c881d5855cc25373a" - }, - { - "transactionIndex": 14, - "blockNumber": 29540743, - "transactionHash": "0xf3eba93abc7d8f2daa265d0f13551306b343444c3a53762c6edc78a0d1878ce0", - "address": "0x542930ff08acEe13a54c0F46F32890d9B7f2E4A2", - "topics": [ - "0x9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab15" - ], - "data": "0x1e468ad0fcde4edec429cd41eb28a0e78d4f31fa2c25172ef677468b2b38a9dc2b6e9a8e3b8ed419cca51e2e2ee7ae07d2902454deca17d7da7b00ae4a798add", - "logIndex": 72, - "blockHash": "0xc6b9da4b24eb2020ed01fd996150d75046257832efe3f20c881d5855cc25373a" - }, - { - "transactionIndex": 14, - "blockNumber": 29540743, - "transactionHash": "0xf3eba93abc7d8f2daa265d0f13551306b343444c3a53762c6edc78a0d1878ce0", - "address": "0x542930ff08acEe13a54c0F46F32890d9B7f2E4A2", - "topics": [ - "0xa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f4" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "logIndex": 73, - "blockHash": "0xc6b9da4b24eb2020ed01fd996150d75046257832efe3f20c881d5855cc25373a" - }, - { - "transactionIndex": 14, - "blockNumber": 29540743, - "transactionHash": "0xf3eba93abc7d8f2daa265d0f13551306b343444c3a53762c6edc78a0d1878ce0", - "address": "0x542930ff08acEe13a54c0F46F32890d9B7f2E4A2", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000002", - "logIndex": 74, - "blockHash": "0xc6b9da4b24eb2020ed01fd996150d75046257832efe3f20c881d5855cc25373a" - }, - { - "transactionIndex": 14, - "blockNumber": 29540743, - "transactionHash": "0xf3eba93abc7d8f2daa265d0f13551306b343444c3a53762c6edc78a0d1878ce0", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000be188d6641e8b680743a4815dfa0f6208038960f" - ], - "data": "0x00000000000000000000000000000000000000000000000000025d1c42f841380000000000000000000000000000000000000000000000007c94dbc2373dffa400000000000000000000000000000000000000000000280a3a35dd50f9a0c3ba0000000000000000000000000000000000000000000000007c927ea5f445be6c00000000000000000000000000000000000000000000280a3a383a6d3c9904f2", - "logIndex": 75, - "blockHash": "0xc6b9da4b24eb2020ed01fd996150d75046257832efe3f20c881d5855cc25373a" - } - ], - "blockNumber": 29540743, - "cumulativeGasUsed": "3150337", - "status": 1, - "byzantium": true - }, - "args": [ - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954", - [ - "0x1e468ad0fcde4edec429cd41eb28a0e78d4f31fa2c25172ef677468b2b38a9dc", - "0x2b6e9a8e3b8ed419cca51e2e2ee7ae07d2902454deca17d7da7b00ae4a798add" - ], - "0x0000000000000000000000000000000000000000" - ], - "numDeployments": 3, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentMapperEdDSAPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"pubKey\",\"type\":\"uint256[2]\"}],\"name\":\"PubKeyNotValid\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"UpdatedCommitmentMapperAddress\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256[2]\",\"name\":\"newEdDSAPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"UpdatedCommitmentMapperEdDSAPubKey\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEdDSAPubKey\",\"outputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"\",\"type\":\"uint256[2]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentMapperEdDSAPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"updateCommitmentMapperAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"newEdDSAPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"updateCommitmentMapperEdDSAPubKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"commitmentMapperAddress\":\"Address of the commitment mapper\",\"commitmentMapperEdDSAPubKey\":\"EdDSA public key of the commitment mapper\",\"owner\":\"Owner of the contract, can update public key and address\"}},\"getAddress()\":{\"details\":\"Getter of the address of the commitment mapper\"},\"getEdDSAPubKey()\":{\"details\":\"Getter of the EdDSA public key of the commitment mapper\"},\"initialize(address,uint256[2],address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"commitmentMapperAddress\":\"Address of the commitment mapper\",\"commitmentMapperEdDSAPubKey\":\"EdDSA public key of the commitment mapper\",\"ownerAddress\":\"Owner of the contract, can update public key and address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"updateCommitmentMapperAddress(address)\":{\"details\":\"Updates the address\",\"params\":{\"newAddress\":\"new address\"}},\"updateCommitmentMapperEdDSAPubKey(uint256[2])\":{\"details\":\"Updates the EdDSA public key\",\"params\":{\"newEdDSAPubKey\":\"new EdDSA pubic key\"}}},\"title\":\"Commitment Mapper Registry Contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address,uint256[2],address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"This contract stores information about the commitment mapper. Its ethereum address and its EdDSA public key For more information: https://commitment-mapper.docs.sismo.io*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":\"CommitmentMapperRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address ownerAddress,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0x1b6ab7a4ba266f3da2c7f6ba3de93e3ab89f389dbd6db14514b43cbdcbe9fe09\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0xcb419cf389baad6f38de28625718f64f551d2669339c1b4e1887e11d62484469\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b5060405162000abe38038062000abe833981016040819052620000349162000313565b6200003f3362000055565b6200004c838383620000b0565b505050620003ef565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600290610100900460ff16158015620000d3575060005460ff8083169116105b6200013b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff831617610100178155620001686000546201000090046001600160a01b031690565b6001600160a01b031614806200017d5750303b155b15620001a4576200018e8462000055565b6200019983620001eb565b620001a48262000237565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b620001fa600182600262000286565b507f9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab15816040516200022c9190620003bc565b60405180910390a150565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f4906020016200022c565b8260028101928215620002b7579160200282015b82811115620002b75782518255916020019190600101906200029a565b50620002c5929150620002c9565b5090565b5b80821115620002c55760008155600101620002ca565b80516001600160a01b0381168114620002f857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b6000806000608084860312156200032957600080fd5b6200033484620002e0565b9250602085603f8601126200034857600080fd5b604080519081016001600160401b03811182821017156200036d576200036d620002fd565b6040528060608701888111156200038357600080fd5b8388015b81811015620003a0578051835291840191840162000387565b50829550620003af81620002e0565b9450505050509250925092565b60408101818360005b6002811015620003e6578151835260209283019290910190600101620003c5565b50505092915050565b6106bf80620003ff6000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063727b2d5c11610066578063727b2d5c146100f4578063754b377c1461010757806378cf75d7146101215780638da5cb5b14610134578063f2fde38b1461014b57600080fd5b806338cc48311461009857806359a80d0d146100c25780637098a5f4146100d7578063715018a6146100ec575b600080fd5b6003546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100ca61015e565b6040516100b9919061053c565b6100ea6100e53660046105eb565b610198565b005b6100ea6101ac565b6100ea61010236600461062a565b6101c0565b61010f600281565b60405160ff90911681526020016100b9565b6100ea61012f366004610645565b6101d1565b6000546201000090046001600160a01b03166100a5565b6100ea61015936600461062a565b610303565b6101666104cb565b60408051808201918290529060019060029082845b81548152602001906001019080831161017b575050505050905090565b6101a0610379565b6101a9816103da565b50565b6101b4610379565b6101be6000610422565b565b6101c8610379565b6101a98161047d565b600054600290610100900460ff161580156101f3575060005460ff8083169116105b61025b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556102886000546001600160a01b03620100009091041690565b6001600160a01b0316148061029c5750303b155b156102bc576102aa84610422565b6102b3836103da565b6102bc8261047d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b61030b610379565b6001600160a01b0381166103705760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610252565b6101a981610422565b6000546001600160a01b03620100009091041633146101be5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610252565b6103e760018260026104e9565b507f9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab1581604051610417919061053c565b60405180910390a150565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f490602001610417565b60405180604001604052806002906020820280368337509192915050565b8260028101928215610517579160200282015b828111156105175782518255916020019190600101906104fc565b50610523929150610527565b5090565b5b808211156105235760008155600101610528565b60408101818360005b6002811015610564578151835260209283019290910190600101610545565b50505092915050565b600082601f83011261057e57600080fd5b6040516040810181811067ffffffffffffffff821117156105af57634e487b7160e01b600052604160045260246000fd5b80604052508060408401858111156105c657600080fd5b845b818110156105e05780358352602092830192016105c8565b509195945050505050565b6000604082840312156105fd57600080fd5b610607838361056d565b9392505050565b80356001600160a01b038116811461062557600080fd5b919050565b60006020828403121561063c57600080fd5b6106078261060e565b60008060006080848603121561065a57600080fd5b6106638461060e565b9250610672856020860161056d565b91506106806060850161060e565b9050925092509256fea2646970667358221220d4b69e1f79868deff972c669c62c01ccfa63a6b030214293debea10ed567f04f64736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063727b2d5c11610066578063727b2d5c146100f4578063754b377c1461010757806378cf75d7146101215780638da5cb5b14610134578063f2fde38b1461014b57600080fd5b806338cc48311461009857806359a80d0d146100c25780637098a5f4146100d7578063715018a6146100ec575b600080fd5b6003546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100ca61015e565b6040516100b9919061053c565b6100ea6100e53660046105eb565b610198565b005b6100ea6101ac565b6100ea61010236600461062a565b6101c0565b61010f600281565b60405160ff90911681526020016100b9565b6100ea61012f366004610645565b6101d1565b6000546201000090046001600160a01b03166100a5565b6100ea61015936600461062a565b610303565b6101666104cb565b60408051808201918290529060019060029082845b81548152602001906001019080831161017b575050505050905090565b6101a0610379565b6101a9816103da565b50565b6101b4610379565b6101be6000610422565b565b6101c8610379565b6101a98161047d565b600054600290610100900460ff161580156101f3575060005460ff8083169116105b61025b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556102886000546001600160a01b03620100009091041690565b6001600160a01b0316148061029c5750303b155b156102bc576102aa84610422565b6102b3836103da565b6102bc8261047d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b61030b610379565b6001600160a01b0381166103705760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610252565b6101a981610422565b6000546001600160a01b03620100009091041633146101be5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610252565b6103e760018260026104e9565b507f9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab1581604051610417919061053c565b60405180910390a150565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f490602001610417565b60405180604001604052806002906020820280368337509192915050565b8260028101928215610517579160200282015b828111156105175782518255916020019190600101906104fc565b50610523929150610527565b5090565b5b808211156105235760008155600101610528565b60408101818360005b6002811015610564578151835260209283019290910190600101610545565b50505092915050565b600082601f83011261057e57600080fd5b6040516040810181811067ffffffffffffffff821117156105af57634e487b7160e01b600052604160045260246000fd5b80604052508060408401858111156105c657600080fd5b845b818110156105e05780358352602092830192016105c8565b509195945050505050565b6000604082840312156105fd57600080fd5b610607838361056d565b9392505050565b80356001600160a01b038116811461062557600080fd5b919050565b60006020828403121561063c57600080fd5b6106078261060e565b60008060006080848603121561065a57600080fd5b6106638461060e565b9250610672856020860161056d565b91506106806060850161060e565b9050925092509256fea2646970667358221220d4b69e1f79868deff972c669c62c01ccfa63a6b030214293debea10ed567f04f64736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "constructor": { - "details": "Constructor", - "params": { - "commitmentMapperAddress": "Address of the commitment mapper", - "commitmentMapperEdDSAPubKey": "EdDSA public key of the commitment mapper", - "owner": "Owner of the contract, can update public key and address" - } - }, - "getAddress()": { - "details": "Getter of the address of the commitment mapper" - }, - "getEdDSAPubKey()": { - "details": "Getter of the EdDSA public key of the commitment mapper" - }, - "initialize(address,uint256[2],address)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "commitmentMapperAddress": "Address of the commitment mapper", - "commitmentMapperEdDSAPubKey": "EdDSA public key of the commitment mapper", - "ownerAddress": "Owner of the contract, can update public key and address" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "updateCommitmentMapperAddress(address)": { - "details": "Updates the address", - "params": { - "newAddress": "new address" - } - }, - "updateCommitmentMapperEdDSAPubKey(uint256[2])": { - "details": "Updates the EdDSA public key", - "params": { - "newEdDSAPubKey": "new EdDSA pubic key" - } - } - }, - "title": "Commitment Mapper Registry Contract", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(address,uint256[2],address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "This contract stores information about the commitment mapper. Its ethereum address and its EdDSA public key For more information: https://commitment-mapper.docs.sismo.io*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 396, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_owner", - "offset": 2, - "slot": "0", - "type": "t_address" - }, - { - "astId": 15766, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_commitmentMapperPubKey", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)2_storage" - }, - { - "astId": 15768, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_commitmentMapperAddress", - "offset": 0, - "slot": "3", - "type": "t_address" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)2_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[2]", - "numberOfBytes": "64" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/mumbai/CommitmentMapperRegistryImplem.json b/deployments/mumbai/CommitmentMapperRegistryImplem.json deleted file mode 100644 index 2aec9ba..0000000 --- a/deployments/mumbai/CommitmentMapperRegistryImplem.json +++ /dev/null @@ -1,458 +0,0 @@ -{ - "address": "0x542930ff08acEe13a54c0F46F32890d9B7f2E4A2", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "uint256[2]", - "name": "commitmentMapperEdDSAPubKey", - "type": "uint256[2]" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "pubKey", - "type": "uint256[2]" - } - ], - "name": "PubKeyNotValid", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "newAddress", - "type": "address" - } - ], - "name": "UpdatedCommitmentMapperAddress", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256[2]", - "name": "newEdDSAPubKey", - "type": "uint256[2]" - } - ], - "name": "UpdatedCommitmentMapperEdDSAPubKey", - "type": "event" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getEdDSAPubKey", - "outputs": [ - { - "internalType": "uint256[2]", - "name": "", - "type": "uint256[2]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - }, - { - "internalType": "uint256[2]", - "name": "commitmentMapperEdDSAPubKey", - "type": "uint256[2]" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAddress", - "type": "address" - } - ], - "name": "updateCommitmentMapperAddress", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "newEdDSAPubKey", - "type": "uint256[2]" - } - ], - "name": "updateCommitmentMapperEdDSAPubKey", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xf3eba93abc7d8f2daa265d0f13551306b343444c3a53762c6edc78a0d1878ce0", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x542930ff08acEe13a54c0F46F32890d9B7f2E4A2", - "transactionIndex": 14, - "gasUsed": "520392", - "logsBloom": "0x00000000000000000000000000020000000000000000000000800000000000000000000000000000000000000000000000008000000000000000000004000000000000000000008002000010000400800801000000000000000100000000004000000000020000000000000000000800002000000000000084000000000000400000000000000000000000000000000000000010000080000000000000008000200000000000000000000000800400000000000000000000000000000000004000000004000000000001000000040000000000000000000000100040000020000000100000000000000000000000000000000000000000000020000000100000", - "blockHash": "0xc6b9da4b24eb2020ed01fd996150d75046257832efe3f20c881d5855cc25373a", - "transactionHash": "0xf3eba93abc7d8f2daa265d0f13551306b343444c3a53762c6edc78a0d1878ce0", - "logs": [ - { - "transactionIndex": 14, - "blockNumber": 29540743, - "transactionHash": "0xf3eba93abc7d8f2daa265d0f13551306b343444c3a53762c6edc78a0d1878ce0", - "address": "0x542930ff08acEe13a54c0F46F32890d9B7f2E4A2", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" - ], - "data": "0x", - "logIndex": 70, - "blockHash": "0xc6b9da4b24eb2020ed01fd996150d75046257832efe3f20c881d5855cc25373a" - }, - { - "transactionIndex": 14, - "blockNumber": 29540743, - "transactionHash": "0xf3eba93abc7d8f2daa265d0f13551306b343444c3a53762c6edc78a0d1878ce0", - "address": "0x542930ff08acEe13a54c0F46F32890d9B7f2E4A2", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954" - ], - "data": "0x", - "logIndex": 71, - "blockHash": "0xc6b9da4b24eb2020ed01fd996150d75046257832efe3f20c881d5855cc25373a" - }, - { - "transactionIndex": 14, - "blockNumber": 29540743, - "transactionHash": "0xf3eba93abc7d8f2daa265d0f13551306b343444c3a53762c6edc78a0d1878ce0", - "address": "0x542930ff08acEe13a54c0F46F32890d9B7f2E4A2", - "topics": [ - "0x9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab15" - ], - "data": "0x1e468ad0fcde4edec429cd41eb28a0e78d4f31fa2c25172ef677468b2b38a9dc2b6e9a8e3b8ed419cca51e2e2ee7ae07d2902454deca17d7da7b00ae4a798add", - "logIndex": 72, - "blockHash": "0xc6b9da4b24eb2020ed01fd996150d75046257832efe3f20c881d5855cc25373a" - }, - { - "transactionIndex": 14, - "blockNumber": 29540743, - "transactionHash": "0xf3eba93abc7d8f2daa265d0f13551306b343444c3a53762c6edc78a0d1878ce0", - "address": "0x542930ff08acEe13a54c0F46F32890d9B7f2E4A2", - "topics": [ - "0xa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f4" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "logIndex": 73, - "blockHash": "0xc6b9da4b24eb2020ed01fd996150d75046257832efe3f20c881d5855cc25373a" - }, - { - "transactionIndex": 14, - "blockNumber": 29540743, - "transactionHash": "0xf3eba93abc7d8f2daa265d0f13551306b343444c3a53762c6edc78a0d1878ce0", - "address": "0x542930ff08acEe13a54c0F46F32890d9B7f2E4A2", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000002", - "logIndex": 74, - "blockHash": "0xc6b9da4b24eb2020ed01fd996150d75046257832efe3f20c881d5855cc25373a" - }, - { - "transactionIndex": 14, - "blockNumber": 29540743, - "transactionHash": "0xf3eba93abc7d8f2daa265d0f13551306b343444c3a53762c6edc78a0d1878ce0", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000be188d6641e8b680743a4815dfa0f6208038960f" - ], - "data": "0x00000000000000000000000000000000000000000000000000025d1c42f841380000000000000000000000000000000000000000000000007c94dbc2373dffa400000000000000000000000000000000000000000000280a3a35dd50f9a0c3ba0000000000000000000000000000000000000000000000007c927ea5f445be6c00000000000000000000000000000000000000000000280a3a383a6d3c9904f2", - "logIndex": 75, - "blockHash": "0xc6b9da4b24eb2020ed01fd996150d75046257832efe3f20c881d5855cc25373a" - } - ], - "blockNumber": 29540743, - "cumulativeGasUsed": "3150337", - "status": 1, - "byzantium": true - }, - "args": [ - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954", - [ - "0x1e468ad0fcde4edec429cd41eb28a0e78d4f31fa2c25172ef677468b2b38a9dc", - "0x2b6e9a8e3b8ed419cca51e2e2ee7ae07d2902454deca17d7da7b00ae4a798add" - ], - "0x0000000000000000000000000000000000000000" - ], - "numDeployments": 2, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentMapperEdDSAPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"pubKey\",\"type\":\"uint256[2]\"}],\"name\":\"PubKeyNotValid\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"UpdatedCommitmentMapperAddress\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256[2]\",\"name\":\"newEdDSAPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"UpdatedCommitmentMapperEdDSAPubKey\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEdDSAPubKey\",\"outputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"\",\"type\":\"uint256[2]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentMapperEdDSAPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"updateCommitmentMapperAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"newEdDSAPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"updateCommitmentMapperEdDSAPubKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"commitmentMapperAddress\":\"Address of the commitment mapper\",\"commitmentMapperEdDSAPubKey\":\"EdDSA public key of the commitment mapper\",\"owner\":\"Owner of the contract, can update public key and address\"}},\"getAddress()\":{\"details\":\"Getter of the address of the commitment mapper\"},\"getEdDSAPubKey()\":{\"details\":\"Getter of the EdDSA public key of the commitment mapper\"},\"initialize(address,uint256[2],address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"commitmentMapperAddress\":\"Address of the commitment mapper\",\"commitmentMapperEdDSAPubKey\":\"EdDSA public key of the commitment mapper\",\"ownerAddress\":\"Owner of the contract, can update public key and address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"updateCommitmentMapperAddress(address)\":{\"details\":\"Updates the address\",\"params\":{\"newAddress\":\"new address\"}},\"updateCommitmentMapperEdDSAPubKey(uint256[2])\":{\"details\":\"Updates the EdDSA public key\",\"params\":{\"newEdDSAPubKey\":\"new EdDSA pubic key\"}}},\"title\":\"Commitment Mapper Registry Contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address,uint256[2],address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"This contract stores information about the commitment mapper. Its ethereum address and its EdDSA public key For more information: https://commitment-mapper.docs.sismo.io*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":\"CommitmentMapperRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address ownerAddress,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0x1b6ab7a4ba266f3da2c7f6ba3de93e3ab89f389dbd6db14514b43cbdcbe9fe09\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0xcb419cf389baad6f38de28625718f64f551d2669339c1b4e1887e11d62484469\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b5060405162000abe38038062000abe833981016040819052620000349162000313565b6200003f3362000055565b6200004c838383620000b0565b505050620003ef565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600290610100900460ff16158015620000d3575060005460ff8083169116105b6200013b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff831617610100178155620001686000546201000090046001600160a01b031690565b6001600160a01b031614806200017d5750303b155b15620001a4576200018e8462000055565b6200019983620001eb565b620001a48262000237565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b620001fa600182600262000286565b507f9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab15816040516200022c9190620003bc565b60405180910390a150565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f4906020016200022c565b8260028101928215620002b7579160200282015b82811115620002b75782518255916020019190600101906200029a565b50620002c5929150620002c9565b5090565b5b80821115620002c55760008155600101620002ca565b80516001600160a01b0381168114620002f857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b6000806000608084860312156200032957600080fd5b6200033484620002e0565b9250602085603f8601126200034857600080fd5b604080519081016001600160401b03811182821017156200036d576200036d620002fd565b6040528060608701888111156200038357600080fd5b8388015b81811015620003a0578051835291840191840162000387565b50829550620003af81620002e0565b9450505050509250925092565b60408101818360005b6002811015620003e6578151835260209283019290910190600101620003c5565b50505092915050565b6106bf80620003ff6000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063727b2d5c11610066578063727b2d5c146100f4578063754b377c1461010757806378cf75d7146101215780638da5cb5b14610134578063f2fde38b1461014b57600080fd5b806338cc48311461009857806359a80d0d146100c25780637098a5f4146100d7578063715018a6146100ec575b600080fd5b6003546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100ca61015e565b6040516100b9919061053c565b6100ea6100e53660046105eb565b610198565b005b6100ea6101ac565b6100ea61010236600461062a565b6101c0565b61010f600281565b60405160ff90911681526020016100b9565b6100ea61012f366004610645565b6101d1565b6000546201000090046001600160a01b03166100a5565b6100ea61015936600461062a565b610303565b6101666104cb565b60408051808201918290529060019060029082845b81548152602001906001019080831161017b575050505050905090565b6101a0610379565b6101a9816103da565b50565b6101b4610379565b6101be6000610422565b565b6101c8610379565b6101a98161047d565b600054600290610100900460ff161580156101f3575060005460ff8083169116105b61025b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556102886000546001600160a01b03620100009091041690565b6001600160a01b0316148061029c5750303b155b156102bc576102aa84610422565b6102b3836103da565b6102bc8261047d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b61030b610379565b6001600160a01b0381166103705760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610252565b6101a981610422565b6000546001600160a01b03620100009091041633146101be5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610252565b6103e760018260026104e9565b507f9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab1581604051610417919061053c565b60405180910390a150565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f490602001610417565b60405180604001604052806002906020820280368337509192915050565b8260028101928215610517579160200282015b828111156105175782518255916020019190600101906104fc565b50610523929150610527565b5090565b5b808211156105235760008155600101610528565b60408101818360005b6002811015610564578151835260209283019290910190600101610545565b50505092915050565b600082601f83011261057e57600080fd5b6040516040810181811067ffffffffffffffff821117156105af57634e487b7160e01b600052604160045260246000fd5b80604052508060408401858111156105c657600080fd5b845b818110156105e05780358352602092830192016105c8565b509195945050505050565b6000604082840312156105fd57600080fd5b610607838361056d565b9392505050565b80356001600160a01b038116811461062557600080fd5b919050565b60006020828403121561063c57600080fd5b6106078261060e565b60008060006080848603121561065a57600080fd5b6106638461060e565b9250610672856020860161056d565b91506106806060850161060e565b9050925092509256fea2646970667358221220d4b69e1f79868deff972c669c62c01ccfa63a6b030214293debea10ed567f04f64736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063727b2d5c11610066578063727b2d5c146100f4578063754b377c1461010757806378cf75d7146101215780638da5cb5b14610134578063f2fde38b1461014b57600080fd5b806338cc48311461009857806359a80d0d146100c25780637098a5f4146100d7578063715018a6146100ec575b600080fd5b6003546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100ca61015e565b6040516100b9919061053c565b6100ea6100e53660046105eb565b610198565b005b6100ea6101ac565b6100ea61010236600461062a565b6101c0565b61010f600281565b60405160ff90911681526020016100b9565b6100ea61012f366004610645565b6101d1565b6000546201000090046001600160a01b03166100a5565b6100ea61015936600461062a565b610303565b6101666104cb565b60408051808201918290529060019060029082845b81548152602001906001019080831161017b575050505050905090565b6101a0610379565b6101a9816103da565b50565b6101b4610379565b6101be6000610422565b565b6101c8610379565b6101a98161047d565b600054600290610100900460ff161580156101f3575060005460ff8083169116105b61025b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556102886000546001600160a01b03620100009091041690565b6001600160a01b0316148061029c5750303b155b156102bc576102aa84610422565b6102b3836103da565b6102bc8261047d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b61030b610379565b6001600160a01b0381166103705760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610252565b6101a981610422565b6000546001600160a01b03620100009091041633146101be5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610252565b6103e760018260026104e9565b507f9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab1581604051610417919061053c565b60405180910390a150565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f490602001610417565b60405180604001604052806002906020820280368337509192915050565b8260028101928215610517579160200282015b828111156105175782518255916020019190600101906104fc565b50610523929150610527565b5090565b5b808211156105235760008155600101610528565b60408101818360005b6002811015610564578151835260209283019290910190600101610545565b50505092915050565b600082601f83011261057e57600080fd5b6040516040810181811067ffffffffffffffff821117156105af57634e487b7160e01b600052604160045260246000fd5b80604052508060408401858111156105c657600080fd5b845b818110156105e05780358352602092830192016105c8565b509195945050505050565b6000604082840312156105fd57600080fd5b610607838361056d565b9392505050565b80356001600160a01b038116811461062557600080fd5b919050565b60006020828403121561063c57600080fd5b6106078261060e565b60008060006080848603121561065a57600080fd5b6106638461060e565b9250610672856020860161056d565b91506106806060850161060e565b9050925092509256fea2646970667358221220d4b69e1f79868deff972c669c62c01ccfa63a6b030214293debea10ed567f04f64736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "constructor": { - "details": "Constructor", - "params": { - "commitmentMapperAddress": "Address of the commitment mapper", - "commitmentMapperEdDSAPubKey": "EdDSA public key of the commitment mapper", - "owner": "Owner of the contract, can update public key and address" - } - }, - "getAddress()": { - "details": "Getter of the address of the commitment mapper" - }, - "getEdDSAPubKey()": { - "details": "Getter of the EdDSA public key of the commitment mapper" - }, - "initialize(address,uint256[2],address)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "commitmentMapperAddress": "Address of the commitment mapper", - "commitmentMapperEdDSAPubKey": "EdDSA public key of the commitment mapper", - "ownerAddress": "Owner of the contract, can update public key and address" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - }, - "updateCommitmentMapperAddress(address)": { - "details": "Updates the address", - "params": { - "newAddress": "new address" - } - }, - "updateCommitmentMapperEdDSAPubKey(uint256[2])": { - "details": "Updates the EdDSA public key", - "params": { - "newEdDSAPubKey": "new EdDSA pubic key" - } - } - }, - "title": "Commitment Mapper Registry Contract", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(address,uint256[2],address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "This contract stores information about the commitment mapper. Its ethereum address and its EdDSA public key For more information: https://commitment-mapper.docs.sismo.io*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 396, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_owner", - "offset": 2, - "slot": "0", - "type": "t_address" - }, - { - "astId": 15766, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_commitmentMapperPubKey", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)2_storage" - }, - { - "astId": 15768, - "contract": "contracts/periphery/utils/CommitmentMapperRegistry.sol:CommitmentMapperRegistry", - "label": "_commitmentMapperAddress", - "offset": 0, - "slot": "3", - "type": "t_address" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)2_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[2]", - "numberOfBytes": "64" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/mumbai/CommitmentMapperRegistryProxy.json b/deployments/mumbai/CommitmentMapperRegistryProxy.json deleted file mode 100644 index d2c53ba..0000000 --- a/deployments/mumbai/CommitmentMapperRegistryProxy.json +++ /dev/null @@ -1,288 +0,0 @@ -{ - "address": "0x82B54988e4E3a2850501F91AC06CEA82bdb014D3", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x50060b327d1e66c38fd95bf2aace0dabc328b236a9ae69b01a756398f037883a", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x82B54988e4E3a2850501F91AC06CEA82bdb014D3", - "transactionIndex": 56, - "gasUsed": "661445", - "logsBloom": "0x00000000000000020000000000000000400000000000000000800000000000000000000000000000000000000000080000008000000000000000000004000000000000000000008000000000000402800001000000000000000100000000000000000000020000000010000000000800000000800000000084000000000000400000000000000000000000000000000000000010000000000000000000808000200800000000000020000000000000000001000000000000000000000000204000000024000000000001000000000000000000000400000000100000000020000000100000000020000000000000000000000000000000000020000010100000", - "blockHash": "0x5da083ea34e8dd6ef8eaf224e53de00d0f5c6f1e63b2ef8346ecb0ced9b6d487", - "transactionHash": "0x50060b327d1e66c38fd95bf2aace0dabc328b236a9ae69b01a756398f037883a", - "logs": [ - { - "transactionIndex": 56, - "blockNumber": 28600021, - "transactionHash": "0x50060b327d1e66c38fd95bf2aace0dabc328b236a9ae69b01a756398f037883a", - "address": "0x82B54988e4E3a2850501F91AC06CEA82bdb014D3", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x0000000000000000000000008c1e3e8b767369cb9c173dbc66e441cfef37283c" - ], - "data": "0x", - "logIndex": 341, - "blockHash": "0x5da083ea34e8dd6ef8eaf224e53de00d0f5c6f1e63b2ef8346ecb0ced9b6d487" - }, - { - "transactionIndex": 56, - "blockNumber": 28600021, - "transactionHash": "0x50060b327d1e66c38fd95bf2aace0dabc328b236a9ae69b01a756398f037883a", - "address": "0x82B54988e4E3a2850501F91AC06CEA82bdb014D3", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" - ], - "data": "0x", - "logIndex": 342, - "blockHash": "0x5da083ea34e8dd6ef8eaf224e53de00d0f5c6f1e63b2ef8346ecb0ced9b6d487" - }, - { - "transactionIndex": 56, - "blockNumber": 28600021, - "transactionHash": "0x50060b327d1e66c38fd95bf2aace0dabc328b236a9ae69b01a756398f037883a", - "address": "0x82B54988e4E3a2850501F91AC06CEA82bdb014D3", - "topics": [ - "0x9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab15" - ], - "data": "0x1e468ad0fcde4edec429cd41eb28a0e78d4f31fa2c25172ef677468b2b38a9dc2b6e9a8e3b8ed419cca51e2e2ee7ae07d2902454deca17d7da7b00ae4a798add", - "logIndex": 343, - "blockHash": "0x5da083ea34e8dd6ef8eaf224e53de00d0f5c6f1e63b2ef8346ecb0ced9b6d487" - }, - { - "transactionIndex": 56, - "blockNumber": 28600021, - "transactionHash": "0x50060b327d1e66c38fd95bf2aace0dabc328b236a9ae69b01a756398f037883a", - "address": "0x82B54988e4E3a2850501F91AC06CEA82bdb014D3", - "topics": [ - "0xa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f4" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "logIndex": 344, - "blockHash": "0x5da083ea34e8dd6ef8eaf224e53de00d0f5c6f1e63b2ef8346ecb0ced9b6d487" - }, - { - "transactionIndex": 56, - "blockNumber": 28600021, - "transactionHash": "0x50060b327d1e66c38fd95bf2aace0dabc328b236a9ae69b01a756398f037883a", - "address": "0x82B54988e4E3a2850501F91AC06CEA82bdb014D3", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000246e71bc2a257f4be9c7fad4664e6d7444844adc", - "logIndex": 345, - "blockHash": "0x5da083ea34e8dd6ef8eaf224e53de00d0f5c6f1e63b2ef8346ecb0ced9b6d487" - }, - { - "transactionIndex": 56, - "blockNumber": 28600021, - "transactionHash": "0x50060b327d1e66c38fd95bf2aace0dabc328b236a9ae69b01a756398f037883a", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" - ], - "data": "0x000000000000000000000000000000000000000000000000000d9bc4867ad85e0000000000000000000000000000000000000000000000008598994dfa7bc66d00000000000000000000000000000000000000000000167a29a62c87757bff54000000000000000000000000000000000000000000000000858afd897400ee0f00000000000000000000000000000000000000000000167a29b3c84bfbf6d7b2", - "logIndex": 346, - "blockHash": "0x5da083ea34e8dd6ef8eaf224e53de00d0f5c6f1e63b2ef8346ecb0ced9b6d487" - } - ], - "blockNumber": 28600021, - "cumulativeGasUsed": "11390287", - "status": 1, - "byzantium": true - }, - "args": [ - "0x8C1E3E8B767369Cb9C173dBC66E441CFEF37283c", - "0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc", - "0x78cf75d7000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc61e468ad0fcde4edec429cd41eb28a0e78d4f31fa2c25172ef677468b2b38a9dc2b6e9a8e3b8ed419cca51e2e2ee7ae07d2902454deca17d7da7b00ae4a798add0000000000000000000000000000000000000000000000000000000000000000" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/mumbai/Front.json b/deployments/mumbai/Front.json deleted file mode 100644 index eaa6c59..0000000 --- a/deployments/mumbai/Front.json +++ /dev/null @@ -1,535 +0,0 @@ -{ - "address": "0xFD0395fEb7805447e84Eb439a543413ecb22d562", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "DifferentRequestsDestinations", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "name": "EarlyUserAttestationGenerated", - "type": "event" - }, - { - "inputs": [], - "name": "ATTESTATIONS_REGISTRY", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "EARLY_USER_BADGE_END_DATE", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "EARLY_USER_COLLECTION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "attesters", - "type": "address[]" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request[]", - "name": "requests", - "type": "tuple[]" - }, - { - "internalType": "bytes[]", - "name": "proofDataArray", - "type": "bytes[]" - } - ], - "name": "batchBuildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[][]", - "name": "", - "type": "tuple[][]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "attesters", - "type": "address[]" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request[]", - "name": "requests", - "type": "tuple[]" - }, - { - "internalType": "bytes[]", - "name": "proofDataArray", - "type": "bytes[]" - } - ], - "name": "batchGenerateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[][]", - "name": "", - "type": "tuple[][]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x28a36764730aba0ace31dbef26acc4cfa4fb64478e777c69cb83d2ad29768b62", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0xf24E30Cb970eb97b07cA1dFf1F2b61A981AaE2DE", - "transactionIndex": 3, - "gasUsed": "954922", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000002000000000000000000000000000000000000000000000000000800000000000000000040100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000010000000000000000000008000200000000000000000000000000000000000000000000000000040000000004000000000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000100000", - "blockHash": "0x747303405e612fb5b760d26aa1f615aa0d3dcb5bed71854a204f6dbf78354041", - "transactionHash": "0x28a36764730aba0ace31dbef26acc4cfa4fb64478e777c69cb83d2ad29768b62", - "logs": [ - { - "transactionIndex": 3, - "blockNumber": 28599993, - "transactionHash": "0x28a36764730aba0ace31dbef26acc4cfa4fb64478e777c69cb83d2ad29768b62", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000c275dc8be39f50d12f66b6a63629c39da5bae5bd" - ], - "data": "0x000000000000000000000000000000000000000000000000000cb53722f5c31a000000000000000000000000000000000000000000000000879586ead26535e3000000000000000000000000000000000000000000000a08d78aeedf66d7be2a0000000000000000000000000000000000000000000000008788d1b3af6f72c9000000000000000000000000000000000000000000000a08d797a41689cd8144", - "logIndex": 23, - "blockHash": "0x747303405e612fb5b760d26aa1f615aa0d3dcb5bed71854a204f6dbf78354041" - } - ], - "blockNumber": 28599993, - "cumulativeGasUsed": "1896668", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf576E42E5b2682B8f606B1840c3A982610C29a3f" - ], - "numDeployments": 2, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"DifferentRequestsDestinations\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"EarlyUserAttestationGenerated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ATTESTATIONS_REGISTRY\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EARLY_USER_BADGE_END_DATE\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EARLY_USER_COLLECTION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"attesters\",\"type\":\"address[]\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request[]\",\"name\":\"requests\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"proofDataArray\",\"type\":\"bytes[]\"}],\"name\":\"batchBuildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[][]\",\"name\":\"\",\"type\":\"tuple[][]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"attesters\",\"type\":\"address[]\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request[]\",\"name\":\"requests\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"proofDataArray\",\"type\":\"bytes[]\"}],\"name\":\"batchGenerateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[][]\",\"name\":\"\",\"type\":\"tuple[][]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"batchBuildAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])\":{\"details\":\"build the attestations from multiple user requests. Forwards to the build function of targeted attester\",\"params\":{\"attesters\":\"Targeted attesters\",\"proofDataArray\":\"Data sent along the request to prove its validity\",\"requests\":\"User requests\"},\"returns\":{\"_0\":\"attestations Attestations that will be recorded\"}},\"batchGenerateAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])\":{\"details\":\"generate multiple attestations at once, to the same destination, generates an early user attestation\",\"params\":{\"attesters\":\"Attesters targeted by the attesters\",\"proofDataArray\":\"Data sent with each request\",\"requests\":\"Requests sent to attester\"}},\"buildAttestations(address,((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"build the attestations from a user request targeting a specific attester. Forwards to the build function of targeted attester\",\"params\":{\"attester\":\"Targeted attester\",\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that will be recorded\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"attestationsRegistryAddress\":\"Attestations registry contract address\"}},\"generateAttestations(address,((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Forward a request to an attester and generates an early user attestation\",\"params\":{\"attester\":\"Attester targeted by the request\",\"proofData\":\"Data provided to the attester to back the request\",\"request\":\"Request sent to the attester\"}}},\"title\":\"Front\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This is the Front contract of the Sismo protocol Behind a proxy, it routes attestations request to the targeted attester and can perform some actions This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference For more information: https://front.docs.sismo.io\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/Front.sol\":\"Front\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/core/Front.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {IFront} from './interfaces/IFront.sol';\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation} from './libs/Structs.sol';\\n\\n/**\\n * @title Front\\n * @author Sismo\\n * @notice This is the Front contract of the Sismo protocol\\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\\n\\n * For more information: https://front.docs.sismo.io\\n */\\ncontract Front is IFront {\\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\\n uint256 public constant EARLY_USER_COLLECTION = 0;\\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress Attestations registry contract address\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Forward a request to an attester and generates an early user attestation\\n * @param attester Attester targeted by the request\\n * @param request Request sent to the attester\\n * @param proofData Data provided to the attester to back the request\\n */\\n function generateAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n Attestation[] memory attestations = _forwardAttestationsGeneration(\\n attester,\\n request,\\n proofData\\n );\\n _generateEarlyUserAttestation(request.destination);\\n return attestations;\\n }\\n\\n /**\\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\\n * @param attesters Attesters targeted by the attesters\\n * @param requests Requests sent to attester\\n * @param proofDataArray Data sent with each request\\n */\\n function batchGenerateAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external override returns (Attestation[][] memory) {\\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\\n address destination = requests[0].destination;\\n for (uint256 i = 0; i < attesters.length; i++) {\\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\\n attestations[i] = _forwardAttestationsGeneration(\\n attesters[i],\\n requests[i],\\n proofDataArray[i]\\n );\\n }\\n _generateEarlyUserAttestation(destination);\\n return attestations;\\n }\\n\\n /**\\n * @dev build the attestations from a user request targeting a specific attester.\\n * Forwards to the build function of targeted attester\\n * @param attester Targeted attester\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external view override returns (Attestation[] memory) {\\n return _forwardAttestationsBuild(attester, request, proofData);\\n }\\n\\n /**\\n * @dev build the attestations from multiple user requests.\\n * Forwards to the build function of targeted attester\\n * @param attesters Targeted attesters\\n * @param requests User requests\\n * @param proofDataArray Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function batchBuildAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external view override returns (Attestation[][] memory) {\\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\\n\\n for (uint256 i = 0; i < attesters.length; i++) {\\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\\n }\\n return attestations;\\n }\\n\\n function _forwardAttestationsBuild(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) internal view returns (Attestation[] memory) {\\n return IAttester(attester).buildAttestations(request, proofData);\\n }\\n\\n function _forwardAttestationsGeneration(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) internal returns (Attestation[] memory) {\\n return IAttester(attester).generateAttestations(request, proofData);\\n }\\n\\n function _generateEarlyUserAttestation(address destination) internal {\\n uint32 currentTimestamp = uint32(block.timestamp);\\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\\n EARLY_USER_COLLECTION,\\n destination\\n );\\n\\n if (!alreadyHasAttestation) {\\n Attestation[] memory attestations = new Attestation[](1);\\n attestations[0] = Attestation(\\n EARLY_USER_COLLECTION,\\n destination,\\n address(this),\\n 1,\\n currentTimestamp,\\n 'With strong love from Sismo'\\n );\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n emit EarlyUserAttestationGenerated(destination);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3ea2112c22a36ff318873f1f015fa9e3b447e93d33464ae81b9bcd7d0f917621\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param attestations Attestations to be deleted\\n */\\n function deleteAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xb5e25bd7e0372c9973e582fb7fe96318c145831a5452d8c79eb848a7464b0297\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/interfaces/IFront.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\n\\n/**\\n * @title IFront\\n * @author Sismo\\n * @notice This is the interface of the Front Contract\\n */\\ninterface IFront {\\n error DifferentRequestsDestinations();\\n event EarlyUserAttestationGenerated(address destination);\\n\\n /**\\n * @dev Forward a request to an attester and generates an early user attestation\\n * @param attester Attester targeted by the request\\n * @param request Request sent to the attester\\n * @param proofData Data provided to the attester to back the request\\n */\\n function generateAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev generate multiple attestations at once, to the same destination\\n * @param attesters Attesters targeted by the attesters\\n * @param requests Requests sent to attester\\n * @param proofDataArray Data sent with each request\\n */\\n function batchGenerateAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external returns (Attestation[][] memory);\\n\\n /**\\n * @dev build the attestations from a user request targeting a specific attester.\\n * Forwards to the build function of targeted attester\\n * @param attester Targeted attester\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev build the attestations from multiple user requests.\\n * Forwards to the build function(s) of targeted attester(s)\\n * @param attesters Targeted attesters\\n * @param requests User requests\\n * @param proofDataArray Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function batchBuildAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external view returns (Attestation[][] memory);\\n}\\n\",\"keccak256\":\"0xfeab84e36830c432f91d0cbe1beb430331529829ce667a6371fbad47baa12191\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b506040516110e43803806110e483398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161104b610099600039600081816101020152818161051901526106bd015261104b6000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806389a504771161005b57806389a50477146100e7578063ac9d6541146100fd578063aebddc691461013c578063c0a92c911461014f57600080fd5b80630a60387d14610082578063369b88be146100a75780633ee490ce146100c7575b600080fd5b61008d6363226b0081565b60405163ffffffff90911681526020015b60405180910390f35b6100ba6100b5366004610805565b610162565b60405161009e91906108cf565b6100da6100d5366004610a0d565b61031d565b60405161009e9190610ab9565b6100ef600081565b60405190815260200161009e565b6101247f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161009e565b6100da61014a366004610a0d565b610350565b6100ba61015d366004610805565b61035e565b606060008667ffffffffffffffff81111561017f5761017f610b84565b6040519080825280602002602001820160405280156101b257816020015b606081526020019060019003908161019d5790505b5090506000868660008181106101ca576101ca610b9a565b90506020028101906101dc9190610bb0565b6101ed906040810190602001610bd0565b905060005b8881101561030757816001600160a01b031688888381811061021657610216610b9a565b90506020028101906102289190610bb0565b610239906040810190602001610bd0565b6001600160a01b0316146102605760405163f1b973df60e01b815260040160405180910390fd5b6102d78a8a8381811061027557610275610b9a565b905060200201602081019061028a9190610bd0565b89898481811061029c5761029c610b9a565b90506020028101906102ae9190610bb0565b8888858181106102c0576102c0610b9a565b90506020028101906102d29190610bf4565b610463565b8382815181106102e9576102e9610b9a565b602002602001018190525080806102ff90610c3b565b9150506101f2565b50610311816104dd565b50979650505050505050565b6060600061032d86868686610463565b90506103476103426040870160208801610bd0565b6104dd565b95945050505050565b606061034785858585610769565b606060008667ffffffffffffffff81111561037b5761037b610b84565b6040519080825280602002602001820160405280156103ae57816020015b60608152602001906001900390816103995790505b50905060005b87811015610311576104338989838181106103d1576103d1610b9a565b90506020020160208101906103e69190610bd0565b8888848181106103f8576103f8610b9a565b905060200281019061040a9190610bb0565b87878581811061041c5761041c610b9a565b905060200281019061042e9190610bf4565b610769565b82828151811061044557610445610b9a565b6020026020010181905250808061045b90610c3b565b9150506103b4565b60405163e60f999f60e01b81526060906001600160a01b0386169063e60f999f9061049690879087908790600401610c8b565b6000604051808303816000875af11580156104b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103479190810190610e9d565b426363226b0063ffffffff82161015610765576040516211023960e41b81526000600482018190526001600160a01b03848116602484015290917f0000000000000000000000000000000000000000000000000000000000000000909116906301102390906044016020604051808303816000875af1158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190610ff3565b90508061076357604080516001808252818301909252600091816020015b6105f76040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816105a65790505090506040518060c0016040528060008152602001856001600160a01b03168152602001306001600160a01b03168152602001600181526020018463ffffffff1681526020016040518060400160405280601b81526020017f57697468207374726f6e67206c6f76652066726f6d205369736d6f00000000008152508152508160008151811061069b5761069b610b9a565b602090810291909101015260405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106f2908490600401610ab9565b600060405180830381600087803b15801561070c57600080fd5b505af1158015610720573d6000803e3d6000fd5b50506040516001600160a01b03871681527f65566f56ce57729c92989973ff6ac5bdd213f57bf75d7248c4190d6d3634738e9250602001905060405180910390a1505b505b5050565b604051630af411a360e41b81526060906001600160a01b0386169063af411a309061079c90879087908790600401610c8b565b600060405180830381865afa1580156104b5573d6000803e3d6000fd5b60008083601f8401126107cb57600080fd5b50813567ffffffffffffffff8111156107e357600080fd5b6020830191508360208260051b85010111156107fe57600080fd5b9250929050565b6000806000806000806060878903121561081e57600080fd5b863567ffffffffffffffff8082111561083657600080fd5b6108428a838b016107b9565b9098509650602089013591508082111561085b57600080fd5b6108678a838b016107b9565b9096509450604089013591508082111561088057600080fd5b5061088d89828a016107b9565b979a9699509497509295939492505050565b60005b838110156108ba5781810151838201526020016108a2565b838111156108c9576000848401525b50505050565b60208152600060208201835180825260408401915060408160051b8501016020860160005b838110156109d957868303603f19018552815180518085526020918201918086019190600582901b87010160005b828110156109bf57601f1980898403018552855180518452602081015160018060a01b03808216602087015280604084015116604087015250506060810151606085015263ffffffff608082015116608085015260a0810151905060c060a085015280518060c086015261099d8160e087016020850161089f565b6020978801979690960195601f019091169290920160e0019150600101610922565b5060209889019890965094909401935050506001016108f4565b50909695505050505050565b6001600160a01b03811681146109fa57600080fd5b50565b8035610a08816109e5565b919050565b60008060008060608587031215610a2357600080fd5b8435610a2e816109e5565b9350602085013567ffffffffffffffff80821115610a4b57600080fd5b9086019060408289031215610a5f57600080fd5b90935060408601359080821115610a7557600080fd5b818701915087601f830112610a8957600080fd5b813581811115610a9857600080fd5b886020828501011115610aaa57600080fd5b95989497505060200194505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610b7657888303603f19018552815180518452878101516001600160a01b03908116898601528782015116878501526060808201519085015260808082015163ffffffff169085015260a09081015160c091850182905280519185018290529060e090610b5681838801858d0161089f565b96890196601f01601f191694909401909301925090860190600101610ae0565b509098975050505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008235603e19833603018112610bc657600080fd5b9190910192915050565b600060208284031215610be257600080fd5b8135610bed816109e5565b9392505050565b6000808335601e19843603018112610c0b57600080fd5b83018035915067ffffffffffffffff821115610c2657600080fd5b6020019150368190038213156107fe57600080fd5b600060018201610c5b57634e487b7160e01b600052601160045260246000fd5b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006040808352608083018635601e19883603018112610caa57600080fd5b87018035602080830167ffffffffffffffff80841115610cc957600080fd5b8360051b803603831315610cdc57600080fd5b878a018890529584905260a09589018601956000908a01607e1936889003015b86831015610d96578b8903609f190182528435818112610d1b57600080fd5b8801868101358a528a8101358a88015260608082013536839003603e19018112610d4457600080fd5b9091018b8101919088013586811115610d5c57600080fd5b803603831315610d6b57600080fd5b818d8d0152610d7d828d018285610c62565b9b50505094860194506001929092019190850190610cfc565b5050505050610da6818b016109fd565b6001600160a01b0381166060890152945086840381880152505050610dcc818688610c62565b979650505050505050565b60405160c0810167ffffffffffffffff81118282101715610dfa57610dfa610b84565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e2957610e29610b84565b604052919050565b600082601f830112610e4257600080fd5b815167ffffffffffffffff811115610e5c57610e5c610b84565b610e6f601f8201601f1916602001610e00565b818152846020838601011115610e8457600080fd5b610e9582602083016020870161089f565b949350505050565b60006020808385031215610eb057600080fd5b825167ffffffffffffffff80821115610ec857600080fd5b818501915085601f830112610edc57600080fd5b815181811115610eee57610eee610b84565b8060051b610efd858201610e00565b9182528381018501918581019089841115610f1757600080fd5b86860192505b83831015610fe657825185811115610f355760008081fd5b860160c0818c03601f1901811315610f4d5760008081fd5b610f55610dd7565b898301518152604080840151610f6a816109e5565b828c0152606084810151610f7d816109e5565b8083850152506080915081850151818401525060a08085015163ffffffff81168114610fa95760008081fd5b83830152928401519289841115610fc257600091508182fd5b610fd08f8d86880101610e31565b9083015250845250509186019190860190610f1d565b9998505050505050505050565b60006020828403121561100557600080fd5b81518015158114610bed57600080fdfea26469706673582212206eab9b350687ecccafd79868df619e95a4ffb1f38b3590296e186abb24b904f864736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806389a504771161005b57806389a50477146100e7578063ac9d6541146100fd578063aebddc691461013c578063c0a92c911461014f57600080fd5b80630a60387d14610082578063369b88be146100a75780633ee490ce146100c7575b600080fd5b61008d6363226b0081565b60405163ffffffff90911681526020015b60405180910390f35b6100ba6100b5366004610805565b610162565b60405161009e91906108cf565b6100da6100d5366004610a0d565b61031d565b60405161009e9190610ab9565b6100ef600081565b60405190815260200161009e565b6101247f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161009e565b6100da61014a366004610a0d565b610350565b6100ba61015d366004610805565b61035e565b606060008667ffffffffffffffff81111561017f5761017f610b84565b6040519080825280602002602001820160405280156101b257816020015b606081526020019060019003908161019d5790505b5090506000868660008181106101ca576101ca610b9a565b90506020028101906101dc9190610bb0565b6101ed906040810190602001610bd0565b905060005b8881101561030757816001600160a01b031688888381811061021657610216610b9a565b90506020028101906102289190610bb0565b610239906040810190602001610bd0565b6001600160a01b0316146102605760405163f1b973df60e01b815260040160405180910390fd5b6102d78a8a8381811061027557610275610b9a565b905060200201602081019061028a9190610bd0565b89898481811061029c5761029c610b9a565b90506020028101906102ae9190610bb0565b8888858181106102c0576102c0610b9a565b90506020028101906102d29190610bf4565b610463565b8382815181106102e9576102e9610b9a565b602002602001018190525080806102ff90610c3b565b9150506101f2565b50610311816104dd565b50979650505050505050565b6060600061032d86868686610463565b90506103476103426040870160208801610bd0565b6104dd565b95945050505050565b606061034785858585610769565b606060008667ffffffffffffffff81111561037b5761037b610b84565b6040519080825280602002602001820160405280156103ae57816020015b60608152602001906001900390816103995790505b50905060005b87811015610311576104338989838181106103d1576103d1610b9a565b90506020020160208101906103e69190610bd0565b8888848181106103f8576103f8610b9a565b905060200281019061040a9190610bb0565b87878581811061041c5761041c610b9a565b905060200281019061042e9190610bf4565b610769565b82828151811061044557610445610b9a565b6020026020010181905250808061045b90610c3b565b9150506103b4565b60405163e60f999f60e01b81526060906001600160a01b0386169063e60f999f9061049690879087908790600401610c8b565b6000604051808303816000875af11580156104b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103479190810190610e9d565b426363226b0063ffffffff82161015610765576040516211023960e41b81526000600482018190526001600160a01b03848116602484015290917f0000000000000000000000000000000000000000000000000000000000000000909116906301102390906044016020604051808303816000875af1158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190610ff3565b90508061076357604080516001808252818301909252600091816020015b6105f76040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816105a65790505090506040518060c0016040528060008152602001856001600160a01b03168152602001306001600160a01b03168152602001600181526020018463ffffffff1681526020016040518060400160405280601b81526020017f57697468207374726f6e67206c6f76652066726f6d205369736d6f00000000008152508152508160008151811061069b5761069b610b9a565b602090810291909101015260405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106f2908490600401610ab9565b600060405180830381600087803b15801561070c57600080fd5b505af1158015610720573d6000803e3d6000fd5b50506040516001600160a01b03871681527f65566f56ce57729c92989973ff6ac5bdd213f57bf75d7248c4190d6d3634738e9250602001905060405180910390a1505b505b5050565b604051630af411a360e41b81526060906001600160a01b0386169063af411a309061079c90879087908790600401610c8b565b600060405180830381865afa1580156104b5573d6000803e3d6000fd5b60008083601f8401126107cb57600080fd5b50813567ffffffffffffffff8111156107e357600080fd5b6020830191508360208260051b85010111156107fe57600080fd5b9250929050565b6000806000806000806060878903121561081e57600080fd5b863567ffffffffffffffff8082111561083657600080fd5b6108428a838b016107b9565b9098509650602089013591508082111561085b57600080fd5b6108678a838b016107b9565b9096509450604089013591508082111561088057600080fd5b5061088d89828a016107b9565b979a9699509497509295939492505050565b60005b838110156108ba5781810151838201526020016108a2565b838111156108c9576000848401525b50505050565b60208152600060208201835180825260408401915060408160051b8501016020860160005b838110156109d957868303603f19018552815180518085526020918201918086019190600582901b87010160005b828110156109bf57601f1980898403018552855180518452602081015160018060a01b03808216602087015280604084015116604087015250506060810151606085015263ffffffff608082015116608085015260a0810151905060c060a085015280518060c086015261099d8160e087016020850161089f565b6020978801979690960195601f019091169290920160e0019150600101610922565b5060209889019890965094909401935050506001016108f4565b50909695505050505050565b6001600160a01b03811681146109fa57600080fd5b50565b8035610a08816109e5565b919050565b60008060008060608587031215610a2357600080fd5b8435610a2e816109e5565b9350602085013567ffffffffffffffff80821115610a4b57600080fd5b9086019060408289031215610a5f57600080fd5b90935060408601359080821115610a7557600080fd5b818701915087601f830112610a8957600080fd5b813581811115610a9857600080fd5b886020828501011115610aaa57600080fd5b95989497505060200194505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610b7657888303603f19018552815180518452878101516001600160a01b03908116898601528782015116878501526060808201519085015260808082015163ffffffff169085015260a09081015160c091850182905280519185018290529060e090610b5681838801858d0161089f565b96890196601f01601f191694909401909301925090860190600101610ae0565b509098975050505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008235603e19833603018112610bc657600080fd5b9190910192915050565b600060208284031215610be257600080fd5b8135610bed816109e5565b9392505050565b6000808335601e19843603018112610c0b57600080fd5b83018035915067ffffffffffffffff821115610c2657600080fd5b6020019150368190038213156107fe57600080fd5b600060018201610c5b57634e487b7160e01b600052601160045260246000fd5b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006040808352608083018635601e19883603018112610caa57600080fd5b87018035602080830167ffffffffffffffff80841115610cc957600080fd5b8360051b803603831315610cdc57600080fd5b878a018890529584905260a09589018601956000908a01607e1936889003015b86831015610d96578b8903609f190182528435818112610d1b57600080fd5b8801868101358a528a8101358a88015260608082013536839003603e19018112610d4457600080fd5b9091018b8101919088013586811115610d5c57600080fd5b803603831315610d6b57600080fd5b818d8d0152610d7d828d018285610c62565b9b50505094860194506001929092019190850190610cfc565b5050505050610da6818b016109fd565b6001600160a01b0381166060890152945086840381880152505050610dcc818688610c62565b979650505050505050565b60405160c0810167ffffffffffffffff81118282101715610dfa57610dfa610b84565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e2957610e29610b84565b604052919050565b600082601f830112610e4257600080fd5b815167ffffffffffffffff811115610e5c57610e5c610b84565b610e6f601f8201601f1916602001610e00565b818152846020838601011115610e8457600080fd5b610e9582602083016020870161089f565b949350505050565b60006020808385031215610eb057600080fd5b825167ffffffffffffffff80821115610ec857600080fd5b818501915085601f830112610edc57600080fd5b815181811115610eee57610eee610b84565b8060051b610efd858201610e00565b9182528381018501918581019089841115610f1757600080fd5b86860192505b83831015610fe657825185811115610f355760008081fd5b860160c0818c03601f1901811315610f4d5760008081fd5b610f55610dd7565b898301518152604080840151610f6a816109e5565b828c0152606084810151610f7d816109e5565b8083850152506080915081850151818401525060a08085015163ffffffff81168114610fa95760008081fd5b83830152928401519289841115610fc257600091508182fd5b610fd08f8d86880101610e31565b9083015250845250509186019190860190610f1d565b9998505050505050505050565b60006020828403121561100557600080fd5b81518015158114610bed57600080fdfea26469706673582212206eab9b350687ecccafd79868df619e95a4ffb1f38b3590296e186abb24b904f864736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "batchBuildAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])": { - "details": "build the attestations from multiple user requests. Forwards to the build function of targeted attester", - "params": { - "attesters": "Targeted attesters", - "proofDataArray": "Data sent along the request to prove its validity", - "requests": "User requests" - }, - "returns": { - "_0": "attestations Attestations that will be recorded" - } - }, - "batchGenerateAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])": { - "details": "generate multiple attestations at once, to the same destination, generates an early user attestation", - "params": { - "attesters": "Attesters targeted by the attesters", - "proofDataArray": "Data sent with each request", - "requests": "Requests sent to attester" - } - }, - "buildAttestations(address,((uint256,uint256,bytes)[],address),bytes)": { - "details": "build the attestations from a user request targeting a specific attester. Forwards to the build function of targeted attester", - "params": { - "attester": "Targeted attester", - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that will be recorded" - } - }, - "constructor": { - "details": "Constructor", - "params": { - "attestationsRegistryAddress": "Attestations registry contract address" - } - }, - "generateAttestations(address,((uint256,uint256,bytes)[],address),bytes)": { - "details": "Forward a request to an attester and generates an early user attestation", - "params": { - "attester": "Attester targeted by the request", - "proofData": "Data provided to the attester to back the request", - "request": "Request sent to the attester" - } - } - }, - "title": "Front", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "This is the Front contract of the Sismo protocol Behind a proxy, it routes attestations request to the targeted attester and can perform some actions This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference For more information: https://front.docs.sismo.io", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/mumbai/FrontImplem.json b/deployments/mumbai/FrontImplem.json deleted file mode 100644 index 3c4d799..0000000 --- a/deployments/mumbai/FrontImplem.json +++ /dev/null @@ -1,535 +0,0 @@ -{ - "address": "0xf24E30Cb970eb97b07cA1dFf1F2b61A981AaE2DE", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "DifferentRequestsDestinations", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "name": "EarlyUserAttestationGenerated", - "type": "event" - }, - { - "inputs": [], - "name": "ATTESTATIONS_REGISTRY", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "EARLY_USER_BADGE_END_DATE", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "EARLY_USER_COLLECTION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "attesters", - "type": "address[]" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request[]", - "name": "requests", - "type": "tuple[]" - }, - { - "internalType": "bytes[]", - "name": "proofDataArray", - "type": "bytes[]" - } - ], - "name": "batchBuildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[][]", - "name": "", - "type": "tuple[][]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "attesters", - "type": "address[]" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request[]", - "name": "requests", - "type": "tuple[]" - }, - { - "internalType": "bytes[]", - "name": "proofDataArray", - "type": "bytes[]" - } - ], - "name": "batchGenerateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[][]", - "name": "", - "type": "tuple[][]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attester", - "type": "address" - }, - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x28a36764730aba0ace31dbef26acc4cfa4fb64478e777c69cb83d2ad29768b62", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0xf24E30Cb970eb97b07cA1dFf1F2b61A981AaE2DE", - "transactionIndex": 3, - "gasUsed": "954922", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000002000000000000000000000000000000000000000000000000000800000000000000000040100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000010000000000000000000008000200000000000000000000000000000000000000000000000000040000000004000000000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000100000", - "blockHash": "0x747303405e612fb5b760d26aa1f615aa0d3dcb5bed71854a204f6dbf78354041", - "transactionHash": "0x28a36764730aba0ace31dbef26acc4cfa4fb64478e777c69cb83d2ad29768b62", - "logs": [ - { - "transactionIndex": 3, - "blockNumber": 28599993, - "transactionHash": "0x28a36764730aba0ace31dbef26acc4cfa4fb64478e777c69cb83d2ad29768b62", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000c275dc8be39f50d12f66b6a63629c39da5bae5bd" - ], - "data": "0x000000000000000000000000000000000000000000000000000cb53722f5c31a000000000000000000000000000000000000000000000000879586ead26535e3000000000000000000000000000000000000000000000a08d78aeedf66d7be2a0000000000000000000000000000000000000000000000008788d1b3af6f72c9000000000000000000000000000000000000000000000a08d797a41689cd8144", - "logIndex": 23, - "blockHash": "0x747303405e612fb5b760d26aa1f615aa0d3dcb5bed71854a204f6dbf78354041" - } - ], - "blockNumber": 28599993, - "cumulativeGasUsed": "1896668", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf576E42E5b2682B8f606B1840c3A982610C29a3f" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"DifferentRequestsDestinations\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"EarlyUserAttestationGenerated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ATTESTATIONS_REGISTRY\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EARLY_USER_BADGE_END_DATE\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EARLY_USER_COLLECTION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"attesters\",\"type\":\"address[]\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request[]\",\"name\":\"requests\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"proofDataArray\",\"type\":\"bytes[]\"}],\"name\":\"batchBuildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[][]\",\"name\":\"\",\"type\":\"tuple[][]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"attesters\",\"type\":\"address[]\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request[]\",\"name\":\"requests\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"proofDataArray\",\"type\":\"bytes[]\"}],\"name\":\"batchGenerateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[][]\",\"name\":\"\",\"type\":\"tuple[][]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"batchBuildAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])\":{\"details\":\"build the attestations from multiple user requests. Forwards to the build function of targeted attester\",\"params\":{\"attesters\":\"Targeted attesters\",\"proofDataArray\":\"Data sent along the request to prove its validity\",\"requests\":\"User requests\"},\"returns\":{\"_0\":\"attestations Attestations that will be recorded\"}},\"batchGenerateAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])\":{\"details\":\"generate multiple attestations at once, to the same destination, generates an early user attestation\",\"params\":{\"attesters\":\"Attesters targeted by the attesters\",\"proofDataArray\":\"Data sent with each request\",\"requests\":\"Requests sent to attester\"}},\"buildAttestations(address,((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"build the attestations from a user request targeting a specific attester. Forwards to the build function of targeted attester\",\"params\":{\"attester\":\"Targeted attester\",\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that will be recorded\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"attestationsRegistryAddress\":\"Attestations registry contract address\"}},\"generateAttestations(address,((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Forward a request to an attester and generates an early user attestation\",\"params\":{\"attester\":\"Attester targeted by the request\",\"proofData\":\"Data provided to the attester to back the request\",\"request\":\"Request sent to the attester\"}}},\"title\":\"Front\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This is the Front contract of the Sismo protocol Behind a proxy, it routes attestations request to the targeted attester and can perform some actions This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference For more information: https://front.docs.sismo.io\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/Front.sol\":\"Front\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/core/Front.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {IFront} from './interfaces/IFront.sol';\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation} from './libs/Structs.sol';\\n\\n/**\\n * @title Front\\n * @author Sismo\\n * @notice This is the Front contract of the Sismo protocol\\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\\n\\n * For more information: https://front.docs.sismo.io\\n */\\ncontract Front is IFront {\\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\\n uint256 public constant EARLY_USER_COLLECTION = 0;\\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress Attestations registry contract address\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Forward a request to an attester and generates an early user attestation\\n * @param attester Attester targeted by the request\\n * @param request Request sent to the attester\\n * @param proofData Data provided to the attester to back the request\\n */\\n function generateAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n Attestation[] memory attestations = _forwardAttestationsGeneration(\\n attester,\\n request,\\n proofData\\n );\\n _generateEarlyUserAttestation(request.destination);\\n return attestations;\\n }\\n\\n /**\\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\\n * @param attesters Attesters targeted by the attesters\\n * @param requests Requests sent to attester\\n * @param proofDataArray Data sent with each request\\n */\\n function batchGenerateAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external override returns (Attestation[][] memory) {\\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\\n address destination = requests[0].destination;\\n for (uint256 i = 0; i < attesters.length; i++) {\\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\\n attestations[i] = _forwardAttestationsGeneration(\\n attesters[i],\\n requests[i],\\n proofDataArray[i]\\n );\\n }\\n _generateEarlyUserAttestation(destination);\\n return attestations;\\n }\\n\\n /**\\n * @dev build the attestations from a user request targeting a specific attester.\\n * Forwards to the build function of targeted attester\\n * @param attester Targeted attester\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external view override returns (Attestation[] memory) {\\n return _forwardAttestationsBuild(attester, request, proofData);\\n }\\n\\n /**\\n * @dev build the attestations from multiple user requests.\\n * Forwards to the build function of targeted attester\\n * @param attesters Targeted attesters\\n * @param requests User requests\\n * @param proofDataArray Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function batchBuildAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external view override returns (Attestation[][] memory) {\\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\\n\\n for (uint256 i = 0; i < attesters.length; i++) {\\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\\n }\\n return attestations;\\n }\\n\\n function _forwardAttestationsBuild(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) internal view returns (Attestation[] memory) {\\n return IAttester(attester).buildAttestations(request, proofData);\\n }\\n\\n function _forwardAttestationsGeneration(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) internal returns (Attestation[] memory) {\\n return IAttester(attester).generateAttestations(request, proofData);\\n }\\n\\n function _generateEarlyUserAttestation(address destination) internal {\\n uint32 currentTimestamp = uint32(block.timestamp);\\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\\n EARLY_USER_COLLECTION,\\n destination\\n );\\n\\n if (!alreadyHasAttestation) {\\n Attestation[] memory attestations = new Attestation[](1);\\n attestations[0] = Attestation(\\n EARLY_USER_COLLECTION,\\n destination,\\n address(this),\\n 1,\\n currentTimestamp,\\n 'With strong love from Sismo'\\n );\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n emit EarlyUserAttestationGenerated(destination);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3ea2112c22a36ff318873f1f015fa9e3b447e93d33464ae81b9bcd7d0f917621\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param attestations Attestations to be deleted\\n */\\n function deleteAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xb5e25bd7e0372c9973e582fb7fe96318c145831a5452d8c79eb848a7464b0297\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/interfaces/IFront.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\n\\n/**\\n * @title IFront\\n * @author Sismo\\n * @notice This is the interface of the Front Contract\\n */\\ninterface IFront {\\n error DifferentRequestsDestinations();\\n event EarlyUserAttestationGenerated(address destination);\\n\\n /**\\n * @dev Forward a request to an attester and generates an early user attestation\\n * @param attester Attester targeted by the request\\n * @param request Request sent to the attester\\n * @param proofData Data provided to the attester to back the request\\n */\\n function generateAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev generate multiple attestations at once, to the same destination\\n * @param attesters Attesters targeted by the attesters\\n * @param requests Requests sent to attester\\n * @param proofDataArray Data sent with each request\\n */\\n function batchGenerateAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external returns (Attestation[][] memory);\\n\\n /**\\n * @dev build the attestations from a user request targeting a specific attester.\\n * Forwards to the build function of targeted attester\\n * @param attester Targeted attester\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev build the attestations from multiple user requests.\\n * Forwards to the build function(s) of targeted attester(s)\\n * @param attesters Targeted attesters\\n * @param requests User requests\\n * @param proofDataArray Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function batchBuildAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external view returns (Attestation[][] memory);\\n}\\n\",\"keccak256\":\"0xfeab84e36830c432f91d0cbe1beb430331529829ce667a6371fbad47baa12191\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b506040516110e43803806110e483398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161104b610099600039600081816101020152818161051901526106bd015261104b6000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806389a504771161005b57806389a50477146100e7578063ac9d6541146100fd578063aebddc691461013c578063c0a92c911461014f57600080fd5b80630a60387d14610082578063369b88be146100a75780633ee490ce146100c7575b600080fd5b61008d6363226b0081565b60405163ffffffff90911681526020015b60405180910390f35b6100ba6100b5366004610805565b610162565b60405161009e91906108cf565b6100da6100d5366004610a0d565b61031d565b60405161009e9190610ab9565b6100ef600081565b60405190815260200161009e565b6101247f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161009e565b6100da61014a366004610a0d565b610350565b6100ba61015d366004610805565b61035e565b606060008667ffffffffffffffff81111561017f5761017f610b84565b6040519080825280602002602001820160405280156101b257816020015b606081526020019060019003908161019d5790505b5090506000868660008181106101ca576101ca610b9a565b90506020028101906101dc9190610bb0565b6101ed906040810190602001610bd0565b905060005b8881101561030757816001600160a01b031688888381811061021657610216610b9a565b90506020028101906102289190610bb0565b610239906040810190602001610bd0565b6001600160a01b0316146102605760405163f1b973df60e01b815260040160405180910390fd5b6102d78a8a8381811061027557610275610b9a565b905060200201602081019061028a9190610bd0565b89898481811061029c5761029c610b9a565b90506020028101906102ae9190610bb0565b8888858181106102c0576102c0610b9a565b90506020028101906102d29190610bf4565b610463565b8382815181106102e9576102e9610b9a565b602002602001018190525080806102ff90610c3b565b9150506101f2565b50610311816104dd565b50979650505050505050565b6060600061032d86868686610463565b90506103476103426040870160208801610bd0565b6104dd565b95945050505050565b606061034785858585610769565b606060008667ffffffffffffffff81111561037b5761037b610b84565b6040519080825280602002602001820160405280156103ae57816020015b60608152602001906001900390816103995790505b50905060005b87811015610311576104338989838181106103d1576103d1610b9a565b90506020020160208101906103e69190610bd0565b8888848181106103f8576103f8610b9a565b905060200281019061040a9190610bb0565b87878581811061041c5761041c610b9a565b905060200281019061042e9190610bf4565b610769565b82828151811061044557610445610b9a565b6020026020010181905250808061045b90610c3b565b9150506103b4565b60405163e60f999f60e01b81526060906001600160a01b0386169063e60f999f9061049690879087908790600401610c8b565b6000604051808303816000875af11580156104b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103479190810190610e9d565b426363226b0063ffffffff82161015610765576040516211023960e41b81526000600482018190526001600160a01b03848116602484015290917f0000000000000000000000000000000000000000000000000000000000000000909116906301102390906044016020604051808303816000875af1158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190610ff3565b90508061076357604080516001808252818301909252600091816020015b6105f76040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816105a65790505090506040518060c0016040528060008152602001856001600160a01b03168152602001306001600160a01b03168152602001600181526020018463ffffffff1681526020016040518060400160405280601b81526020017f57697468207374726f6e67206c6f76652066726f6d205369736d6f00000000008152508152508160008151811061069b5761069b610b9a565b602090810291909101015260405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106f2908490600401610ab9565b600060405180830381600087803b15801561070c57600080fd5b505af1158015610720573d6000803e3d6000fd5b50506040516001600160a01b03871681527f65566f56ce57729c92989973ff6ac5bdd213f57bf75d7248c4190d6d3634738e9250602001905060405180910390a1505b505b5050565b604051630af411a360e41b81526060906001600160a01b0386169063af411a309061079c90879087908790600401610c8b565b600060405180830381865afa1580156104b5573d6000803e3d6000fd5b60008083601f8401126107cb57600080fd5b50813567ffffffffffffffff8111156107e357600080fd5b6020830191508360208260051b85010111156107fe57600080fd5b9250929050565b6000806000806000806060878903121561081e57600080fd5b863567ffffffffffffffff8082111561083657600080fd5b6108428a838b016107b9565b9098509650602089013591508082111561085b57600080fd5b6108678a838b016107b9565b9096509450604089013591508082111561088057600080fd5b5061088d89828a016107b9565b979a9699509497509295939492505050565b60005b838110156108ba5781810151838201526020016108a2565b838111156108c9576000848401525b50505050565b60208152600060208201835180825260408401915060408160051b8501016020860160005b838110156109d957868303603f19018552815180518085526020918201918086019190600582901b87010160005b828110156109bf57601f1980898403018552855180518452602081015160018060a01b03808216602087015280604084015116604087015250506060810151606085015263ffffffff608082015116608085015260a0810151905060c060a085015280518060c086015261099d8160e087016020850161089f565b6020978801979690960195601f019091169290920160e0019150600101610922565b5060209889019890965094909401935050506001016108f4565b50909695505050505050565b6001600160a01b03811681146109fa57600080fd5b50565b8035610a08816109e5565b919050565b60008060008060608587031215610a2357600080fd5b8435610a2e816109e5565b9350602085013567ffffffffffffffff80821115610a4b57600080fd5b9086019060408289031215610a5f57600080fd5b90935060408601359080821115610a7557600080fd5b818701915087601f830112610a8957600080fd5b813581811115610a9857600080fd5b886020828501011115610aaa57600080fd5b95989497505060200194505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610b7657888303603f19018552815180518452878101516001600160a01b03908116898601528782015116878501526060808201519085015260808082015163ffffffff169085015260a09081015160c091850182905280519185018290529060e090610b5681838801858d0161089f565b96890196601f01601f191694909401909301925090860190600101610ae0565b509098975050505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008235603e19833603018112610bc657600080fd5b9190910192915050565b600060208284031215610be257600080fd5b8135610bed816109e5565b9392505050565b6000808335601e19843603018112610c0b57600080fd5b83018035915067ffffffffffffffff821115610c2657600080fd5b6020019150368190038213156107fe57600080fd5b600060018201610c5b57634e487b7160e01b600052601160045260246000fd5b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006040808352608083018635601e19883603018112610caa57600080fd5b87018035602080830167ffffffffffffffff80841115610cc957600080fd5b8360051b803603831315610cdc57600080fd5b878a018890529584905260a09589018601956000908a01607e1936889003015b86831015610d96578b8903609f190182528435818112610d1b57600080fd5b8801868101358a528a8101358a88015260608082013536839003603e19018112610d4457600080fd5b9091018b8101919088013586811115610d5c57600080fd5b803603831315610d6b57600080fd5b818d8d0152610d7d828d018285610c62565b9b50505094860194506001929092019190850190610cfc565b5050505050610da6818b016109fd565b6001600160a01b0381166060890152945086840381880152505050610dcc818688610c62565b979650505050505050565b60405160c0810167ffffffffffffffff81118282101715610dfa57610dfa610b84565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e2957610e29610b84565b604052919050565b600082601f830112610e4257600080fd5b815167ffffffffffffffff811115610e5c57610e5c610b84565b610e6f601f8201601f1916602001610e00565b818152846020838601011115610e8457600080fd5b610e9582602083016020870161089f565b949350505050565b60006020808385031215610eb057600080fd5b825167ffffffffffffffff80821115610ec857600080fd5b818501915085601f830112610edc57600080fd5b815181811115610eee57610eee610b84565b8060051b610efd858201610e00565b9182528381018501918581019089841115610f1757600080fd5b86860192505b83831015610fe657825185811115610f355760008081fd5b860160c0818c03601f1901811315610f4d5760008081fd5b610f55610dd7565b898301518152604080840151610f6a816109e5565b828c0152606084810151610f7d816109e5565b8083850152506080915081850151818401525060a08085015163ffffffff81168114610fa95760008081fd5b83830152928401519289841115610fc257600091508182fd5b610fd08f8d86880101610e31565b9083015250845250509186019190860190610f1d565b9998505050505050505050565b60006020828403121561100557600080fd5b81518015158114610bed57600080fdfea26469706673582212206eab9b350687ecccafd79868df619e95a4ffb1f38b3590296e186abb24b904f864736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806389a504771161005b57806389a50477146100e7578063ac9d6541146100fd578063aebddc691461013c578063c0a92c911461014f57600080fd5b80630a60387d14610082578063369b88be146100a75780633ee490ce146100c7575b600080fd5b61008d6363226b0081565b60405163ffffffff90911681526020015b60405180910390f35b6100ba6100b5366004610805565b610162565b60405161009e91906108cf565b6100da6100d5366004610a0d565b61031d565b60405161009e9190610ab9565b6100ef600081565b60405190815260200161009e565b6101247f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161009e565b6100da61014a366004610a0d565b610350565b6100ba61015d366004610805565b61035e565b606060008667ffffffffffffffff81111561017f5761017f610b84565b6040519080825280602002602001820160405280156101b257816020015b606081526020019060019003908161019d5790505b5090506000868660008181106101ca576101ca610b9a565b90506020028101906101dc9190610bb0565b6101ed906040810190602001610bd0565b905060005b8881101561030757816001600160a01b031688888381811061021657610216610b9a565b90506020028101906102289190610bb0565b610239906040810190602001610bd0565b6001600160a01b0316146102605760405163f1b973df60e01b815260040160405180910390fd5b6102d78a8a8381811061027557610275610b9a565b905060200201602081019061028a9190610bd0565b89898481811061029c5761029c610b9a565b90506020028101906102ae9190610bb0565b8888858181106102c0576102c0610b9a565b90506020028101906102d29190610bf4565b610463565b8382815181106102e9576102e9610b9a565b602002602001018190525080806102ff90610c3b565b9150506101f2565b50610311816104dd565b50979650505050505050565b6060600061032d86868686610463565b90506103476103426040870160208801610bd0565b6104dd565b95945050505050565b606061034785858585610769565b606060008667ffffffffffffffff81111561037b5761037b610b84565b6040519080825280602002602001820160405280156103ae57816020015b60608152602001906001900390816103995790505b50905060005b87811015610311576104338989838181106103d1576103d1610b9a565b90506020020160208101906103e69190610bd0565b8888848181106103f8576103f8610b9a565b905060200281019061040a9190610bb0565b87878581811061041c5761041c610b9a565b905060200281019061042e9190610bf4565b610769565b82828151811061044557610445610b9a565b6020026020010181905250808061045b90610c3b565b9150506103b4565b60405163e60f999f60e01b81526060906001600160a01b0386169063e60f999f9061049690879087908790600401610c8b565b6000604051808303816000875af11580156104b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103479190810190610e9d565b426363226b0063ffffffff82161015610765576040516211023960e41b81526000600482018190526001600160a01b03848116602484015290917f0000000000000000000000000000000000000000000000000000000000000000909116906301102390906044016020604051808303816000875af1158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190610ff3565b90508061076357604080516001808252818301909252600091816020015b6105f76040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816105a65790505090506040518060c0016040528060008152602001856001600160a01b03168152602001306001600160a01b03168152602001600181526020018463ffffffff1681526020016040518060400160405280601b81526020017f57697468207374726f6e67206c6f76652066726f6d205369736d6f00000000008152508152508160008151811061069b5761069b610b9a565b602090810291909101015260405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106f2908490600401610ab9565b600060405180830381600087803b15801561070c57600080fd5b505af1158015610720573d6000803e3d6000fd5b50506040516001600160a01b03871681527f65566f56ce57729c92989973ff6ac5bdd213f57bf75d7248c4190d6d3634738e9250602001905060405180910390a1505b505b5050565b604051630af411a360e41b81526060906001600160a01b0386169063af411a309061079c90879087908790600401610c8b565b600060405180830381865afa1580156104b5573d6000803e3d6000fd5b60008083601f8401126107cb57600080fd5b50813567ffffffffffffffff8111156107e357600080fd5b6020830191508360208260051b85010111156107fe57600080fd5b9250929050565b6000806000806000806060878903121561081e57600080fd5b863567ffffffffffffffff8082111561083657600080fd5b6108428a838b016107b9565b9098509650602089013591508082111561085b57600080fd5b6108678a838b016107b9565b9096509450604089013591508082111561088057600080fd5b5061088d89828a016107b9565b979a9699509497509295939492505050565b60005b838110156108ba5781810151838201526020016108a2565b838111156108c9576000848401525b50505050565b60208152600060208201835180825260408401915060408160051b8501016020860160005b838110156109d957868303603f19018552815180518085526020918201918086019190600582901b87010160005b828110156109bf57601f1980898403018552855180518452602081015160018060a01b03808216602087015280604084015116604087015250506060810151606085015263ffffffff608082015116608085015260a0810151905060c060a085015280518060c086015261099d8160e087016020850161089f565b6020978801979690960195601f019091169290920160e0019150600101610922565b5060209889019890965094909401935050506001016108f4565b50909695505050505050565b6001600160a01b03811681146109fa57600080fd5b50565b8035610a08816109e5565b919050565b60008060008060608587031215610a2357600080fd5b8435610a2e816109e5565b9350602085013567ffffffffffffffff80821115610a4b57600080fd5b9086019060408289031215610a5f57600080fd5b90935060408601359080821115610a7557600080fd5b818701915087601f830112610a8957600080fd5b813581811115610a9857600080fd5b886020828501011115610aaa57600080fd5b95989497505060200194505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610b7657888303603f19018552815180518452878101516001600160a01b03908116898601528782015116878501526060808201519085015260808082015163ffffffff169085015260a09081015160c091850182905280519185018290529060e090610b5681838801858d0161089f565b96890196601f01601f191694909401909301925090860190600101610ae0565b509098975050505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008235603e19833603018112610bc657600080fd5b9190910192915050565b600060208284031215610be257600080fd5b8135610bed816109e5565b9392505050565b6000808335601e19843603018112610c0b57600080fd5b83018035915067ffffffffffffffff821115610c2657600080fd5b6020019150368190038213156107fe57600080fd5b600060018201610c5b57634e487b7160e01b600052601160045260246000fd5b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006040808352608083018635601e19883603018112610caa57600080fd5b87018035602080830167ffffffffffffffff80841115610cc957600080fd5b8360051b803603831315610cdc57600080fd5b878a018890529584905260a09589018601956000908a01607e1936889003015b86831015610d96578b8903609f190182528435818112610d1b57600080fd5b8801868101358a528a8101358a88015260608082013536839003603e19018112610d4457600080fd5b9091018b8101919088013586811115610d5c57600080fd5b803603831315610d6b57600080fd5b818d8d0152610d7d828d018285610c62565b9b50505094860194506001929092019190850190610cfc565b5050505050610da6818b016109fd565b6001600160a01b0381166060890152945086840381880152505050610dcc818688610c62565b979650505050505050565b60405160c0810167ffffffffffffffff81118282101715610dfa57610dfa610b84565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e2957610e29610b84565b604052919050565b600082601f830112610e4257600080fd5b815167ffffffffffffffff811115610e5c57610e5c610b84565b610e6f601f8201601f1916602001610e00565b818152846020838601011115610e8457600080fd5b610e9582602083016020870161089f565b949350505050565b60006020808385031215610eb057600080fd5b825167ffffffffffffffff80821115610ec857600080fd5b818501915085601f830112610edc57600080fd5b815181811115610eee57610eee610b84565b8060051b610efd858201610e00565b9182528381018501918581019089841115610f1757600080fd5b86860192505b83831015610fe657825185811115610f355760008081fd5b860160c0818c03601f1901811315610f4d5760008081fd5b610f55610dd7565b898301518152604080840151610f6a816109e5565b828c0152606084810151610f7d816109e5565b8083850152506080915081850151818401525060a08085015163ffffffff81168114610fa95760008081fd5b83830152928401519289841115610fc257600091508182fd5b610fd08f8d86880101610e31565b9083015250845250509186019190860190610f1d565b9998505050505050505050565b60006020828403121561100557600080fd5b81518015158114610bed57600080fdfea26469706673582212206eab9b350687ecccafd79868df619e95a4ffb1f38b3590296e186abb24b904f864736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "batchBuildAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])": { - "details": "build the attestations from multiple user requests. Forwards to the build function of targeted attester", - "params": { - "attesters": "Targeted attesters", - "proofDataArray": "Data sent along the request to prove its validity", - "requests": "User requests" - }, - "returns": { - "_0": "attestations Attestations that will be recorded" - } - }, - "batchGenerateAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])": { - "details": "generate multiple attestations at once, to the same destination, generates an early user attestation", - "params": { - "attesters": "Attesters targeted by the attesters", - "proofDataArray": "Data sent with each request", - "requests": "Requests sent to attester" - } - }, - "buildAttestations(address,((uint256,uint256,bytes)[],address),bytes)": { - "details": "build the attestations from a user request targeting a specific attester. Forwards to the build function of targeted attester", - "params": { - "attester": "Targeted attester", - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that will be recorded" - } - }, - "constructor": { - "details": "Constructor", - "params": { - "attestationsRegistryAddress": "Attestations registry contract address" - } - }, - "generateAttestations(address,((uint256,uint256,bytes)[],address),bytes)": { - "details": "Forward a request to an attester and generates an early user attestation", - "params": { - "attester": "Attester targeted by the request", - "proofData": "Data provided to the attester to back the request", - "request": "Request sent to the attester" - } - } - }, - "title": "Front", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "This is the Front contract of the Sismo protocol Behind a proxy, it routes attestations request to the targeted attester and can perform some actions This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference For more information: https://front.docs.sismo.io", - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/mumbai/FrontProxy.json b/deployments/mumbai/FrontProxy.json deleted file mode 100644 index 7a5f41b..0000000 --- a/deployments/mumbai/FrontProxy.json +++ /dev/null @@ -1,250 +0,0 @@ -{ - "address": "0xFD0395fEb7805447e84Eb439a543413ecb22d562", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x177b1d6795df3764a5a84b4137d73730ea1dd284dde6ee68064729eaa7b8caf8", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0xFD0395fEb7805447e84Eb439a543413ecb22d562", - "transactionIndex": 41, - "gasUsed": "583384", - "logsBloom": "0x00000000000000000000000000000000400000000000000008000000000000000000000000000000000000000000000000008000002800000000000000000000000000000000000000000000000002800000000000000000040100000000000000000000000000000000000000000000000000800001000080000000000000000000000000000000000000000000000000000010000000000000000000808000200000000000000000000000000000000000000000000000000040000000004000000020000000000001000000000000000000000400000000100000000008000000000000000000000000000000018000000000000000000020000000100000", - "blockHash": "0x4c0233ab176639c06a43a888b2c254c8e9fca43113b9c77a314a59a3461bed8b", - "transactionHash": "0x177b1d6795df3764a5a84b4137d73730ea1dd284dde6ee68064729eaa7b8caf8", - "logs": [ - { - "transactionIndex": 41, - "blockNumber": 28599995, - "transactionHash": "0x177b1d6795df3764a5a84b4137d73730ea1dd284dde6ee68064729eaa7b8caf8", - "address": "0xFD0395fEb7805447e84Eb439a543413ecb22d562", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000f24e30cb970eb97b07ca1dff1f2b61a981aae2de" - ], - "data": "0x", - "logIndex": 245, - "blockHash": "0x4c0233ab176639c06a43a888b2c254c8e9fca43113b9c77a314a59a3461bed8b" - }, - { - "transactionIndex": 41, - "blockNumber": 28599995, - "transactionHash": "0x177b1d6795df3764a5a84b4137d73730ea1dd284dde6ee68064729eaa7b8caf8", - "address": "0xFD0395fEb7805447e84Eb439a543413ecb22d562", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000246e71bc2a257f4be9c7fad4664e6d7444844adc", - "logIndex": 246, - "blockHash": "0x4c0233ab176639c06a43a888b2c254c8e9fca43113b9c77a314a59a3461bed8b" - }, - { - "transactionIndex": 41, - "blockNumber": 28599995, - "transactionHash": "0x177b1d6795df3764a5a84b4137d73730ea1dd284dde6ee68064729eaa7b8caf8", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000c275dc8be39f50d12f66b6a63629c39da5bae5bd" - ], - "data": "0x00000000000000000000000000000000000000000000000000055ca3b4bc17f800000000000000000000000000000000000000000000000086fd3ba77daaaa4b000000000000000000000000000000000000000000000a08d90cada77dcda4cf00000000000000000000000000000000000000000000000086f7df03c8ee9253000000000000000000000000000000000000000000000a08d9120a4b3289bcc7", - "logIndex": 247, - "blockHash": "0x4c0233ab176639c06a43a888b2c254c8e9fca43113b9c77a314a59a3461bed8b" - } - ], - "blockNumber": 28599995, - "cumulativeGasUsed": "8728377", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf24E30Cb970eb97b07cA1dFf1F2b61A981AaE2DE", - "0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc", - "0x" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/mumbai/HydraS1SoulboundAttester.json b/deployments/mumbai/HydraS1SoulboundAttester.json deleted file mode 100644 index aede697..0000000 --- a/deployments/mumbai/HydraS1SoulboundAttester.json +++ /dev/null @@ -1,1019 +0,0 @@ -{ - "address": "0x76D8Ed0e34555dEF84c2bfff9be85446e8E9fa2A", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "hydraS1VerifierAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "availableRootsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "soulboundCooldownDuration", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "AccountsTreeValueMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "claimLength", - "type": "uint256" - } - ], - "name": "ClaimsLengthDifferentThanOne", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentMapperPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "NotAttestationOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "inputRoot", - "type": "uint256" - } - ], - "name": "RegistryRootMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "ticketData", - "type": "uint256" - } - ], - "name": "TicketFrozen", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedTicketIdentifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ticketIdentifier", - "type": "uint256" - } - ], - "name": "TicketIdentifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "destination", - "type": "address" - }, - { - "internalType": "uint32", - "name": "cooldownStart", - "type": "uint32" - } - ], - "internalType": "struct IHydraS1SoulboundAttester.TicketData", - "name": "ticketData", - "type": "tuple" - } - ], - "name": "TicketUsedAndOnCooldown", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "TicketDestinationUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - } - ], - "name": "TicketSetOnCooldown", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "SOULBOUND_COOLDOWN_DURATION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAvailableRootsRegistry", - "outputs": [ - { - "internalType": "contract IAvailableRootsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentMapperRegistry", - "outputs": [ - { - "internalType": "contract ICommitmentMapperRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getDestinationOfTicket", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getTicketData", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "destination", - "type": "address" - }, - { - "internalType": "uint32", - "name": "cooldownStart", - "type": "uint32" - } - ], - "internalType": "struct IHydraS1SoulboundAttester.TicketData", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract HydraS1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "isTicketOnCooldown", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x7f977d111604fac7d95c4998e96790f6bdefc834edb860dba96112b86e22f892", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x1F38a480d04348708F4b2413fb9AB1F975C176b6", - "transactionIndex": 42, - "gasUsed": "1821131", - "logsBloom": "0x00000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000010000000000000000000008000200000000000000020000000000000000001000000000000000000000000004000000000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000100000", - "blockHash": "0xf02d122fdcb54cfbd733e9ab75450089d94b6287c89947756c1cb33c040d4a4e", - "transactionHash": "0x7f977d111604fac7d95c4998e96790f6bdefc834edb860dba96112b86e22f892", - "logs": [ - { - "transactionIndex": 42, - "blockNumber": 28600035, - "transactionHash": "0x7f977d111604fac7d95c4998e96790f6bdefc834edb860dba96112b86e22f892", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" - ], - "data": "0x00000000000000000000000000000000000000000000000000125f7c53b1970e00000000000000000000000000000000000000000000000082adc81c0122e43400000000000000000000000000000000000000000000167a30e33576abc94b08000000000000000000000000000000000000000000000000829b689fad714d2600000000000000000000000000000000000000000000167a30f594f2ff7ae216", - "logIndex": 250, - "blockHash": "0xf02d122fdcb54cfbd733e9ab75450089d94b6287c89947756c1cb33c040d4a4e" - } - ], - "blockNumber": 28600035, - "cumulativeGasUsed": "10654068", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf576E42E5b2682B8f606B1840c3A982610C29a3f", - "0x34e3CcCF4fF2E297be22465b85F03E5E6D27b41B", - "0x2c17e335d131dfd21238475Dd545B9B29Fb5A27D", - "0x82B54988e4E3a2850501F91AC06CEA82bdb014D3", - "20000001", - "30000000", - "295200" - ], - "numDeployments": 2, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"hydraS1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"availableRootsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"soulboundCooldownDuration\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"AccountsTreeValueMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimLength\",\"type\":\"uint256\"}],\"name\":\"ClaimsLengthDifferentThanOne\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentMapperPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"NotAttestationOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inputRoot\",\"type\":\"uint256\"}],\"name\":\"RegistryRootMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"ticketData\",\"type\":\"uint256\"}],\"name\":\"TicketFrozen\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"cooldownStart\",\"type\":\"uint32\"}],\"internalType\":\"struct IHydraS1SoulboundAttester.TicketData\",\"name\":\"ticketData\",\"type\":\"tuple\"}],\"name\":\"TicketUsedAndOnCooldown\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"}],\"name\":\"TicketSetOnCooldown\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SOULBOUND_COOLDOWN_DURATION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAvailableRootsRegistry\",\"outputs\":[{\"internalType\":\"contract IAvailableRootsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentMapperRegistry\",\"outputs\":[{\"internalType\":\"contract ICommitmentMapperRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getTicketData\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"cooldownStart\",\"type\":\"uint32\"}],\"internalType\":\"struct IHydraS1SoulboundAttester.TicketData\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract HydraS1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"isTicketOnCooldown\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns the actual attestations constructed from the user request\",\"params\":{\"proofData\":\"snark public input as well as snark proof\",\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"availableRootsRegistryAddress\":\"Registry storing the available groups for this attester (e.g roots of registry merkle trees)\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentMapperAddress\":\"commitment mapper's public key registry\",\"hydraS1VerifierAddress\":\"ZK Snark Hydra-S1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getAvailableRootsRegistry()\":{\"details\":\"Getter of Roots Registry Contract\"},\"getCommitmentMapperRegistry()\":{\"details\":\"Getter of Commitment Mapper Registry contract\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getTicketData(uint256)\":{\"details\":\"Getter, returns the data linked to a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Hydra-S1 Verifier contract\"},\"isTicketOnCooldown(uint256)\":{\"details\":\"returns whether a ticket is on cooldown or not\",\"params\":{\"userTicket\":\"ticket used*\"}}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"},\"SOULBOUND_COOLDOWN_DURATION\":{\"details\":\"Getter returns of the duration of the cooldown period after having used a ticket*\"}},\"title\":\"Hydra-S1 Soulbound Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - SoulBound (with cooldown period) A user can chose to delete attestations or generate attestation to a new destination. When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional User will need to wait until the end of the cooldown period before being able to delete or switch destination again One can however know that the former and the new destinations were created using the same userTicket - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol\":\"HydraS1SoulboundAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() initializer {}\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\\n // contract may have been reentered.\\n require(_initializing ? _isConstructor() : !_initialized, \\\"Initializable: contract is already initialized\\\");\\n\\n bool isTopLevelCall = !_initializing;\\n if (isTopLevelCall) {\\n _initializing = true;\\n _initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n _initializing = false;\\n }\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} modifier, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n function _isConstructor() private view returns (bool) {\\n return !Address.isContract(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x4823752b07b8ea4ca971b217e39457930e7cb103c2c91e2a29729e5ca907e4f0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\\n 546002182798634190282541153661423157791776194062719045593389981526666716416\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x70c0b7d96ff1b90538938a4cb2d8086b3aabb4febf1e36cb3f470bfe0b4a9e89\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n \\n \\n **/\\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n virtual\\n returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\\n internal\\n view\\n virtual\\n {\\n if (input.accountsTreeValue != claim.groupId)\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\\n revert RegistryRootMismatch(input.registryRoot);\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n )\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(\\n uint256 /*errorCode*/\\n ) {\\n revert InvalidGroth16Proof('');\\n } catch (\\n bytes memory /*lowLevelData*/\\n ) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0x02708884237382835cd3d3514fdc3603409ce5ea1dc7255a7ceea07dff417c34\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n// todo: explain well what is specific to this attester\\ninterface IHydraS1Base {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x73cff4dcd9c30857859721ea2897be8bb7087c0122f4587acdaa79d8ec0a728d\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SoulboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n// todo: explain well what is specific to this attester\\ninterface IHydraS1SoulboundAttester is IHydraS1Base, IAttester {\\n struct TicketData {\\n address destination;\\n uint32 cooldownStart;\\n }\\n error NotAttestationOwner(uint256 ticket, address sender);\\n error TicketFrozen(uint256 ticketData);\\n error TicketUsedAndOnCooldown(TicketData ticketData);\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n event TicketSetOnCooldown(uint256 ticket);\\n\\n /**\\n * @dev returns whether a ticket is on cooldown or not\\n * @param userTicket ticket used\\n **/\\n function isTicketOnCooldown(uint256 userTicket) external view returns (bool);\\n\\n /**\\n * @dev Getter, returns the data linked to a ticket\\n * @param userTicket ticket used\\n **/\\n function getTicketData(uint256 userTicket) external view returns (TicketData memory);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the duration of the cooldown period after having used a ticket\\n **/\\n function SOULBOUND_COOLDOWN_DURATION() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x253a424fda33fca3de3fabd731e4a4f5d48af14bcd9d7c66302113268fd3a9f5\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // ticketIdentifier\\n // ticket\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (\\n uint256[2] memory,\\n uint256[2][2] memory,\\n uint256[2] memory,\\n uint256[10] memory\\n )\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256[2] memory)\\n {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256)\\n {\\n return self.input[5];\\n }\\n\\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\\n internal\\n pure\\n returns (uint256)\\n {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x596225970aabbc4edb989ee640867c76944e797bfafe5e06dcf37b973480b957\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SoulboundAttester} from '../interfaces/IHydraS1SoulboundAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from '../../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from '../base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Soulbound Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - SoulBound (with cooldown period)\\n * A user can chose to delete attestations or generate attestation to a new destination.\\n * When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional\\n * User will need to wait until the end of the cooldown period before being able to delete or switch destination again\\n * One can however know that the former and the new destinations were created using the same userTicket\\n \\n * - Renewable\\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew or update their attestations\\n **/\\ncontract HydraS1SoulboundAttester is IHydraS1SoulboundAttester, HydraS1Base, Attester {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n uint256 public immutable SOULBOUND_COOLDOWN_DURATION;\\n\\n mapping(uint256 => TicketData) internal _userTicketsData;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n uint256 soulboundCooldownDuration\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n SOULBOUND_COOLDOWN_DURATION = soulboundCooldownDuration;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user attestations request is invalid\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark proof backing the claim\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Throws if user attestations deletion request is not made by its owner\\n * @param attestations attestations to delete\\n */\\n function _verifyAttestationsDeletionRequest(Attestation[] memory attestations, bytes calldata)\\n internal\\n view\\n override\\n {\\n for (uint256 i = 0; i < attestations.length; i++) {\\n uint256 userTicket = abi.decode(attestations[0].extraData, (uint256));\\n if (_userTicketsData[userTicket].destination != msg.sender)\\n revert NotAttestationOwner(userTicket, msg.sender);\\n }\\n }\\n\\n /**\\n * @dev Returns the actual attestations constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark public input as well as snark proof\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n override(IAttester, Attester)\\n returns (Attestation[] memory)\\n {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n // The issuer of attestations is the attester\\n address issuer = address(this);\\n // user sends the ticket as input in the data\\n uint256 userTicket = proofData._getTicket();\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n request.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n abi.encode(userTicket)\\n );\\n\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used, not a renewal, and ticket on cooldown.\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n uint256 userTicket = proofData._getTicket();\\n TicketData memory userTicketData = _userTicketsData[userTicket];\\n\\n if (\\n userTicketData.destination != address(0) && userTicketData.destination != request.destination\\n ) {\\n if (_isOnCooldown(userTicketData)) revert TicketUsedAndOnCooldown(userTicketData);\\n _setTicketOnCooldown(userTicket);\\n }\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n override\\n {\\n // we retrieve the ticketUsed from attestations extraData\\n for (uint256 i = 0; i < attestations.length; i++) {\\n uint256 userTicket = abi.decode(attestations[i].extraData, (uint256));\\n if (_isOnCooldown(_userTicketsData[userTicket]) == true) revert TicketFrozen(userTicket);\\n _userTicketsData[userTicket].destination = address(0);\\n }\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n override\\n returns (uint256)\\n {\\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\\n return ticketIdentifier;\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n /**\\n * @dev Getter, returns the data linked to a ticket\\n * @param userTicket ticket used\\n **/\\n function getTicketData(uint256 userTicket) external view override returns (TicketData memory) {\\n return _getTicketData(userTicket);\\n }\\n\\n /**\\n * @dev returns whether a ticket is on cooldown or not\\n * @param userTicket ticket used\\n **/\\n function isTicketOnCooldown(uint256 userTicket) external view override returns (bool) {\\n return _isOnCooldown(_getTicketData(userTicket));\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _userTicketsData[userTicket].destination = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _setTicketOnCooldown(uint256 userTicket) internal {\\n _userTicketsData[userTicket].cooldownStart = uint32(block.timestamp);\\n emit TicketSetOnCooldown(userTicket);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _userTicketsData[userTicket].destination;\\n }\\n\\n function _isOnCooldown(TicketData memory userTicketData) internal view returns (bool) {\\n return userTicketData.cooldownStart + SOULBOUND_COOLDOWN_DURATION < block.timestamp;\\n }\\n\\n function _getTicketData(uint256 userTicket) internal view returns (TicketData memory) {\\n return _userTicketsData[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0xe72642edf2eecc2886aae203d09ac63f5515a1e51f0ad85b9da410aa59db6261\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n override\\n returns (Attestation[] memory)\\n {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // fetch attestations from the registry\\n Attestation[] memory attestationsToDelete;\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationsToDelete[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestationsToDelete, proofData);\\n\\n _beforeDeleteAttestations(attestationsToDelete, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationsToDelete);\\n\\n _afterDeleteAttestations(attestationsToDelete, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestationsToDelete[i]);\\n }\\n return attestationsToDelete;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n}\\n\",\"keccak256\":\"0x37683c6752d4dc911459084eb191c1045f3bf34e2143f3db3d298a66c971a106\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param attestations Attestations to be deleted\\n */\\n function deleteAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xb5e25bd7e0372c9973e582fb7fe96318c145831a5452d8c79eb848a7464b0297\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) public initializer {\\n _transferOwnership(owner);\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9329ecaf60ffe978c8ab4360e0a8f9bd36e2549e89d672dd39ae80f9a562f9a9\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public initializer {\\n _transferOwnership(owner);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0xacb5347ee1a0e8dc25a1ce3e6fbb427db646e833ff8508909454cad7950418d4\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x87f5035b58936a8458a22f3cf1b3865bd798813310d86af41af74680978c97c8\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0x8d6298b442dde99ee5a9cc989ada6ea808383a08b1e9bb1d4c2b58adc01eec69\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101606040523480156200001257600080fd5b506040516200218c3803806200218c833981016040819052620000359162000088565b6001600160a01b0395861660805293851660c05291841660a0529390921660e05261010092909252610120526101405262000102565b80516001600160a01b03811681146200008357600080fd5b919050565b600080600080600080600060e0888a031215620000a457600080fd5b620000af886200006b565b9650620000bf602089016200006b565b9550620000cf604089016200006b565b9450620000df606089016200006b565b93506080880151925060a0880151915060c0880151905092959891949750929550565b60805160a05160c05160e051610100516101205161014051611ff16200019b6000396000818161013e01526108d30152600081816101ad01526103c901526000818161017301526103a101526000818161023a015281816104e40152818161066601526107a00152600081816101d10152610ec701526000818160d60152610f6301526000818161011501526110be0152611ff16000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063918447af1161008c578063bfa6658511610066578063bfa6658514610238578063c776adde1461025e578063d9895e6a14610271578063e60f999f146102ae57600080fd5b8063918447af146101cf57806392cf369d146101f5578063af411a301461021857600080fd5b80632254f98e146100d457806346657fe9146101135780634e5cf9331461013957806354846d7a1461016e57806363e4afc2146101955780637000b051146101a8575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161010a565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b6100f66101a3366004611537565b6102c1565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b610208610203366004611537565b6102e0565b604051901515815260200161010a565b61022b610226366004611599565b6102f3565b60405161010a91906116c5565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b61022b61026c36600461174c565b6104ce565b61028461027f366004611537565b610745565b6040805182516001600160a01b0316815260209283015163ffffffff16928101929092520161010a565b61022b6102bc366004611599565b610762565b6000818152600160205260408120546001600160a01b03165b92915050565b60006102da6102ee8361087e565b6108ce565b60606000610308610303866118af565b61090e565b60408051600180825281830190925291925060009190816020015b6103746040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816103235750506060830151519091506000906103c5906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611a3f565b90507f000000000000000000000000000000000000000000000000000000000000000081111561041057604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b30600061041d8888610993565b90506040518060c001604052808481526020018a60200160208101906104439190611a57565b6001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff1681526020018260405160200161049191815260200190565b604051602081830303815290604052815250846000815181106104b6576104b6611a74565b60209081029190910101525091979650505050505050565b60608060005b86811015610638576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78d8d8881811061052357610523611a74565b905060200201358c6040518363ffffffff1660e01b815260040161055a9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610577573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261059f9190810190611a9e565b93509350935093506040518060c001604052808d8d888181106105c4576105c4611a74565b9050602002013581526020018b6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061061657610616611a74565b602002602001018190525050505050808061063090611b4e565b9150506104d4565b506106448185856109b8565b61064f818585610a53565b6040516373e4ca1b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e7c994369061069b9084906004016116c5565b600060405180830381600087803b1580156106b557600080fd5b505af11580156106c9573d6000803e3d6000fd5b5050505060005b8681101561073a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070b5761070b611a74565b60200260200101516040516107209190611b67565b60405180910390a18061073281611b4e565b9150506106d0565b509695505050505050565b60408051808201909152600080825260208201526102da8261087e565b606061076f848484610b29565b600061077c8585856102f3565b9050610789858585610b71565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107d59084906004016116c5565b600060405180830381600087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b5050505060005b8151811015610875577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061084657610846611a74565b602002602001015160405161085b9190611b67565b60405180910390a18061086d81611b4e565b91505061080a565b50949350505050565b6040805180820190915260008082526020820152506000908152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff169082015290565b6000427f0000000000000000000000000000000000000000000000000000000000000000836020015163ffffffff166109079190611a3f565b1092915050565b610916611463565b6000826000015160008151811061092f5761092f611a74565b6020026020010151905061094281610c65565b6000816040015180602001905181019061095c9190611b8a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b6000806109a283850185611cbb565b905060006109af82610ca9565b95945050505050565b60005b8351811015610a4d576000846000815181106109d9576109d9611a74565b602002602001015160a001518060200190518101906109f89190611d8c565b6000818152600160205260409020549091506001600160a01b03163314610a3a5760405162f8a2bf60e81b815260048101829052336024820152604401610407565b5080610a4581611b4e565b9150506109bb565b50505050565b60005b8351811015610a4d576000848281518110610a7357610a73611a74565b602002602001015160a00151806020019051810190610a929190611d8c565b6000818152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff1690820152909150610ad6906108ce565b1515600103610afb57604051632fcfdde360e11b815260048101829052602401610407565b600090815260016020526040902080546001600160a01b031916905580610b2181611b4e565b915050610a56565b6000610b3782840184611cbb565b90506000610b4482610cbf565b90506000610b54610303876118af565b9050610b608183610d69565b610b6983611094565b505050505050565b6000610b7d8383610993565b6000818152600160209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910463ffffffff16918301919091529192509015801590610bf15750610bd76040860160208701611a57565b6001600160a01b031681600001516001600160a01b031614155b15610c4257610bff816108ce565b15610c3957604051633f8ffaa560e01b815281516001600160a01b03166004820152602082015163ffffffff166024820152604401610407565b610c428261122d565b610c5b82610c566040880160208901611a57565b61128e565b5050505050565b50565b6000610c7482604001516112f4565b82519091508114610ca55781516040516337e3d1ab60e01b8152610407918391600401918252602082015260400190565b5050565b602081015160009060065b602002015192915050565b610cc76114c6565b604051806101200160405280610cdc84611329565b6001600160a01b03168152602001610cf384611337565b8152602001610d0184611346565b8152602001610d0f84611355565b8152602001610d1d84610ca9565b8152602001610d2b84611364565b8152602001610d3984611373565b8152602001610d518460200151610120015160011490565b15158152602001610d6184611382565b905292915050565b815160c082015114610d9e57815160c082015160405163fe405c7760e01b815260048101929092526024820152604401610407565b81606001516040015115158160e00151151503610de957606082015160409081015160e08301519151634629f1b560e11b815290151560048201529015156024820152604401610407565b81604001516001600160a01b031681600001516001600160a01b031614610e3d57604082810151825191516370a8d99b60e11b81526001600160a01b03918216600482015291166024820152604401610407565b46816020015114610e70576020810151604051630432cec160e31b81524660048201526024810191909152604401610407565b81602001518160a0015114610eab57602082015160a0820151604051630626ade360e41b815260048101929092526024820152604401610407565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a9190611da5565b610f5f57806040015160405163cbfe7bc360e01b815260040161040791815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe29190611dc0565b80516101008401515191925014158061100957506020808201516101008401519091015114155b15611053578051602080830151610100850151805192015160405163318d812b60e01b81526004810194909452602484019190915260448301919091526064820152608401610407565b600061105e846113da565b905080836060015114610a4d5760608301516040516377bb6d2760e11b8152610407918391600401918252602082015260400190565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946110f794909392909190600401611e3c565b602060405180830381865afa925050508015611130575060408051601f3d908101601f1916820190925261112d91810190611da5565b60015b6112065761113c611ec0565b806308c379a0036111755750611150611edc565b8061115b57506111b4565b8060405162dd577760e81b81526004016104079190611f66565b634e487b71036111b457611187611f79565b9061119257506111b4565b60405162dd577760e81b81526020600482015260006024820152604401610407565b3d8080156111de576040519150601f19603f3d011682016040523d82523d6000602084013e6111e3565b606091505b5060405162dd577760e81b81526020600482015260006024820152604401610407565b80610ca55760405162dd577760e81b81526020600482015260006024820152604401610407565b600081815260016020908152604091829020805463ffffffff60a01b1916600160a01b4263ffffffff160217905590518281527f49ab97b1dc68eafe79e6e7f8ff996d00259888e84cb401cf9ec8d39adf7ab196910160405180910390a150565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102da907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611f99565b602081015160009081610cb4565b60208101516000906001610cb4565b60208101516000906004610cb4565b60208101516000906005610cb4565b60208101516000906007610cb4565b60208101516000906008610cb4565b61138a611519565b604051806040016040528083602001516002600a81106113ac576113ac611a74565b6020020151815260200183602001516003600a81106113cd576113cd611a74565b6020020151905292915050565b6000806113f8308460600151600001516001600160801b03166113ff565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113f89190611f99565b6040518060800160405280600081526020016000815260200160006001600160a01b031681526020016114c1604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114c15b60405180604001604052806002906020820280368337509192915050565b60006020828403121561154957600080fd5b5035919050565b60008083601f84011261156257600080fd5b50813567ffffffffffffffff81111561157a57600080fd5b60208301915083602082850101111561159257600080fd5b9250929050565b6000806000604084860312156115ae57600080fd5b833567ffffffffffffffff808211156115c657600080fd5b90850190604082880312156115da57600080fd5b909350602085013590808211156115f057600080fd5b506115fd86828701611550565b9497909650939450505050565b60005b8381101561162557818101518382015260200161160d565b83811115610a4d5750506000910152565b6000815180845261164e81602086016020860161160a565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a08501526116bd60c0850182611636565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561171a57603f19888603018452611708858351611662565b945092850192908501906001016116ec565b5092979650505050505050565b6001600160a01b0381168114610c6257600080fd5b803561174781611727565b919050565b60008060008060006060868803121561176457600080fd5b853567ffffffffffffffff8082111561177c57600080fd5b818801915088601f83011261179057600080fd5b81358181111561179f57600080fd5b8960208260051b85010111156117b457600080fd5b602083019750809650506117ca6020890161173c565b945060408801359150808211156117e057600080fd5b506117ed88828901611550565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b6040810181811067ffffffffffffffff82111715611834576118346117fe565b60405250565b6060810181811067ffffffffffffffff82111715611834576118346117fe565b601f8201601f1916810167ffffffffffffffff81118282101715611880576118806117fe565b6040525050565b600067ffffffffffffffff8211156118a1576118a16117fe565b50601f01601f191660200190565b600060408083360312156118c257600080fd5b80516118cd81611814565b833567ffffffffffffffff808211156118e557600080fd5b9085019036601f8301126118f857600080fd5b813560208282111561190c5761190c6117fe565b8160051b865161191e8383018261185a565b9283528481018201928281013685111561193757600080fd5b83870192505b84831015611a0b578235868111156119555760008081fd5b8701606036829003601f190181131561196e5760008081fd5b8a516119798161183a565b8287013581528b8301358188015290820135908882111561199a5760008081fd5b9181019136603f8401126119b057600091508182fd5b8683013591506119bf82611887565b8c516119cb828261185a565b838152368e8587010111156119e257600091508182fd5b838e86018a830137600093810189019390935250808c019190915282525091830191830161193d565b50865250611a1a88820161173c565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611a5257611a52611a29565b500190565b600060208284031215611a6957600080fd5b81356113f881611727565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff8116811461174757600080fd5b60008060008060808587031215611ab457600080fd5b8451611abf81611727565b60208601519094509250611ad560408601611a8a565b9150606085015167ffffffffffffffff811115611af157600080fd5b8501601f81018713611b0257600080fd5b8051611b0d81611887565b604051611b1a828261185a565b828152896020848601011115611b2f57600080fd5b611b4083602083016020870161160a565b969995985093965050505050565b600060018201611b6057611b60611a29565b5060010190565b6020815260006113f86020830184611662565b8051801515811461174757600080fd5b600060608284031215611b9c57600080fd5b6040516060810181811067ffffffffffffffff82111715611bbf57611bbf6117fe565b60405282516001600160801b0381168114611bd957600080fd5b8152611be760208401611a8a565b6020820152611bf860408401611b7a565b60408201529392505050565b600082601f830112611c1557600080fd5b604051611c2181611814565b806040840185811115611c3357600080fd5b845b81811015611c4d578035835260209283019201611c35565b509195945050505050565b600082601f830112611c6957600080fd5b60405161014080820182811067ffffffffffffffff82111715611c8e57611c8e6117fe565b60405283018185821115611ca157600080fd5b845b82811015611c4d578035825260209182019101611ca3565b6000818303610240811215611ccf57600080fd5b60408051611cdc81611814565b61010080841215611cec57600080fd5b82519350611cf98461183a565b611d038787611c04565b845286605f870112611d1457600080fd5b8251611d1f81611814565b8060c0880189811115611d3157600080fd5b8589015b81811015611d5657611d478b82611c04565b83526020909201918601611d35565b50826020880152611d678a82611c04565b86880152505050838252611d7d87828801611c58565b60208301525095945050505050565b600060208284031215611d9e57600080fd5b5051919050565b600060208284031215611db757600080fd5b6113f882611b7a565b600060408284031215611dd257600080fd5b82601f830112611de157600080fd5b604051611ded81611814565b806040840185811115611dff57600080fd5b845b81811015611c4d578051835260209283019201611e01565b8060005b6002811015610a4d578151845260209384019390910190600101611e1d565b6102408101611e4b8287611e19565b60408083018660005b6002811015611e7b57611e68838351611e19565b9183019160209190910190600101611e54565b50505050611e8c60c0830185611e19565b61010082018360005b600a811015611eb4578151835260209283019290910190600101611e95565b50505095945050505050565b600060033d1115611ed95760046000803e5060005160e01c5b90565b600060443d1015611eea5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611f1a57505050505090565b8285019150815181811115611f325750505050505090565b843d8701016020828501011115611f4c5750505050505090565b611f5b6020828601018761185a565b509095945050505050565b6020815260006113f86020830184611636565b60008060233d1115611f95576020600460003e50506000516001905b9091565b600082611fb657634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220f1374674d2143dc1e1f8e0666c58769f2e4bc209220c094f513f5b717a358ad464736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063918447af1161008c578063bfa6658511610066578063bfa6658514610238578063c776adde1461025e578063d9895e6a14610271578063e60f999f146102ae57600080fd5b8063918447af146101cf57806392cf369d146101f5578063af411a301461021857600080fd5b80632254f98e146100d457806346657fe9146101135780634e5cf9331461013957806354846d7a1461016e57806363e4afc2146101955780637000b051146101a8575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161010a565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b6100f66101a3366004611537565b6102c1565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b610208610203366004611537565b6102e0565b604051901515815260200161010a565b61022b610226366004611599565b6102f3565b60405161010a91906116c5565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b61022b61026c36600461174c565b6104ce565b61028461027f366004611537565b610745565b6040805182516001600160a01b0316815260209283015163ffffffff16928101929092520161010a565b61022b6102bc366004611599565b610762565b6000818152600160205260408120546001600160a01b03165b92915050565b60006102da6102ee8361087e565b6108ce565b60606000610308610303866118af565b61090e565b60408051600180825281830190925291925060009190816020015b6103746040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816103235750506060830151519091506000906103c5906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611a3f565b90507f000000000000000000000000000000000000000000000000000000000000000081111561041057604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b30600061041d8888610993565b90506040518060c001604052808481526020018a60200160208101906104439190611a57565b6001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff1681526020018260405160200161049191815260200190565b604051602081830303815290604052815250846000815181106104b6576104b6611a74565b60209081029190910101525091979650505050505050565b60608060005b86811015610638576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78d8d8881811061052357610523611a74565b905060200201358c6040518363ffffffff1660e01b815260040161055a9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610577573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261059f9190810190611a9e565b93509350935093506040518060c001604052808d8d888181106105c4576105c4611a74565b9050602002013581526020018b6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061061657610616611a74565b602002602001018190525050505050808061063090611b4e565b9150506104d4565b506106448185856109b8565b61064f818585610a53565b6040516373e4ca1b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e7c994369061069b9084906004016116c5565b600060405180830381600087803b1580156106b557600080fd5b505af11580156106c9573d6000803e3d6000fd5b5050505060005b8681101561073a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070b5761070b611a74565b60200260200101516040516107209190611b67565b60405180910390a18061073281611b4e565b9150506106d0565b509695505050505050565b60408051808201909152600080825260208201526102da8261087e565b606061076f848484610b29565b600061077c8585856102f3565b9050610789858585610b71565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107d59084906004016116c5565b600060405180830381600087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b5050505060005b8151811015610875577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061084657610846611a74565b602002602001015160405161085b9190611b67565b60405180910390a18061086d81611b4e565b91505061080a565b50949350505050565b6040805180820190915260008082526020820152506000908152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff169082015290565b6000427f0000000000000000000000000000000000000000000000000000000000000000836020015163ffffffff166109079190611a3f565b1092915050565b610916611463565b6000826000015160008151811061092f5761092f611a74565b6020026020010151905061094281610c65565b6000816040015180602001905181019061095c9190611b8a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b6000806109a283850185611cbb565b905060006109af82610ca9565b95945050505050565b60005b8351811015610a4d576000846000815181106109d9576109d9611a74565b602002602001015160a001518060200190518101906109f89190611d8c565b6000818152600160205260409020549091506001600160a01b03163314610a3a5760405162f8a2bf60e81b815260048101829052336024820152604401610407565b5080610a4581611b4e565b9150506109bb565b50505050565b60005b8351811015610a4d576000848281518110610a7357610a73611a74565b602002602001015160a00151806020019051810190610a929190611d8c565b6000818152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff1690820152909150610ad6906108ce565b1515600103610afb57604051632fcfdde360e11b815260048101829052602401610407565b600090815260016020526040902080546001600160a01b031916905580610b2181611b4e565b915050610a56565b6000610b3782840184611cbb565b90506000610b4482610cbf565b90506000610b54610303876118af565b9050610b608183610d69565b610b6983611094565b505050505050565b6000610b7d8383610993565b6000818152600160209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910463ffffffff16918301919091529192509015801590610bf15750610bd76040860160208701611a57565b6001600160a01b031681600001516001600160a01b031614155b15610c4257610bff816108ce565b15610c3957604051633f8ffaa560e01b815281516001600160a01b03166004820152602082015163ffffffff166024820152604401610407565b610c428261122d565b610c5b82610c566040880160208901611a57565b61128e565b5050505050565b50565b6000610c7482604001516112f4565b82519091508114610ca55781516040516337e3d1ab60e01b8152610407918391600401918252602082015260400190565b5050565b602081015160009060065b602002015192915050565b610cc76114c6565b604051806101200160405280610cdc84611329565b6001600160a01b03168152602001610cf384611337565b8152602001610d0184611346565b8152602001610d0f84611355565b8152602001610d1d84610ca9565b8152602001610d2b84611364565b8152602001610d3984611373565b8152602001610d518460200151610120015160011490565b15158152602001610d6184611382565b905292915050565b815160c082015114610d9e57815160c082015160405163fe405c7760e01b815260048101929092526024820152604401610407565b81606001516040015115158160e00151151503610de957606082015160409081015160e08301519151634629f1b560e11b815290151560048201529015156024820152604401610407565b81604001516001600160a01b031681600001516001600160a01b031614610e3d57604082810151825191516370a8d99b60e11b81526001600160a01b03918216600482015291166024820152604401610407565b46816020015114610e70576020810151604051630432cec160e31b81524660048201526024810191909152604401610407565b81602001518160a0015114610eab57602082015160a0820151604051630626ade360e41b815260048101929092526024820152604401610407565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a9190611da5565b610f5f57806040015160405163cbfe7bc360e01b815260040161040791815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe29190611dc0565b80516101008401515191925014158061100957506020808201516101008401519091015114155b15611053578051602080830151610100850151805192015160405163318d812b60e01b81526004810194909452602484019190915260448301919091526064820152608401610407565b600061105e846113da565b905080836060015114610a4d5760608301516040516377bb6d2760e11b8152610407918391600401918252602082015260400190565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946110f794909392909190600401611e3c565b602060405180830381865afa925050508015611130575060408051601f3d908101601f1916820190925261112d91810190611da5565b60015b6112065761113c611ec0565b806308c379a0036111755750611150611edc565b8061115b57506111b4565b8060405162dd577760e81b81526004016104079190611f66565b634e487b71036111b457611187611f79565b9061119257506111b4565b60405162dd577760e81b81526020600482015260006024820152604401610407565b3d8080156111de576040519150601f19603f3d011682016040523d82523d6000602084013e6111e3565b606091505b5060405162dd577760e81b81526020600482015260006024820152604401610407565b80610ca55760405162dd577760e81b81526020600482015260006024820152604401610407565b600081815260016020908152604091829020805463ffffffff60a01b1916600160a01b4263ffffffff160217905590518281527f49ab97b1dc68eafe79e6e7f8ff996d00259888e84cb401cf9ec8d39adf7ab196910160405180910390a150565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102da907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611f99565b602081015160009081610cb4565b60208101516000906001610cb4565b60208101516000906004610cb4565b60208101516000906005610cb4565b60208101516000906007610cb4565b60208101516000906008610cb4565b61138a611519565b604051806040016040528083602001516002600a81106113ac576113ac611a74565b6020020151815260200183602001516003600a81106113cd576113cd611a74565b6020020151905292915050565b6000806113f8308460600151600001516001600160801b03166113ff565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113f89190611f99565b6040518060800160405280600081526020016000815260200160006001600160a01b031681526020016114c1604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114c15b60405180604001604052806002906020820280368337509192915050565b60006020828403121561154957600080fd5b5035919050565b60008083601f84011261156257600080fd5b50813567ffffffffffffffff81111561157a57600080fd5b60208301915083602082850101111561159257600080fd5b9250929050565b6000806000604084860312156115ae57600080fd5b833567ffffffffffffffff808211156115c657600080fd5b90850190604082880312156115da57600080fd5b909350602085013590808211156115f057600080fd5b506115fd86828701611550565b9497909650939450505050565b60005b8381101561162557818101518382015260200161160d565b83811115610a4d5750506000910152565b6000815180845261164e81602086016020860161160a565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a08501526116bd60c0850182611636565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561171a57603f19888603018452611708858351611662565b945092850192908501906001016116ec565b5092979650505050505050565b6001600160a01b0381168114610c6257600080fd5b803561174781611727565b919050565b60008060008060006060868803121561176457600080fd5b853567ffffffffffffffff8082111561177c57600080fd5b818801915088601f83011261179057600080fd5b81358181111561179f57600080fd5b8960208260051b85010111156117b457600080fd5b602083019750809650506117ca6020890161173c565b945060408801359150808211156117e057600080fd5b506117ed88828901611550565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b6040810181811067ffffffffffffffff82111715611834576118346117fe565b60405250565b6060810181811067ffffffffffffffff82111715611834576118346117fe565b601f8201601f1916810167ffffffffffffffff81118282101715611880576118806117fe565b6040525050565b600067ffffffffffffffff8211156118a1576118a16117fe565b50601f01601f191660200190565b600060408083360312156118c257600080fd5b80516118cd81611814565b833567ffffffffffffffff808211156118e557600080fd5b9085019036601f8301126118f857600080fd5b813560208282111561190c5761190c6117fe565b8160051b865161191e8383018261185a565b9283528481018201928281013685111561193757600080fd5b83870192505b84831015611a0b578235868111156119555760008081fd5b8701606036829003601f190181131561196e5760008081fd5b8a516119798161183a565b8287013581528b8301358188015290820135908882111561199a5760008081fd5b9181019136603f8401126119b057600091508182fd5b8683013591506119bf82611887565b8c516119cb828261185a565b838152368e8587010111156119e257600091508182fd5b838e86018a830137600093810189019390935250808c019190915282525091830191830161193d565b50865250611a1a88820161173c565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611a5257611a52611a29565b500190565b600060208284031215611a6957600080fd5b81356113f881611727565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff8116811461174757600080fd5b60008060008060808587031215611ab457600080fd5b8451611abf81611727565b60208601519094509250611ad560408601611a8a565b9150606085015167ffffffffffffffff811115611af157600080fd5b8501601f81018713611b0257600080fd5b8051611b0d81611887565b604051611b1a828261185a565b828152896020848601011115611b2f57600080fd5b611b4083602083016020870161160a565b969995985093965050505050565b600060018201611b6057611b60611a29565b5060010190565b6020815260006113f86020830184611662565b8051801515811461174757600080fd5b600060608284031215611b9c57600080fd5b6040516060810181811067ffffffffffffffff82111715611bbf57611bbf6117fe565b60405282516001600160801b0381168114611bd957600080fd5b8152611be760208401611a8a565b6020820152611bf860408401611b7a565b60408201529392505050565b600082601f830112611c1557600080fd5b604051611c2181611814565b806040840185811115611c3357600080fd5b845b81811015611c4d578035835260209283019201611c35565b509195945050505050565b600082601f830112611c6957600080fd5b60405161014080820182811067ffffffffffffffff82111715611c8e57611c8e6117fe565b60405283018185821115611ca157600080fd5b845b82811015611c4d578035825260209182019101611ca3565b6000818303610240811215611ccf57600080fd5b60408051611cdc81611814565b61010080841215611cec57600080fd5b82519350611cf98461183a565b611d038787611c04565b845286605f870112611d1457600080fd5b8251611d1f81611814565b8060c0880189811115611d3157600080fd5b8589015b81811015611d5657611d478b82611c04565b83526020909201918601611d35565b50826020880152611d678a82611c04565b86880152505050838252611d7d87828801611c58565b60208301525095945050505050565b600060208284031215611d9e57600080fd5b5051919050565b600060208284031215611db757600080fd5b6113f882611b7a565b600060408284031215611dd257600080fd5b82601f830112611de157600080fd5b604051611ded81611814565b806040840185811115611dff57600080fd5b845b81811015611c4d578051835260209283019201611e01565b8060005b6002811015610a4d578151845260209384019390910190600101611e1d565b6102408101611e4b8287611e19565b60408083018660005b6002811015611e7b57611e68838351611e19565b9183019160209190910190600101611e54565b50505050611e8c60c0830185611e19565b61010082018360005b600a811015611eb4578151835260209283019290910190600101611e95565b50505095945050505050565b600060033d1115611ed95760046000803e5060005160e01c5b90565b600060443d1015611eea5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611f1a57505050505090565b8285019150815181811115611f325750505050505090565b843d8701016020828501011115611f4c5750505050505090565b611f5b6020828601018761185a565b509095945050505050565b6020815260006113f86020830184611636565b60008060233d1115611f95576020600460003e50506000516001905b9091565b600082611fb657634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220f1374674d2143dc1e1f8e0666c58769f2e4bc209220c094f513f5b717a358ad464736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns the actual attestations constructed from the user request", - "params": { - "proofData": "snark public input as well as snark proof", - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "availableRootsRegistryAddress": "Registry storing the available groups for this attester (e.g roots of registry merkle trees)", - "collectionIdFirst": "Id of the first collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last collection in which the attester is supposed to record", - "commitmentMapperAddress": "commitment mapper's public key registry", - "hydraS1VerifierAddress": "ZK Snark Hydra-S1 Verifier contract" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getAvailableRootsRegistry()": { - "details": "Getter of Roots Registry Contract" - }, - "getCommitmentMapperRegistry()": { - "details": "Getter of Commitment Mapper Registry contract" - }, - "getDestinationOfTicket(uint256)": { - "details": "Getter, returns the last attestation destination of a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getTicketData(uint256)": { - "details": "Getter, returns the data linked to a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getVerifier()": { - "details": "Getter of Hydra-S1 Verifier contract" - }, - "isTicketOnCooldown(uint256)": { - "details": "returns whether a ticket is on cooldown or not", - "params": { - "userTicket": "ticket used*" - } - } - }, - "stateVariables": { - "AUTHORIZED_COLLECTION_ID_FIRST": { - "details": "Getter returns of the first collection in which the attester is supposed to record*" - }, - "AUTHORIZED_COLLECTION_ID_LAST": { - "details": "Getter returns of the last collection in which the attester is supposed to record*" - }, - "SOULBOUND_COOLDOWN_DURATION": { - "details": "Getter returns of the duration of the cooldown period after having used a ticket*" - } - }, - "title": "Hydra-S1 Soulbound Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - SoulBound (with cooldown period) A user can chose to delete attestations or generate attestation to a new destination. When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional User will need to wait until the end of the cooldown period before being able to delete or switch destination again One can however know that the former and the new destinations were created using the same userTicket - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 936, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 939, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 7701, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "_userTicketsData", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_struct(TicketData)7128_storage)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_struct(TicketData)7128_storage)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => struct IHydraS1SoulboundAttester.TicketData)", - "numberOfBytes": "32", - "value": "t_struct(TicketData)7128_storage" - }, - "t_struct(TicketData)7128_storage": { - "encoding": "inplace", - "label": "struct IHydraS1SoulboundAttester.TicketData", - "members": [ - { - "astId": 7125, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "destination", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 7127, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "cooldownStart", - "offset": 20, - "slot": "0", - "type": "t_uint32" - } - ], - "numberOfBytes": "32" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} \ No newline at end of file diff --git a/deployments/mumbai/HydraS1SoulboundAttesterImplem.json b/deployments/mumbai/HydraS1SoulboundAttesterImplem.json deleted file mode 100644 index b269023..0000000 --- a/deployments/mumbai/HydraS1SoulboundAttesterImplem.json +++ /dev/null @@ -1,1019 +0,0 @@ -{ - "address": "0x1F38a480d04348708F4b2413fb9AB1F975C176b6", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "hydraS1VerifierAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "availableRootsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "soulboundCooldownDuration", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "AccountsTreeValueMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "claimLength", - "type": "uint256" - } - ], - "name": "ClaimsLengthDifferentThanOne", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentMapperPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "NotAttestationOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "inputRoot", - "type": "uint256" - } - ], - "name": "RegistryRootMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "ticketData", - "type": "uint256" - } - ], - "name": "TicketFrozen", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedTicketIdentifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ticketIdentifier", - "type": "uint256" - } - ], - "name": "TicketIdentifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "destination", - "type": "address" - }, - { - "internalType": "uint32", - "name": "cooldownStart", - "type": "uint32" - } - ], - "internalType": "struct IHydraS1SoulboundAttester.TicketData", - "name": "ticketData", - "type": "tuple" - } - ], - "name": "TicketUsedAndOnCooldown", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "TicketDestinationUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - } - ], - "name": "TicketSetOnCooldown", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "SOULBOUND_COOLDOWN_DURATION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAvailableRootsRegistry", - "outputs": [ - { - "internalType": "contract IAvailableRootsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentMapperRegistry", - "outputs": [ - { - "internalType": "contract ICommitmentMapperRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getDestinationOfTicket", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getTicketData", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "destination", - "type": "address" - }, - { - "internalType": "uint32", - "name": "cooldownStart", - "type": "uint32" - } - ], - "internalType": "struct IHydraS1SoulboundAttester.TicketData", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract HydraS1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "isTicketOnCooldown", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x7f977d111604fac7d95c4998e96790f6bdefc834edb860dba96112b86e22f892", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x1F38a480d04348708F4b2413fb9AB1F975C176b6", - "transactionIndex": 42, - "gasUsed": "1821131", - "logsBloom": "0x00000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000010000000000000000000008000200000000000000020000000000000000001000000000000000000000000004000000000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000100000", - "blockHash": "0xf02d122fdcb54cfbd733e9ab75450089d94b6287c89947756c1cb33c040d4a4e", - "transactionHash": "0x7f977d111604fac7d95c4998e96790f6bdefc834edb860dba96112b86e22f892", - "logs": [ - { - "transactionIndex": 42, - "blockNumber": 28600035, - "transactionHash": "0x7f977d111604fac7d95c4998e96790f6bdefc834edb860dba96112b86e22f892", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" - ], - "data": "0x00000000000000000000000000000000000000000000000000125f7c53b1970e00000000000000000000000000000000000000000000000082adc81c0122e43400000000000000000000000000000000000000000000167a30e33576abc94b08000000000000000000000000000000000000000000000000829b689fad714d2600000000000000000000000000000000000000000000167a30f594f2ff7ae216", - "logIndex": 250, - "blockHash": "0xf02d122fdcb54cfbd733e9ab75450089d94b6287c89947756c1cb33c040d4a4e" - } - ], - "blockNumber": 28600035, - "cumulativeGasUsed": "10654068", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf576E42E5b2682B8f606B1840c3A982610C29a3f", - "0x34e3CcCF4fF2E297be22465b85F03E5E6D27b41B", - "0x2c17e335d131dfd21238475Dd545B9B29Fb5A27D", - "0x82B54988e4E3a2850501F91AC06CEA82bdb014D3", - "20000001", - "30000000", - "295200" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"hydraS1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"availableRootsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"soulboundCooldownDuration\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"AccountsTreeValueMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimLength\",\"type\":\"uint256\"}],\"name\":\"ClaimsLengthDifferentThanOne\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentMapperPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"NotAttestationOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inputRoot\",\"type\":\"uint256\"}],\"name\":\"RegistryRootMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"ticketData\",\"type\":\"uint256\"}],\"name\":\"TicketFrozen\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"cooldownStart\",\"type\":\"uint32\"}],\"internalType\":\"struct IHydraS1SoulboundAttester.TicketData\",\"name\":\"ticketData\",\"type\":\"tuple\"}],\"name\":\"TicketUsedAndOnCooldown\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"}],\"name\":\"TicketSetOnCooldown\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SOULBOUND_COOLDOWN_DURATION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAvailableRootsRegistry\",\"outputs\":[{\"internalType\":\"contract IAvailableRootsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentMapperRegistry\",\"outputs\":[{\"internalType\":\"contract ICommitmentMapperRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getTicketData\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"cooldownStart\",\"type\":\"uint32\"}],\"internalType\":\"struct IHydraS1SoulboundAttester.TicketData\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract HydraS1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"isTicketOnCooldown\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns the actual attestations constructed from the user request\",\"params\":{\"proofData\":\"snark public input as well as snark proof\",\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"availableRootsRegistryAddress\":\"Registry storing the available groups for this attester (e.g roots of registry merkle trees)\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentMapperAddress\":\"commitment mapper's public key registry\",\"hydraS1VerifierAddress\":\"ZK Snark Hydra-S1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getAvailableRootsRegistry()\":{\"details\":\"Getter of Roots Registry Contract\"},\"getCommitmentMapperRegistry()\":{\"details\":\"Getter of Commitment Mapper Registry contract\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getTicketData(uint256)\":{\"details\":\"Getter, returns the data linked to a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Hydra-S1 Verifier contract\"},\"isTicketOnCooldown(uint256)\":{\"details\":\"returns whether a ticket is on cooldown or not\",\"params\":{\"userTicket\":\"ticket used*\"}}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"},\"SOULBOUND_COOLDOWN_DURATION\":{\"details\":\"Getter returns of the duration of the cooldown period after having used a ticket*\"}},\"title\":\"Hydra-S1 Soulbound Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - SoulBound (with cooldown period) A user can chose to delete attestations or generate attestation to a new destination. When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional User will need to wait until the end of the cooldown period before being able to delete or switch destination again One can however know that the former and the new destinations were created using the same userTicket - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol\":\"HydraS1SoulboundAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() initializer {}\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\\n // contract may have been reentered.\\n require(_initializing ? _isConstructor() : !_initialized, \\\"Initializable: contract is already initialized\\\");\\n\\n bool isTopLevelCall = !_initializing;\\n if (isTopLevelCall) {\\n _initializing = true;\\n _initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n _initializing = false;\\n }\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} modifier, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n function _isConstructor() private view returns (bool) {\\n return !Address.isContract(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x4823752b07b8ea4ca971b217e39457930e7cb103c2c91e2a29729e5ca907e4f0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\\n 546002182798634190282541153661423157791776194062719045593389981526666716416\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x70c0b7d96ff1b90538938a4cb2d8086b3aabb4febf1e36cb3f470bfe0b4a9e89\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n \\n \\n **/\\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n virtual\\n returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\\n internal\\n view\\n virtual\\n {\\n if (input.accountsTreeValue != claim.groupId)\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\\n revert RegistryRootMismatch(input.registryRoot);\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n )\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(\\n uint256 /*errorCode*/\\n ) {\\n revert InvalidGroth16Proof('');\\n } catch (\\n bytes memory /*lowLevelData*/\\n ) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0x02708884237382835cd3d3514fdc3603409ce5ea1dc7255a7ceea07dff417c34\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n// todo: explain well what is specific to this attester\\ninterface IHydraS1Base {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x73cff4dcd9c30857859721ea2897be8bb7087c0122f4587acdaa79d8ec0a728d\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SoulboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n// todo: explain well what is specific to this attester\\ninterface IHydraS1SoulboundAttester is IHydraS1Base, IAttester {\\n struct TicketData {\\n address destination;\\n uint32 cooldownStart;\\n }\\n error NotAttestationOwner(uint256 ticket, address sender);\\n error TicketFrozen(uint256 ticketData);\\n error TicketUsedAndOnCooldown(TicketData ticketData);\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n event TicketSetOnCooldown(uint256 ticket);\\n\\n /**\\n * @dev returns whether a ticket is on cooldown or not\\n * @param userTicket ticket used\\n **/\\n function isTicketOnCooldown(uint256 userTicket) external view returns (bool);\\n\\n /**\\n * @dev Getter, returns the data linked to a ticket\\n * @param userTicket ticket used\\n **/\\n function getTicketData(uint256 userTicket) external view returns (TicketData memory);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the duration of the cooldown period after having used a ticket\\n **/\\n function SOULBOUND_COOLDOWN_DURATION() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x253a424fda33fca3de3fabd731e4a4f5d48af14bcd9d7c66302113268fd3a9f5\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // ticketIdentifier\\n // ticket\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (\\n uint256[2] memory,\\n uint256[2][2] memory,\\n uint256[2] memory,\\n uint256[10] memory\\n )\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256[2] memory)\\n {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256)\\n {\\n return self.input[5];\\n }\\n\\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\\n internal\\n pure\\n returns (uint256)\\n {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x596225970aabbc4edb989ee640867c76944e797bfafe5e06dcf37b973480b957\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SoulboundAttester} from '../interfaces/IHydraS1SoulboundAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from '../../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from '../base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Soulbound Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - SoulBound (with cooldown period)\\n * A user can chose to delete attestations or generate attestation to a new destination.\\n * When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional\\n * User will need to wait until the end of the cooldown period before being able to delete or switch destination again\\n * One can however know that the former and the new destinations were created using the same userTicket\\n \\n * - Renewable\\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew or update their attestations\\n **/\\ncontract HydraS1SoulboundAttester is IHydraS1SoulboundAttester, HydraS1Base, Attester {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n uint256 public immutable SOULBOUND_COOLDOWN_DURATION;\\n\\n mapping(uint256 => TicketData) internal _userTicketsData;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n uint256 soulboundCooldownDuration\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n SOULBOUND_COOLDOWN_DURATION = soulboundCooldownDuration;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user attestations request is invalid\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark proof backing the claim\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Throws if user attestations deletion request is not made by its owner\\n * @param attestations attestations to delete\\n */\\n function _verifyAttestationsDeletionRequest(Attestation[] memory attestations, bytes calldata)\\n internal\\n view\\n override\\n {\\n for (uint256 i = 0; i < attestations.length; i++) {\\n uint256 userTicket = abi.decode(attestations[0].extraData, (uint256));\\n if (_userTicketsData[userTicket].destination != msg.sender)\\n revert NotAttestationOwner(userTicket, msg.sender);\\n }\\n }\\n\\n /**\\n * @dev Returns the actual attestations constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark public input as well as snark proof\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n override(IAttester, Attester)\\n returns (Attestation[] memory)\\n {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n // The issuer of attestations is the attester\\n address issuer = address(this);\\n // user sends the ticket as input in the data\\n uint256 userTicket = proofData._getTicket();\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n request.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n abi.encode(userTicket)\\n );\\n\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used, not a renewal, and ticket on cooldown.\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n uint256 userTicket = proofData._getTicket();\\n TicketData memory userTicketData = _userTicketsData[userTicket];\\n\\n if (\\n userTicketData.destination != address(0) && userTicketData.destination != request.destination\\n ) {\\n if (_isOnCooldown(userTicketData)) revert TicketUsedAndOnCooldown(userTicketData);\\n _setTicketOnCooldown(userTicket);\\n }\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n override\\n {\\n // we retrieve the ticketUsed from attestations extraData\\n for (uint256 i = 0; i < attestations.length; i++) {\\n uint256 userTicket = abi.decode(attestations[i].extraData, (uint256));\\n if (_isOnCooldown(_userTicketsData[userTicket]) == true) revert TicketFrozen(userTicket);\\n _userTicketsData[userTicket].destination = address(0);\\n }\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n override\\n returns (uint256)\\n {\\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\\n return ticketIdentifier;\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n /**\\n * @dev Getter, returns the data linked to a ticket\\n * @param userTicket ticket used\\n **/\\n function getTicketData(uint256 userTicket) external view override returns (TicketData memory) {\\n return _getTicketData(userTicket);\\n }\\n\\n /**\\n * @dev returns whether a ticket is on cooldown or not\\n * @param userTicket ticket used\\n **/\\n function isTicketOnCooldown(uint256 userTicket) external view override returns (bool) {\\n return _isOnCooldown(_getTicketData(userTicket));\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _userTicketsData[userTicket].destination = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _setTicketOnCooldown(uint256 userTicket) internal {\\n _userTicketsData[userTicket].cooldownStart = uint32(block.timestamp);\\n emit TicketSetOnCooldown(userTicket);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _userTicketsData[userTicket].destination;\\n }\\n\\n function _isOnCooldown(TicketData memory userTicketData) internal view returns (bool) {\\n return userTicketData.cooldownStart + SOULBOUND_COOLDOWN_DURATION < block.timestamp;\\n }\\n\\n function _getTicketData(uint256 userTicket) internal view returns (TicketData memory) {\\n return _userTicketsData[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0xe72642edf2eecc2886aae203d09ac63f5515a1e51f0ad85b9da410aa59db6261\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n override\\n returns (Attestation[] memory)\\n {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // fetch attestations from the registry\\n Attestation[] memory attestationsToDelete;\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationsToDelete[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestationsToDelete, proofData);\\n\\n _beforeDeleteAttestations(attestationsToDelete, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationsToDelete);\\n\\n _afterDeleteAttestations(attestationsToDelete, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestationsToDelete[i]);\\n }\\n return attestationsToDelete;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n}\\n\",\"keccak256\":\"0x37683c6752d4dc911459084eb191c1045f3bf34e2143f3db3d298a66c971a106\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param attestations Attestations to be deleted\\n */\\n function deleteAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xb5e25bd7e0372c9973e582fb7fe96318c145831a5452d8c79eb848a7464b0297\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) public initializer {\\n _transferOwnership(owner);\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9329ecaf60ffe978c8ab4360e0a8f9bd36e2549e89d672dd39ae80f9a562f9a9\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public initializer {\\n _transferOwnership(owner);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0xacb5347ee1a0e8dc25a1ce3e6fbb427db646e833ff8508909454cad7950418d4\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x87f5035b58936a8458a22f3cf1b3865bd798813310d86af41af74680978c97c8\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0x8d6298b442dde99ee5a9cc989ada6ea808383a08b1e9bb1d4c2b58adc01eec69\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101606040523480156200001257600080fd5b506040516200218c3803806200218c833981016040819052620000359162000088565b6001600160a01b0395861660805293851660c05291841660a0529390921660e05261010092909252610120526101405262000102565b80516001600160a01b03811681146200008357600080fd5b919050565b600080600080600080600060e0888a031215620000a457600080fd5b620000af886200006b565b9650620000bf602089016200006b565b9550620000cf604089016200006b565b9450620000df606089016200006b565b93506080880151925060a0880151915060c0880151905092959891949750929550565b60805160a05160c05160e051610100516101205161014051611ff16200019b6000396000818161013e01526108d30152600081816101ad01526103c901526000818161017301526103a101526000818161023a015281816104e40152818161066601526107a00152600081816101d10152610ec701526000818160d60152610f6301526000818161011501526110be0152611ff16000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063918447af1161008c578063bfa6658511610066578063bfa6658514610238578063c776adde1461025e578063d9895e6a14610271578063e60f999f146102ae57600080fd5b8063918447af146101cf57806392cf369d146101f5578063af411a301461021857600080fd5b80632254f98e146100d457806346657fe9146101135780634e5cf9331461013957806354846d7a1461016e57806363e4afc2146101955780637000b051146101a8575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161010a565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b6100f66101a3366004611537565b6102c1565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b610208610203366004611537565b6102e0565b604051901515815260200161010a565b61022b610226366004611599565b6102f3565b60405161010a91906116c5565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b61022b61026c36600461174c565b6104ce565b61028461027f366004611537565b610745565b6040805182516001600160a01b0316815260209283015163ffffffff16928101929092520161010a565b61022b6102bc366004611599565b610762565b6000818152600160205260408120546001600160a01b03165b92915050565b60006102da6102ee8361087e565b6108ce565b60606000610308610303866118af565b61090e565b60408051600180825281830190925291925060009190816020015b6103746040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816103235750506060830151519091506000906103c5906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611a3f565b90507f000000000000000000000000000000000000000000000000000000000000000081111561041057604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b30600061041d8888610993565b90506040518060c001604052808481526020018a60200160208101906104439190611a57565b6001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff1681526020018260405160200161049191815260200190565b604051602081830303815290604052815250846000815181106104b6576104b6611a74565b60209081029190910101525091979650505050505050565b60608060005b86811015610638576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78d8d8881811061052357610523611a74565b905060200201358c6040518363ffffffff1660e01b815260040161055a9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610577573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261059f9190810190611a9e565b93509350935093506040518060c001604052808d8d888181106105c4576105c4611a74565b9050602002013581526020018b6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061061657610616611a74565b602002602001018190525050505050808061063090611b4e565b9150506104d4565b506106448185856109b8565b61064f818585610a53565b6040516373e4ca1b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e7c994369061069b9084906004016116c5565b600060405180830381600087803b1580156106b557600080fd5b505af11580156106c9573d6000803e3d6000fd5b5050505060005b8681101561073a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070b5761070b611a74565b60200260200101516040516107209190611b67565b60405180910390a18061073281611b4e565b9150506106d0565b509695505050505050565b60408051808201909152600080825260208201526102da8261087e565b606061076f848484610b29565b600061077c8585856102f3565b9050610789858585610b71565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107d59084906004016116c5565b600060405180830381600087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b5050505060005b8151811015610875577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061084657610846611a74565b602002602001015160405161085b9190611b67565b60405180910390a18061086d81611b4e565b91505061080a565b50949350505050565b6040805180820190915260008082526020820152506000908152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff169082015290565b6000427f0000000000000000000000000000000000000000000000000000000000000000836020015163ffffffff166109079190611a3f565b1092915050565b610916611463565b6000826000015160008151811061092f5761092f611a74565b6020026020010151905061094281610c65565b6000816040015180602001905181019061095c9190611b8a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b6000806109a283850185611cbb565b905060006109af82610ca9565b95945050505050565b60005b8351811015610a4d576000846000815181106109d9576109d9611a74565b602002602001015160a001518060200190518101906109f89190611d8c565b6000818152600160205260409020549091506001600160a01b03163314610a3a5760405162f8a2bf60e81b815260048101829052336024820152604401610407565b5080610a4581611b4e565b9150506109bb565b50505050565b60005b8351811015610a4d576000848281518110610a7357610a73611a74565b602002602001015160a00151806020019051810190610a929190611d8c565b6000818152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff1690820152909150610ad6906108ce565b1515600103610afb57604051632fcfdde360e11b815260048101829052602401610407565b600090815260016020526040902080546001600160a01b031916905580610b2181611b4e565b915050610a56565b6000610b3782840184611cbb565b90506000610b4482610cbf565b90506000610b54610303876118af565b9050610b608183610d69565b610b6983611094565b505050505050565b6000610b7d8383610993565b6000818152600160209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910463ffffffff16918301919091529192509015801590610bf15750610bd76040860160208701611a57565b6001600160a01b031681600001516001600160a01b031614155b15610c4257610bff816108ce565b15610c3957604051633f8ffaa560e01b815281516001600160a01b03166004820152602082015163ffffffff166024820152604401610407565b610c428261122d565b610c5b82610c566040880160208901611a57565b61128e565b5050505050565b50565b6000610c7482604001516112f4565b82519091508114610ca55781516040516337e3d1ab60e01b8152610407918391600401918252602082015260400190565b5050565b602081015160009060065b602002015192915050565b610cc76114c6565b604051806101200160405280610cdc84611329565b6001600160a01b03168152602001610cf384611337565b8152602001610d0184611346565b8152602001610d0f84611355565b8152602001610d1d84610ca9565b8152602001610d2b84611364565b8152602001610d3984611373565b8152602001610d518460200151610120015160011490565b15158152602001610d6184611382565b905292915050565b815160c082015114610d9e57815160c082015160405163fe405c7760e01b815260048101929092526024820152604401610407565b81606001516040015115158160e00151151503610de957606082015160409081015160e08301519151634629f1b560e11b815290151560048201529015156024820152604401610407565b81604001516001600160a01b031681600001516001600160a01b031614610e3d57604082810151825191516370a8d99b60e11b81526001600160a01b03918216600482015291166024820152604401610407565b46816020015114610e70576020810151604051630432cec160e31b81524660048201526024810191909152604401610407565b81602001518160a0015114610eab57602082015160a0820151604051630626ade360e41b815260048101929092526024820152604401610407565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a9190611da5565b610f5f57806040015160405163cbfe7bc360e01b815260040161040791815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe29190611dc0565b80516101008401515191925014158061100957506020808201516101008401519091015114155b15611053578051602080830151610100850151805192015160405163318d812b60e01b81526004810194909452602484019190915260448301919091526064820152608401610407565b600061105e846113da565b905080836060015114610a4d5760608301516040516377bb6d2760e11b8152610407918391600401918252602082015260400190565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946110f794909392909190600401611e3c565b602060405180830381865afa925050508015611130575060408051601f3d908101601f1916820190925261112d91810190611da5565b60015b6112065761113c611ec0565b806308c379a0036111755750611150611edc565b8061115b57506111b4565b8060405162dd577760e81b81526004016104079190611f66565b634e487b71036111b457611187611f79565b9061119257506111b4565b60405162dd577760e81b81526020600482015260006024820152604401610407565b3d8080156111de576040519150601f19603f3d011682016040523d82523d6000602084013e6111e3565b606091505b5060405162dd577760e81b81526020600482015260006024820152604401610407565b80610ca55760405162dd577760e81b81526020600482015260006024820152604401610407565b600081815260016020908152604091829020805463ffffffff60a01b1916600160a01b4263ffffffff160217905590518281527f49ab97b1dc68eafe79e6e7f8ff996d00259888e84cb401cf9ec8d39adf7ab196910160405180910390a150565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102da907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611f99565b602081015160009081610cb4565b60208101516000906001610cb4565b60208101516000906004610cb4565b60208101516000906005610cb4565b60208101516000906007610cb4565b60208101516000906008610cb4565b61138a611519565b604051806040016040528083602001516002600a81106113ac576113ac611a74565b6020020151815260200183602001516003600a81106113cd576113cd611a74565b6020020151905292915050565b6000806113f8308460600151600001516001600160801b03166113ff565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113f89190611f99565b6040518060800160405280600081526020016000815260200160006001600160a01b031681526020016114c1604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114c15b60405180604001604052806002906020820280368337509192915050565b60006020828403121561154957600080fd5b5035919050565b60008083601f84011261156257600080fd5b50813567ffffffffffffffff81111561157a57600080fd5b60208301915083602082850101111561159257600080fd5b9250929050565b6000806000604084860312156115ae57600080fd5b833567ffffffffffffffff808211156115c657600080fd5b90850190604082880312156115da57600080fd5b909350602085013590808211156115f057600080fd5b506115fd86828701611550565b9497909650939450505050565b60005b8381101561162557818101518382015260200161160d565b83811115610a4d5750506000910152565b6000815180845261164e81602086016020860161160a565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a08501526116bd60c0850182611636565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561171a57603f19888603018452611708858351611662565b945092850192908501906001016116ec565b5092979650505050505050565b6001600160a01b0381168114610c6257600080fd5b803561174781611727565b919050565b60008060008060006060868803121561176457600080fd5b853567ffffffffffffffff8082111561177c57600080fd5b818801915088601f83011261179057600080fd5b81358181111561179f57600080fd5b8960208260051b85010111156117b457600080fd5b602083019750809650506117ca6020890161173c565b945060408801359150808211156117e057600080fd5b506117ed88828901611550565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b6040810181811067ffffffffffffffff82111715611834576118346117fe565b60405250565b6060810181811067ffffffffffffffff82111715611834576118346117fe565b601f8201601f1916810167ffffffffffffffff81118282101715611880576118806117fe565b6040525050565b600067ffffffffffffffff8211156118a1576118a16117fe565b50601f01601f191660200190565b600060408083360312156118c257600080fd5b80516118cd81611814565b833567ffffffffffffffff808211156118e557600080fd5b9085019036601f8301126118f857600080fd5b813560208282111561190c5761190c6117fe565b8160051b865161191e8383018261185a565b9283528481018201928281013685111561193757600080fd5b83870192505b84831015611a0b578235868111156119555760008081fd5b8701606036829003601f190181131561196e5760008081fd5b8a516119798161183a565b8287013581528b8301358188015290820135908882111561199a5760008081fd5b9181019136603f8401126119b057600091508182fd5b8683013591506119bf82611887565b8c516119cb828261185a565b838152368e8587010111156119e257600091508182fd5b838e86018a830137600093810189019390935250808c019190915282525091830191830161193d565b50865250611a1a88820161173c565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611a5257611a52611a29565b500190565b600060208284031215611a6957600080fd5b81356113f881611727565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff8116811461174757600080fd5b60008060008060808587031215611ab457600080fd5b8451611abf81611727565b60208601519094509250611ad560408601611a8a565b9150606085015167ffffffffffffffff811115611af157600080fd5b8501601f81018713611b0257600080fd5b8051611b0d81611887565b604051611b1a828261185a565b828152896020848601011115611b2f57600080fd5b611b4083602083016020870161160a565b969995985093965050505050565b600060018201611b6057611b60611a29565b5060010190565b6020815260006113f86020830184611662565b8051801515811461174757600080fd5b600060608284031215611b9c57600080fd5b6040516060810181811067ffffffffffffffff82111715611bbf57611bbf6117fe565b60405282516001600160801b0381168114611bd957600080fd5b8152611be760208401611a8a565b6020820152611bf860408401611b7a565b60408201529392505050565b600082601f830112611c1557600080fd5b604051611c2181611814565b806040840185811115611c3357600080fd5b845b81811015611c4d578035835260209283019201611c35565b509195945050505050565b600082601f830112611c6957600080fd5b60405161014080820182811067ffffffffffffffff82111715611c8e57611c8e6117fe565b60405283018185821115611ca157600080fd5b845b82811015611c4d578035825260209182019101611ca3565b6000818303610240811215611ccf57600080fd5b60408051611cdc81611814565b61010080841215611cec57600080fd5b82519350611cf98461183a565b611d038787611c04565b845286605f870112611d1457600080fd5b8251611d1f81611814565b8060c0880189811115611d3157600080fd5b8589015b81811015611d5657611d478b82611c04565b83526020909201918601611d35565b50826020880152611d678a82611c04565b86880152505050838252611d7d87828801611c58565b60208301525095945050505050565b600060208284031215611d9e57600080fd5b5051919050565b600060208284031215611db757600080fd5b6113f882611b7a565b600060408284031215611dd257600080fd5b82601f830112611de157600080fd5b604051611ded81611814565b806040840185811115611dff57600080fd5b845b81811015611c4d578051835260209283019201611e01565b8060005b6002811015610a4d578151845260209384019390910190600101611e1d565b6102408101611e4b8287611e19565b60408083018660005b6002811015611e7b57611e68838351611e19565b9183019160209190910190600101611e54565b50505050611e8c60c0830185611e19565b61010082018360005b600a811015611eb4578151835260209283019290910190600101611e95565b50505095945050505050565b600060033d1115611ed95760046000803e5060005160e01c5b90565b600060443d1015611eea5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611f1a57505050505090565b8285019150815181811115611f325750505050505090565b843d8701016020828501011115611f4c5750505050505090565b611f5b6020828601018761185a565b509095945050505050565b6020815260006113f86020830184611636565b60008060233d1115611f95576020600460003e50506000516001905b9091565b600082611fb657634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220f1374674d2143dc1e1f8e0666c58769f2e4bc209220c094f513f5b717a358ad464736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063918447af1161008c578063bfa6658511610066578063bfa6658514610238578063c776adde1461025e578063d9895e6a14610271578063e60f999f146102ae57600080fd5b8063918447af146101cf57806392cf369d146101f5578063af411a301461021857600080fd5b80632254f98e146100d457806346657fe9146101135780634e5cf9331461013957806354846d7a1461016e57806363e4afc2146101955780637000b051146101a8575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161010a565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b6100f66101a3366004611537565b6102c1565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b610208610203366004611537565b6102e0565b604051901515815260200161010a565b61022b610226366004611599565b6102f3565b60405161010a91906116c5565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b61022b61026c36600461174c565b6104ce565b61028461027f366004611537565b610745565b6040805182516001600160a01b0316815260209283015163ffffffff16928101929092520161010a565b61022b6102bc366004611599565b610762565b6000818152600160205260408120546001600160a01b03165b92915050565b60006102da6102ee8361087e565b6108ce565b60606000610308610303866118af565b61090e565b60408051600180825281830190925291925060009190816020015b6103746040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816103235750506060830151519091506000906103c5906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611a3f565b90507f000000000000000000000000000000000000000000000000000000000000000081111561041057604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b30600061041d8888610993565b90506040518060c001604052808481526020018a60200160208101906104439190611a57565b6001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff1681526020018260405160200161049191815260200190565b604051602081830303815290604052815250846000815181106104b6576104b6611a74565b60209081029190910101525091979650505050505050565b60608060005b86811015610638576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78d8d8881811061052357610523611a74565b905060200201358c6040518363ffffffff1660e01b815260040161055a9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610577573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261059f9190810190611a9e565b93509350935093506040518060c001604052808d8d888181106105c4576105c4611a74565b9050602002013581526020018b6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061061657610616611a74565b602002602001018190525050505050808061063090611b4e565b9150506104d4565b506106448185856109b8565b61064f818585610a53565b6040516373e4ca1b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e7c994369061069b9084906004016116c5565b600060405180830381600087803b1580156106b557600080fd5b505af11580156106c9573d6000803e3d6000fd5b5050505060005b8681101561073a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070b5761070b611a74565b60200260200101516040516107209190611b67565b60405180910390a18061073281611b4e565b9150506106d0565b509695505050505050565b60408051808201909152600080825260208201526102da8261087e565b606061076f848484610b29565b600061077c8585856102f3565b9050610789858585610b71565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107d59084906004016116c5565b600060405180830381600087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b5050505060005b8151811015610875577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061084657610846611a74565b602002602001015160405161085b9190611b67565b60405180910390a18061086d81611b4e565b91505061080a565b50949350505050565b6040805180820190915260008082526020820152506000908152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff169082015290565b6000427f0000000000000000000000000000000000000000000000000000000000000000836020015163ffffffff166109079190611a3f565b1092915050565b610916611463565b6000826000015160008151811061092f5761092f611a74565b6020026020010151905061094281610c65565b6000816040015180602001905181019061095c9190611b8a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b6000806109a283850185611cbb565b905060006109af82610ca9565b95945050505050565b60005b8351811015610a4d576000846000815181106109d9576109d9611a74565b602002602001015160a001518060200190518101906109f89190611d8c565b6000818152600160205260409020549091506001600160a01b03163314610a3a5760405162f8a2bf60e81b815260048101829052336024820152604401610407565b5080610a4581611b4e565b9150506109bb565b50505050565b60005b8351811015610a4d576000848281518110610a7357610a73611a74565b602002602001015160a00151806020019051810190610a929190611d8c565b6000818152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff1690820152909150610ad6906108ce565b1515600103610afb57604051632fcfdde360e11b815260048101829052602401610407565b600090815260016020526040902080546001600160a01b031916905580610b2181611b4e565b915050610a56565b6000610b3782840184611cbb565b90506000610b4482610cbf565b90506000610b54610303876118af565b9050610b608183610d69565b610b6983611094565b505050505050565b6000610b7d8383610993565b6000818152600160209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910463ffffffff16918301919091529192509015801590610bf15750610bd76040860160208701611a57565b6001600160a01b031681600001516001600160a01b031614155b15610c4257610bff816108ce565b15610c3957604051633f8ffaa560e01b815281516001600160a01b03166004820152602082015163ffffffff166024820152604401610407565b610c428261122d565b610c5b82610c566040880160208901611a57565b61128e565b5050505050565b50565b6000610c7482604001516112f4565b82519091508114610ca55781516040516337e3d1ab60e01b8152610407918391600401918252602082015260400190565b5050565b602081015160009060065b602002015192915050565b610cc76114c6565b604051806101200160405280610cdc84611329565b6001600160a01b03168152602001610cf384611337565b8152602001610d0184611346565b8152602001610d0f84611355565b8152602001610d1d84610ca9565b8152602001610d2b84611364565b8152602001610d3984611373565b8152602001610d518460200151610120015160011490565b15158152602001610d6184611382565b905292915050565b815160c082015114610d9e57815160c082015160405163fe405c7760e01b815260048101929092526024820152604401610407565b81606001516040015115158160e00151151503610de957606082015160409081015160e08301519151634629f1b560e11b815290151560048201529015156024820152604401610407565b81604001516001600160a01b031681600001516001600160a01b031614610e3d57604082810151825191516370a8d99b60e11b81526001600160a01b03918216600482015291166024820152604401610407565b46816020015114610e70576020810151604051630432cec160e31b81524660048201526024810191909152604401610407565b81602001518160a0015114610eab57602082015160a0820151604051630626ade360e41b815260048101929092526024820152604401610407565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a9190611da5565b610f5f57806040015160405163cbfe7bc360e01b815260040161040791815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe29190611dc0565b80516101008401515191925014158061100957506020808201516101008401519091015114155b15611053578051602080830151610100850151805192015160405163318d812b60e01b81526004810194909452602484019190915260448301919091526064820152608401610407565b600061105e846113da565b905080836060015114610a4d5760608301516040516377bb6d2760e11b8152610407918391600401918252602082015260400190565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946110f794909392909190600401611e3c565b602060405180830381865afa925050508015611130575060408051601f3d908101601f1916820190925261112d91810190611da5565b60015b6112065761113c611ec0565b806308c379a0036111755750611150611edc565b8061115b57506111b4565b8060405162dd577760e81b81526004016104079190611f66565b634e487b71036111b457611187611f79565b9061119257506111b4565b60405162dd577760e81b81526020600482015260006024820152604401610407565b3d8080156111de576040519150601f19603f3d011682016040523d82523d6000602084013e6111e3565b606091505b5060405162dd577760e81b81526020600482015260006024820152604401610407565b80610ca55760405162dd577760e81b81526020600482015260006024820152604401610407565b600081815260016020908152604091829020805463ffffffff60a01b1916600160a01b4263ffffffff160217905590518281527f49ab97b1dc68eafe79e6e7f8ff996d00259888e84cb401cf9ec8d39adf7ab196910160405180910390a150565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102da907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611f99565b602081015160009081610cb4565b60208101516000906001610cb4565b60208101516000906004610cb4565b60208101516000906005610cb4565b60208101516000906007610cb4565b60208101516000906008610cb4565b61138a611519565b604051806040016040528083602001516002600a81106113ac576113ac611a74565b6020020151815260200183602001516003600a81106113cd576113cd611a74565b6020020151905292915050565b6000806113f8308460600151600001516001600160801b03166113ff565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113f89190611f99565b6040518060800160405280600081526020016000815260200160006001600160a01b031681526020016114c1604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114c15b60405180604001604052806002906020820280368337509192915050565b60006020828403121561154957600080fd5b5035919050565b60008083601f84011261156257600080fd5b50813567ffffffffffffffff81111561157a57600080fd5b60208301915083602082850101111561159257600080fd5b9250929050565b6000806000604084860312156115ae57600080fd5b833567ffffffffffffffff808211156115c657600080fd5b90850190604082880312156115da57600080fd5b909350602085013590808211156115f057600080fd5b506115fd86828701611550565b9497909650939450505050565b60005b8381101561162557818101518382015260200161160d565b83811115610a4d5750506000910152565b6000815180845261164e81602086016020860161160a565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a08501526116bd60c0850182611636565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561171a57603f19888603018452611708858351611662565b945092850192908501906001016116ec565b5092979650505050505050565b6001600160a01b0381168114610c6257600080fd5b803561174781611727565b919050565b60008060008060006060868803121561176457600080fd5b853567ffffffffffffffff8082111561177c57600080fd5b818801915088601f83011261179057600080fd5b81358181111561179f57600080fd5b8960208260051b85010111156117b457600080fd5b602083019750809650506117ca6020890161173c565b945060408801359150808211156117e057600080fd5b506117ed88828901611550565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b6040810181811067ffffffffffffffff82111715611834576118346117fe565b60405250565b6060810181811067ffffffffffffffff82111715611834576118346117fe565b601f8201601f1916810167ffffffffffffffff81118282101715611880576118806117fe565b6040525050565b600067ffffffffffffffff8211156118a1576118a16117fe565b50601f01601f191660200190565b600060408083360312156118c257600080fd5b80516118cd81611814565b833567ffffffffffffffff808211156118e557600080fd5b9085019036601f8301126118f857600080fd5b813560208282111561190c5761190c6117fe565b8160051b865161191e8383018261185a565b9283528481018201928281013685111561193757600080fd5b83870192505b84831015611a0b578235868111156119555760008081fd5b8701606036829003601f190181131561196e5760008081fd5b8a516119798161183a565b8287013581528b8301358188015290820135908882111561199a5760008081fd5b9181019136603f8401126119b057600091508182fd5b8683013591506119bf82611887565b8c516119cb828261185a565b838152368e8587010111156119e257600091508182fd5b838e86018a830137600093810189019390935250808c019190915282525091830191830161193d565b50865250611a1a88820161173c565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611a5257611a52611a29565b500190565b600060208284031215611a6957600080fd5b81356113f881611727565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff8116811461174757600080fd5b60008060008060808587031215611ab457600080fd5b8451611abf81611727565b60208601519094509250611ad560408601611a8a565b9150606085015167ffffffffffffffff811115611af157600080fd5b8501601f81018713611b0257600080fd5b8051611b0d81611887565b604051611b1a828261185a565b828152896020848601011115611b2f57600080fd5b611b4083602083016020870161160a565b969995985093965050505050565b600060018201611b6057611b60611a29565b5060010190565b6020815260006113f86020830184611662565b8051801515811461174757600080fd5b600060608284031215611b9c57600080fd5b6040516060810181811067ffffffffffffffff82111715611bbf57611bbf6117fe565b60405282516001600160801b0381168114611bd957600080fd5b8152611be760208401611a8a565b6020820152611bf860408401611b7a565b60408201529392505050565b600082601f830112611c1557600080fd5b604051611c2181611814565b806040840185811115611c3357600080fd5b845b81811015611c4d578035835260209283019201611c35565b509195945050505050565b600082601f830112611c6957600080fd5b60405161014080820182811067ffffffffffffffff82111715611c8e57611c8e6117fe565b60405283018185821115611ca157600080fd5b845b82811015611c4d578035825260209182019101611ca3565b6000818303610240811215611ccf57600080fd5b60408051611cdc81611814565b61010080841215611cec57600080fd5b82519350611cf98461183a565b611d038787611c04565b845286605f870112611d1457600080fd5b8251611d1f81611814565b8060c0880189811115611d3157600080fd5b8589015b81811015611d5657611d478b82611c04565b83526020909201918601611d35565b50826020880152611d678a82611c04565b86880152505050838252611d7d87828801611c58565b60208301525095945050505050565b600060208284031215611d9e57600080fd5b5051919050565b600060208284031215611db757600080fd5b6113f882611b7a565b600060408284031215611dd257600080fd5b82601f830112611de157600080fd5b604051611ded81611814565b806040840185811115611dff57600080fd5b845b81811015611c4d578051835260209283019201611e01565b8060005b6002811015610a4d578151845260209384019390910190600101611e1d565b6102408101611e4b8287611e19565b60408083018660005b6002811015611e7b57611e68838351611e19565b9183019160209190910190600101611e54565b50505050611e8c60c0830185611e19565b61010082018360005b600a811015611eb4578151835260209283019290910190600101611e95565b50505095945050505050565b600060033d1115611ed95760046000803e5060005160e01c5b90565b600060443d1015611eea5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611f1a57505050505090565b8285019150815181811115611f325750505050505090565b843d8701016020828501011115611f4c5750505050505090565b611f5b6020828601018761185a565b509095945050505050565b6020815260006113f86020830184611636565b60008060233d1115611f95576020600460003e50506000516001905b9091565b600082611fb657634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220f1374674d2143dc1e1f8e0666c58769f2e4bc209220c094f513f5b717a358ad464736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns the actual attestations constructed from the user request", - "params": { - "proofData": "snark public input as well as snark proof", - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "availableRootsRegistryAddress": "Registry storing the available groups for this attester (e.g roots of registry merkle trees)", - "collectionIdFirst": "Id of the first collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last collection in which the attester is supposed to record", - "commitmentMapperAddress": "commitment mapper's public key registry", - "hydraS1VerifierAddress": "ZK Snark Hydra-S1 Verifier contract" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getAvailableRootsRegistry()": { - "details": "Getter of Roots Registry Contract" - }, - "getCommitmentMapperRegistry()": { - "details": "Getter of Commitment Mapper Registry contract" - }, - "getDestinationOfTicket(uint256)": { - "details": "Getter, returns the last attestation destination of a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getTicketData(uint256)": { - "details": "Getter, returns the data linked to a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getVerifier()": { - "details": "Getter of Hydra-S1 Verifier contract" - }, - "isTicketOnCooldown(uint256)": { - "details": "returns whether a ticket is on cooldown or not", - "params": { - "userTicket": "ticket used*" - } - } - }, - "stateVariables": { - "AUTHORIZED_COLLECTION_ID_FIRST": { - "details": "Getter returns of the first collection in which the attester is supposed to record*" - }, - "AUTHORIZED_COLLECTION_ID_LAST": { - "details": "Getter returns of the last collection in which the attester is supposed to record*" - }, - "SOULBOUND_COOLDOWN_DURATION": { - "details": "Getter returns of the duration of the cooldown period after having used a ticket*" - } - }, - "title": "Hydra-S1 Soulbound Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - SoulBound (with cooldown period) A user can chose to delete attestations or generate attestation to a new destination. When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional User will need to wait until the end of the cooldown period before being able to delete or switch destination again One can however know that the former and the new destinations were created using the same userTicket - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 936, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 939, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 7701, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "_userTicketsData", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_struct(TicketData)7128_storage)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_struct(TicketData)7128_storage)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => struct IHydraS1SoulboundAttester.TicketData)", - "numberOfBytes": "32", - "value": "t_struct(TicketData)7128_storage" - }, - "t_struct(TicketData)7128_storage": { - "encoding": "inplace", - "label": "struct IHydraS1SoulboundAttester.TicketData", - "members": [ - { - "astId": 7125, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "destination", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 7127, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "cooldownStart", - "offset": 20, - "slot": "0", - "type": "t_uint32" - } - ], - "numberOfBytes": "32" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} \ No newline at end of file diff --git a/deployments/mumbai/HydraS1SoulboundAttesterProxy.json b/deployments/mumbai/HydraS1SoulboundAttesterProxy.json deleted file mode 100644 index 6526735..0000000 --- a/deployments/mumbai/HydraS1SoulboundAttesterProxy.json +++ /dev/null @@ -1,250 +0,0 @@ -{ - "address": "0x76D8Ed0e34555dEF84c2bfff9be85446e8E9fa2A", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0xa7d369b9ff4f0bba0feebc8e219d88fb28c6aa45c04efab51653cff906b2aafd", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x76D8Ed0e34555dEF84c2bfff9be85446e8E9fa2A", - "transactionIndex": 37, - "gasUsed": "583384", - "logsBloom": "0x00000000000000020000000000000000400000000000008000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000002800000000000000000000100000000000000000000000000000000000000000000000000800000000080000000000000000000000000000000000000000000000000000010000000000000000000808000200000080000000020000000000000000001000000000000000000000000004000000020000000000001000000000000008040000400000000100000000010000000000000000000000000000000000000000000000000000020000000108000", - "blockHash": "0xb4502778295749da386c2393d33d065c35d9fc8157c4bff3f7de0e30f9b15182", - "transactionHash": "0xa7d369b9ff4f0bba0feebc8e219d88fb28c6aa45c04efab51653cff906b2aafd", - "logs": [ - { - "transactionIndex": 37, - "blockNumber": 28600037, - "transactionHash": "0xa7d369b9ff4f0bba0feebc8e219d88fb28c6aa45c04efab51653cff906b2aafd", - "address": "0x76D8Ed0e34555dEF84c2bfff9be85446e8E9fa2A", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x0000000000000000000000001f38a480d04348708f4b2413fb9ab1f975c176b6" - ], - "data": "0x", - "logIndex": 180, - "blockHash": "0xb4502778295749da386c2393d33d065c35d9fc8157c4bff3f7de0e30f9b15182" - }, - { - "transactionIndex": 37, - "blockNumber": 28600037, - "transactionHash": "0xa7d369b9ff4f0bba0feebc8e219d88fb28c6aa45c04efab51653cff906b2aafd", - "address": "0x76D8Ed0e34555dEF84c2bfff9be85446e8E9fa2A", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000246e71bc2a257f4be9c7fad4664e6d7444844adc", - "logIndex": 181, - "blockHash": "0xb4502778295749da386c2393d33d065c35d9fc8157c4bff3f7de0e30f9b15182" - }, - { - "transactionIndex": 37, - "blockNumber": 28600037, - "transactionHash": "0xa7d369b9ff4f0bba0feebc8e219d88fb28c6aa45c04efab51653cff906b2aafd", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" - ], - "data": "0x0000000000000000000000000000000000000000000000000005e2b8d9b55d7000000000000000000000000000000000000000000000000081698e1f24bb5d9800000000000000000000000000000000000000000000167a31ceb366608cf8330000000000000000000000000000000000000000000000008163ab664b06002800000000000000000000000000000000000000000000167a31d4961f3a4255a3", - "logIndex": 182, - "blockHash": "0xb4502778295749da386c2393d33d065c35d9fc8157c4bff3f7de0e30f9b15182" - } - ], - "blockNumber": 28600037, - "cumulativeGasUsed": "6241153", - "status": 1, - "byzantium": true - }, - "args": [ - "0x1F38a480d04348708F4b2413fb9AB1F975C176b6", - "0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc", - "0x" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/mumbai/Pythia1SimpleAttester.json b/deployments/mumbai/Pythia1SimpleAttester.json deleted file mode 100644 index a6cbc2f..0000000 --- a/deployments/mumbai/Pythia1SimpleAttester.json +++ /dev/null @@ -1,1056 +0,0 @@ -{ - "address": "0x1586190051bf7bb0b754A7AA7CDde21E920ad009", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - }, - { - "internalType": "address", - "name": "pythia1VerifierAddress", - "type": "address" - }, - { - "internalType": "uint256[2]", - "name": "commitmentSignerPubKey", - "type": "uint256[2]" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentSignerPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "GroupIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedTicketIdentifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ticketIdentifier", - "type": "uint256" - } - ], - "name": "TicketIdentifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "TicketUsed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "inputdestination", - "type": "address" - } - ], - "name": "UserShouldOwnItsDestination", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256[2]", - "name": "newCommitmentSignerPubKey", - "type": "uint256[2]" - } - ], - "name": "CommitmentSignerPubKeyUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "TicketDestinationUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentSignerPubKey", - "outputs": [ - { - "internalType": "uint256[2]", - "name": "", - "type": "uint256[2]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getDestinationOfTicket", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract Pythia1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "commitmentSignerPubKey", - "type": "uint256[2]" - }, - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "commitmentSignerPubKey", - "type": "uint256[2]" - } - ], - "name": "updateCommitmentSignerPubKey", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x7757d7b590e85f889004b3d89b9bbe8bfd1795b460382bb17de6ed1dde0088a0", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x5CE8544C05F6Ed9Dc626071505795C3c4E1EB559", - "transactionIndex": 23, - "gasUsed": "1945946", - "logsBloom": "0x00000000000000000000000000020000000000000000000000800010000000000000000000000020000000000000000000008000000040000000000000000000000000000000000000000000000000800001000000000000000100000000000000000000020000000000000000000800002000000200000080000000000000400000000000000000008000000000000000000010000080000000000000008000200000000000000000200000800400000000000000000000000000000000004000000000000000000001000000040000000000000000000000100000001020000000000000000000000000000000000000002200000000000020000000100000", - "blockHash": "0xcdd137365ec23546d2267ad15968428470503f9c792d3f666ac25fcb94a9f2f4", - "transactionHash": "0x7757d7b590e85f889004b3d89b9bbe8bfd1795b460382bb17de6ed1dde0088a0", - "logs": [ - { - "transactionIndex": 23, - "blockNumber": 29540709, - "transactionHash": "0x7757d7b590e85f889004b3d89b9bbe8bfd1795b460382bb17de6ed1dde0088a0", - "address": "0x5CE8544C05F6Ed9Dc626071505795C3c4E1EB559", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" - ], - "data": "0x", - "logIndex": 101, - "blockHash": "0xcdd137365ec23546d2267ad15968428470503f9c792d3f666ac25fcb94a9f2f4" - }, - { - "transactionIndex": 23, - "blockNumber": 29540709, - "transactionHash": "0x7757d7b590e85f889004b3d89b9bbe8bfd1795b460382bb17de6ed1dde0088a0", - "address": "0x5CE8544C05F6Ed9Dc626071505795C3c4E1EB559", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954" - ], - "data": "0x", - "logIndex": 102, - "blockHash": "0xcdd137365ec23546d2267ad15968428470503f9c792d3f666ac25fcb94a9f2f4" - }, - { - "transactionIndex": 23, - "blockNumber": 29540709, - "transactionHash": "0x7757d7b590e85f889004b3d89b9bbe8bfd1795b460382bb17de6ed1dde0088a0", - "address": "0x5CE8544C05F6Ed9Dc626071505795C3c4E1EB559", - "topics": [ - "0xda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df" - ], - "data": "0x038d3d596875c66eb90608bbe04e4e238607fd32ad61f4278bdaf47aadc28d601b46b55a0ce3f35d6025cdd4554aaac1fc7180b14d51b0f15aa51a6929bdb952", - "logIndex": 103, - "blockHash": "0xcdd137365ec23546d2267ad15968428470503f9c792d3f666ac25fcb94a9f2f4" - }, - { - "transactionIndex": 23, - "blockNumber": 29540709, - "transactionHash": "0x7757d7b590e85f889004b3d89b9bbe8bfd1795b460382bb17de6ed1dde0088a0", - "address": "0x5CE8544C05F6Ed9Dc626071505795C3c4E1EB559", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 104, - "blockHash": "0xcdd137365ec23546d2267ad15968428470503f9c792d3f666ac25fcb94a9f2f4" - }, - { - "transactionIndex": 23, - "blockNumber": 29540709, - "transactionHash": "0x7757d7b590e85f889004b3d89b9bbe8bfd1795b460382bb17de6ed1dde0088a0", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000f903ba9e006193c1527bfbe65fe2123704ea3f99" - ], - "data": "0x000000000000000000000000000000000000000000000000000af11b618dcada0000000000000000000000000000000000000000000000007cc03a6b555a767600000000000000000000000000000000000000000000093b286bfaaecb33a9440000000000000000000000000000000000000000000000007cb5494ff3ccab9c00000000000000000000000000000000000000000000093b2876ebca2cc1741e", - "logIndex": 105, - "blockHash": "0xcdd137365ec23546d2267ad15968428470503f9c792d3f666ac25fcb94a9f2f4" - } - ], - "blockNumber": 29540709, - "cumulativeGasUsed": "7737931", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf576E42E5b2682B8f606B1840c3A982610C29a3f", - "30000001", - "30000100", - "0x115dFa344C877fF74e970F06BE10FF5A59EAba02", - [ - "0x038d3d596875c66eb90608bbe04e4e238607fd32ad61f4278bdaf47aadc28d60", - "0x1b46b55a0ce3f35d6025cdd4554aaac1fc7180b14d51b0f15aa51a6929bdb952" - ], - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954" - ], - "numDeployments": 3, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"pythia1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentSignerPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"GroupIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"TicketUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputdestination\",\"type\":\"address\"}],\"name\":\"UserShouldOwnItsDestination\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256[2]\",\"name\":\"newCommitmentSignerPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"CommitmentSignerPubKeyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentSignerPubKey\",\"outputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"\",\"type\":\"uint256[2]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract Pythia1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"updateCommitmentSignerPubKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns attestations that will be recorded, constructed from the user request\",\"params\":{\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentSignerPubKey\":\"The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\",\"owner\":\"The owner of the contract that can update the commitment signer pub key\",\"pythia1VerifierAddress\":\"ZK Snark Pythia-1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getCommitmentSignerPubKey()\":{\"details\":\"Getter of the Commitment signer Eddsa Public key\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Pythia-1 Verifier contract\"},\"initialize(uint256[2],address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"commitmentSignerPubKey\":\"EdDSA public key of the commitment signer\",\"ownerAddress\":\"Owner of the contract, can update public key and address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"}},\"title\":\"Pythia-1 Simple Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(uint256[2],address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"This attester is part of the family of the Pythia-1 Attesters. Pythia-1 attesters enable users to prove they have a claim and its proof issued by an offchain service in a privacy preserving way. That means no-one can make the link between the account used in the offchain service and the onchain account where the attestation is stored. The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic. We invite readers to refer to: - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each users gets one userTicket per claim For people used to semaphore/ tornado cash people: userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/pythia-1/Pythia1SimpleAttester.sol\":\"Pythia1SimpleAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/pythia-1/contracts/Pythia1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract Pythia1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\\n );\\n vk.IC = new Pairing.G1Point[](10);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 104028078850975554065172701281783302003220555203883119831575537681421753151,\\n 19148240629904598794948591359118971959790791697910953160820265703277306346\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[9] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3babb956e64535b9bf535df94288b4d83ea82c54727f79ee8949fe4a19c1d5ba\",\"license\":\"GPL-3.0\"},\"contracts/attesters/pythia-1/Pythia1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to Pythia1 Proving Scheme\\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\\n\\n/**\\n * @title Pythia-1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Pythia-1 Attesters.\\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \\n * offchain service in a privacy preserving way. \\n * That means no-one can make the link between the account used in the offchain service\\n * and the onchain account where the attestation is stored.\\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\\n * We invite readers to refer to:\\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each users gets one userTicket per claim\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n **/\\n\\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\\n using Pythia1Lib for Pythia1ProofData;\\n using Pythia1Lib for bytes;\\n using Pythia1Lib for Request;\\n\\n uint8 public constant IMPLEMENTATION_VERSION = 3;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n uint256[2] internal _commitmentSignerPubKey;\\n mapping(uint256 => address) internal _ticketsDestinations;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\\n * @param owner The owner of the contract that can update the commitment signer pub key\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n address pythia1VerifierAddress,\\n uint256[2] memory commitmentSignerPubKey,\\n address owner\\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n initialize(commitmentSignerPubKey, owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n uint256[2] memory commitmentSignerPubKey,\\n address ownerAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\\n }\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into Pythia1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\\n Pythia1ProofInput memory snarkInput = snarkProof._input();\\n Pythia1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata\\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\\n Pythia1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.internalCollectionId;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n uint32(block.timestamp),\\n ''\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used\\n * @param request users request. Claim of beiing part of a group.\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n // we get the ticket used from the snark input in the data provided\\n uint256 userTicket = proofData._getTicket();\\n address currentDestination = _getDestinationOfTicket(userTicket);\\n\\n if (currentDestination != address(0)) {\\n revert TicketUsed(userTicket);\\n }\\n\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n /*******************************************************\\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\\n * users bring secretHash as private input in snark which guarantees privacy\\n * the secretHash is only known by the user and never escape the user's browser\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(\\n Pythia1Claim memory claim\\n ) internal view override returns (uint256) {\\n uint256 ticketIdentifier = _encodeInSnarkField(\\n address(this),\\n claim.groupProperties.internalCollectionId\\n );\\n return ticketIdentifier;\\n }\\n\\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\\n return _commitmentSignerPubKey;\\n }\\n\\n /*******************************************************\\n Pythia-1 Attester Specific Functions\\n *******************************************************/\\n\\n function updateCommitmentSignerPubKey(\\n uint256[2] memory commitmentSignerPubKey\\n ) external onlyOwner {\\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\\n }\\n\\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\\n _commitmentSignerPubKey = commitmentSignerPubKey;\\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\\n }\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _ticketsDestinations[userTicket] = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _ticketsDestinations[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x22a505a2f8a3246ad46cf6fdd5eeab1a58b7fcb08982d03ff742f48aec063b82\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/base/IPythia1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\\n\\ninterface IPythia1Base {\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error UserShouldOwnItsDestination(address sender, address inputdestination);\\n error CommitmentSignerPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Pythia-1 Verifier contract\\n */\\n function getVerifier() external view returns (Pythia1Verifier);\\n\\n /**\\n * @dev Getter of the Commitment Signer EdDSA Public Key\\n */\\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\\n}\\n\",\"keccak256\":\"0x61924d768ab0c8cd61d0ff3c9ecbfbc37aacdbec7f575f0d46041b1847222526\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/base/Pythia1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IPythia1Base} from './IPythia1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Pythia 1 ZK Proving Scheme\\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\\n\\n/**\\n * @title Pythia-1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \\n * without anyone being able to make the link between the offchain service and the onchain service.\\n * It is inherited by the family of Pythia-1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to:\\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\\n \\n \\n **/\\nabstract contract Pythia1Base is IPythia1Base, Initializable {\\n using Pythia1Lib for Pythia1ProofData;\\n\\n // ZK-SNARK Verifier\\n Pythia1Verifier immutable VERIFIER;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\\n */\\n constructor(address Pythia1VerifierAddress) {\\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\\n }\\n\\n /**\\n * @dev Getter of Pythia-1 Verifier contract\\n */\\n function getVerifier() external view returns (Pythia1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of the Commitment signer Eddsa Public key\\n */\\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\\n return _getCommitmentSignerPubKey();\\n }\\n\\n /*******************************************************\\n Pythia-1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\\n * the secretHash is a number only known by the user and is used in \\n * the zero knowledge as a private input which guarantees privacy\\n\\n * This function MUST be implemented by Pythia-1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Pythia-1 Simple Attester for an example\\n * @param claim user claim: a particular claim that a user have that he can prove s right.\\n */\\n function _getTicketIdentifierOfClaim(\\n Pythia1Claim memory claim\\n ) internal view virtual returns (uint256);\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\\n * prove the claim was correctly issued for the user.\\n */\\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(\\n Pythia1Claim memory claim,\\n Pythia1ProofInput memory input\\n ) internal view virtual {\\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (claim.destination != msg.sender)\\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\\n if (\\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\\n )\\n revert CommitmentSignerPubKeyMismatch(\\n commitmentSignerPubKey[0],\\n commitmentSignerPubKey[1],\\n input.commitmentSignerPubKey[0],\\n input.commitmentSignerPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the plonk mathematical proof using the circom verifier contract\\n * @param proofData snark public input\\n */\\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(uint256 /*errorCode*/) {\\n revert InvalidGroth16Proof('');\\n } catch (bytes memory /*lowLevelData*/) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc15ec9f4ae345d96e52465049836e9294a37a45a4c219211264b1d7d15779285\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\\n\\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\\n error TicketUsed(uint256 userTicket);\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xa727568cccc2689a13e843d64003ffd6868537c73220e1dc94b86827c8e445d4\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/libs/Pythia1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\\n\\n// user Pythia-1 claim retrieved form his request\\nstruct Pythia1Claim {\\n uint256 groupId; // user claims be part of this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct Pythia1GroupProperties {\\n uint128 internalCollectionId;\\n bool isScore;\\n}\\n\\nstruct Pythia1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct Pythia1ProofData {\\n Pythia1CircomSnarkProof proof;\\n uint256[9] input;\\n // destination;\\n // chainId;\\n // commitmentSignerPubKey.x;\\n // commitmentSignerPubKey.y;\\n // groupId;\\n // ticketIdentifier;\\n // userTicket;\\n // value;\\n // isStrict;\\n}\\n\\nstruct Pythia1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 groupId;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n bool isStrict;\\n uint256[2] commitmentSignerPubKey;\\n}\\n\\nlibrary Pythia1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\\n return\\n Pythia1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getGroupId(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n Pythia1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (Pythia1GroupProperties)\\n );\\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(\\n Pythia1ProofData memory self\\n )\\n internal\\n pure\\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[9] memory)\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(\\n Pythia1ProofData memory self\\n ) internal pure returns (uint256[2] memory) {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(\\n Pythia1ProofData memory self\\n ) internal pure returns (uint256) {\\n return self.input[5];\\n }\\n\\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\\n return self.input[8] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 internalCollectionId,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\\n }\\n\\n function _generateGroupIdFromEncodedProperties(\\n bytes memory encodedProperties\\n ) internal pure returns (uint256) {\\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 internalCollectionId,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(internalCollectionId, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x9f50e72124764619442a1d9ad876661b56bc0abb330bc2ffe7536a1c65eb0d0e\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n address[] memory attestationOwners = new address[](collectionIds.length);\\n\\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\\n\\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n // fetch attestations from the registry\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationOwners[i] = attestationsOwner;\\n attestationCollectionIds[i] = collectionIds[i];\\n\\n attestations[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestations, proofData);\\n\\n _beforeDeleteAttestations(attestations, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n\\n _afterDeleteAttestations(attestations, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestations[i]);\\n }\\n return attestations;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x7743f02ed07e1b40a2ff45f5a45b5fe87d765326cce3528676cbd36c3d08ba37\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0x2d5faf5df56dfe1294202e89180846a1d4a5f938699619ee73b60c7314a97dfe\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101006040523480156200001257600080fd5b50604051620024dd380380620024dd8339810160408190526200003591620002d8565b6001600160a01b03838116608052861660a052620000533362000075565b60c085905260e0849052620000698282620000d0565b505050505050620003d9565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600390610100900460ff16158015620000f3575060005460ff8083169116105b6200015b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff831617610100178155620001886000546201000090046001600160a01b031690565b6001600160a01b031614806200019d5750303b155b15620001b957620001ae8262000075565b620001b983620001ff565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6200020e60018260026200024b565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051620002409190620003a6565b60405180910390a150565b82600281019282156200027c579160200282015b828111156200027c5782518255916020019190600101906200025f565b506200028a9291506200028e565b5090565b5b808211156200028a57600081556001016200028f565b80516001600160a01b0381168114620002bd57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060e08789031215620002f257600080fd5b620002fd87620002a5565b95506020808801519550604088015194506200031c60608901620002a5565b935088609f8901126200032e57600080fd5b604080519081016001600160401b0381118282101715620003535762000353620002c2565b6040528060c08a018b8111156200036957600080fd5b60808b015b818110156200038757805183529184019184016200036e565b508295506200039681620002a5565b9450505050509295509295509295565b60408101818360005b6002811015620003d0578151835260209283019290910190600101620003af565b50505092915050565b60805160a05160c05160e0516120a06200043d600039600081816101b4015261038a01526000818161016c01526103620152600081816102310152818161055301528181610734015261097801526000818161012f01526110d501526120a06000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c8063754b377c11610097578063c776adde11610066578063c776adde14610255578063c9cdef0414610268578063e60f999f1461027b578063f2fde38b1461028e57600080fd5b8063754b377c146101de5780638da5cb5b146101f8578063af411a301461020f578063bfa665851461022f57600080fd5b806354846d7a116100d357806354846d7a1461016757806363e4afc21461019c5780637000b051146101af578063715018a6146101d657600080fd5b8063124d7199146100fa5780632785e3221461010f57806346657fe91461012d575b600080fd5b61010d61010836600461164e565b6102a1565b005b6101176102b5565b604051610124919061168d565b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610124565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610124565b61014f6101aa36600461169b565b6102ca565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b61010d6102e9565b6101e6600381565b60405160ff9091168152602001610124565b6000546201000090046001600160a01b031661014f565b61022261021d3660046116fc565b6102fd565b6040516101249190611827565b7f000000000000000000000000000000000000000000000000000000000000000061014f565b6102226102633660046118ae565b61045c565b61010d61027636600461195f565b610817565b6102226102893660046116fc565b61093a565b61010d61029c366004611997565b610a56565b6102a9610acc565b6102b281610b2d565b50565b6102bd611445565b6102c5610b75565b905090565b6000818152600360205260408120546001600160a01b03165b92915050565b6102f1610acc565b6102fb6000610baf565b565b6060600061031261030d866119db565b610c0a565b60408051600180825281830190925291925060009190816020015b610335611463565b81526020019060019003908161032d575050606083015151909150600090610386906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611b6a565b90507f00000000000000000000000000000000000000000000000000000000000000008111156103d157604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b03168152602001856020015181526020014263ffffffff168152602001604051806020016040528060008152508152508360008151811061044557610445611b82565b602090810291909101015250909695505050505050565b60606000856001600160401b0381111561047857610478611559565b6040519080825280602002602001820160405280156104a1578160200160208202803683370190505b5090506000866001600160401b038111156104be576104be611559565b6040519080825280602002602001820160405280156104e7578160200160208202803683370190505b5090506000876001600160401b0381111561050457610504611559565b60405190808252806020026020018201604052801561053d57816020015b61052a611463565b8152602001906001900390816105225790505b50905060005b88811015610711576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f8881811061059257610592611b82565b905060200201358e6040518363ffffffff1660e01b81526004016105c99291909182526001600160a01b0316602082015260400190565b600060405180830381865afa1580156105e6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261060e9190810190611b98565b93509350935093508b88868151811061062957610629611b82565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061065b5761065b611b82565b9050602002013587868151811061067457610674611b82565b6020026020010181815250506040518060c001604052808f8f8881811061069d5761069d611b82565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff168152602001828152508686815181106106ef576106ef611b82565b602002602001018190525050505050808061070990611c53565b915050610543565b5061071d818787610cbe565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061076b9086908690600401611c6c565b600060405180830381600087803b15801561078557600080fd5b505af1158015610799573d6000803e3d6000fd5b5050505060005b8881101561080a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b8282815181106107db576107db611b82565b60200260200101516040516107f09190611cf0565b60405180910390a18061080281611c53565b9150506107a0565b5098975050505050505050565b600054600390610100900460ff16158015610839575060005460ff8083169116105b61089c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103c8565b6000805461ffff191660ff8316176101001781556108c96000546001600160a01b03620100009091041690565b6001600160a01b031614806108dd5750303b155b156108f4576108eb82610baf565b6108f483610b2d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6060610947848484610cd7565b60006109548585856102fd565b9050610961858585610d1f565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906109ad908490600401611827565b600060405180830381600087803b1580156109c757600080fd5b505af11580156109db573d6000803e3d6000fd5b5050505060005b8151811015610a4d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610a1e57610a1e611b82565b6020026020010151604051610a339190611cf0565b60405180910390a180610a4581611c53565b9150506109e2565b50949350505050565b610a5e610acc565b6001600160a01b038116610ac35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103c8565b6102b281610baf565b6000546001600160a01b03620100009091041633146102fb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103c8565b610b3a60018260026114b1565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051610b6a919061168d565b60405180910390a150565b610b7d611445565b60408051808201918290529060019060029082845b815481526020019060010190808311610b92575050505050905090565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b610c416040805160808101825260008082526020808301829052828401829052835180850190945281845283015290606082015290565b60008260000151600081518110610c5a57610c5a611b82565b60200260200101519050610c6d81610d88565b60008160400151806020019051810190610c879190611d13565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ce582840184611ddd565b90506000610cf282610dcc565b90506000610d0261030d876119db565b9050610d0e8183610e68565b610d17836110ab565b505050505050565b6000610d2b8383611244565b6000818152600360205260409020549091506001600160a01b03168015610d6857604051631f5d53e360e01b8152600481018390526024016103c8565b610d8182610d7c6040880160208901611997565b611269565b5050505050565b6000610d9782604001516112cf565b82519091508114610dc85781516040516337e3d1ab60e01b81526103c8918391600401918252602082015260400190565b5050565b610dd46114f4565b604051806101000160405280610de984611304565b6001600160a01b03168152602001610e0084611319565b8152602001610e0e84611328565b8152602001610e1c84611337565b8152602001610e2a84611346565b8152602001610e3884611355565b8152602001610e508460200151610100015160011490565b15158152602001610e6084611364565b905292915050565b8151604082015114610e9d57815160408281015190516347a9715d60e01b8152600481019290925260248201526044016103c8565b81606001516020015115158160c00151151503610ee65760608201516020015160c0820151604051634629f1b560e11b81529115156004830152151560248201526044016103c8565b81604001516001600160a01b031681600001516001600160a01b031614610f3a57604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016103c8565b60408201516001600160a01b03163314610f7e576040808301519051632bfa317f60e11b81523360048201526001600160a01b0390911660248201526044016103c8565b46816020015114610fb1576020810151604051630432cec160e31b815246600482015260248101919091526044016103c8565b81602001518160a0015114610fec57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016103c8565b6000610ff6610b75565b805160e08401515191925014158061101b575060208082015160e08401519091015114155b1561106457805160208083015160e0850151805192015160405163f71cb0f760e01b815260048101949094526024840191909152604483019190915260648201526084016103c8565b600061106f846113bc565b9050808360600151146110a55760608301516040516377bb6d2760e11b81526103c8918391600401918252602082015260400190565b50505050565b8051805160208083015160409384015191850151935163c542c93b60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463c542c93b9461110e94909392909190600401611eae565b602060405180830381865afa925050508015611147575060408051601f3d908101601f1916820190925261114491810190611f55565b60015b61121d57611153611f70565b806308c379a00361118c5750611167611f8c565b8061117257506111cb565b8060405162dd577760e81b81526004016103c89190612015565b634e487b71036111cb5761119e612028565b906111a957506111cb565b60405162dd577760e81b815260206004820152600060248201526044016103c8565b3d8080156111f5576040519150601f19603f3d011682016040523d82523d6000602084013e6111fa565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016103c8565b80610dc85760405162dd577760e81b815260206004820152600060248201526044016103c8565b60008061125383850185611ddd565b9050600061126082611346565b95945050505050565b60008281526003602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102e3907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190612048565b6020810151600090815b602002015192915050565b6020810151600090600161130e565b6020810151600090600461130e565b6020810151600090600561130e565b6020810151600090600661130e565b6020810151600090600761130e565b61136c611445565b6040518060400160405280836020015160026009811061138e5761138e611b82565b6020020151815260200183602001516003600981106113af576113af611b82565b6020020151905292915050565b6000806113da308460600151600001516001600160801b03166113e1565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113da9190612048565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b82600281019282156114df579160200282015b828111156114df5782518255916020019190600101906114c4565b506114eb929150611544565b5090565b905290565b60405180610100016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114ef611445565b5b808211156114eb5760008155600101611545565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b038211171561158e5761158e611559565b60405250565b606081018181106001600160401b038211171561158e5761158e611559565b601f8201601f191681016001600160401b03811182821017156115d8576115d8611559565b6040525050565b600082601f8301126115f057600080fd5b604051604081018181106001600160401b038211171561161257611612611559565b806040525080604084018581111561162957600080fd5b845b8181101561164357803583526020928301920161162b565b509195945050505050565b60006040828403121561166057600080fd5b6113da83836115df565b8060005b60028110156110a557815184526020938401939091019060010161166e565b604081016102e3828461166a565b6000602082840312156116ad57600080fd5b5035919050565b60008083601f8401126116c657600080fd5b5081356001600160401b038111156116dd57600080fd5b6020830191508360208285010111156116f557600080fd5b9250929050565b60008060006040848603121561171157600080fd5b83356001600160401b038082111561172857600080fd5b908501906040828803121561173c57600080fd5b9093506020850135908082111561175257600080fd5b5061175f868287016116b4565b9497909650939450505050565b60005b8381101561178757818101518382015260200161176f565b838111156110a55750506000910152565b600081518084526117b081602086016020860161176c565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261181f60c0850182611798565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561187c57603f1988860301845261186a8583516117c4565b9450928501929085019060010161184e565b5092979650505050505050565b6001600160a01b03811681146102b257600080fd5b80356118a981611889565b919050565b6000806000806000606086880312156118c657600080fd5b85356001600160401b03808211156118dd57600080fd5b818801915088601f8301126118f157600080fd5b81358181111561190057600080fd5b8960208260051b850101111561191557600080fd5b6020830197508096505061192b6020890161189e565b9450604088013591508082111561194157600080fd5b5061194e888289016116b4565b969995985093965092949392505050565b6000806060838503121561197257600080fd5b61197c84846115df565b9150604083013561198c81611889565b809150509250929050565b6000602082840312156119a957600080fd5b81356113da81611889565b60006001600160401b038211156119cd576119cd611559565b50601f01601f191660200190565b600060408083360312156119ee57600080fd5b80516119f98161156f565b83356001600160401b0380821115611a1057600080fd5b9085019036601f830112611a2357600080fd5b8135602082821115611a3757611a37611559565b8160051b8651611a49838301826115b3565b92835284810182019282810136851115611a6257600080fd5b83870192505b84831015611b3657823586811115611a805760008081fd5b8701606036829003601f1901811315611a995760008081fd5b8a51611aa481611594565b8287013581528b83013581880152908201359088821115611ac55760008081fd5b9181019136603f840112611adb57600091508182fd5b868301359150611aea826119b4565b8c51611af682826115b3565b838152368e858701011115611b0d57600091508182fd5b838e86018a830137600093810189019390935250808c0191909152825250918301918301611a68565b50865250611b4588820161189e565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611b7d57611b7d611b54565b500190565b634e487b7160e01b600052603260045260246000fd5b60008060008060808587031215611bae57600080fd5b8451611bb981611889565b60208601516040870151919550935063ffffffff81168114611bda57600080fd5b60608601519092506001600160401b03811115611bf657600080fd5b8501601f81018713611c0757600080fd5b8051611c12816119b4565b604051611c1f82826115b3565b828152896020848601011115611c3457600080fd5b611c4583602083016020870161176c565b969995985093965050505050565b600060018201611c6557611c65611b54565b5060010190565b604080825283519082018190526000906020906060840190828701845b82811015611cae5781516001600160a01b031684529284019290840190600101611c89565b5050508381038285015284518082528583019183019060005b81811015611ce357835183529284019291840191600101611cc7565b5090979650505050505050565b6020815260006113da60208301846117c4565b805180151581146118a957600080fd5b600060408284031215611d2557600080fd5b604051604081018181106001600160401b0382111715611d4757611d47611559565b60405282516001600160801b0381168114611d6157600080fd5b8152611d6f60208401611d03565b60208201529392505050565b600082601f830112611d8c57600080fd5b6040516101208082018281106001600160401b0382111715611db057611db0611559565b60405283018185821115611dc357600080fd5b845b82811015611643578035825260209182019101611dc5565b6000818303610220811215611df157600080fd5b60408051611dfe8161156f565b61010080841215611e0e57600080fd5b82519350611e1b84611594565b611e2587876115df565b845286605f870112611e3657600080fd5b8251611e418161156f565b8060c0880189811115611e5357600080fd5b8589015b81811015611e7857611e698b826115df565b83526020909201918601611e57565b50826020880152611e898a826115df565b86880152505050838252611e9f87828801611d7b565b60208301525095945050505050565b6102208101611ebd828761166a565b60408083018660005b6002808210611ed55750611f10565b82518460005b83811015611ef9578251825260209283019290910190600101611edb565b505050928401925060209190910190600101611ec6565b50505050611f2160c083018561166a565b61010082018360005b6009811015611f49578151835260209283019290910190600101611f2a565b50505095945050505050565b600060208284031215611f6757600080fd5b6113da82611d03565b600060033d1115611f895760046000803e5060005160e01c5b90565b600060443d1015611f9a5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611fc957505050505090565b8285019150815181811115611fe15750505050505090565b843d8701016020828501011115611ffb5750505050505090565b61200a602082860101876115b3565b509095945050505050565b6020815260006113da6020830184611798565b60008060233d1115612044576020600460003e50506000516001905b9091565b60008261206557634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220ecfcdd3ed3aafdf6de9cf8f871557ae2657814cf595e7da8c33a09d25121780964736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063754b377c11610097578063c776adde11610066578063c776adde14610255578063c9cdef0414610268578063e60f999f1461027b578063f2fde38b1461028e57600080fd5b8063754b377c146101de5780638da5cb5b146101f8578063af411a301461020f578063bfa665851461022f57600080fd5b806354846d7a116100d357806354846d7a1461016757806363e4afc21461019c5780637000b051146101af578063715018a6146101d657600080fd5b8063124d7199146100fa5780632785e3221461010f57806346657fe91461012d575b600080fd5b61010d61010836600461164e565b6102a1565b005b6101176102b5565b604051610124919061168d565b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610124565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610124565b61014f6101aa36600461169b565b6102ca565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b61010d6102e9565b6101e6600381565b60405160ff9091168152602001610124565b6000546201000090046001600160a01b031661014f565b61022261021d3660046116fc565b6102fd565b6040516101249190611827565b7f000000000000000000000000000000000000000000000000000000000000000061014f565b6102226102633660046118ae565b61045c565b61010d61027636600461195f565b610817565b6102226102893660046116fc565b61093a565b61010d61029c366004611997565b610a56565b6102a9610acc565b6102b281610b2d565b50565b6102bd611445565b6102c5610b75565b905090565b6000818152600360205260408120546001600160a01b03165b92915050565b6102f1610acc565b6102fb6000610baf565b565b6060600061031261030d866119db565b610c0a565b60408051600180825281830190925291925060009190816020015b610335611463565b81526020019060019003908161032d575050606083015151909150600090610386906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611b6a565b90507f00000000000000000000000000000000000000000000000000000000000000008111156103d157604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b03168152602001856020015181526020014263ffffffff168152602001604051806020016040528060008152508152508360008151811061044557610445611b82565b602090810291909101015250909695505050505050565b60606000856001600160401b0381111561047857610478611559565b6040519080825280602002602001820160405280156104a1578160200160208202803683370190505b5090506000866001600160401b038111156104be576104be611559565b6040519080825280602002602001820160405280156104e7578160200160208202803683370190505b5090506000876001600160401b0381111561050457610504611559565b60405190808252806020026020018201604052801561053d57816020015b61052a611463565b8152602001906001900390816105225790505b50905060005b88811015610711576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f8881811061059257610592611b82565b905060200201358e6040518363ffffffff1660e01b81526004016105c99291909182526001600160a01b0316602082015260400190565b600060405180830381865afa1580156105e6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261060e9190810190611b98565b93509350935093508b88868151811061062957610629611b82565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061065b5761065b611b82565b9050602002013587868151811061067457610674611b82565b6020026020010181815250506040518060c001604052808f8f8881811061069d5761069d611b82565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff168152602001828152508686815181106106ef576106ef611b82565b602002602001018190525050505050808061070990611c53565b915050610543565b5061071d818787610cbe565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061076b9086908690600401611c6c565b600060405180830381600087803b15801561078557600080fd5b505af1158015610799573d6000803e3d6000fd5b5050505060005b8881101561080a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b8282815181106107db576107db611b82565b60200260200101516040516107f09190611cf0565b60405180910390a18061080281611c53565b9150506107a0565b5098975050505050505050565b600054600390610100900460ff16158015610839575060005460ff8083169116105b61089c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103c8565b6000805461ffff191660ff8316176101001781556108c96000546001600160a01b03620100009091041690565b6001600160a01b031614806108dd5750303b155b156108f4576108eb82610baf565b6108f483610b2d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6060610947848484610cd7565b60006109548585856102fd565b9050610961858585610d1f565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906109ad908490600401611827565b600060405180830381600087803b1580156109c757600080fd5b505af11580156109db573d6000803e3d6000fd5b5050505060005b8151811015610a4d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610a1e57610a1e611b82565b6020026020010151604051610a339190611cf0565b60405180910390a180610a4581611c53565b9150506109e2565b50949350505050565b610a5e610acc565b6001600160a01b038116610ac35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103c8565b6102b281610baf565b6000546001600160a01b03620100009091041633146102fb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103c8565b610b3a60018260026114b1565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051610b6a919061168d565b60405180910390a150565b610b7d611445565b60408051808201918290529060019060029082845b815481526020019060010190808311610b92575050505050905090565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b610c416040805160808101825260008082526020808301829052828401829052835180850190945281845283015290606082015290565b60008260000151600081518110610c5a57610c5a611b82565b60200260200101519050610c6d81610d88565b60008160400151806020019051810190610c879190611d13565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ce582840184611ddd565b90506000610cf282610dcc565b90506000610d0261030d876119db565b9050610d0e8183610e68565b610d17836110ab565b505050505050565b6000610d2b8383611244565b6000818152600360205260409020549091506001600160a01b03168015610d6857604051631f5d53e360e01b8152600481018390526024016103c8565b610d8182610d7c6040880160208901611997565b611269565b5050505050565b6000610d9782604001516112cf565b82519091508114610dc85781516040516337e3d1ab60e01b81526103c8918391600401918252602082015260400190565b5050565b610dd46114f4565b604051806101000160405280610de984611304565b6001600160a01b03168152602001610e0084611319565b8152602001610e0e84611328565b8152602001610e1c84611337565b8152602001610e2a84611346565b8152602001610e3884611355565b8152602001610e508460200151610100015160011490565b15158152602001610e6084611364565b905292915050565b8151604082015114610e9d57815160408281015190516347a9715d60e01b8152600481019290925260248201526044016103c8565b81606001516020015115158160c00151151503610ee65760608201516020015160c0820151604051634629f1b560e11b81529115156004830152151560248201526044016103c8565b81604001516001600160a01b031681600001516001600160a01b031614610f3a57604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016103c8565b60408201516001600160a01b03163314610f7e576040808301519051632bfa317f60e11b81523360048201526001600160a01b0390911660248201526044016103c8565b46816020015114610fb1576020810151604051630432cec160e31b815246600482015260248101919091526044016103c8565b81602001518160a0015114610fec57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016103c8565b6000610ff6610b75565b805160e08401515191925014158061101b575060208082015160e08401519091015114155b1561106457805160208083015160e0850151805192015160405163f71cb0f760e01b815260048101949094526024840191909152604483019190915260648201526084016103c8565b600061106f846113bc565b9050808360600151146110a55760608301516040516377bb6d2760e11b81526103c8918391600401918252602082015260400190565b50505050565b8051805160208083015160409384015191850151935163c542c93b60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463c542c93b9461110e94909392909190600401611eae565b602060405180830381865afa925050508015611147575060408051601f3d908101601f1916820190925261114491810190611f55565b60015b61121d57611153611f70565b806308c379a00361118c5750611167611f8c565b8061117257506111cb565b8060405162dd577760e81b81526004016103c89190612015565b634e487b71036111cb5761119e612028565b906111a957506111cb565b60405162dd577760e81b815260206004820152600060248201526044016103c8565b3d8080156111f5576040519150601f19603f3d011682016040523d82523d6000602084013e6111fa565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016103c8565b80610dc85760405162dd577760e81b815260206004820152600060248201526044016103c8565b60008061125383850185611ddd565b9050600061126082611346565b95945050505050565b60008281526003602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102e3907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190612048565b6020810151600090815b602002015192915050565b6020810151600090600161130e565b6020810151600090600461130e565b6020810151600090600561130e565b6020810151600090600661130e565b6020810151600090600761130e565b61136c611445565b6040518060400160405280836020015160026009811061138e5761138e611b82565b6020020151815260200183602001516003600981106113af576113af611b82565b6020020151905292915050565b6000806113da308460600151600001516001600160801b03166113e1565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113da9190612048565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b82600281019282156114df579160200282015b828111156114df5782518255916020019190600101906114c4565b506114eb929150611544565b5090565b905290565b60405180610100016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114ef611445565b5b808211156114eb5760008155600101611545565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b038211171561158e5761158e611559565b60405250565b606081018181106001600160401b038211171561158e5761158e611559565b601f8201601f191681016001600160401b03811182821017156115d8576115d8611559565b6040525050565b600082601f8301126115f057600080fd5b604051604081018181106001600160401b038211171561161257611612611559565b806040525080604084018581111561162957600080fd5b845b8181101561164357803583526020928301920161162b565b509195945050505050565b60006040828403121561166057600080fd5b6113da83836115df565b8060005b60028110156110a557815184526020938401939091019060010161166e565b604081016102e3828461166a565b6000602082840312156116ad57600080fd5b5035919050565b60008083601f8401126116c657600080fd5b5081356001600160401b038111156116dd57600080fd5b6020830191508360208285010111156116f557600080fd5b9250929050565b60008060006040848603121561171157600080fd5b83356001600160401b038082111561172857600080fd5b908501906040828803121561173c57600080fd5b9093506020850135908082111561175257600080fd5b5061175f868287016116b4565b9497909650939450505050565b60005b8381101561178757818101518382015260200161176f565b838111156110a55750506000910152565b600081518084526117b081602086016020860161176c565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261181f60c0850182611798565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561187c57603f1988860301845261186a8583516117c4565b9450928501929085019060010161184e565b5092979650505050505050565b6001600160a01b03811681146102b257600080fd5b80356118a981611889565b919050565b6000806000806000606086880312156118c657600080fd5b85356001600160401b03808211156118dd57600080fd5b818801915088601f8301126118f157600080fd5b81358181111561190057600080fd5b8960208260051b850101111561191557600080fd5b6020830197508096505061192b6020890161189e565b9450604088013591508082111561194157600080fd5b5061194e888289016116b4565b969995985093965092949392505050565b6000806060838503121561197257600080fd5b61197c84846115df565b9150604083013561198c81611889565b809150509250929050565b6000602082840312156119a957600080fd5b81356113da81611889565b60006001600160401b038211156119cd576119cd611559565b50601f01601f191660200190565b600060408083360312156119ee57600080fd5b80516119f98161156f565b83356001600160401b0380821115611a1057600080fd5b9085019036601f830112611a2357600080fd5b8135602082821115611a3757611a37611559565b8160051b8651611a49838301826115b3565b92835284810182019282810136851115611a6257600080fd5b83870192505b84831015611b3657823586811115611a805760008081fd5b8701606036829003601f1901811315611a995760008081fd5b8a51611aa481611594565b8287013581528b83013581880152908201359088821115611ac55760008081fd5b9181019136603f840112611adb57600091508182fd5b868301359150611aea826119b4565b8c51611af682826115b3565b838152368e858701011115611b0d57600091508182fd5b838e86018a830137600093810189019390935250808c0191909152825250918301918301611a68565b50865250611b4588820161189e565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611b7d57611b7d611b54565b500190565b634e487b7160e01b600052603260045260246000fd5b60008060008060808587031215611bae57600080fd5b8451611bb981611889565b60208601516040870151919550935063ffffffff81168114611bda57600080fd5b60608601519092506001600160401b03811115611bf657600080fd5b8501601f81018713611c0757600080fd5b8051611c12816119b4565b604051611c1f82826115b3565b828152896020848601011115611c3457600080fd5b611c4583602083016020870161176c565b969995985093965050505050565b600060018201611c6557611c65611b54565b5060010190565b604080825283519082018190526000906020906060840190828701845b82811015611cae5781516001600160a01b031684529284019290840190600101611c89565b5050508381038285015284518082528583019183019060005b81811015611ce357835183529284019291840191600101611cc7565b5090979650505050505050565b6020815260006113da60208301846117c4565b805180151581146118a957600080fd5b600060408284031215611d2557600080fd5b604051604081018181106001600160401b0382111715611d4757611d47611559565b60405282516001600160801b0381168114611d6157600080fd5b8152611d6f60208401611d03565b60208201529392505050565b600082601f830112611d8c57600080fd5b6040516101208082018281106001600160401b0382111715611db057611db0611559565b60405283018185821115611dc357600080fd5b845b82811015611643578035825260209182019101611dc5565b6000818303610220811215611df157600080fd5b60408051611dfe8161156f565b61010080841215611e0e57600080fd5b82519350611e1b84611594565b611e2587876115df565b845286605f870112611e3657600080fd5b8251611e418161156f565b8060c0880189811115611e5357600080fd5b8589015b81811015611e7857611e698b826115df565b83526020909201918601611e57565b50826020880152611e898a826115df565b86880152505050838252611e9f87828801611d7b565b60208301525095945050505050565b6102208101611ebd828761166a565b60408083018660005b6002808210611ed55750611f10565b82518460005b83811015611ef9578251825260209283019290910190600101611edb565b505050928401925060209190910190600101611ec6565b50505050611f2160c083018561166a565b61010082018360005b6009811015611f49578151835260209283019290910190600101611f2a565b50505095945050505050565b600060208284031215611f6757600080fd5b6113da82611d03565b600060033d1115611f895760046000803e5060005160e01c5b90565b600060443d1015611f9a5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611fc957505050505090565b8285019150815181811115611fe15750505050505090565b843d8701016020828501011115611ffb5750505050505090565b61200a602082860101876115b3565b509095945050505050565b6020815260006113da6020830184611798565b60008060233d1115612044576020600460003e50506000516001905b9091565b60008261206557634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220ecfcdd3ed3aafdf6de9cf8f871557ae2657814cf595e7da8c33a09d25121780964736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns attestations that will be recorded, constructed from the user request", - "params": { - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "collectionIdFirst": "Id of the first collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last collection in which the attester is supposed to record", - "commitmentSignerPubKey": "The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme", - "owner": "The owner of the contract that can update the commitment signer pub key", - "pythia1VerifierAddress": "ZK Snark Pythia-1 Verifier contract" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getCommitmentSignerPubKey()": { - "details": "Getter of the Commitment signer Eddsa Public key" - }, - "getDestinationOfTicket(uint256)": { - "details": "Getter, returns the last attestation destination of a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getVerifier()": { - "details": "Getter of Pythia-1 Verifier contract" - }, - "initialize(uint256[2],address)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "commitmentSignerPubKey": "EdDSA public key of the commitment signer", - "ownerAddress": "Owner of the contract, can update public key and address" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "stateVariables": { - "AUTHORIZED_COLLECTION_ID_FIRST": { - "details": "Getter returns of the first collection in which the attester is supposed to record*" - }, - "AUTHORIZED_COLLECTION_ID_LAST": { - "details": "Getter returns of the last collection in which the attester is supposed to record*" - } - }, - "title": "Pythia-1 Simple Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(uint256[2],address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "This attester is part of the family of the Pythia-1 Attesters. Pythia-1 attesters enable users to prove they have a claim and its proof issued by an offchain service in a privacy preserving way. That means no-one can make the link between the account used in the offchain service and the onchain account where the attestation is stored. The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic. We invite readers to refer to: - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each users gets one userTicket per claim For people used to semaphore/ tornado cash people: userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 396, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_owner", - "offset": 2, - "slot": "0", - "type": "t_address" - }, - { - "astId": 9697, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_commitmentSignerPubKey", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)2_storage" - }, - { - "astId": 9701, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_ticketsDestinations", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_uint256,t_address)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)2_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[2]", - "numberOfBytes": "64" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_address)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/mumbai/Pythia1SimpleAttesterImplem.json b/deployments/mumbai/Pythia1SimpleAttesterImplem.json deleted file mode 100644 index 9b83bff..0000000 --- a/deployments/mumbai/Pythia1SimpleAttesterImplem.json +++ /dev/null @@ -1,1056 +0,0 @@ -{ - "address": "0x5CE8544C05F6Ed9Dc626071505795C3c4E1EB559", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - }, - { - "internalType": "address", - "name": "pythia1VerifierAddress", - "type": "address" - }, - { - "internalType": "uint256[2]", - "name": "commitmentSignerPubKey", - "type": "uint256[2]" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentSignerPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "GroupIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedTicketIdentifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ticketIdentifier", - "type": "uint256" - } - ], - "name": "TicketIdentifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "TicketUsed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "sender", - "type": "address" - }, - { - "internalType": "address", - "name": "inputdestination", - "type": "address" - } - ], - "name": "UserShouldOwnItsDestination", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256[2]", - "name": "newCommitmentSignerPubKey", - "type": "uint256[2]" - } - ], - "name": "CommitmentSignerPubKeyUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "TicketDestinationUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentSignerPubKey", - "outputs": [ - { - "internalType": "uint256[2]", - "name": "", - "type": "uint256[2]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getDestinationOfTicket", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract Pythia1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "commitmentSignerPubKey", - "type": "uint256[2]" - }, - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "commitmentSignerPubKey", - "type": "uint256[2]" - } - ], - "name": "updateCommitmentSignerPubKey", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x7757d7b590e85f889004b3d89b9bbe8bfd1795b460382bb17de6ed1dde0088a0", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x5CE8544C05F6Ed9Dc626071505795C3c4E1EB559", - "transactionIndex": 23, - "gasUsed": "1945946", - "logsBloom": "0x00000000000000000000000000020000000000000000000000800010000000000000000000000020000000000000000000008000000040000000000000000000000000000000000000000000000000800001000000000000000100000000000000000000020000000000000000000800002000000200000080000000000000400000000000000000008000000000000000000010000080000000000000008000200000000000000000200000800400000000000000000000000000000000004000000000000000000001000000040000000000000000000000100000001020000000000000000000000000000000000000002200000000000020000000100000", - "blockHash": "0xcdd137365ec23546d2267ad15968428470503f9c792d3f666ac25fcb94a9f2f4", - "transactionHash": "0x7757d7b590e85f889004b3d89b9bbe8bfd1795b460382bb17de6ed1dde0088a0", - "logs": [ - { - "transactionIndex": 23, - "blockNumber": 29540709, - "transactionHash": "0x7757d7b590e85f889004b3d89b9bbe8bfd1795b460382bb17de6ed1dde0088a0", - "address": "0x5CE8544C05F6Ed9Dc626071505795C3c4E1EB559", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" - ], - "data": "0x", - "logIndex": 101, - "blockHash": "0xcdd137365ec23546d2267ad15968428470503f9c792d3f666ac25fcb94a9f2f4" - }, - { - "transactionIndex": 23, - "blockNumber": 29540709, - "transactionHash": "0x7757d7b590e85f889004b3d89b9bbe8bfd1795b460382bb17de6ed1dde0088a0", - "address": "0x5CE8544C05F6Ed9Dc626071505795C3c4E1EB559", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954" - ], - "data": "0x", - "logIndex": 102, - "blockHash": "0xcdd137365ec23546d2267ad15968428470503f9c792d3f666ac25fcb94a9f2f4" - }, - { - "transactionIndex": 23, - "blockNumber": 29540709, - "transactionHash": "0x7757d7b590e85f889004b3d89b9bbe8bfd1795b460382bb17de6ed1dde0088a0", - "address": "0x5CE8544C05F6Ed9Dc626071505795C3c4E1EB559", - "topics": [ - "0xda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df" - ], - "data": "0x038d3d596875c66eb90608bbe04e4e238607fd32ad61f4278bdaf47aadc28d601b46b55a0ce3f35d6025cdd4554aaac1fc7180b14d51b0f15aa51a6929bdb952", - "logIndex": 103, - "blockHash": "0xcdd137365ec23546d2267ad15968428470503f9c792d3f666ac25fcb94a9f2f4" - }, - { - "transactionIndex": 23, - "blockNumber": 29540709, - "transactionHash": "0x7757d7b590e85f889004b3d89b9bbe8bfd1795b460382bb17de6ed1dde0088a0", - "address": "0x5CE8544C05F6Ed9Dc626071505795C3c4E1EB559", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 104, - "blockHash": "0xcdd137365ec23546d2267ad15968428470503f9c792d3f666ac25fcb94a9f2f4" - }, - { - "transactionIndex": 23, - "blockNumber": 29540709, - "transactionHash": "0x7757d7b590e85f889004b3d89b9bbe8bfd1795b460382bb17de6ed1dde0088a0", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000f903ba9e006193c1527bfbe65fe2123704ea3f99" - ], - "data": "0x000000000000000000000000000000000000000000000000000af11b618dcada0000000000000000000000000000000000000000000000007cc03a6b555a767600000000000000000000000000000000000000000000093b286bfaaecb33a9440000000000000000000000000000000000000000000000007cb5494ff3ccab9c00000000000000000000000000000000000000000000093b2876ebca2cc1741e", - "logIndex": 105, - "blockHash": "0xcdd137365ec23546d2267ad15968428470503f9c792d3f666ac25fcb94a9f2f4" - } - ], - "blockNumber": 29540709, - "cumulativeGasUsed": "7737931", - "status": 1, - "byzantium": true - }, - "args": [ - "0xf576E42E5b2682B8f606B1840c3A982610C29a3f", - "30000001", - "30000100", - "0x115dFa344C877fF74e970F06BE10FF5A59EAba02", - [ - "0x038d3d596875c66eb90608bbe04e4e238607fd32ad61f4278bdaf47aadc28d60", - "0x1b46b55a0ce3f35d6025cdd4554aaac1fc7180b14d51b0f15aa51a6929bdb952" - ], - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954" - ], - "numDeployments": 2, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"pythia1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentSignerPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"GroupIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"TicketUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputdestination\",\"type\":\"address\"}],\"name\":\"UserShouldOwnItsDestination\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256[2]\",\"name\":\"newCommitmentSignerPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"CommitmentSignerPubKeyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentSignerPubKey\",\"outputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"\",\"type\":\"uint256[2]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract Pythia1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"updateCommitmentSignerPubKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns attestations that will be recorded, constructed from the user request\",\"params\":{\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentSignerPubKey\":\"The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\",\"owner\":\"The owner of the contract that can update the commitment signer pub key\",\"pythia1VerifierAddress\":\"ZK Snark Pythia-1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getCommitmentSignerPubKey()\":{\"details\":\"Getter of the Commitment signer Eddsa Public key\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Pythia-1 Verifier contract\"},\"initialize(uint256[2],address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"commitmentSignerPubKey\":\"EdDSA public key of the commitment signer\",\"ownerAddress\":\"Owner of the contract, can update public key and address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"}},\"title\":\"Pythia-1 Simple Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(uint256[2],address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"This attester is part of the family of the Pythia-1 Attesters. Pythia-1 attesters enable users to prove they have a claim and its proof issued by an offchain service in a privacy preserving way. That means no-one can make the link between the account used in the offchain service and the onchain account where the attestation is stored. The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic. We invite readers to refer to: - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each users gets one userTicket per claim For people used to semaphore/ tornado cash people: userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/pythia-1/Pythia1SimpleAttester.sol\":\"Pythia1SimpleAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/pythia-1/contracts/Pythia1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract Pythia1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\\n );\\n vk.IC = new Pairing.G1Point[](10);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 104028078850975554065172701281783302003220555203883119831575537681421753151,\\n 19148240629904598794948591359118971959790791697910953160820265703277306346\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[9] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3babb956e64535b9bf535df94288b4d83ea82c54727f79ee8949fe4a19c1d5ba\",\"license\":\"GPL-3.0\"},\"contracts/attesters/pythia-1/Pythia1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to Pythia1 Proving Scheme\\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\\n\\n/**\\n * @title Pythia-1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Pythia-1 Attesters.\\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \\n * offchain service in a privacy preserving way. \\n * That means no-one can make the link between the account used in the offchain service\\n * and the onchain account where the attestation is stored.\\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\\n * We invite readers to refer to:\\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each users gets one userTicket per claim\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n **/\\n\\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\\n using Pythia1Lib for Pythia1ProofData;\\n using Pythia1Lib for bytes;\\n using Pythia1Lib for Request;\\n\\n uint8 public constant IMPLEMENTATION_VERSION = 3;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n uint256[2] internal _commitmentSignerPubKey;\\n mapping(uint256 => address) internal _ticketsDestinations;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\\n * @param owner The owner of the contract that can update the commitment signer pub key\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n address pythia1VerifierAddress,\\n uint256[2] memory commitmentSignerPubKey,\\n address owner\\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n initialize(commitmentSignerPubKey, owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n uint256[2] memory commitmentSignerPubKey,\\n address ownerAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\\n }\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into Pythia1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\\n Pythia1ProofInput memory snarkInput = snarkProof._input();\\n Pythia1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata\\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\\n Pythia1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.internalCollectionId;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n uint32(block.timestamp),\\n ''\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used\\n * @param request users request. Claim of beiing part of a group.\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n // we get the ticket used from the snark input in the data provided\\n uint256 userTicket = proofData._getTicket();\\n address currentDestination = _getDestinationOfTicket(userTicket);\\n\\n if (currentDestination != address(0)) {\\n revert TicketUsed(userTicket);\\n }\\n\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n /*******************************************************\\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\\n * users bring secretHash as private input in snark which guarantees privacy\\n * the secretHash is only known by the user and never escape the user's browser\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(\\n Pythia1Claim memory claim\\n ) internal view override returns (uint256) {\\n uint256 ticketIdentifier = _encodeInSnarkField(\\n address(this),\\n claim.groupProperties.internalCollectionId\\n );\\n return ticketIdentifier;\\n }\\n\\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\\n return _commitmentSignerPubKey;\\n }\\n\\n /*******************************************************\\n Pythia-1 Attester Specific Functions\\n *******************************************************/\\n\\n function updateCommitmentSignerPubKey(\\n uint256[2] memory commitmentSignerPubKey\\n ) external onlyOwner {\\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\\n }\\n\\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\\n _commitmentSignerPubKey = commitmentSignerPubKey;\\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\\n }\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _ticketsDestinations[userTicket] = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _ticketsDestinations[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x22a505a2f8a3246ad46cf6fdd5eeab1a58b7fcb08982d03ff742f48aec063b82\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/base/IPythia1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\\n\\ninterface IPythia1Base {\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error UserShouldOwnItsDestination(address sender, address inputdestination);\\n error CommitmentSignerPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Pythia-1 Verifier contract\\n */\\n function getVerifier() external view returns (Pythia1Verifier);\\n\\n /**\\n * @dev Getter of the Commitment Signer EdDSA Public Key\\n */\\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\\n}\\n\",\"keccak256\":\"0x61924d768ab0c8cd61d0ff3c9ecbfbc37aacdbec7f575f0d46041b1847222526\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/base/Pythia1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IPythia1Base} from './IPythia1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Pythia 1 ZK Proving Scheme\\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\\n\\n/**\\n * @title Pythia-1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \\n * without anyone being able to make the link between the offchain service and the onchain service.\\n * It is inherited by the family of Pythia-1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to:\\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\\n \\n \\n **/\\nabstract contract Pythia1Base is IPythia1Base, Initializable {\\n using Pythia1Lib for Pythia1ProofData;\\n\\n // ZK-SNARK Verifier\\n Pythia1Verifier immutable VERIFIER;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\\n */\\n constructor(address Pythia1VerifierAddress) {\\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\\n }\\n\\n /**\\n * @dev Getter of Pythia-1 Verifier contract\\n */\\n function getVerifier() external view returns (Pythia1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of the Commitment signer Eddsa Public key\\n */\\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\\n return _getCommitmentSignerPubKey();\\n }\\n\\n /*******************************************************\\n Pythia-1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\\n * the secretHash is a number only known by the user and is used in \\n * the zero knowledge as a private input which guarantees privacy\\n\\n * This function MUST be implemented by Pythia-1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Pythia-1 Simple Attester for an example\\n * @param claim user claim: a particular claim that a user have that he can prove s right.\\n */\\n function _getTicketIdentifierOfClaim(\\n Pythia1Claim memory claim\\n ) internal view virtual returns (uint256);\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\\n * prove the claim was correctly issued for the user.\\n */\\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(\\n Pythia1Claim memory claim,\\n Pythia1ProofInput memory input\\n ) internal view virtual {\\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (claim.destination != msg.sender)\\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\\n if (\\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\\n )\\n revert CommitmentSignerPubKeyMismatch(\\n commitmentSignerPubKey[0],\\n commitmentSignerPubKey[1],\\n input.commitmentSignerPubKey[0],\\n input.commitmentSignerPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the plonk mathematical proof using the circom verifier contract\\n * @param proofData snark public input\\n */\\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(uint256 /*errorCode*/) {\\n revert InvalidGroth16Proof('');\\n } catch (bytes memory /*lowLevelData*/) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc15ec9f4ae345d96e52465049836e9294a37a45a4c219211264b1d7d15779285\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\\n\\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\\n error TicketUsed(uint256 userTicket);\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xa727568cccc2689a13e843d64003ffd6868537c73220e1dc94b86827c8e445d4\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/libs/Pythia1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\\n\\n// user Pythia-1 claim retrieved form his request\\nstruct Pythia1Claim {\\n uint256 groupId; // user claims be part of this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct Pythia1GroupProperties {\\n uint128 internalCollectionId;\\n bool isScore;\\n}\\n\\nstruct Pythia1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct Pythia1ProofData {\\n Pythia1CircomSnarkProof proof;\\n uint256[9] input;\\n // destination;\\n // chainId;\\n // commitmentSignerPubKey.x;\\n // commitmentSignerPubKey.y;\\n // groupId;\\n // ticketIdentifier;\\n // userTicket;\\n // value;\\n // isStrict;\\n}\\n\\nstruct Pythia1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 groupId;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n bool isStrict;\\n uint256[2] commitmentSignerPubKey;\\n}\\n\\nlibrary Pythia1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\\n return\\n Pythia1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getGroupId(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n Pythia1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (Pythia1GroupProperties)\\n );\\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(\\n Pythia1ProofData memory self\\n )\\n internal\\n pure\\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[9] memory)\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(\\n Pythia1ProofData memory self\\n ) internal pure returns (uint256[2] memory) {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(\\n Pythia1ProofData memory self\\n ) internal pure returns (uint256) {\\n return self.input[5];\\n }\\n\\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\\n return self.input[8] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 internalCollectionId,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\\n }\\n\\n function _generateGroupIdFromEncodedProperties(\\n bytes memory encodedProperties\\n ) internal pure returns (uint256) {\\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 internalCollectionId,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(internalCollectionId, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x9f50e72124764619442a1d9ad876661b56bc0abb330bc2ffe7536a1c65eb0d0e\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n address[] memory attestationOwners = new address[](collectionIds.length);\\n\\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\\n\\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n // fetch attestations from the registry\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationOwners[i] = attestationsOwner;\\n attestationCollectionIds[i] = collectionIds[i];\\n\\n attestations[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestations, proofData);\\n\\n _beforeDeleteAttestations(attestations, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n\\n _afterDeleteAttestations(attestations, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestations[i]);\\n }\\n return attestations;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x7743f02ed07e1b40a2ff45f5a45b5fe87d765326cce3528676cbd36c3d08ba37\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0x2d5faf5df56dfe1294202e89180846a1d4a5f938699619ee73b60c7314a97dfe\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101006040523480156200001257600080fd5b50604051620024dd380380620024dd8339810160408190526200003591620002d8565b6001600160a01b03838116608052861660a052620000533362000075565b60c085905260e0849052620000698282620000d0565b505050505050620003d9565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600390610100900460ff16158015620000f3575060005460ff8083169116105b6200015b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff831617610100178155620001886000546201000090046001600160a01b031690565b6001600160a01b031614806200019d5750303b155b15620001b957620001ae8262000075565b620001b983620001ff565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6200020e60018260026200024b565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051620002409190620003a6565b60405180910390a150565b82600281019282156200027c579160200282015b828111156200027c5782518255916020019190600101906200025f565b506200028a9291506200028e565b5090565b5b808211156200028a57600081556001016200028f565b80516001600160a01b0381168114620002bd57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060e08789031215620002f257600080fd5b620002fd87620002a5565b95506020808801519550604088015194506200031c60608901620002a5565b935088609f8901126200032e57600080fd5b604080519081016001600160401b0381118282101715620003535762000353620002c2565b6040528060c08a018b8111156200036957600080fd5b60808b015b818110156200038757805183529184019184016200036e565b508295506200039681620002a5565b9450505050509295509295509295565b60408101818360005b6002811015620003d0578151835260209283019290910190600101620003af565b50505092915050565b60805160a05160c05160e0516120a06200043d600039600081816101b4015261038a01526000818161016c01526103620152600081816102310152818161055301528181610734015261097801526000818161012f01526110d501526120a06000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c8063754b377c11610097578063c776adde11610066578063c776adde14610255578063c9cdef0414610268578063e60f999f1461027b578063f2fde38b1461028e57600080fd5b8063754b377c146101de5780638da5cb5b146101f8578063af411a301461020f578063bfa665851461022f57600080fd5b806354846d7a116100d357806354846d7a1461016757806363e4afc21461019c5780637000b051146101af578063715018a6146101d657600080fd5b8063124d7199146100fa5780632785e3221461010f57806346657fe91461012d575b600080fd5b61010d61010836600461164e565b6102a1565b005b6101176102b5565b604051610124919061168d565b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610124565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610124565b61014f6101aa36600461169b565b6102ca565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b61010d6102e9565b6101e6600381565b60405160ff9091168152602001610124565b6000546201000090046001600160a01b031661014f565b61022261021d3660046116fc565b6102fd565b6040516101249190611827565b7f000000000000000000000000000000000000000000000000000000000000000061014f565b6102226102633660046118ae565b61045c565b61010d61027636600461195f565b610817565b6102226102893660046116fc565b61093a565b61010d61029c366004611997565b610a56565b6102a9610acc565b6102b281610b2d565b50565b6102bd611445565b6102c5610b75565b905090565b6000818152600360205260408120546001600160a01b03165b92915050565b6102f1610acc565b6102fb6000610baf565b565b6060600061031261030d866119db565b610c0a565b60408051600180825281830190925291925060009190816020015b610335611463565b81526020019060019003908161032d575050606083015151909150600090610386906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611b6a565b90507f00000000000000000000000000000000000000000000000000000000000000008111156103d157604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b03168152602001856020015181526020014263ffffffff168152602001604051806020016040528060008152508152508360008151811061044557610445611b82565b602090810291909101015250909695505050505050565b60606000856001600160401b0381111561047857610478611559565b6040519080825280602002602001820160405280156104a1578160200160208202803683370190505b5090506000866001600160401b038111156104be576104be611559565b6040519080825280602002602001820160405280156104e7578160200160208202803683370190505b5090506000876001600160401b0381111561050457610504611559565b60405190808252806020026020018201604052801561053d57816020015b61052a611463565b8152602001906001900390816105225790505b50905060005b88811015610711576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f8881811061059257610592611b82565b905060200201358e6040518363ffffffff1660e01b81526004016105c99291909182526001600160a01b0316602082015260400190565b600060405180830381865afa1580156105e6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261060e9190810190611b98565b93509350935093508b88868151811061062957610629611b82565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061065b5761065b611b82565b9050602002013587868151811061067457610674611b82565b6020026020010181815250506040518060c001604052808f8f8881811061069d5761069d611b82565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff168152602001828152508686815181106106ef576106ef611b82565b602002602001018190525050505050808061070990611c53565b915050610543565b5061071d818787610cbe565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061076b9086908690600401611c6c565b600060405180830381600087803b15801561078557600080fd5b505af1158015610799573d6000803e3d6000fd5b5050505060005b8881101561080a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b8282815181106107db576107db611b82565b60200260200101516040516107f09190611cf0565b60405180910390a18061080281611c53565b9150506107a0565b5098975050505050505050565b600054600390610100900460ff16158015610839575060005460ff8083169116105b61089c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103c8565b6000805461ffff191660ff8316176101001781556108c96000546001600160a01b03620100009091041690565b6001600160a01b031614806108dd5750303b155b156108f4576108eb82610baf565b6108f483610b2d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6060610947848484610cd7565b60006109548585856102fd565b9050610961858585610d1f565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906109ad908490600401611827565b600060405180830381600087803b1580156109c757600080fd5b505af11580156109db573d6000803e3d6000fd5b5050505060005b8151811015610a4d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610a1e57610a1e611b82565b6020026020010151604051610a339190611cf0565b60405180910390a180610a4581611c53565b9150506109e2565b50949350505050565b610a5e610acc565b6001600160a01b038116610ac35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103c8565b6102b281610baf565b6000546001600160a01b03620100009091041633146102fb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103c8565b610b3a60018260026114b1565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051610b6a919061168d565b60405180910390a150565b610b7d611445565b60408051808201918290529060019060029082845b815481526020019060010190808311610b92575050505050905090565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b610c416040805160808101825260008082526020808301829052828401829052835180850190945281845283015290606082015290565b60008260000151600081518110610c5a57610c5a611b82565b60200260200101519050610c6d81610d88565b60008160400151806020019051810190610c879190611d13565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ce582840184611ddd565b90506000610cf282610dcc565b90506000610d0261030d876119db565b9050610d0e8183610e68565b610d17836110ab565b505050505050565b6000610d2b8383611244565b6000818152600360205260409020549091506001600160a01b03168015610d6857604051631f5d53e360e01b8152600481018390526024016103c8565b610d8182610d7c6040880160208901611997565b611269565b5050505050565b6000610d9782604001516112cf565b82519091508114610dc85781516040516337e3d1ab60e01b81526103c8918391600401918252602082015260400190565b5050565b610dd46114f4565b604051806101000160405280610de984611304565b6001600160a01b03168152602001610e0084611319565b8152602001610e0e84611328565b8152602001610e1c84611337565b8152602001610e2a84611346565b8152602001610e3884611355565b8152602001610e508460200151610100015160011490565b15158152602001610e6084611364565b905292915050565b8151604082015114610e9d57815160408281015190516347a9715d60e01b8152600481019290925260248201526044016103c8565b81606001516020015115158160c00151151503610ee65760608201516020015160c0820151604051634629f1b560e11b81529115156004830152151560248201526044016103c8565b81604001516001600160a01b031681600001516001600160a01b031614610f3a57604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016103c8565b60408201516001600160a01b03163314610f7e576040808301519051632bfa317f60e11b81523360048201526001600160a01b0390911660248201526044016103c8565b46816020015114610fb1576020810151604051630432cec160e31b815246600482015260248101919091526044016103c8565b81602001518160a0015114610fec57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016103c8565b6000610ff6610b75565b805160e08401515191925014158061101b575060208082015160e08401519091015114155b1561106457805160208083015160e0850151805192015160405163f71cb0f760e01b815260048101949094526024840191909152604483019190915260648201526084016103c8565b600061106f846113bc565b9050808360600151146110a55760608301516040516377bb6d2760e11b81526103c8918391600401918252602082015260400190565b50505050565b8051805160208083015160409384015191850151935163c542c93b60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463c542c93b9461110e94909392909190600401611eae565b602060405180830381865afa925050508015611147575060408051601f3d908101601f1916820190925261114491810190611f55565b60015b61121d57611153611f70565b806308c379a00361118c5750611167611f8c565b8061117257506111cb565b8060405162dd577760e81b81526004016103c89190612015565b634e487b71036111cb5761119e612028565b906111a957506111cb565b60405162dd577760e81b815260206004820152600060248201526044016103c8565b3d8080156111f5576040519150601f19603f3d011682016040523d82523d6000602084013e6111fa565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016103c8565b80610dc85760405162dd577760e81b815260206004820152600060248201526044016103c8565b60008061125383850185611ddd565b9050600061126082611346565b95945050505050565b60008281526003602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102e3907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190612048565b6020810151600090815b602002015192915050565b6020810151600090600161130e565b6020810151600090600461130e565b6020810151600090600561130e565b6020810151600090600661130e565b6020810151600090600761130e565b61136c611445565b6040518060400160405280836020015160026009811061138e5761138e611b82565b6020020151815260200183602001516003600981106113af576113af611b82565b6020020151905292915050565b6000806113da308460600151600001516001600160801b03166113e1565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113da9190612048565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b82600281019282156114df579160200282015b828111156114df5782518255916020019190600101906114c4565b506114eb929150611544565b5090565b905290565b60405180610100016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114ef611445565b5b808211156114eb5760008155600101611545565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b038211171561158e5761158e611559565b60405250565b606081018181106001600160401b038211171561158e5761158e611559565b601f8201601f191681016001600160401b03811182821017156115d8576115d8611559565b6040525050565b600082601f8301126115f057600080fd5b604051604081018181106001600160401b038211171561161257611612611559565b806040525080604084018581111561162957600080fd5b845b8181101561164357803583526020928301920161162b565b509195945050505050565b60006040828403121561166057600080fd5b6113da83836115df565b8060005b60028110156110a557815184526020938401939091019060010161166e565b604081016102e3828461166a565b6000602082840312156116ad57600080fd5b5035919050565b60008083601f8401126116c657600080fd5b5081356001600160401b038111156116dd57600080fd5b6020830191508360208285010111156116f557600080fd5b9250929050565b60008060006040848603121561171157600080fd5b83356001600160401b038082111561172857600080fd5b908501906040828803121561173c57600080fd5b9093506020850135908082111561175257600080fd5b5061175f868287016116b4565b9497909650939450505050565b60005b8381101561178757818101518382015260200161176f565b838111156110a55750506000910152565b600081518084526117b081602086016020860161176c565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261181f60c0850182611798565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561187c57603f1988860301845261186a8583516117c4565b9450928501929085019060010161184e565b5092979650505050505050565b6001600160a01b03811681146102b257600080fd5b80356118a981611889565b919050565b6000806000806000606086880312156118c657600080fd5b85356001600160401b03808211156118dd57600080fd5b818801915088601f8301126118f157600080fd5b81358181111561190057600080fd5b8960208260051b850101111561191557600080fd5b6020830197508096505061192b6020890161189e565b9450604088013591508082111561194157600080fd5b5061194e888289016116b4565b969995985093965092949392505050565b6000806060838503121561197257600080fd5b61197c84846115df565b9150604083013561198c81611889565b809150509250929050565b6000602082840312156119a957600080fd5b81356113da81611889565b60006001600160401b038211156119cd576119cd611559565b50601f01601f191660200190565b600060408083360312156119ee57600080fd5b80516119f98161156f565b83356001600160401b0380821115611a1057600080fd5b9085019036601f830112611a2357600080fd5b8135602082821115611a3757611a37611559565b8160051b8651611a49838301826115b3565b92835284810182019282810136851115611a6257600080fd5b83870192505b84831015611b3657823586811115611a805760008081fd5b8701606036829003601f1901811315611a995760008081fd5b8a51611aa481611594565b8287013581528b83013581880152908201359088821115611ac55760008081fd5b9181019136603f840112611adb57600091508182fd5b868301359150611aea826119b4565b8c51611af682826115b3565b838152368e858701011115611b0d57600091508182fd5b838e86018a830137600093810189019390935250808c0191909152825250918301918301611a68565b50865250611b4588820161189e565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611b7d57611b7d611b54565b500190565b634e487b7160e01b600052603260045260246000fd5b60008060008060808587031215611bae57600080fd5b8451611bb981611889565b60208601516040870151919550935063ffffffff81168114611bda57600080fd5b60608601519092506001600160401b03811115611bf657600080fd5b8501601f81018713611c0757600080fd5b8051611c12816119b4565b604051611c1f82826115b3565b828152896020848601011115611c3457600080fd5b611c4583602083016020870161176c565b969995985093965050505050565b600060018201611c6557611c65611b54565b5060010190565b604080825283519082018190526000906020906060840190828701845b82811015611cae5781516001600160a01b031684529284019290840190600101611c89565b5050508381038285015284518082528583019183019060005b81811015611ce357835183529284019291840191600101611cc7565b5090979650505050505050565b6020815260006113da60208301846117c4565b805180151581146118a957600080fd5b600060408284031215611d2557600080fd5b604051604081018181106001600160401b0382111715611d4757611d47611559565b60405282516001600160801b0381168114611d6157600080fd5b8152611d6f60208401611d03565b60208201529392505050565b600082601f830112611d8c57600080fd5b6040516101208082018281106001600160401b0382111715611db057611db0611559565b60405283018185821115611dc357600080fd5b845b82811015611643578035825260209182019101611dc5565b6000818303610220811215611df157600080fd5b60408051611dfe8161156f565b61010080841215611e0e57600080fd5b82519350611e1b84611594565b611e2587876115df565b845286605f870112611e3657600080fd5b8251611e418161156f565b8060c0880189811115611e5357600080fd5b8589015b81811015611e7857611e698b826115df565b83526020909201918601611e57565b50826020880152611e898a826115df565b86880152505050838252611e9f87828801611d7b565b60208301525095945050505050565b6102208101611ebd828761166a565b60408083018660005b6002808210611ed55750611f10565b82518460005b83811015611ef9578251825260209283019290910190600101611edb565b505050928401925060209190910190600101611ec6565b50505050611f2160c083018561166a565b61010082018360005b6009811015611f49578151835260209283019290910190600101611f2a565b50505095945050505050565b600060208284031215611f6757600080fd5b6113da82611d03565b600060033d1115611f895760046000803e5060005160e01c5b90565b600060443d1015611f9a5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611fc957505050505090565b8285019150815181811115611fe15750505050505090565b843d8701016020828501011115611ffb5750505050505090565b61200a602082860101876115b3565b509095945050505050565b6020815260006113da6020830184611798565b60008060233d1115612044576020600460003e50506000516001905b9091565b60008261206557634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220ecfcdd3ed3aafdf6de9cf8f871557ae2657814cf595e7da8c33a09d25121780964736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063754b377c11610097578063c776adde11610066578063c776adde14610255578063c9cdef0414610268578063e60f999f1461027b578063f2fde38b1461028e57600080fd5b8063754b377c146101de5780638da5cb5b146101f8578063af411a301461020f578063bfa665851461022f57600080fd5b806354846d7a116100d357806354846d7a1461016757806363e4afc21461019c5780637000b051146101af578063715018a6146101d657600080fd5b8063124d7199146100fa5780632785e3221461010f57806346657fe91461012d575b600080fd5b61010d61010836600461164e565b6102a1565b005b6101176102b5565b604051610124919061168d565b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610124565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610124565b61014f6101aa36600461169b565b6102ca565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b61010d6102e9565b6101e6600381565b60405160ff9091168152602001610124565b6000546201000090046001600160a01b031661014f565b61022261021d3660046116fc565b6102fd565b6040516101249190611827565b7f000000000000000000000000000000000000000000000000000000000000000061014f565b6102226102633660046118ae565b61045c565b61010d61027636600461195f565b610817565b6102226102893660046116fc565b61093a565b61010d61029c366004611997565b610a56565b6102a9610acc565b6102b281610b2d565b50565b6102bd611445565b6102c5610b75565b905090565b6000818152600360205260408120546001600160a01b03165b92915050565b6102f1610acc565b6102fb6000610baf565b565b6060600061031261030d866119db565b610c0a565b60408051600180825281830190925291925060009190816020015b610335611463565b81526020019060019003908161032d575050606083015151909150600090610386906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611b6a565b90507f00000000000000000000000000000000000000000000000000000000000000008111156103d157604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b03168152602001856020015181526020014263ffffffff168152602001604051806020016040528060008152508152508360008151811061044557610445611b82565b602090810291909101015250909695505050505050565b60606000856001600160401b0381111561047857610478611559565b6040519080825280602002602001820160405280156104a1578160200160208202803683370190505b5090506000866001600160401b038111156104be576104be611559565b6040519080825280602002602001820160405280156104e7578160200160208202803683370190505b5090506000876001600160401b0381111561050457610504611559565b60405190808252806020026020018201604052801561053d57816020015b61052a611463565b8152602001906001900390816105225790505b50905060005b88811015610711576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f8881811061059257610592611b82565b905060200201358e6040518363ffffffff1660e01b81526004016105c99291909182526001600160a01b0316602082015260400190565b600060405180830381865afa1580156105e6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261060e9190810190611b98565b93509350935093508b88868151811061062957610629611b82565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061065b5761065b611b82565b9050602002013587868151811061067457610674611b82565b6020026020010181815250506040518060c001604052808f8f8881811061069d5761069d611b82565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff168152602001828152508686815181106106ef576106ef611b82565b602002602001018190525050505050808061070990611c53565b915050610543565b5061071d818787610cbe565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061076b9086908690600401611c6c565b600060405180830381600087803b15801561078557600080fd5b505af1158015610799573d6000803e3d6000fd5b5050505060005b8881101561080a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b8282815181106107db576107db611b82565b60200260200101516040516107f09190611cf0565b60405180910390a18061080281611c53565b9150506107a0565b5098975050505050505050565b600054600390610100900460ff16158015610839575060005460ff8083169116105b61089c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103c8565b6000805461ffff191660ff8316176101001781556108c96000546001600160a01b03620100009091041690565b6001600160a01b031614806108dd5750303b155b156108f4576108eb82610baf565b6108f483610b2d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6060610947848484610cd7565b60006109548585856102fd565b9050610961858585610d1f565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906109ad908490600401611827565b600060405180830381600087803b1580156109c757600080fd5b505af11580156109db573d6000803e3d6000fd5b5050505060005b8151811015610a4d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610a1e57610a1e611b82565b6020026020010151604051610a339190611cf0565b60405180910390a180610a4581611c53565b9150506109e2565b50949350505050565b610a5e610acc565b6001600160a01b038116610ac35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103c8565b6102b281610baf565b6000546001600160a01b03620100009091041633146102fb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103c8565b610b3a60018260026114b1565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051610b6a919061168d565b60405180910390a150565b610b7d611445565b60408051808201918290529060019060029082845b815481526020019060010190808311610b92575050505050905090565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b610c416040805160808101825260008082526020808301829052828401829052835180850190945281845283015290606082015290565b60008260000151600081518110610c5a57610c5a611b82565b60200260200101519050610c6d81610d88565b60008160400151806020019051810190610c879190611d13565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ce582840184611ddd565b90506000610cf282610dcc565b90506000610d0261030d876119db565b9050610d0e8183610e68565b610d17836110ab565b505050505050565b6000610d2b8383611244565b6000818152600360205260409020549091506001600160a01b03168015610d6857604051631f5d53e360e01b8152600481018390526024016103c8565b610d8182610d7c6040880160208901611997565b611269565b5050505050565b6000610d9782604001516112cf565b82519091508114610dc85781516040516337e3d1ab60e01b81526103c8918391600401918252602082015260400190565b5050565b610dd46114f4565b604051806101000160405280610de984611304565b6001600160a01b03168152602001610e0084611319565b8152602001610e0e84611328565b8152602001610e1c84611337565b8152602001610e2a84611346565b8152602001610e3884611355565b8152602001610e508460200151610100015160011490565b15158152602001610e6084611364565b905292915050565b8151604082015114610e9d57815160408281015190516347a9715d60e01b8152600481019290925260248201526044016103c8565b81606001516020015115158160c00151151503610ee65760608201516020015160c0820151604051634629f1b560e11b81529115156004830152151560248201526044016103c8565b81604001516001600160a01b031681600001516001600160a01b031614610f3a57604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016103c8565b60408201516001600160a01b03163314610f7e576040808301519051632bfa317f60e11b81523360048201526001600160a01b0390911660248201526044016103c8565b46816020015114610fb1576020810151604051630432cec160e31b815246600482015260248101919091526044016103c8565b81602001518160a0015114610fec57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016103c8565b6000610ff6610b75565b805160e08401515191925014158061101b575060208082015160e08401519091015114155b1561106457805160208083015160e0850151805192015160405163f71cb0f760e01b815260048101949094526024840191909152604483019190915260648201526084016103c8565b600061106f846113bc565b9050808360600151146110a55760608301516040516377bb6d2760e11b81526103c8918391600401918252602082015260400190565b50505050565b8051805160208083015160409384015191850151935163c542c93b60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463c542c93b9461110e94909392909190600401611eae565b602060405180830381865afa925050508015611147575060408051601f3d908101601f1916820190925261114491810190611f55565b60015b61121d57611153611f70565b806308c379a00361118c5750611167611f8c565b8061117257506111cb565b8060405162dd577760e81b81526004016103c89190612015565b634e487b71036111cb5761119e612028565b906111a957506111cb565b60405162dd577760e81b815260206004820152600060248201526044016103c8565b3d8080156111f5576040519150601f19603f3d011682016040523d82523d6000602084013e6111fa565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016103c8565b80610dc85760405162dd577760e81b815260206004820152600060248201526044016103c8565b60008061125383850185611ddd565b9050600061126082611346565b95945050505050565b60008281526003602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102e3907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190612048565b6020810151600090815b602002015192915050565b6020810151600090600161130e565b6020810151600090600461130e565b6020810151600090600561130e565b6020810151600090600661130e565b6020810151600090600761130e565b61136c611445565b6040518060400160405280836020015160026009811061138e5761138e611b82565b6020020151815260200183602001516003600981106113af576113af611b82565b6020020151905292915050565b6000806113da308460600151600001516001600160801b03166113e1565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113da9190612048565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b82600281019282156114df579160200282015b828111156114df5782518255916020019190600101906114c4565b506114eb929150611544565b5090565b905290565b60405180610100016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114ef611445565b5b808211156114eb5760008155600101611545565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b038211171561158e5761158e611559565b60405250565b606081018181106001600160401b038211171561158e5761158e611559565b601f8201601f191681016001600160401b03811182821017156115d8576115d8611559565b6040525050565b600082601f8301126115f057600080fd5b604051604081018181106001600160401b038211171561161257611612611559565b806040525080604084018581111561162957600080fd5b845b8181101561164357803583526020928301920161162b565b509195945050505050565b60006040828403121561166057600080fd5b6113da83836115df565b8060005b60028110156110a557815184526020938401939091019060010161166e565b604081016102e3828461166a565b6000602082840312156116ad57600080fd5b5035919050565b60008083601f8401126116c657600080fd5b5081356001600160401b038111156116dd57600080fd5b6020830191508360208285010111156116f557600080fd5b9250929050565b60008060006040848603121561171157600080fd5b83356001600160401b038082111561172857600080fd5b908501906040828803121561173c57600080fd5b9093506020850135908082111561175257600080fd5b5061175f868287016116b4565b9497909650939450505050565b60005b8381101561178757818101518382015260200161176f565b838111156110a55750506000910152565b600081518084526117b081602086016020860161176c565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261181f60c0850182611798565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561187c57603f1988860301845261186a8583516117c4565b9450928501929085019060010161184e565b5092979650505050505050565b6001600160a01b03811681146102b257600080fd5b80356118a981611889565b919050565b6000806000806000606086880312156118c657600080fd5b85356001600160401b03808211156118dd57600080fd5b818801915088601f8301126118f157600080fd5b81358181111561190057600080fd5b8960208260051b850101111561191557600080fd5b6020830197508096505061192b6020890161189e565b9450604088013591508082111561194157600080fd5b5061194e888289016116b4565b969995985093965092949392505050565b6000806060838503121561197257600080fd5b61197c84846115df565b9150604083013561198c81611889565b809150509250929050565b6000602082840312156119a957600080fd5b81356113da81611889565b60006001600160401b038211156119cd576119cd611559565b50601f01601f191660200190565b600060408083360312156119ee57600080fd5b80516119f98161156f565b83356001600160401b0380821115611a1057600080fd5b9085019036601f830112611a2357600080fd5b8135602082821115611a3757611a37611559565b8160051b8651611a49838301826115b3565b92835284810182019282810136851115611a6257600080fd5b83870192505b84831015611b3657823586811115611a805760008081fd5b8701606036829003601f1901811315611a995760008081fd5b8a51611aa481611594565b8287013581528b83013581880152908201359088821115611ac55760008081fd5b9181019136603f840112611adb57600091508182fd5b868301359150611aea826119b4565b8c51611af682826115b3565b838152368e858701011115611b0d57600091508182fd5b838e86018a830137600093810189019390935250808c0191909152825250918301918301611a68565b50865250611b4588820161189e565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611b7d57611b7d611b54565b500190565b634e487b7160e01b600052603260045260246000fd5b60008060008060808587031215611bae57600080fd5b8451611bb981611889565b60208601516040870151919550935063ffffffff81168114611bda57600080fd5b60608601519092506001600160401b03811115611bf657600080fd5b8501601f81018713611c0757600080fd5b8051611c12816119b4565b604051611c1f82826115b3565b828152896020848601011115611c3457600080fd5b611c4583602083016020870161176c565b969995985093965050505050565b600060018201611c6557611c65611b54565b5060010190565b604080825283519082018190526000906020906060840190828701845b82811015611cae5781516001600160a01b031684529284019290840190600101611c89565b5050508381038285015284518082528583019183019060005b81811015611ce357835183529284019291840191600101611cc7565b5090979650505050505050565b6020815260006113da60208301846117c4565b805180151581146118a957600080fd5b600060408284031215611d2557600080fd5b604051604081018181106001600160401b0382111715611d4757611d47611559565b60405282516001600160801b0381168114611d6157600080fd5b8152611d6f60208401611d03565b60208201529392505050565b600082601f830112611d8c57600080fd5b6040516101208082018281106001600160401b0382111715611db057611db0611559565b60405283018185821115611dc357600080fd5b845b82811015611643578035825260209182019101611dc5565b6000818303610220811215611df157600080fd5b60408051611dfe8161156f565b61010080841215611e0e57600080fd5b82519350611e1b84611594565b611e2587876115df565b845286605f870112611e3657600080fd5b8251611e418161156f565b8060c0880189811115611e5357600080fd5b8589015b81811015611e7857611e698b826115df565b83526020909201918601611e57565b50826020880152611e898a826115df565b86880152505050838252611e9f87828801611d7b565b60208301525095945050505050565b6102208101611ebd828761166a565b60408083018660005b6002808210611ed55750611f10565b82518460005b83811015611ef9578251825260209283019290910190600101611edb565b505050928401925060209190910190600101611ec6565b50505050611f2160c083018561166a565b61010082018360005b6009811015611f49578151835260209283019290910190600101611f2a565b50505095945050505050565b600060208284031215611f6757600080fd5b6113da82611d03565b600060033d1115611f895760046000803e5060005160e01c5b90565b600060443d1015611f9a5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611fc957505050505090565b8285019150815181811115611fe15750505050505090565b843d8701016020828501011115611ffb5750505050505090565b61200a602082860101876115b3565b509095945050505050565b6020815260006113da6020830184611798565b60008060233d1115612044576020600460003e50506000516001905b9091565b60008261206557634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220ecfcdd3ed3aafdf6de9cf8f871557ae2657814cf595e7da8c33a09d25121780964736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns attestations that will be recorded, constructed from the user request", - "params": { - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "collectionIdFirst": "Id of the first collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last collection in which the attester is supposed to record", - "commitmentSignerPubKey": "The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme", - "owner": "The owner of the contract that can update the commitment signer pub key", - "pythia1VerifierAddress": "ZK Snark Pythia-1 Verifier contract" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getCommitmentSignerPubKey()": { - "details": "Getter of the Commitment signer Eddsa Public key" - }, - "getDestinationOfTicket(uint256)": { - "details": "Getter, returns the last attestation destination of a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getVerifier()": { - "details": "Getter of Pythia-1 Verifier contract" - }, - "initialize(uint256[2],address)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "commitmentSignerPubKey": "EdDSA public key of the commitment signer", - "ownerAddress": "Owner of the contract, can update public key and address" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "stateVariables": { - "AUTHORIZED_COLLECTION_ID_FIRST": { - "details": "Getter returns of the first collection in which the attester is supposed to record*" - }, - "AUTHORIZED_COLLECTION_ID_LAST": { - "details": "Getter returns of the last collection in which the attester is supposed to record*" - } - }, - "title": "Pythia-1 Simple Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(uint256[2],address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "This attester is part of the family of the Pythia-1 Attesters. Pythia-1 attesters enable users to prove they have a claim and its proof issued by an offchain service in a privacy preserving way. That means no-one can make the link between the account used in the offchain service and the onchain account where the attestation is stored. The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic. We invite readers to refer to: - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each users gets one userTicket per claim For people used to semaphore/ tornado cash people: userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 396, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_owner", - "offset": 2, - "slot": "0", - "type": "t_address" - }, - { - "astId": 9697, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_commitmentSignerPubKey", - "offset": 0, - "slot": "1", - "type": "t_array(t_uint256)2_storage" - }, - { - "astId": 9701, - "contract": "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol:Pythia1SimpleAttester", - "label": "_ticketsDestinations", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_uint256,t_address)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)2_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[2]", - "numberOfBytes": "64" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_address)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/mumbai/Pythia1SimpleAttesterProxy.json b/deployments/mumbai/Pythia1SimpleAttesterProxy.json deleted file mode 100644 index 0109c11..0000000 --- a/deployments/mumbai/Pythia1SimpleAttesterProxy.json +++ /dev/null @@ -1,276 +0,0 @@ -{ - "address": "0x1586190051bf7bb0b754A7AA7CDde21E920ad009", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0xecd2ffdd3fb951d04e41cc8cb319366b0cda73c75821f380704f161304034f8e", - "receipt": { - "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x1586190051bf7bb0b754A7AA7CDde21E920ad009", - "transactionIndex": 2, - "gasUsed": "657801", - "logsBloom": "0x00000000000000000000000000040000400000000000000000800010000000000000000000000020000000000000000000008000000040000000000000010000040000000000000000000000000002800001000000000000000100800000000000000000020000000000000000000800000000800000000080000000000000400000000000000000000000000000000000000010000080000000000000808000200000000000000000200000200000000000000000000000000000000000004000000020000000000001000000000000000000000400000000100000001020000000000000000000000000000000000000000200000000000020000000100000", - "blockHash": "0x4e9b6480f0ad3eccfa386b8f7ff38b1e8f3019595af07be6220ec2dfbe54914b", - "transactionHash": "0xecd2ffdd3fb951d04e41cc8cb319366b0cda73c75821f380704f161304034f8e", - "logs": [ - { - "transactionIndex": 2, - "blockNumber": 28600085, - "transactionHash": "0xecd2ffdd3fb951d04e41cc8cb319366b0cda73c75821f380704f161304034f8e", - "address": "0x1586190051bf7bb0b754A7AA7CDde21E920ad009", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x0000000000000000000000007d4358593d1f3e8202d7d3a7f3fa9e97a61b464e" - ], - "data": "0x", - "logIndex": 10, - "blockHash": "0x4e9b6480f0ad3eccfa386b8f7ff38b1e8f3019595af07be6220ec2dfbe54914b" - }, - { - "transactionIndex": 2, - "blockNumber": 28600085, - "transactionHash": "0xecd2ffdd3fb951d04e41cc8cb319366b0cda73c75821f380704f161304034f8e", - "address": "0x1586190051bf7bb0b754A7AA7CDde21E920ad009", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" - ], - "data": "0x", - "logIndex": 11, - "blockHash": "0x4e9b6480f0ad3eccfa386b8f7ff38b1e8f3019595af07be6220ec2dfbe54914b" - }, - { - "transactionIndex": 2, - "blockNumber": 28600085, - "transactionHash": "0xecd2ffdd3fb951d04e41cc8cb319366b0cda73c75821f380704f161304034f8e", - "address": "0x1586190051bf7bb0b754A7AA7CDde21E920ad009", - "topics": [ - "0xda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df" - ], - "data": "0x038d3d596875c66eb90608bbe04e4e238607fd32ad61f4278bdaf47aadc28d601b46b55a0ce3f35d6025cdd4554aaac1fc7180b14d51b0f15aa51a6929bdb952", - "logIndex": 12, - "blockHash": "0x4e9b6480f0ad3eccfa386b8f7ff38b1e8f3019595af07be6220ec2dfbe54914b" - }, - { - "transactionIndex": 2, - "blockNumber": 28600085, - "transactionHash": "0xecd2ffdd3fb951d04e41cc8cb319366b0cda73c75821f380704f161304034f8e", - "address": "0x1586190051bf7bb0b754A7AA7CDde21E920ad009", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000246e71bc2a257f4be9c7fad4664e6d7444844adc", - "logIndex": 13, - "blockHash": "0x4e9b6480f0ad3eccfa386b8f7ff38b1e8f3019595af07be6220ec2dfbe54914b" - }, - { - "transactionIndex": 2, - "blockNumber": 28600085, - "transactionHash": "0xecd2ffdd3fb951d04e41cc8cb319366b0cda73c75821f380704f161304034f8e", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000f903ba9e006193c1527bfbe65fe2123704ea3f99" - ], - "data": "0x000000000000000000000000000000000000000000000000000b2045c5c1e74d0000000000000000000000000000000000000000000000007e988c4bda10fa7b0000000000000000000000000000000000000000000007c531247d7793ce3ea60000000000000000000000000000000000000000000000007e8d6c06144f132e0000000000000000000000000000000000000000000007c5312f9dbd599025f3", - "logIndex": 14, - "blockHash": "0x4e9b6480f0ad3eccfa386b8f7ff38b1e8f3019595af07be6220ec2dfbe54914b" - } - ], - "blockNumber": 28600085, - "cumulativeGasUsed": "788600", - "status": 1, - "byzantium": true - }, - "args": [ - "0x7D4358593d1F3e8202d7d3a7f3Fa9e97a61b464E", - "0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc", - "0xc9cdef04038d3d596875c66eb90608bbe04e4e238607fd32ad61f4278bdaf47aadc28d601b46b55a0ce3f35d6025cdd4554aaac1fc7180b14d51b0f15aa51a6929bdb952000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/mumbai/solcInputs/24c70469fd559e01f6ff2a10472da9a6.json b/deployments/mumbai/solcInputs/24c70469fd559e01f6ff2a10472da9a6.json deleted file mode 100644 index f931f7d..0000000 --- a/deployments/mumbai/solcInputs/24c70469fd559e01f6ff2a10472da9a6.json +++ /dev/null @@ -1,237 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/access/AccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(account),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" - }, - "@openzeppelin/contracts/access/IAccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" - }, - "@openzeppelin/contracts/access/Ownable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" - }, - "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" - }, - "@openzeppelin/contracts/security/Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/ERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC1155.sol\";\nimport \"./IERC1155Receiver.sol\";\nimport \"./extensions/IERC1155MetadataURI.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of the basic standard multi-token.\n * See https://eips.ethereum.org/EIPS/eip-1155\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\n *\n * _Available since v3.1._\n */\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\n using Address for address;\n\n // Mapping from token ID to account balances\n mapping(uint256 => mapping(address => uint256)) private _balances;\n\n // Mapping from account to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n string private _uri;\n\n /**\n * @dev See {_setURI}.\n */\n constructor(string memory uri_) {\n _setURI(uri_);\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155).interfaceId ||\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC1155MetadataURI-uri}.\n *\n * This implementation returns the same URI for *all* token types. It relies\n * on the token type ID substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * Clients calling this function must replace the `\\{id\\}` substring with the\n * actual token type ID.\n */\n function uri(uint256) public view virtual override returns (string memory) {\n return _uri;\n }\n\n /**\n * @dev See {IERC1155-balanceOf}.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\n require(account != address(0), \"ERC1155: address zero is not a valid owner\");\n return _balances[id][account];\n }\n\n /**\n * @dev See {IERC1155-balanceOfBatch}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\n public\n view\n virtual\n override\n returns (uint256[] memory)\n {\n require(accounts.length == ids.length, \"ERC1155: accounts and ids length mismatch\");\n\n uint256[] memory batchBalances = new uint256[](accounts.length);\n\n for (uint256 i = 0; i < accounts.length; ++i) {\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\n }\n\n return batchBalances;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev See {IERC1155-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not token owner or approved\"\n );\n _safeTransferFrom(from, to, id, amount, data);\n }\n\n /**\n * @dev See {IERC1155-safeBatchTransferFrom}.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not token owner or approved\"\n );\n _safeBatchTransferFrom(from, to, ids, amounts, data);\n }\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n\n emit TransferSingle(operator, from, to, id, amount);\n\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\n\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; ++i) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n }\n\n emit TransferBatch(operator, from, to, ids, amounts);\n\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\n\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\n }\n\n /**\n * @dev Sets a new URI for all token types, by relying on the token type ID\n * substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * By this mechanism, any occurrence of the `\\{id\\}` substring in either the\n * URI or any of the amounts in the JSON file at said URI will be replaced by\n * clients with the token type ID.\n *\n * For example, the `https://token-cdn-domain/\\{id\\}.json` URI would be\n * interpreted by clients as\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\n * for token type ID 0x4cce0.\n *\n * See {uri}.\n *\n * Because these URIs cannot be meaningfully represented by the {URI} event,\n * this function emits no events.\n */\n function _setURI(string memory newuri) internal virtual {\n _uri = newuri;\n }\n\n /**\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _mint(\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _balances[id][to] += amount;\n emit TransferSingle(operator, address(0), to, id, amount);\n\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _mintBatch(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; i++) {\n _balances[ids[i]][to] += amounts[i];\n }\n\n emit TransferBatch(operator, address(0), to, ids, amounts);\n\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\n }\n\n /**\n * @dev Destroys `amount` tokens of token type `id` from `from`\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `from` must have at least `amount` tokens of token type `id`.\n */\n function _burn(\n address from,\n uint256 id,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n\n emit TransferSingle(operator, from, address(0), id, amount);\n\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n */\n function _burnBatch(\n address from,\n uint256[] memory ids,\n uint256[] memory amounts\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n for (uint256 i = 0; i < ids.length; i++) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n }\n\n emit TransferBatch(operator, from, address(0), ids, amounts);\n\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC1155: setting approval status for self\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `ids` and `amounts` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `id` and `amount` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n function _doSafeTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\n if (response != IERC1155Receiver.onERC1155Received.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non-ERC1155Receiver implementer\");\n }\n }\n }\n\n function _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\n bytes4 response\n ) {\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non-ERC1155Receiver implementer\");\n }\n }\n }\n\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\n uint256[] memory array = new uint256[](1);\n array[0] = element;\n\n return array;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1155.sol\";\nimport \"../../../security/Pausable.sol\";\n\n/**\n * @dev ERC1155 token with pausable token transfers, minting and burning.\n *\n * Useful for scenarios such as preventing trades until the end of an evaluation\n * period, or having an emergency switch for freezing all token transfers in the\n * event of a large bug.\n *\n * _Available since v3.1._\n */\nabstract contract ERC1155Pausable is ERC1155, Pausable {\n /**\n * @dev See {ERC1155-_beforeTokenTransfer}.\n *\n * Requirements:\n *\n * - the contract must not be paused.\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n require(!paused(), \"ERC1155Pausable: token transfer while paused\");\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155MetadataURI is IERC1155 {\n /**\n * @dev Returns the URI for token type `id`.\n *\n * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n * clients with the actual token type ID.\n */\n function uri(uint256 id) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/ERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"./extensions/IERC721Metadata.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/Strings.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: address zero is not a valid owner\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _ownerOf(tokenId);\n require(owner != address(0), \"ERC721: invalid token ID\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireMinted(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not token owner or approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n _requireMinted(tokenId);\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n _safeTransfer(from, to, tokenId, data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _ownerOf(tokenId) != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId, 1);\n\n // Check that tokenId was not minted by `_beforeTokenTransfer` hook\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n unchecked {\n // Will not overflow unless all 2**256 token ids are minted to the same owner.\n // Given that tokens are minted one by one, it is impossible in practice that\n // this ever happens. Might change if we allow batch minting.\n // The ERC fails to describe this case.\n _balances[to] += 1;\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId, 1);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId, 1);\n\n // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook\n owner = ERC721.ownerOf(tokenId);\n\n // Clear approvals\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // Cannot overflow, as that would require more tokens to be burned/transferred\n // out than the owner initially received through minting and transferring in.\n _balances[owner] -= 1;\n }\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId, 1);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId, 1);\n\n // Check that tokenId was not transferred by `_beforeTokenTransfer` hook\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n\n // Clear approvals from the previous owner\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // `_balances[from]` cannot overflow for the same reason as described in `_burn`:\n // `from`'s balance is the number of token held, which is at least one before the current\n // transfer.\n // `_balances[to]` could overflow in the conditions described in `_mint`. That would require\n // all 2**256 token ids to be minted, which in practice is impossible.\n _balances[from] -= 1;\n _balances[to] += 1;\n }\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId, 1);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits an {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` has not been minted yet.\n */\n function _requireMinted(uint256 tokenId) internal view virtual {\n require(_exists(tokenId), \"ERC721: invalid token ID\");\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.\n * - When `from` is zero, the tokens will be minted for `to`.\n * - When `to` is zero, ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256, /* firstTokenId */\n uint256 batchSize\n ) internal virtual {\n if (batchSize > 1) {\n if (from != address(0)) {\n _balances[from] -= batchSize;\n }\n if (to != address(0)) {\n _balances[to] += batchSize;\n }\n }\n }\n\n /**\n * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.\n * - When `from` is zero, the tokens were minted for `to`.\n * - When `to` is zero, ``from``'s tokens were burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 firstTokenId,\n uint256 batchSize\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/ERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/StorageSlot.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Strings.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" - }, - "@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract HydraS1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [8609986746108439658545470593166889256314951959466775818870246174320018498804,\n 6848251127850009101372611262053374737897586140140607384018397707035108265914],\n [21367916863936594568281095443965096905143705300114190558130516981138584550504,\n 13327705762185115653848159709412003423932761899188342359583872691135383932883]\n );\n vk.IC = new Pairing.G1Point[](11);\n \n vk.IC[0] = Pairing.G1Point( \n 19965766170734310004645394427613286415565755728797065894668054116047682895204,\n 6952067612339183672227137101423582097916038093373585908267153974352032944482\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 13987716160490730015463796942940452666334097189904948795214986996497499925899,\n 5336810094802209074340875836312868429276540870324469349093948627126061524544\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 14931593253473978964215343699995811275378324235306358485461293343370969283966,\n 564306919152089917957316877787764763278299990971316475606280877961553231205\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11591267743733991434114686002448165336885445656808796470854638278338319268343,\n 11495219763417990955889652410266075210402006084183208750635660647824890013350\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 8183184532870222270700473518157259944911700429689031755853536692005688965081,\n 9121077094104828462137861111631978599019724423614716723152060153405564278301\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 4314095526093128699362232919686741372014146055311239687202926853002748112330,\n 11665330391505820654128458332883010598817535082070674418723503440883598640597\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\n 181057165072599074288983745076121344893296348827576905983079816835912241514\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 18925967077785550270509493111690046951994174908254476036944536825999614778001,\n 4990629719417206796668074534812314525340851981015724652256935997545282642849\n ); \n \n vk.IC[10] = Pairing.G1Point( \n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[10] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "@sismo-core/pythia-1/contracts/Pythia1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract Pythia1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\n );\n vk.IC = new Pairing.G1Point[](10);\n \n vk.IC[0] = Pairing.G1Point( \n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 104028078850975554065172701281783302003220555203883119831575537681421753151,\n 19148240629904598794948591359118971959790791697910953160820265703277306346\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[9] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/HydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1Base} from './IHydraS1Base.sol';\nimport {Attester} from '../../../core/Attester.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Hydra S1 ZK Proving Scheme\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to the following:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n *\n */\nabstract contract HydraS1Base is IHydraS1Base, Attester, Initializable {\n using HydraS1Lib for HydraS1ProofData;\n\n // ZK-SNARK Verifier\n HydraS1Verifier immutable VERIFIER;\n // Registry storing the Commitment Mapper EdDSA Public key\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS\n *******************************************************/\n\n /**\n * @dev Constructor. Initializes the contract\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\n * @param commitmentMapperAddress Commitment mapper's public key registry\n */\n constructor(\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress\n ) {\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\n }\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\n return COMMITMENT_MAPPER_REGISTRY;\n }\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\n return AVAILABLE_ROOTS_REGISTRY;\n }\n\n /*******************************************************\n Hydra-S1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the nullifier from an attestation extraData\n * @dev Getter of a nullifier encoded in extraData\n * @notice Must be implemented by the inheriting contracts\n * @param extraData extraData where nullifier can be encoded\n */\n function getNullifierFromExtraData(\n bytes memory extraData\n ) external view virtual returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the external nullifier from a user request\n * so it can be checked against snark input\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\n * users bring sourceSecretHash as private input which guarantees privacy\n *\n * This function MUST be implemented by Hydra-S1 attesters.\n * This is the core function that implements the logic of external nullifiers\n *\n * Do they get one external nullifier per claim?\n * Do they get 2 external nullifiers per claim?\n * Do they get 1 external nullifier per claim, every month?\n * Take a look at Hydra-S1 Simple Attester for an example\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\n */\n function _getExternalNullifierOfClaim(\n HydraS1Claim memory claim\n ) internal view virtual returns (uint256);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(\n HydraS1Claim memory claim,\n HydraS1ProofInput memory input\n ) internal view virtual {\n if (input.accountsTreeValue != claim.groupId) {\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\n }\n\n if (input.isStrict == claim.groupProperties.isScore) {\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n }\n\n if (input.destination != claim.destination) {\n revert DestinationMismatch(claim.destination, input.destination);\n }\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot)) {\n revert RegistryRootMismatch(input.registryRoot);\n }\n\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\n if (\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\n ) {\n revert CommitmentMapperPubKeyMismatch(\n commitmentMapperPubKey[0],\n commitmentMapperPubKey[1],\n input.commitmentMapperPubKey[0],\n input.commitmentMapperPubKey[1]\n );\n }\n\n uint256 externalNullifier = _getExternalNullifierOfClaim(claim);\n\n if (input.externalNullifier != externalNullifier) {\n revert ExternalNullifierMismatch(externalNullifier, input.externalNullifier);\n }\n }\n\n /**\n * @dev verify the groth16 mathematical proof\n * @param proofData snark public input\n */\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(uint256 /*errorCode*/) {\n revert InvalidGroth16Proof('');\n } catch (bytes memory /*lowLevelData*/) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/IHydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Interface\n * @author Sismo\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\n * We invite readers to refer to the following:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n **/\ninterface IHydraS1Base is IAttester {\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\n error RegistryRootMismatch(uint256 inputRoot);\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error CommitmentMapperPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error ExternalNullifierMismatch(uint256 expectedExternalNullifier, uint256 externalNullifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error AccountsTreeValueMismatch(\n uint256 expectedAccountsTreeValue,\n uint256 inputAccountsTreeValue\n );\n error InvalidGroth16Proof(string reason);\n\n function getNullifierFromExtraData(bytes memory extraData) external view returns (uint256);\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier);\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\n\nimport {IHydraS1AccountboundAttester} from './interfaces/IHydraS1AccountboundAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from '../../core/libs/Structs.sol';\n\n// Imports related to Hydra-S1\nimport {HydraS1SimpleAttester, IAttester, HydraS1Lib, HydraS1ProofData, HydraS1Claim} from './HydraS1SimpleAttester.sol';\n\n/**\n * @title Hydra-S1 Accountbound Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic.\n * Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic.\n * However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation.\n * The _beforeRecordAttestations is also overriden to fit the Accountbound logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Nullified\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\n * While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier)\n * We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation.\n * We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation.\n * Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier)\n\n * - Accountbound (opt-in, with cooldown period)\n * The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group.\n * Users can update their attestation's destination by providing a new Hydra-S1 ZK proof \n * It means the attestation is bound to the source account, stored on an updatable destination account.\n * When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional.\n * A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred\n * One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations.\n \n * - Renewable\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew or update their attestations\n **/\n\ncontract HydraS1AccountboundAttester is\n IHydraS1AccountboundAttester,\n HydraS1SimpleAttester,\n Ownable\n{\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n uint8 public constant IMPLEMENTATION_VERSION = 4;\n\n /*******************************************************\n Storage layout:\n 20 slots between HydraS1SimpleAttester and HydraS1AccountboundAttester\n 1 currently used by Ownable\n 19 place holders\n 2O for config\n 1 currently used\n 19 place holders\n 20 for logic\n 2 currently used\n 18 place holders\n *******************************************************/\n\n // keeping some space for future config logics\n uint256[19] private _placeHolderBeforeHydraS1Accountbound;\n\n // cooldown durations for each groupIndex\n mapping(uint256 => uint32) internal _cooldownDurations;\n\n // keeping some space for future config logics\n uint256[19] private _placeHoldersHydraS1AccountboundConfig;\n\n mapping(uint256 => uint32) internal _nullifiersCooldownStart;\n mapping(uint256 => uint16) internal _nullifiersBurnCount;\n\n // keeping some space for future config logics\n uint256[18] private _placeHoldersHydraS1AccountboundLogic;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first attestation collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last attestation collection in which the attester is supposed to record\n * @param owner Address of attester's owner\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address owner\n )\n HydraS1SimpleAttester(\n attestationsRegistryAddress,\n hydraS1VerifierAddress,\n availableRootsRegistryAddress,\n commitmentMapperAddress,\n collectionIdFirst,\n collectionIdLast\n )\n {\n initialize(owner);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n }\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Returns the actual attestations constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark public input as well as snark proof\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) public view virtual override(IAttester, HydraS1SimpleAttester) returns (Attestation[] memory) {\n Attestation[] memory attestations = super.buildAttestations(request, proofData);\n\n uint256 nullifier = proofData._getNullifier();\n attestations[0].extraData = abi.encodePacked(\n attestations[0].extraData, // nullifier, from HydraS1 Simple\n _getNextBurnCount(nullifier, attestations[0].owner) // BurnCount\n );\n\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Hook run before recording the attestation.\n * Throws if nullifier already used, not a renewal, and nullifier on cooldown.\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n uint256 nullifier = proofData._getNullifier();\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\n\n HydraS1Claim memory claim = request._claim();\n\n // check if the nullifier has already been used previously, if so it may be on cooldown\n if (\n previousNullifierDestination != address(0) &&\n previousNullifierDestination != claim.destination\n ) {\n uint32 cooldownDuration = _getCooldownDurationForGroupIndex(claim.groupProperties.groupIndex);\n if (cooldownDuration == 0) {\n revert CooldownDurationNotSetForGroupIndex(claim.groupProperties.groupIndex);\n }\n if (_isOnCooldown(nullifier, cooldownDuration)) {\n uint16 burnCount = _getNullifierBurnCount(nullifier);\n revert NullifierOnCooldown(\n nullifier,\n previousNullifierDestination,\n burnCount,\n cooldownDuration\n );\n }\n\n // Delete the old Attestation linked to the nullifier before recording the new one (accountbound feature)\n _deletePreviousAttestation(claim, previousNullifierDestination);\n\n _setNullifierOnCooldownAndIncrementBurnCount(nullifier);\n }\n _setDestinationForNullifier(nullifier, request.destination);\n }\n\n /*******************************************************\n LOGIC FUNCTIONS RELATED TO ACCOUNTBOUND FEATURE\n *******************************************************/\n\n /**\n * @dev Getter, returns the burnCount of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16) {\n return _getNullifierBurnCount(nullifier);\n }\n\n /**\n * @dev Getter, returns the cooldown start of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32) {\n return _getNullifierCooldownStart(nullifier);\n }\n\n /**\n * @dev returns the nullifier for a given extraData\n * @param extraData bytes where the nullifier is encoded\n */\n function getNullifierFromExtraData(\n bytes memory extraData\n ) external pure override(HydraS1SimpleAttester, IHydraS1AccountboundAttester) returns (uint256) {\n (uint256 nullifier, ) = abi.decode(extraData, (uint256, uint16));\n\n return nullifier;\n }\n\n /**\n * @dev Returns the burn count for a given extraData\n * @param extraData bytes where the burnCount is encoded\n */\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16) {\n (, uint16 burnCount) = abi.decode(extraData, (uint256, uint16));\n\n return burnCount;\n }\n\n /**\n * @dev Checks if a nullifier is on cooldown\n * @param nullifier user nullifier\n * @param cooldownDuration waiting time before the user can change its badge destination\n */\n function _isOnCooldown(uint256 nullifier, uint32 cooldownDuration) internal view returns (bool) {\n return _getNullifierCooldownStart(nullifier) + cooldownDuration > block.timestamp;\n }\n\n /**\n * @dev Delete the previous attestation created with this nullifier\n * @param claim user claim\n * @param previousNullifierDestination previous destination chosen for this user nullifier\n */\n function _deletePreviousAttestation(\n HydraS1Claim memory claim,\n address previousNullifierDestination\n ) internal {\n address[] memory attestationOwners = new address[](1);\n uint256[] memory attestationCollectionIds = new uint256[](1);\n\n attestationOwners[0] = previousNullifierDestination;\n attestationCollectionIds[0] = AUTHORIZED_COLLECTION_ID_FIRST + claim.groupProperties.groupIndex;\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n }\n\n function _setNullifierOnCooldownAndIncrementBurnCount(uint256 nullifier) internal {\n _nullifiersCooldownStart[nullifier] = uint32(block.timestamp);\n _nullifiersBurnCount[nullifier] += 1;\n emit NullifierSetOnCooldown(nullifier, _nullifiersBurnCount[nullifier]);\n }\n\n function _getNullifierCooldownStart(uint256 nullifier) internal view returns (uint32) {\n return _nullifiersCooldownStart[nullifier];\n }\n\n function _getNullifierBurnCount(uint256 nullifier) internal view returns (uint16) {\n return _nullifiersBurnCount[nullifier];\n }\n\n /**\n * @dev returns burn count or burn count + 1 if new burn will happen\n * @param nullifier user nullifier\n * @param claimDestination destination referenced in the user claim\n */\n function _getNextBurnCount(\n uint256 nullifier,\n address claimDestination\n ) public view virtual returns (uint16) {\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\n uint16 burnCount = _getNullifierBurnCount(nullifier);\n // If the attestation is minted on a new destination address\n // the burnCount that will be encoded in the extraData of the Attestation should be incremented\n if (\n previousNullifierDestination != address(0) && previousNullifierDestination != claimDestination\n ) {\n burnCount += 1;\n }\n return burnCount;\n }\n\n /*******************************************************\n GROUP CONFIGURATION LOGIC\n *******************************************************/\n\n /**\n * @dev Setter, sets the cooldown duration of a groupIndex\n * @notice set to 0 to deactivate the accountbound feature for this group\n * @param groupIndex internal collection id\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\n **/\n function setCooldownDurationForGroupIndex(\n uint256 groupIndex,\n uint32 cooldownDuration\n ) external onlyOwner {\n _cooldownDurations[groupIndex] = cooldownDuration;\n emit CooldownDurationSetForGroupIndex(groupIndex, cooldownDuration);\n }\n\n /**\n * @dev Getter, get the cooldown duration of a groupIndex\n * @notice returns 0 when the accountbound feature is deactivated for this group\n * @param groupIndex internal collection id\n **/\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32) {\n return _getCooldownDurationForGroupIndex(groupIndex);\n }\n\n // = 0 means that the accountbound feature is deactivated for this group\n function _getCooldownDurationForGroupIndex(uint256 groupIndex) internal view returns (uint32) {\n return _cooldownDurations[groupIndex];\n }\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\nimport {IHydraS1Base} from './base/IHydraS1Base.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Nullified\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * nullifier = hash(sourceSecret, externalNullifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - Renewable\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew their attestations\n **/\n\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n /*******************************************************\n Storage layout:\n 20 slots for HydraS1\n 1 slot used\n 19 place holders\n *******************************************************/\n\n mapping(uint256 => address) internal _nullifiersDestinations;\n\n // keeping some space for future\n uint256[19] private _placeHoldersHydraS1Simple;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\n HydraS1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n uint256 nullifier = proofData._getNullifier();\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n abi.encode(nullifier)\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if nullifier already used and not a renewal (e.g destination different that last)\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n // we get the nullifier used from the snark input in the data provided\n uint256 nullifier = proofData._getNullifier();\n address currentDestination = _getDestinationOfNullifier(nullifier);\n\n if (currentDestination != address(0) && currentDestination != request.destination) {\n revert NullifierUsed(nullifier);\n }\n\n _setDestinationForNullifier(nullifier, request.destination);\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the external nullifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose externalNullifier = hash(attesterAddress, claim.GroupId)\n * Creates one nullifier per group, per user and makes sure no collision with other attester's nullifiers\n **/\n function _getExternalNullifierOfClaim(\n HydraS1Claim memory claim\n ) internal view override returns (uint256) {\n uint256 externalNullifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.groupIndex\n );\n return externalNullifier;\n }\n\n /**\n * @dev returns the nullifier for a given extraData\n * @param extraData bytes where the nullifier is encoded\n */\n function getNullifierFromExtraData(\n bytes memory extraData\n ) external pure virtual override(IHydraS1Base, HydraS1Base) returns (uint256) {\n return abi.decode(extraData, (uint256));\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a nullifier\n * @param nullifier nullifier used\n **/\n function getDestinationOfNullifier(uint256 nullifier) external view override returns (address) {\n return _getDestinationOfNullifier(nullifier);\n }\n\n function _setDestinationForNullifier(uint256 nullifier, address destination) internal virtual {\n _nullifiersDestinations[nullifier] = destination;\n emit NullifierDestinationUpdated(nullifier, destination);\n }\n\n function _getDestinationOfNullifier(uint256 nullifier) internal view returns (address) {\n return _nullifiersDestinations[nullifier];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from '././IHydraS1SimpleAttester.sol';\n\n/**\n * @title Hydra-S1 Accountbound Interface\n * @author Sismo\n * @notice Interface of the HydraS1AccountboundAttester contract which inherits from the errors, events and methods specific to the HydraS1SimpleAttester interface.\n **/\ninterface IHydraS1AccountboundAttester is IHydraS1SimpleAttester {\n /**\n * @dev Event emitted when the duration of the cooldown duration for a group index (internal collection id) has been set\n * @param groupIndex internal collection id\n * @param cooldownDuration the duration of the cooldown period\n **/\n event CooldownDurationSetForGroupIndex(uint256 indexed groupIndex, uint32 cooldownDuration);\n\n /**\n * @dev Event emitted when the nullifier has been set on cooldown. This happens when the\n * attestation destination of a nullifier has been changed\n * @param nullifier user nullifier\n * @param burnCount the number of times the attestation destination of a nullifier has been changed\n **/\n event NullifierSetOnCooldown(uint256 indexed nullifier, uint16 burnCount);\n\n /**\n * @dev Error when the nullifier is on cooldown. The user have to wait the cooldownDuration\n * before being able to change again the destination address.\n **/\n error NullifierOnCooldown(\n uint256 nullifier,\n address destination,\n uint16 burnCount,\n uint32 cooldownStart\n );\n\n /**\n * @dev Error when the cooldown duration for a given groupIndex is equal to zero.\n * The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.\n **/\n error CooldownDurationNotSetForGroupIndex(uint256 groupIndex);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) external;\n\n /**\n * @dev returns the nullifier for a given extraData\n * @param extraData bytes where the nullifier is encoded\n */\n function getNullifierFromExtraData(bytes memory extraData) external pure returns (uint256);\n\n /**\n * @dev Returns the burn count for a given extraData\n * @param extraData bytes where the burnCount is encoded\n */\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16);\n\n /**\n * @dev Getter, returns the cooldown start of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32);\n\n /**\n * @dev Getter, returns the burnCount of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16);\n\n /**\n * @dev Setter, sets the cooldown duration of a groupIndex\n * @param groupIndex internal collection id\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\n **/\n function setCooldownDurationForGroupIndex(uint256 groupIndex, uint32 cooldownDuration) external;\n\n /*/**\n * @dev Getter, get the cooldown duration of a groupIndex\n * @notice returns 0 when the accountbound feature is deactivated for this group\n * @param groupIndex internal collection id\n **/\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32);\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Accountbound Interface\n * @author Sismo\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\n **/\ninterface IHydraS1SimpleAttester is IHydraS1Base {\n /**\n * @dev Error when the nullifier is already used for a destination address\n **/\n error NullifierUsed(uint256 nullifier);\n\n /**\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\n **/\n error CollectionIdOutOfBound(uint256 collectionId);\n\n /**\n * @dev Event emitted when the nullifier is associated to a destination address.\n **/\n event NullifierDestinationUpdated(uint256 nullifier, address newOwner);\n\n /**\n * @dev Getter, returns the last attestation destination of a nullifier\n * @param nullifier nullifier used\n **/\n function getDestinationOfNullifier(uint256 nullifier) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1AccountboundLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Lib, HydraS1Claim, HydraS1GroupProperties} from './HydraS1Lib.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1AccountboundClaim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1AccountboundGroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1AccountboundGroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n uint32 cooldownDuration;\n bool isScore;\n}\n\nlibrary HydraS1AccountboundLib {\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _hydraS1claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n HydraS1GroupProperties memory hydraS1GroupProperties = HydraS1GroupProperties(\n groupProperties.groupIndex,\n groupProperties.generationTimestamp,\n groupProperties.isScore\n );\n\n return (\n HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, hydraS1GroupProperties)\n );\n }\n\n function _hydraS1Accountboundclaim(\n Request memory self\n ) internal pure returns (HydraS1AccountboundClaim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory hydraS1AccountboundGroupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n return (\n HydraS1AccountboundClaim(\n claim.groupId,\n claim.claimedValue,\n self.destination,\n hydraS1AccountboundGroupProperties\n )\n );\n }\n\n function _generateGroupIdFromEncodedProperties(\n bytes memory encodedProperties\n ) internal pure returns (uint256) {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1GroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n bool isScore;\n}\n\nstruct HydraS1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct HydraS1ProofData {\n HydraS1CircomSnarkProof proof;\n uint256[10] input;\n // destination\n // chainId\n // commitmentMapperPubKey.x\n // commitmentMapperPubKey.y\n // registryTreeRoot\n // externalNullifier\n // nullifier\n // claimedValue\n // accountsTreeValue\n // isStrict\n}\n\nstruct HydraS1ProofInput {\n address destination;\n uint256 chainId;\n uint256 registryRoot;\n uint256 externalNullifier;\n uint256 nullifier;\n uint256 value;\n uint256 accountsTreeValue;\n bool isStrict;\n uint256[2] commitmentMapperPubKey;\n}\n\nlibrary HydraS1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\n return\n HydraS1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getRegistryRoot(self),\n _getExpectedExternalNullifier(self),\n _getNullifier(self),\n _getValue(self),\n _getAccountsTreeValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1GroupProperties)\n );\n\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(\n HydraS1ProofData memory self\n )\n internal\n pure\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[10] memory)\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(\n HydraS1ProofData memory self\n ) internal pure returns (uint256[2] memory) {\n return [self.input[2], self.input[3]];\n }\n\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(\n HydraS1ProofData memory self\n ) internal pure returns (uint256) {\n return self.input[5];\n }\n\n function _getNullifier(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[8];\n }\n\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\n return self.input[9] == 1;\n }\n\n function _getNullifier(bytes calldata self) internal pure returns (uint256) {\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\n uint256 nullifier = uint256(_getNullifier(snarkProofData));\n return nullifier;\n }\n\n function _generateGroupIdFromProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\n );\n }\n\n function _generateGroupIdFromEncodedProperties(\n bytes memory encodedProperties\n ) internal pure returns (uint256) {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(groupIndex, generationTimestamp, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/pythia-1/base/IPythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\n\ninterface IPythia1Base {\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error UserShouldOwnItsDestination(address sender, address inputdestination);\n error CommitmentSignerPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier);\n\n /**\n * @dev Getter of the Commitment Signer EdDSA Public Key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\n}\n" - }, - "contracts/attesters/pythia-1/base/Pythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IPythia1Base} from './IPythia1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Pythia 1 ZK Proving Scheme\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\n\n/**\n * @title Pythia-1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \n * without anyone being able to make the link between the offchain service and the onchain service.\n * It is inherited by the family of Pythia-1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n \n \n **/\nabstract contract Pythia1Base is IPythia1Base, Initializable {\n using Pythia1Lib for Pythia1ProofData;\n\n // ZK-SNARK Verifier\n Pythia1Verifier immutable VERIFIER;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\n */\n constructor(address Pythia1VerifierAddress) {\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\n }\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of the Commitment signer Eddsa Public key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\n return _getCommitmentSignerPubKey();\n }\n\n /*******************************************************\n Pythia-1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * the secretHash is a number only known by the user and is used in \n * the zero knowledge as a private input which guarantees privacy\n\n * This function MUST be implemented by Pythia-1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Pythia-1 Simple Attester for an example\n * @param claim user claim: a particular claim that a user have that he can prove s right.\n */\n function _getTicketIdentifierOfClaim(\n Pythia1Claim memory claim\n ) internal view virtual returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\n * prove the claim was correctly issued for the user.\n */\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(\n Pythia1Claim memory claim,\n Pythia1ProofInput memory input\n ) internal view virtual {\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (claim.destination != msg.sender)\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\n if (\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\n )\n revert CommitmentSignerPubKeyMismatch(\n commitmentSignerPubKey[0],\n commitmentSignerPubKey[1],\n input.commitmentSignerPubKey[0],\n input.commitmentSignerPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the plonk mathematical proof using the circom verifier contract\n * @param proofData snark public input\n */\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(uint256 /*errorCode*/) {\n revert InvalidGroth16Proof('');\n } catch (bytes memory /*lowLevelData*/) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\n\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\n error TicketUsed(uint256 userTicket);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/pythia-1/libs/Pythia1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\n\n// user Pythia-1 claim retrieved form his request\nstruct Pythia1Claim {\n uint256 groupId; // user claims be part of this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct Pythia1GroupProperties {\n uint128 internalCollectionId;\n bool isScore;\n}\n\nstruct Pythia1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct Pythia1ProofData {\n Pythia1CircomSnarkProof proof;\n uint256[9] input;\n // destination;\n // chainId;\n // commitmentSignerPubKey.x;\n // commitmentSignerPubKey.y;\n // groupId;\n // ticketIdentifier;\n // userTicket;\n // value;\n // isStrict;\n}\n\nstruct Pythia1ProofInput {\n address destination;\n uint256 chainId;\n uint256 groupId;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n bool isStrict;\n uint256[2] commitmentSignerPubKey;\n}\n\nlibrary Pythia1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\n return\n Pythia1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getGroupId(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n Pythia1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (Pythia1GroupProperties)\n );\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(\n Pythia1ProofData memory self\n )\n internal\n pure\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[9] memory)\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(\n Pythia1ProofData memory self\n ) internal pure returns (uint256[2] memory) {\n return [self.input[2], self.input[3]];\n }\n\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(\n Pythia1ProofData memory self\n ) internal pure returns (uint256) {\n return self.input[5];\n }\n\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\n return self.input[8] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(\n uint128 internalCollectionId,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\n }\n\n function _generateGroupIdFromEncodedProperties(\n bytes memory encodedProperties\n ) internal pure returns (uint256) {\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 internalCollectionId,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(internalCollectionId, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to Pythia1 Proving Scheme\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\n\n/**\n * @title Pythia-1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Pythia-1 Attesters.\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \n * offchain service in a privacy preserving way. \n * That means no-one can make the link between the account used in the offchain service\n * and the onchain account where the attestation is stored.\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each users gets one userTicket per claim\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n **/\n\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\n using Pythia1Lib for Pythia1ProofData;\n using Pythia1Lib for bytes;\n using Pythia1Lib for Request;\n\n uint8 public constant IMPLEMENTATION_VERSION = 3;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n uint256[2] internal _commitmentSignerPubKey;\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\n * @param owner The owner of the contract that can update the commitment signer pub key\n */\n constructor(\n address attestationsRegistryAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address pythia1VerifierAddress,\n uint256[2] memory commitmentSignerPubKey,\n address owner\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n initialize(commitmentSignerPubKey, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param ownerAddress Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n uint256[2] memory commitmentSignerPubKey,\n address ownerAddress\n ) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into Pythia1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\n Pythia1ProofInput memory snarkInput = snarkProof._input();\n Pythia1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\n Pythia1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.internalCollectionId;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n uint32(block.timestamp),\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used\n * @param request users request. Claim of beiing part of a group.\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0)) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * users bring secretHash as private input in snark which guarantees privacy\n * the secretHash is only known by the user and never escape the user's browser\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(\n Pythia1Claim memory claim\n ) internal view override returns (uint256) {\n uint256 ticketIdentifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.internalCollectionId\n );\n return ticketIdentifier;\n }\n\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\n return _commitmentSignerPubKey;\n }\n\n /*******************************************************\n Pythia-1 Attester Specific Functions\n *******************************************************/\n\n function updateCommitmentSignerPubKey(\n uint256[2] memory commitmentSignerPubKey\n ) external onlyOwner {\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\n _commitmentSignerPubKey = commitmentSignerPubKey;\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\n }\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/core/AttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\nimport {Attestation, AttestationData} from './libs/Structs.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Attestations Registry\n * @author Sismo\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\n * Only authorized attestations issuers can record attestation in the registry\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\n * For more information: https://attestations-registry.docs.sismo.io\n\n * For each attestation recorded, a badge is received by the user\n * The badge is the Non transferrable NFT representation of an attestation \n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\n * It enables off-chain apps such as opensea to catch the \"shadow mint\" of the badge\n **/\ncontract AttestationsRegistry is\n AttestationsRegistryState,\n IAttestationsRegistry,\n AttestationsRegistryConfigLogic\n{\n uint8 public constant IMPLEMENTATION_VERSION = 3;\n IBadges immutable BADGES;\n\n /**\n * @dev Constructor.\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @param badgesAddress Stateless ERC1155 Badges contract\n */\n constructor(address owner, address badgesAddress) {\n BADGES = IBadges(badgesAddress);\n initialize(owner);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n }\n }\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\n address issuer = _msgSender();\n for (uint256 i = 0; i < attestations.length; i++) {\n if (!_isAuthorized(issuer, attestations[i].collectionId))\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\n\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\n attestations[i].owner\n ].value;\n\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\n attestations[i].issuer,\n attestations[i].value,\n attestations[i].timestamp,\n attestations[i].extraData\n );\n\n _triggerBadgeTransferEvent(\n attestations[i].collectionId,\n attestations[i].owner,\n previousAttestationValue,\n attestations[i].value\n );\n emit AttestationRecorded(attestations[i]);\n }\n }\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(\n address[] calldata owners,\n uint256[] calldata collectionIds\n ) external override whenNotPaused {\n if (owners.length != collectionIds.length)\n revert OwnersAndCollectionIdsLengthMismatch(owners, collectionIds);\n\n address issuer = _msgSender();\n for (uint256 i = 0; i < owners.length; i++) {\n AttestationData memory attestationData = _attestationsData[collectionIds[i]][owners[i]];\n\n if (!_isAuthorized(issuer, collectionIds[i]))\n revert IssuerNotAuthorized(issuer, collectionIds[i]);\n delete _attestationsData[collectionIds[i]][owners[i]];\n\n _triggerBadgeTransferEvent(collectionIds[i], owners[i], attestationData.value, 0);\n\n emit AttestationDeleted(\n Attestation(\n collectionIds[i],\n owners[i],\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n )\n );\n }\n }\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(\n uint256 collectionId,\n address owner\n ) external view override returns (bool) {\n return _getAttestationValue(collectionId, owner) != 0;\n }\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(\n uint256 collectionId,\n address owner\n ) external view override returns (AttestationData memory) {\n return _getAttestationData(collectionId, owner);\n }\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(\n uint256 collectionId,\n address owner\n ) external view override returns (uint256) {\n return _getAttestationValue(collectionId, owner);\n }\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(\n uint256 collectionId,\n address owner\n ) external view override returns (address, uint256, uint32, bytes memory) {\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\n return (\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n );\n }\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(\n uint256 collectionId,\n address owner\n ) external view override returns (bytes memory) {\n return _attestationsData[collectionId][owner].extraData;\n }\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(\n uint256 collectionId,\n address owner\n ) external view override returns (address) {\n return _attestationsData[collectionId][owner].issuer;\n }\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(\n uint256 collectionId,\n address owner\n ) external view override returns (uint32) {\n return _attestationsData[collectionId][owner].timestamp;\n }\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view override returns (AttestationData[] memory) {\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\n }\n return attestationsDataArray;\n }\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view override returns (uint256[] memory) {\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\n }\n return attestationsValues;\n }\n\n /**\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\n * It enables off-chain apps such as opensea to catch the \"shadow mints/burns\" of badges\n */\n function _triggerBadgeTransferEvent(\n uint256 badgeTokenId,\n address owner,\n uint256 previousValue,\n uint256 newValue\n ) internal {\n bool isGreaterValue = newValue > previousValue;\n address operator = address(this);\n address from = isGreaterValue ? address(0) : owner;\n address to = isGreaterValue ? owner : address(0);\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\n\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\n }\n\n function _getAttestationData(\n uint256 collectionId,\n address owner\n ) internal view returns (AttestationData memory) {\n return (_attestationsData[collectionId][owner]);\n }\n\n function _getAttestationValue(\n uint256 collectionId,\n address owner\n ) internal view returns (uint256) {\n return _attestationsData[collectionId][owner].value;\n }\n}\n" - }, - "contracts/core/Attester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\n\n/**\n * @title Attester Abstract Contract\n * @author Sismo\n * @notice Contract to be inherited by Attesters\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\n * are recommended to implemented this abstract contract\n\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\n *\n * This contracts is built around two main external standard functions.\n * They must NOT be override them, unless your really know what you are doing\n \n * - generateAttestations(request, proof) => will write attestations in the registry\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\n\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\n\n * For more information: https://attesters.docs.sismo.io\n **/\nabstract contract Attester is IAttester {\n // Registry where all attestations are stored\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n // Verify if request is valid by verifying against proof\n _verifyRequest(request, proofData);\n\n // Generate the actual attestations from user request\n Attestation[] memory attestations = buildAttestations(request, proofData);\n\n _beforeRecordAttestations(request, proofData);\n\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n\n _afterRecordAttestations(attestations);\n\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationGenerated(attestations[i]);\n }\n\n return attestations;\n }\n\n /**\n * @dev External facing function. Allows to delete attestations by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that were deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n address[] memory attestationOwners = new address[](collectionIds.length);\n\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\n\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n // fetch attestations from the registry\n (\n address issuer,\n uint256 attestationValue,\n uint32 timestamp,\n bytes memory extraData\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\n\n attestationOwners[i] = attestationsOwner;\n attestationCollectionIds[i] = collectionIds[i];\n\n attestations[i] = (\n Attestation(\n collectionIds[i],\n attestationsOwner,\n issuer,\n attestationValue,\n timestamp,\n extraData\n )\n );\n }\n\n _verifyAttestationsDeletionRequest(attestations, proofData);\n\n _beforeDeleteAttestations(attestations, proofData);\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n\n _afterDeleteAttestations(attestations, proofData);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n emit AttestationDeleted(attestations[i]);\n }\n return attestations;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) public view virtual returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry getter\n * @return attestationRegistry\n */\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\n return ATTESTATIONS_REGISTRY;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should verify the user request is valid\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\n\n /**\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\n * Default behavior: throws\n * It should verify attestations deletion request is valid\n * @param attestations Attestations that will be deleted\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyAttestationsDeletionRequest(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {\n revert AttestationDeletionNotImplemented();\n }\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before recording attestations in the registry\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual {}\n\n /**\n * @dev (Optional) Can be overridden in attesters inheriting this contract\n * Will be called after recording an attestation\n * @param attestations Recorded attestations\n */\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _beforeDeleteAttestations(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called after deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _afterDeleteAttestations(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {}\n}\n" - }, - "contracts/core/Badges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Badges contract\n * @author Sismo\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n * For more information: https://badges.docs.sismo.io\n */\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\n uint8 public constant IMPLEMENTATION_VERSION = 3;\n\n IAttestationsRegistry internal _attestationsRegistry;\n\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\n\n /**\n * @dev Constructor\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n constructor(\n string memory uri,\n address owner // This is Sismo Frontend Contract\n ) ERC1155(uri) {\n initialize(uri, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n string memory uri,\n address owner\n ) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup uri yet or if called by constructor (for implem setup)\n if (bytes(ERC1155.uri(0)).length == 0 || address(this).code.length == 0) {\n _setURI(uri);\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n }\n }\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(\n address account,\n uint256 id\n ) public view virtual override(ERC1155, IBadges) returns (uint256) {\n return _attestationsRegistry.getAttestationValue(id, account);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function isApprovedForAll(\n address account,\n address operator\n ) public view virtual override returns (bool) {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\n emit TransferSingle(operator, from, to, id, value);\n }\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(\n address attestationsRegistry\n ) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\n }\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _setURI(uri);\n }\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view override returns (address) {\n return address(_attestationsRegistry);\n }\n\n /**\n * @dev Getter of the badge issuer\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeIssuer(address account, uint256 id) external view returns (address) {\n return _attestationsRegistry.getAttestationIssuer(id, account);\n }\n\n /**\n * @dev Getter of the badge timestamp\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32) {\n return _attestationsRegistry.getAttestationTimestamp(id, account);\n }\n\n /**\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory) {\n return _attestationsRegistry.getAttestationExtraData(id, account);\n }\n\n /**\n * @dev Getter of the value of a specific badge attribute\n * @param id Badge Id to check (= attestationCollectionId)\n * @param index Index of the attribute\n */\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8) {\n return _attestationsRegistry.getAttributeValueForAttestationsCollection(id, index);\n }\n\n /**\n * @dev Getter of all badge attributes and their values for a specific badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getAttributesNamesAndValuesForBadge(\n uint256 id\n ) external view returns (bytes32[] memory, uint8[] memory) {\n return _attestationsRegistry.getAttributesNamesAndValuesForAttestationsCollection(id);\n }\n\n /**\n * @dev ERC165\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(AccessControl, ERC1155) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n revert BadgesNonTransferrable();\n }\n}\n" - }, - "contracts/core/Front.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IFront} from './interfaces/IFront.sol';\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation} from './libs/Structs.sol';\n\n/**\n * @title Front\n * @author Sismo\n * @notice This is the Front contract of the Sismo protocol\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\n\n * For more information: https://front.docs.sismo.io\n */\ncontract Front is IFront {\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\n uint256 public constant EARLY_USER_COLLECTION = 0;\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress Attestations registry contract address\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n Attestation[] memory attestations = _forwardAttestationsGeneration(\n attester,\n request,\n proofData\n );\n _generateEarlyUserAttestation(request.destination);\n return attestations;\n }\n\n /**\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n address destination = requests[0].destination;\n for (uint256 i = 0; i < attesters.length; i++) {\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\n attestations[i] = _forwardAttestationsGeneration(\n attesters[i],\n requests[i],\n proofDataArray[i]\n );\n }\n _generateEarlyUserAttestation(destination);\n return attestations;\n }\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view override returns (Attestation[] memory) {\n return _forwardAttestationsBuild(attester, request, proofData);\n }\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function of targeted attester\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n\n for (uint256 i = 0; i < attesters.length; i++) {\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\n }\n return attestations;\n }\n\n function _forwardAttestationsBuild(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal view returns (Attestation[] memory) {\n return IAttester(attester).buildAttestations(request, proofData);\n }\n\n function _forwardAttestationsGeneration(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal returns (Attestation[] memory) {\n return IAttester(attester).generateAttestations(request, proofData);\n }\n\n function _generateEarlyUserAttestation(address destination) internal {\n uint32 currentTimestamp = uint32(block.timestamp);\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\n EARLY_USER_COLLECTION,\n destination\n );\n\n if (!alreadyHasAttestation) {\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n EARLY_USER_COLLECTION,\n destination,\n address(this),\n 1,\n currentTimestamp,\n 'With strong love from Sismo'\n );\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n emit EarlyUserAttestationGenerated(destination);\n }\n }\n }\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\n\n/**\n * @title IAttestationsRegistry\n * @author Sismo\n * @notice This is the interface of the AttestationRegistry\n */\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\n event AttestationRecorded(Attestation attestation);\n event AttestationDeleted(Attestation attestation);\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external;\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(\n uint256 collectionId,\n address owner\n ) external view returns (AttestationData memory);\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(\n uint256 collectionId,\n address owner\n ) external view returns (address, uint256, uint32, bytes memory);\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(\n uint256 collectionId,\n address owner\n ) external view returns (bytes memory);\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(\n uint256 collectionId,\n address owner\n ) external view returns (address);\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(\n uint256 collectionId,\n address owner\n ) external view returns (uint32);\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view returns (AttestationData[] memory);\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view returns (uint256[] memory);\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\n\ninterface IAttestationsRegistryConfigLogic {\n error AttesterNotFound(address issuer);\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\n error IdsMismatch(\n address issuer,\n uint256 rangeIndex,\n uint256 expectedFirstId,\n uint256 expectedLastId,\n uint256 FirstId,\n uint256 lastCollectionId\n );\n error AttributeDoesNotExist(uint8 attributeIndex);\n error AttributeAlreadyExists(uint8 attributeIndex);\n error ArgsLengthDoesNotMatch();\n\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\n event AttributeNameUpdated(\n uint8 attributeIndex,\n bytes32 newAttributeName,\n bytes32 previousAttributeName\n );\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\n\n event AttestationsCollectionAttributeSet(\n uint256 collectionId,\n uint8 attributeIndex,\n uint8 attributeValue\n );\n\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n\n /**\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute. Can go from 0 to 63.\n */\n function attestationsCollectionHasAttribute(\n uint256 collectionId,\n uint8 index\n ) external view returns (bool);\n\n function attestationsCollectionHasAttributes(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (bool);\n\n /**\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\n */\n function getAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 attributeIndex\n ) external view returns (uint8);\n\n function getAttributesValuesForAttestationsCollection(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (uint8[] memory);\n\n /**\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute (must be between 0 and 63)\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\n */\n function setAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 index,\n uint8 value\n ) external;\n\n function setAttributesValuesForAttestationsCollections(\n uint256[] memory collectionIds,\n uint8[] memory indices,\n uint8[] memory values\n ) external;\n\n /**\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n */\n function getAttributesNamesAndValuesForAttestationsCollection(\n uint256 collectionId\n ) external view returns (bytes32[] memory, uint8[] memory);\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external;\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external;\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external;\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external;\n\n /**\n * @dev Create a new attribute.\n * @param index Index of the attribute. Can go from 0 to 63.\n * @param name Name in bytes32 of the attribute\n */\n function createNewAttribute(uint8 index, bytes32 name) external;\n\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\n\n /**\n * @dev Update the name of an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\n * @param newName new name in bytes32 of the attribute\n */\n function updateAttributeName(uint8 index, bytes32 newName) external;\n\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\n\n /**\n * @dev Delete an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\n */\n function deleteAttribute(uint8 index) external;\n\n function deleteAttributes(uint8[] memory indices) external;\n}\n" - }, - "contracts/core/interfaces/IAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\n\n/**\n * @title IAttester\n * @author Sismo\n * @notice This is the interface for the attesters in Sismo Protocol\n */\ninterface IAttester {\n event AttestationGenerated(Attestation attestation);\n\n event AttestationDeleted(Attestation attestation);\n\n error AttestationDeletionNotImplemented();\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev External facing function. Allows to delete an attestation by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that was deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry address getter\n * @return attestationRegistry Address of the registry\n */\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\n}\n" - }, - "contracts/core/interfaces/IBadges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Interface for Badges contract\n * @author Sismo\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n */\ninterface IBadges {\n error BadgesNonTransferrable();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(string memory uri, address owner) external;\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external;\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry) external;\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external;\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view returns (address);\n\n /**\n * @dev Getter of the badge issuer\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeIssuer(address account, uint256 id) external view returns (address);\n\n /**\n * @dev Getter of the badge timestamp\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);\n\n /**\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);\n\n /**\n * @dev Getter of the value of a specific badge attribute\n * @param id Badge Id to check (= attestationCollectionId)\n * @param index Index of the attribute\n */\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);\n\n /**\n * @dev Getter of all badge attributes and their values for a specific badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getAttributesNamesAndValuesForBadge(\n uint256 id\n ) external view returns (bytes32[] memory, uint8[] memory);\n}\n" - }, - "contracts/core/interfaces/IFront.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\n\n/**\n * @title IFront\n * @author Sismo\n * @notice This is the interface of the Front Contract\n */\ninterface IFront {\n error DifferentRequestsDestinations();\n event EarlyUserAttestationGenerated(address destination);\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev generate multiple attestations at once, to the same destination\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external returns (Attestation[][] memory);\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function(s) of targeted attester(s)\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view returns (Attestation[][] memory);\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport './OwnableLogic.sol';\nimport './PausableLogic.sol';\nimport './InitializableLogic.sol';\nimport './AttestationsRegistryState.sol';\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\nimport {Bitmap256Bit} from '../utils/Bitmap256Bit.sol';\n\n/**\n * @title Attestations Registry Config Logic contract\n * @author Sismo\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\n **/\ncontract AttestationsRegistryConfigLogic is\n AttestationsRegistryState,\n IAttestationsRegistryConfigLogic,\n OwnableLogic,\n PausableLogic,\n InitializableLogic\n{\n using RangeUtils for Range[];\n using Bitmap256Bit for uint256;\n using Bitmap256Bit for uint8;\n\n /******************************************\n *\n * ATTESTATION REGISTRY WRITE ACCESS MANAGEMENT (ISSUERS)\n *\n *****************************************/\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external override onlyOwner {\n _pause();\n }\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external override onlyOwner {\n _unpause();\n }\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\n for (uint256 i = 0; i < ranges.length; i++) {\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external override onlyOwner {\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\n return _isAuthorized(issuer, collectionId);\n }\n\n /******************************************\n *\n * ATTRIBUTES CONFIG LOGIC\n *\n *****************************************/\n\n /**\n * @dev Create a new attribute.\n * @param index Index of the attribute. Can go from 0 to 63.\n * @param name Name in bytes32 of the attribute\n */\n function createNewAttribute(uint8 index, bytes32 name) public onlyOwner {\n index._checkIndexIsValid();\n if (_isAttributeCreated(index)) {\n revert AttributeAlreadyExists(index);\n }\n _createNewAttribute(index, name);\n }\n\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external onlyOwner {\n if (indices.length != names.length) {\n revert ArgsLengthDoesNotMatch();\n }\n\n for (uint256 i = 0; i < indices.length; i++) {\n createNewAttribute(indices[i], names[i]);\n }\n }\n\n /**\n * @dev Update the name of an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\n * @param newName new name in bytes32 of the attribute\n */\n function updateAttributeName(uint8 index, bytes32 newName) public onlyOwner {\n index._checkIndexIsValid();\n if (!_isAttributeCreated(index)) {\n revert AttributeDoesNotExist(index);\n }\n _updateAttributeName(index, newName);\n }\n\n function updateAttributesName(\n uint8[] memory indices,\n bytes32[] memory newNames\n ) external onlyOwner {\n if (indices.length != newNames.length) {\n revert ArgsLengthDoesNotMatch();\n }\n\n for (uint256 i = 0; i < indices.length; i++) {\n updateAttributeName(indices[i], newNames[i]);\n }\n }\n\n /**\n * @dev Delete an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must already exist\n */\n function deleteAttribute(uint8 index) public onlyOwner {\n index._checkIndexIsValid();\n if (!_isAttributeCreated(index)) {\n revert AttributeDoesNotExist(index);\n }\n _deleteAttribute(index);\n }\n\n function deleteAttributes(uint8[] memory indices) external onlyOwner {\n for (uint256 i = 0; i < indices.length; i++) {\n deleteAttribute(indices[i]);\n }\n }\n\n /**\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute (must be between 0 and 63)\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\n */\n function setAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 index,\n uint8 value\n ) public onlyOwner {\n index._checkIndexIsValid();\n\n if (!_isAttributeCreated(index)) {\n revert AttributeDoesNotExist(index);\n }\n\n _setAttributeForAttestationsCollection(collectionId, index, value);\n }\n\n function setAttributesValuesForAttestationsCollections(\n uint256[] memory collectionIds,\n uint8[] memory indices,\n uint8[] memory values\n ) external onlyOwner {\n if (collectionIds.length != indices.length || collectionIds.length != values.length) {\n revert ArgsLengthDoesNotMatch();\n }\n for (uint256 i = 0; i < collectionIds.length; i++) {\n setAttributeValueForAttestationsCollection(collectionIds[i], indices[i], values[i]);\n }\n }\n\n /**\n * @dev Returns the attribute's value (from 0 to 15) of an attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute. Can go from 0 to 63.\n */\n function getAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 index\n ) public view returns (uint8) {\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\n collectionId\n );\n return currentAttributesValues._get(index);\n }\n\n function getAttributesValuesForAttestationsCollection(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (uint8[] memory) {\n uint8[] memory attributesValues = new uint8[](indices.length);\n for (uint256 i = 0; i < indices.length; i++) {\n attributesValues[i] = getAttributeValueForAttestationsCollection(collectionId, indices[i]);\n }\n return attributesValues;\n }\n\n /**\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute. Can go from 0 to 63.\n */\n function attestationsCollectionHasAttribute(\n uint256 collectionId,\n uint8 index\n ) public view returns (bool) {\n uint256 currentAttributeValues = _getAttributesValuesBitmapForAttestationsCollection(\n collectionId\n );\n return currentAttributeValues._get(index) > 0;\n }\n\n function attestationsCollectionHasAttributes(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (bool) {\n for (uint256 i = 0; i < indices.length; i++) {\n if (!attestationsCollectionHasAttribute(collectionId, indices[i])) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n */\n function getAttributesNamesAndValuesForAttestationsCollection(\n uint256 collectionId\n ) public view returns (bytes32[] memory, uint8[] memory) {\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\n collectionId\n );\n\n (\n uint8[] memory indices,\n uint8[] memory values,\n uint8 nbOfNonZeroValues\n ) = currentAttributesValues._getAllNonZeroValues();\n\n bytes32[] memory attributesNames = new bytes32[](nbOfNonZeroValues);\n uint8[] memory attributesValues = new uint8[](nbOfNonZeroValues);\n for (uint8 i = 0; i < nbOfNonZeroValues; i++) {\n attributesNames[i] = _attributesNames[indices[i]];\n attributesValues[i] = values[i];\n }\n\n return (attributesNames, attributesValues);\n }\n\n /*****************************\n *\n * INTERNAL FUNCTIONS\n *\n *****************************/\n\n function _authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal {\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\n _authorizedRanges[issuer].push(newRange);\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal onlyOwner {\n if (rangeIndex >= _authorizedRanges[issuer].length)\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\n\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\n revert IdsMismatch(\n issuer,\n rangeIndex,\n expectedFirstId,\n expectedLastId,\n firstCollectionId,\n lastCollectionId\n );\n\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\n _authorizedRanges[issuer].length - 1\n ];\n _authorizedRanges[issuer].pop();\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\n return _authorizedRanges[issuer]._includes(collectionId);\n }\n\n function _setAttributeForAttestationsCollection(\n uint256 collectionId,\n uint8 index,\n uint8 value\n ) internal {\n uint256 currentAttributes = _getAttributesValuesBitmapForAttestationsCollection(collectionId);\n\n _attestationsCollectionAttributesValuesBitmap[collectionId] = currentAttributes._set(\n index,\n value\n );\n\n emit AttestationsCollectionAttributeSet(collectionId, index, value);\n }\n\n function _createNewAttribute(uint8 index, bytes32 name) internal {\n _attributesNames[index] = name;\n\n emit NewAttributeCreated(index, name);\n }\n\n function _updateAttributeName(uint8 index, bytes32 newName) internal {\n bytes32 previousName = _attributesNames[index];\n\n _attributesNames[index] = newName;\n\n emit AttributeNameUpdated(index, newName, previousName);\n }\n\n function _deleteAttribute(uint8 index) internal {\n bytes32 deletedName = _attributesNames[index];\n\n delete _attributesNames[index];\n\n emit AttributeDeleted(index, deletedName);\n }\n\n function _getAttributesValuesBitmapForAttestationsCollection(\n uint256 collectionId\n ) internal view returns (uint256) {\n return _attestationsCollectionAttributesValuesBitmap[collectionId];\n }\n\n function _isAttributeCreated(uint8 index) internal view returns (bool) {\n if (_attributesNames[index] == 0) {\n return false;\n }\n return true;\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryState.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Range} from '../utils/RangeLib.sol';\nimport {Attestation, AttestationData} from '../Structs.sol';\n\ncontract AttestationsRegistryState {\n /*******************************************************\n Storage layout:\n 19 slots for config\n 4 currently used for _initialized, _initializing, _paused, _owner\n 15 place holders\n 16 slots for logic\n 3 currently used for _authorizedRanges, _attestationsCollectionAttributesValuesBitmap, _attributesNames\n 13 place holders\n 1 slot for _attestationsData \n *******************************************************/\n\n // main config\n // changed `_initialized` from bool to uint8\n // as we were using OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n // and changed to OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n // PR: https://github.com/sismo-core/sismo-protocol/pull/41\n uint8 internal _initialized;\n bool internal _initializing;\n bool internal _paused;\n address internal _owner;\n // keeping some space for future\n uint256[15] private _placeHoldersAdmin;\n\n // storing the authorized ranges for each attesters\n mapping(address => Range[]) internal _authorizedRanges;\n // Storing the attributes values used for each attestations collection\n // Each attribute value is an hexadecimal\n mapping(uint256 => uint256) internal _attestationsCollectionAttributesValuesBitmap;\n // Storing the attribute name for each attributes index\n mapping(uint8 => bytes32) internal _attributesNames;\n // keeping some space for future\n uint256[13] private _placeHoldersConfig;\n // storing the data of attestations\n // =collectionId=> =owner=> attestationData\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\n}\n" - }, - "contracts/core/libs/attestations-registry/InitializableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Address.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract InitializableLogic is AttestationsRegistryState {\n // only diff with oz\n // /**\n // * @dev Indicates that the contract has been initialized.\n // */\n // bool private _initialized;\n\n // /**\n // * @dev Indicates that the contract is in the process of being initialized.\n // */\n // bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) ||\n (!Address.isContract(address(this)) && _initialized == 1),\n 'Initializable: contract is already initialized'\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(\n !_initializing && _initialized < version,\n 'Initializable: contract is already initialized'\n );\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, 'Initializable: contract is not initializing');\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, 'Initializable: contract is initializing');\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/OwnableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n // This is the only diff with OZ contract\n // address private _owner;\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/PausableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableLogic is Context, AttestationsRegistryState {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n // this is the only diff with OZ contract\n // bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), 'Pausable: paused');\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), 'Pausable: not paused');\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "contracts/core/libs/Structs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Attestations Registry State\n * @author Sismo\n * @notice This contract holds all of the storage variables and data\n * structures used by the AttestationsRegistry and parent\n * contracts.\n */\n\n// User Attestation Request, can be made by any user\n// The context of an Attestation Request is a specific attester contract\n// Each attester has groups of accounts in its available data\n// eg: for a specific attester:\n// group 1 <=> accounts that sent txs on mainnet\n// group 2 <=> accounts that sent txs on polygon\n// eg: for another attester:\n// group 1 <=> accounts that sent eth txs in 2022\n// group 2 <=> accounts sent eth txs in 2021\nstruct Request {\n // implicit address attester;\n // implicit uint256 chainId;\n Claim[] claims;\n address destination; // destination that will receive the end attestation\n}\n\nstruct Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\n}\n\n/**\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\n * @param collectionId Attestation collection\n * @param owner Attestation collection\n * @param issuer Attestation collection\n * @param value Attestation collection\n * @param timestamp Attestation collection\n * @param extraData Attestation collection\n */\nstruct Attestation {\n // implicit uint256 chainId;\n uint256 collectionId; // Id of the attestation collection (in the registry)\n address owner; // Owner of the attestation\n address issuer; // Contract that created or last updated the record.\n uint256 value; // Value of the attestation\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\n // it is different from the recording timestamp (date when the attestation was recorded)\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\n bytes extraData; // arbitrary data that can be added by the attester\n}\n\n// Attestation Data, stored in the registry\n// The context is a specific owner of a specific collection\nstruct AttestationData {\n // implicit uint256 chainId\n // implicit uint256 collectionId - from context\n // implicit owner\n address issuer; // Address of the contract that recorded the attestation\n uint256 value; // Value of the attestation\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\n bytes extraData; // arbitrary data that can be added by the attester\n}\n" - }, - "contracts/core/libs/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, 'Address: insufficient balance');\n\n (bool success, ) = recipient.call{value: amount}('');\n require(success, 'Address: unable to send value, recipient may have reverted');\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, 'Address: low-level call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, 'Address: insufficient balance for call');\n require(isContract(target), 'Address: call to non-contract');\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data\n ) internal view returns (bytes memory) {\n return functionStaticCall(target, data, 'Address: low-level static call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), 'Address: static call to non-contract');\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), 'Address: delegate call to non-contract');\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/core/libs/utils/Bitmap256Bit.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/*\n * The 256-bit bitmap is structured in 64 chuncks of 4 bits each.\n * The 4 bits can encode any value from 0 to 15.\n\n chunck63 chunck2 chunck1 chunck0\n bits bits bits bits \n ┌────────────┐ ┌────────────┬────────────┬────────────┐\n │ 1 1 1 1 │ .... │ 1 0 1 1 │ 0 0 0 0 │ 0 0 0 1 │\n └────────────┘ └────────────┴────────────┴────────────┘\n value 15 value 11 value 0 value 1\n\n * A chunck index must be between 0 and 63.\n * A value must be between 0 and 15.\n **/\n\nlibrary Bitmap256Bit {\n uint256 constant MAX_INT = 2 ** 256 - 1;\n\n error IndexOutOfBounds(uint8 index);\n error ValueOutOfBounds(uint8 value);\n\n /**\n * @dev Return the value at a given index of a 256-bit bitmap\n * @param index index where the value can be found. Can be between 0 and 63\n */\n function _get(uint256 self, uint8 index) internal pure returns (uint8) {\n uint256 currentValues = self;\n // Get the encoded 4-bit value by right shifting to the `index` position\n uint256 shifted = currentValues >> (4 * index);\n // Get the value by only masking the last 4 bits with an AND operator\n return uint8(shifted & (2 ** 4 - 1));\n }\n\n /**\n * @dev Set a value at a chosen index in a 256-bit bitmap\n * @param index index where the value will be stored. Can be between 0 and 63\n * @param value value to store. Can be between 0 and 15\n */\n function _set(uint256 self, uint8 index, uint8 value) internal pure returns (uint256) {\n _checkIndexIsValid(index);\n _checkValueIsValid(value);\n\n uint256 currentValues = self;\n // 1. first we need to remove the current value for the inputed `index`\n // Left Shift 4 bits mask (1111 mask) to the `index` position\n uint256 mask = (2 ** 4 - 1) << (4 * index);\n // Apply a XOR operation to obtain a mask with all bits set to 1 except the 4 bits that we want to remove\n uint256 negativeMask = MAX_INT ^ mask;\n // Apply a AND operation between the current values and the negative mask to remove the wanted bits\n uint256 newValues = currentValues & negativeMask;\n\n // 2. We set the new value wanted at the `index` position\n // Create the 4 bits encoding the new value and left shift them to the `index` position\n uint256 newValueMask = uint256(value) << (4 * index);\n // Apply an OR operation between the current values and the newValueMask to reference new value\n return newValues | newValueMask;\n }\n\n /**\n * @dev Get all the non-zero values in a 256-bit bitmap\n * @param self a 256-bit bitmap\n */\n function _getAllNonZeroValues(\n uint256 self\n ) internal pure returns (uint8[] memory, uint8[] memory, uint8) {\n uint8[] memory indices = new uint8[](64);\n uint8[] memory values = new uint8[](64);\n uint8 nbOfNonZeroValues = 0;\n for (uint8 i = 0; i < 63; i++) {\n uint8 value = _get(self, i);\n if (value > 0) {\n indices[nbOfNonZeroValues] = i;\n values[nbOfNonZeroValues] = value;\n nbOfNonZeroValues++;\n }\n }\n return (indices, values, nbOfNonZeroValues);\n }\n\n /**\n * @dev Check if the index is valid (is between 0 and 63)\n * @param index index of a chunck\n */\n function _checkIndexIsValid(uint8 index) internal pure {\n if (index > 63) {\n revert IndexOutOfBounds(index);\n }\n }\n\n /**\n * @dev Check if the value is valid (is between 0 and 15)\n * @param value value to encode in a chunck\n */\n function _checkValueIsValid(uint8 value) internal pure {\n if (value > 15) {\n revert ValueOutOfBounds(value);\n }\n }\n}\n" - }, - "contracts/core/libs/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.14;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "contracts/core/libs/utils/RangeLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nstruct Range {\n uint256 min;\n uint256 max;\n}\n\n// Range [0;3] includees 0 and 3\nlibrary RangeUtils {\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\n for (uint256 i = 0; i < ranges.length; i++) {\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\n return true;\n }\n }\n return false;\n }\n}\n" - }, - "contracts/periphery/badges-examples/BAYCOwnershipBadgeExample.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC721} from '@openzeppelin/contracts/token/ERC721/ERC721.sol';\nimport {IAttestationsRegistry} from '../../core/interfaces/IAttestationsRegistry.sol';\n\ncontract BAYCOwnershipBadge is ERC721 {\n IAttestationsRegistry immutable ATTESTATIONS_REGISTRY;\n uint256 constant HydraS1_BAYC_ATTESTATION_COLLECTION_ID = 100000001;\n uint256 constant SMPS_BAYC_ATTESTATION_COLLECTION_ID = 30000000000003;\n\n constructor(\n address attestationsRegistryAddress,\n string memory name,\n string memory symbol\n ) ERC721(name, symbol) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n function balanceOf(address account) public view virtual override returns (uint256) {\n bool hasZKAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n HydraS1_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n bool hasDoxingAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n SMPS_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n return hasZKAttestation || hasDoxingAttestation ? 1 : 0;\n }\n}\n" - }, - "contracts/periphery/utils/AvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n/**\n * @title Attesters Groups Registry\n * @author Sismo\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\n * For more information: https://available-roots-registry.docs.sismo.io\n *\n **/\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\n uint8 public constant IMPLEMENTATION_VERSION = 2;\n\n mapping(address => mapping(uint256 => bool)) public _roots;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can register/ unregister roots\n */\n constructor(address owner) {\n initialize(owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n }\n }\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\n _registerRootForAttester(attester, root);\n }\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\n _unregisterRootForAttester(attester, root);\n }\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external onlyOwner {\n _registerRootForAttester(address(0), root);\n }\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external onlyOwner {\n _unregisterRootForAttester(address(0), root);\n }\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\n return _roots[_msgSender()][root] || _roots[address(0)][root];\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\n return _roots[attester][root] || _roots[address(0)][root];\n }\n\n function _registerRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = true;\n if (attester == address(0)) {\n emit RegisteredRootForAll(root);\n } else {\n emit RegisteredRootForAttester(attester, root);\n }\n }\n\n function _unregisterRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = false;\n if (attester == address(0)) {\n emit UnregisteredRootForAll(root);\n } else {\n emit UnregisteredRootForAttester(attester, root);\n }\n }\n}\n" - }, - "contracts/periphery/utils/CommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\n\n/**\n * @title Commitment Mapper Registry Contract\n * @author Sismo\n * @notice This contract stores information about the commitment mapper.\n * Its ethereum address and its EdDSA public key\n * For more information: https://commitment-mapper.docs.sismo.io\n *\n **/\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\n uint8 public constant IMPLEMENTATION_VERSION = 2;\n\n uint256[2] internal _commitmentMapperPubKey;\n address _commitmentMapperAddress;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n constructor(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) {\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n address ownerAddress,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\n _updateCommitmentMapperAddress(commitmentMapperAddress);\n }\n }\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\n }\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\n _updateCommitmentMapperAddress(newAddress);\n }\n\n /**\n * @dev Getter of the EdDSA public key of the commitment mapper\n */\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\n return _commitmentMapperPubKey;\n }\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view override returns (address) {\n return _commitmentMapperAddress;\n }\n\n function _updateCommitmentMapperAddress(address newAddress) internal {\n _commitmentMapperAddress = newAddress;\n emit UpdatedCommitmentMapperAddress(newAddress);\n }\n\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\n _commitmentMapperPubKey = pubKey;\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\n/**\n * @title IAvailableRootsRegistry\n * @author Sismo\n * @notice Interface for (Merkle) Roots Registry\n */\ninterface IAvailableRootsRegistry {\n event RegisteredRootForAttester(address attester, uint256 root);\n event RegisteredRootForAll(uint256 root);\n event UnregisteredRootForAttester(address attester, uint256 root);\n event UnregisteredRootForAll(uint256 root);\n\n error CannotRegisterForZeroAddress();\n error CannotUnregisterForZeroAddress();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address owner) external;\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external;\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external;\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\n}\n" - }, - "contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\ninterface ICommitmentMapperRegistry {\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\n event UpdatedCommitmentMapperAddress(address newAddress);\n error PubKeyNotValid(uint256[2] pubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) external;\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external;\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getEdDSAPubKey() external view returns (uint256[2] memory);\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view returns (address);\n}\n" - }, - "contracts/periphery/utils/TransparentUpgradeableProxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n// Note: we just copied so that we can see the contract used\npragma solidity ^0.8.14;\n\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(''), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(\n address newImplementation,\n bytes calldata data\n ) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(\n msg.sender != _getAdmin(),\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\n );\n super._beforeFallback();\n }\n}\n" - }, - "contracts/tests/MockAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttestationsRegistry} from '../core/interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from '../core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from '../core/libs/attestations-registry/AttestationsRegistryState.sol';\nimport {IBadges} from '../core/interfaces/IBadges.sol';\nimport {Attestation, AttestationData} from '../core/libs/Structs.sol';\n\ncontract MockAttestationsRegistry {\n uint256 immutable ATTESTATION_VALUE;\n\n event AttestationRecorded(Attestation attestation);\n\n constructor(uint256 attestationValue) {\n ATTESTATION_VALUE = attestationValue;\n }\n\n function getAttestationValue(\n uint256 collectionId,\n address owner\n ) external view returns (uint256) {\n return ATTESTATION_VALUE;\n }\n\n function recordAttestations(Attestation[] calldata attestations) external {\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationRecorded(attestations[i]);\n }\n }\n}\n" - }, - "contracts/tests/MockAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\nimport {Attestation, Request} from '../core/libs/Structs.sol';\nimport {Attester} from '../core/Attester.sol';\nimport {IAttester} from '../core/interfaces/IAttester.sol';\n\ncontract MockAttester is IAttester, Attester {\n uint256 public immutable ATTESTATION_ID_MIN;\n uint256 public immutable ATTESTATION_ID_MAX;\n\n constructor(\n address ATTESTATION_REGISTRY_ADDRESS,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n ) Attester(ATTESTATION_REGISTRY_ADDRESS) {\n ATTESTATION_ID_MIN = collectionIdFirst;\n ATTESTATION_ID_MAX = collectionIdLast;\n }\n\n function _verifyRequest(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {}\n\n function buildAttestations(\n Request calldata request,\n bytes calldata /*data*/\n ) public view virtual override(Attester, IAttester) returns (Attestation[] memory) {\n uint256 collectionId = ATTESTATION_ID_MIN + request.claims[0].groupId;\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n collectionId,\n request.destination,\n address(this),\n request.claims[0].claimedValue,\n abi.decode(request.claims[0].extraData, (uint32)),\n 'Mock Attester v0'\n );\n return (attestations);\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates", - "storageLayout" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/mumbai/solcInputs/61c38ae61d36c4e0fe74ede913f00b14.json b/deployments/mumbai/solcInputs/61c38ae61d36c4e0fe74ede913f00b14.json deleted file mode 100644 index 8a8dcb0..0000000 --- a/deployments/mumbai/solcInputs/61c38ae61d36c4e0fe74ede913f00b14.json +++ /dev/null @@ -1,243 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/access/AccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(account),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" - }, - "@openzeppelin/contracts/access/IAccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" - }, - "@openzeppelin/contracts/access/Ownable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" - }, - "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" - }, - "@openzeppelin/contracts/security/Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/ERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC1155.sol\";\nimport \"./IERC1155Receiver.sol\";\nimport \"./extensions/IERC1155MetadataURI.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of the basic standard multi-token.\n * See https://eips.ethereum.org/EIPS/eip-1155\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\n *\n * _Available since v3.1._\n */\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\n using Address for address;\n\n // Mapping from token ID to account balances\n mapping(uint256 => mapping(address => uint256)) private _balances;\n\n // Mapping from account to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n string private _uri;\n\n /**\n * @dev See {_setURI}.\n */\n constructor(string memory uri_) {\n _setURI(uri_);\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155).interfaceId ||\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC1155MetadataURI-uri}.\n *\n * This implementation returns the same URI for *all* token types. It relies\n * on the token type ID substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * Clients calling this function must replace the `\\{id\\}` substring with the\n * actual token type ID.\n */\n function uri(uint256) public view virtual override returns (string memory) {\n return _uri;\n }\n\n /**\n * @dev See {IERC1155-balanceOf}.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\n require(account != address(0), \"ERC1155: address zero is not a valid owner\");\n return _balances[id][account];\n }\n\n /**\n * @dev See {IERC1155-balanceOfBatch}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\n public\n view\n virtual\n override\n returns (uint256[] memory)\n {\n require(accounts.length == ids.length, \"ERC1155: accounts and ids length mismatch\");\n\n uint256[] memory batchBalances = new uint256[](accounts.length);\n\n for (uint256 i = 0; i < accounts.length; ++i) {\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\n }\n\n return batchBalances;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev See {IERC1155-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not token owner or approved\"\n );\n _safeTransferFrom(from, to, id, amount, data);\n }\n\n /**\n * @dev See {IERC1155-safeBatchTransferFrom}.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not token owner or approved\"\n );\n _safeBatchTransferFrom(from, to, ids, amounts, data);\n }\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n\n emit TransferSingle(operator, from, to, id, amount);\n\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\n\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; ++i) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n }\n\n emit TransferBatch(operator, from, to, ids, amounts);\n\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\n\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\n }\n\n /**\n * @dev Sets a new URI for all token types, by relying on the token type ID\n * substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * By this mechanism, any occurrence of the `\\{id\\}` substring in either the\n * URI or any of the amounts in the JSON file at said URI will be replaced by\n * clients with the token type ID.\n *\n * For example, the `https://token-cdn-domain/\\{id\\}.json` URI would be\n * interpreted by clients as\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\n * for token type ID 0x4cce0.\n *\n * See {uri}.\n *\n * Because these URIs cannot be meaningfully represented by the {URI} event,\n * this function emits no events.\n */\n function _setURI(string memory newuri) internal virtual {\n _uri = newuri;\n }\n\n /**\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _mint(\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _balances[id][to] += amount;\n emit TransferSingle(operator, address(0), to, id, amount);\n\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _mintBatch(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; i++) {\n _balances[ids[i]][to] += amounts[i];\n }\n\n emit TransferBatch(operator, address(0), to, ids, amounts);\n\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\n }\n\n /**\n * @dev Destroys `amount` tokens of token type `id` from `from`\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `from` must have at least `amount` tokens of token type `id`.\n */\n function _burn(\n address from,\n uint256 id,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n\n emit TransferSingle(operator, from, address(0), id, amount);\n\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n */\n function _burnBatch(\n address from,\n uint256[] memory ids,\n uint256[] memory amounts\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n for (uint256 i = 0; i < ids.length; i++) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n }\n\n emit TransferBatch(operator, from, address(0), ids, amounts);\n\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC1155: setting approval status for self\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `ids` and `amounts` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `id` and `amount` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n function _doSafeTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\n if (response != IERC1155Receiver.onERC1155Received.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non-ERC1155Receiver implementer\");\n }\n }\n }\n\n function _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\n bytes4 response\n ) {\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non-ERC1155Receiver implementer\");\n }\n }\n }\n\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\n uint256[] memory array = new uint256[](1);\n array[0] = element;\n\n return array;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1155.sol\";\nimport \"../../../security/Pausable.sol\";\n\n/**\n * @dev ERC1155 token with pausable token transfers, minting and burning.\n *\n * Useful for scenarios such as preventing trades until the end of an evaluation\n * period, or having an emergency switch for freezing all token transfers in the\n * event of a large bug.\n *\n * _Available since v3.1._\n */\nabstract contract ERC1155Pausable is ERC1155, Pausable {\n /**\n * @dev See {ERC1155-_beforeTokenTransfer}.\n *\n * Requirements:\n *\n * - the contract must not be paused.\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n require(!paused(), \"ERC1155Pausable: token transfer while paused\");\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155MetadataURI is IERC1155 {\n /**\n * @dev Returns the URI for token type `id`.\n *\n * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n * clients with the actual token type ID.\n */\n function uri(uint256 id) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/ERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"./extensions/IERC721Metadata.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/Strings.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: address zero is not a valid owner\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _ownerOf(tokenId);\n require(owner != address(0), \"ERC721: invalid token ID\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireMinted(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not token owner or approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n _requireMinted(tokenId);\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n _safeTransfer(from, to, tokenId, data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _ownerOf(tokenId) != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId, 1);\n\n // Check that tokenId was not minted by `_beforeTokenTransfer` hook\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n unchecked {\n // Will not overflow unless all 2**256 token ids are minted to the same owner.\n // Given that tokens are minted one by one, it is impossible in practice that\n // this ever happens. Might change if we allow batch minting.\n // The ERC fails to describe this case.\n _balances[to] += 1;\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId, 1);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId, 1);\n\n // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook\n owner = ERC721.ownerOf(tokenId);\n\n // Clear approvals\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // Cannot overflow, as that would require more tokens to be burned/transferred\n // out than the owner initially received through minting and transferring in.\n _balances[owner] -= 1;\n }\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId, 1);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId, 1);\n\n // Check that tokenId was not transferred by `_beforeTokenTransfer` hook\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n\n // Clear approvals from the previous owner\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // `_balances[from]` cannot overflow for the same reason as described in `_burn`:\n // `from`'s balance is the number of token held, which is at least one before the current\n // transfer.\n // `_balances[to]` could overflow in the conditions described in `_mint`. That would require\n // all 2**256 token ids to be minted, which in practice is impossible.\n _balances[from] -= 1;\n _balances[to] += 1;\n }\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId, 1);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits an {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` has not been minted yet.\n */\n function _requireMinted(uint256 tokenId) internal view virtual {\n require(_exists(tokenId), \"ERC721: invalid token ID\");\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.\n * - When `from` is zero, the tokens will be minted for `to`.\n * - When `to` is zero, ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256, /* firstTokenId */\n uint256 batchSize\n ) internal virtual {\n if (batchSize > 1) {\n if (from != address(0)) {\n _balances[from] -= batchSize;\n }\n if (to != address(0)) {\n _balances[to] += batchSize;\n }\n }\n }\n\n /**\n * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.\n * - When `from` is zero, the tokens were minted for `to`.\n * - When `to` is zero, ``from``'s tokens were burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 firstTokenId,\n uint256 batchSize\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/ERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/StorageSlot.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Strings.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" - }, - "@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract HydraS1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [8609986746108439658545470593166889256314951959466775818870246174320018498804,\n 6848251127850009101372611262053374737897586140140607384018397707035108265914],\n [21367916863936594568281095443965096905143705300114190558130516981138584550504,\n 13327705762185115653848159709412003423932761899188342359583872691135383932883]\n );\n vk.IC = new Pairing.G1Point[](11);\n \n vk.IC[0] = Pairing.G1Point( \n 19965766170734310004645394427613286415565755728797065894668054116047682895204,\n 6952067612339183672227137101423582097916038093373585908267153974352032944482\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 13987716160490730015463796942940452666334097189904948795214986996497499925899,\n 5336810094802209074340875836312868429276540870324469349093948627126061524544\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 14931593253473978964215343699995811275378324235306358485461293343370969283966,\n 564306919152089917957316877787764763278299990971316475606280877961553231205\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11591267743733991434114686002448165336885445656808796470854638278338319268343,\n 11495219763417990955889652410266075210402006084183208750635660647824890013350\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 8183184532870222270700473518157259944911700429689031755853536692005688965081,\n 9121077094104828462137861111631978599019724423614716723152060153405564278301\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 4314095526093128699362232919686741372014146055311239687202926853002748112330,\n 11665330391505820654128458332883010598817535082070674418723503440883598640597\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\n 181057165072599074288983745076121344893296348827576905983079816835912241514\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 18925967077785550270509493111690046951994174908254476036944536825999614778001,\n 4990629719417206796668074534812314525340851981015724652256935997545282642849\n ); \n \n vk.IC[10] = Pairing.G1Point( \n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[10] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "@sismo-core/pythia-1/contracts/Pythia1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract Pythia1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\n );\n vk.IC = new Pairing.G1Point[](10);\n \n vk.IC[0] = Pairing.G1Point( \n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 104028078850975554065172701281783302003220555203883119831575537681421753151,\n 19148240629904598794948591359118971959790791697910953160820265703277306346\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[9] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/HydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1Base} from './IHydraS1Base.sol';\nimport {Attester} from '../../../core/Attester.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Hydra S1 ZK Proving Scheme\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to the following:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n *\n */\nabstract contract HydraS1Base is IHydraS1Base, Attester, Initializable {\n using HydraS1Lib for HydraS1ProofData;\n\n // ZK-SNARK Verifier\n HydraS1Verifier immutable VERIFIER;\n // Registry storing the Commitment Mapper EdDSA Public key\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS\n *******************************************************/\n\n /**\n * @dev Constructor. Initializes the contract\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\n * @param commitmentMapperAddress Commitment mapper's public key registry\n */\n constructor(\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress\n ) {\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\n }\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\n return COMMITMENT_MAPPER_REGISTRY;\n }\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\n return AVAILABLE_ROOTS_REGISTRY;\n }\n\n /*******************************************************\n Hydra-S1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the nullifier from an attestation extraData\n * @dev Getter of a nullifier encoded in extraData\n * @notice Must be implemented by the inheriting contracts\n * @param extraData extraData where nullifier can be encoded\n */\n function getNullifierFromExtraData(\n bytes memory extraData\n ) external view virtual returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the external nullifier from a user request\n * so it can be checked against snark input\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\n * users bring sourceSecretHash as private input which guarantees privacy\n *\n * This function MUST be implemented by Hydra-S1 attesters.\n * This is the core function that implements the logic of external nullifiers\n *\n * Do they get one external nullifier per claim?\n * Do they get 2 external nullifiers per claim?\n * Do they get 1 external nullifier per claim, every month?\n * Take a look at Hydra-S1 Simple Attester for an example\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\n */\n function _getExternalNullifierOfClaim(\n HydraS1Claim memory claim\n ) internal view virtual returns (uint256);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(\n HydraS1Claim memory claim,\n HydraS1ProofInput memory input\n ) internal view virtual {\n if (input.accountsTreeValue != claim.groupId) {\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\n }\n\n if (input.isStrict == claim.groupProperties.isScore) {\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n }\n\n if (input.destination != claim.destination) {\n revert DestinationMismatch(claim.destination, input.destination);\n }\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot)) {\n revert RegistryRootMismatch(input.registryRoot);\n }\n\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\n if (\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\n ) {\n revert CommitmentMapperPubKeyMismatch(\n commitmentMapperPubKey[0],\n commitmentMapperPubKey[1],\n input.commitmentMapperPubKey[0],\n input.commitmentMapperPubKey[1]\n );\n }\n\n uint256 externalNullifier = _getExternalNullifierOfClaim(claim);\n\n if (input.externalNullifier != externalNullifier) {\n revert ExternalNullifierMismatch(externalNullifier, input.externalNullifier);\n }\n }\n\n /**\n * @dev verify the groth16 mathematical proof\n * @param proofData snark public input\n */\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(uint256 /*errorCode*/) {\n revert InvalidGroth16Proof('');\n } catch (bytes memory /*lowLevelData*/) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/IHydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Interface\n * @author Sismo\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\n * We invite readers to refer to the following:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n **/\ninterface IHydraS1Base is IAttester {\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\n error RegistryRootMismatch(uint256 inputRoot);\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error CommitmentMapperPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error ExternalNullifierMismatch(uint256 expectedExternalNullifier, uint256 externalNullifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error AccountsTreeValueMismatch(\n uint256 expectedAccountsTreeValue,\n uint256 inputAccountsTreeValue\n );\n error InvalidGroth16Proof(string reason);\n\n function getNullifierFromExtraData(bytes memory extraData) external view returns (uint256);\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier);\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\n\nimport {IHydraS1AccountboundAttester} from './interfaces/IHydraS1AccountboundAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from '../../core/libs/Structs.sol';\n\n// Imports related to Hydra-S1\nimport {HydraS1SimpleAttester, IAttester, HydraS1Lib, HydraS1ProofData, HydraS1Claim} from './HydraS1SimpleAttester.sol';\n\n/**\n * @title Hydra-S1 Accountbound Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic.\n * Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic.\n * However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation.\n * The _beforeRecordAttestations is also overriden to fit the Accountbound logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Nullified\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\n * While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier)\n * We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation.\n * We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation.\n * Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier)\n\n * - Accountbound (opt-in, with cooldown period)\n * The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group.\n * Users can update their attestation's destination by providing a new Hydra-S1 ZK proof \n * It means the attestation is bound to the source account, stored on an updatable destination account.\n * When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional.\n * A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred\n * One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations.\n \n * - Renewable\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew or update their attestations\n **/\n\ncontract HydraS1AccountboundAttester is\n IHydraS1AccountboundAttester,\n HydraS1SimpleAttester,\n Ownable\n{\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n uint8 public constant IMPLEMENTATION_VERSION = 4;\n\n /*******************************************************\n Storage layout:\n 20 slots between HydraS1SimpleAttester and HydraS1AccountboundAttester\n 1 currently used by Ownable\n 19 place holders\n 2O for config\n 1 currently used\n 19 place holders\n 20 for logic\n 2 currently used\n 18 place holders\n *******************************************************/\n\n // keeping some space for future config logics\n uint256[19] private _placeHolderBeforeHydraS1Accountbound;\n\n // cooldown durations for each groupIndex\n mapping(uint256 => uint32) internal _cooldownDurations;\n\n // keeping some space for future config logics\n uint256[19] private _placeHoldersHydraS1AccountboundConfig;\n\n mapping(uint256 => uint32) internal _nullifiersCooldownStart;\n mapping(uint256 => uint16) internal _nullifiersBurnCount;\n\n // keeping some space for future config logics\n uint256[18] private _placeHoldersHydraS1AccountboundLogic;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first attestation collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last attestation collection in which the attester is supposed to record\n * @param owner Address of attester's owner\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address owner\n )\n HydraS1SimpleAttester(\n attestationsRegistryAddress,\n hydraS1VerifierAddress,\n availableRootsRegistryAddress,\n commitmentMapperAddress,\n collectionIdFirst,\n collectionIdLast\n )\n {\n initialize(owner);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n }\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Returns the actual attestations constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark public input as well as snark proof\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) public view virtual override(IAttester, HydraS1SimpleAttester) returns (Attestation[] memory) {\n Attestation[] memory attestations = super.buildAttestations(request, proofData);\n\n uint256 nullifier = proofData._getNullifier();\n attestations[0].extraData = abi.encode(\n attestations[0].extraData, // nullifier, from HydraS1 Simple\n _getNextBurnCount(nullifier, attestations[0].owner) // BurnCount\n );\n\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Hook run before recording the attestation.\n * Throws if nullifier already used, not a renewal, and nullifier on cooldown.\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n uint256 nullifier = proofData._getNullifier();\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\n\n HydraS1Claim memory claim = request._claim();\n\n // check if the nullifier has already been used previously, if so it may be on cooldown\n if (\n previousNullifierDestination != address(0) &&\n previousNullifierDestination != claim.destination\n ) {\n uint32 cooldownDuration = _getCooldownDurationForGroupIndex(claim.groupProperties.groupIndex);\n if (cooldownDuration == 0) {\n revert CooldownDurationNotSetForGroupIndex(claim.groupProperties.groupIndex);\n }\n if (_isOnCooldown(nullifier, cooldownDuration)) {\n uint16 burnCount = _getNullifierBurnCount(nullifier);\n revert NullifierOnCooldown(\n nullifier,\n previousNullifierDestination,\n burnCount,\n cooldownDuration\n );\n }\n\n // Delete the old Attestation linked to the nullifier before recording the new one (accountbound feature)\n _deletePreviousAttestation(claim, previousNullifierDestination);\n\n _setNullifierOnCooldownAndIncrementBurnCount(nullifier);\n }\n _setDestinationForNullifier(nullifier, request.destination);\n }\n\n /*******************************************************\n LOGIC FUNCTIONS RELATED TO ACCOUNTBOUND FEATURE\n *******************************************************/\n\n /**\n * @dev Getter, returns the burnCount of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16) {\n return _getNullifierBurnCount(nullifier);\n }\n\n /**\n * @dev Getter, returns the cooldown start of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32) {\n return _getNullifierCooldownStart(nullifier);\n }\n\n /**\n * @dev returns the nullifier for a given extraData\n * @param extraData bytes where the nullifier is encoded\n */\n function getNullifierFromExtraData(\n bytes memory extraData\n ) external pure override(HydraS1SimpleAttester, IHydraS1AccountboundAttester) returns (uint256) {\n (uint256 nullifier, ) = abi.decode(extraData, (uint256, uint16));\n\n return nullifier;\n }\n\n /**\n * @dev Returns the burn count for a given extraData\n * @param extraData bytes where the burnCount is encoded\n */\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16) {\n (, uint16 burnCount) = abi.decode(extraData, (uint256, uint16));\n\n return burnCount;\n }\n\n /**\n * @dev Checks if a nullifier is on cooldown\n * @param nullifier user nullifier\n * @param cooldownDuration waiting time before the user can change its badge destination\n */\n function _isOnCooldown(uint256 nullifier, uint32 cooldownDuration) internal view returns (bool) {\n return _getNullifierCooldownStart(nullifier) + cooldownDuration > block.timestamp;\n }\n\n /**\n * @dev Delete the previous attestation created with this nullifier\n * @param claim user claim\n * @param previousNullifierDestination previous destination chosen for this user nullifier\n */\n function _deletePreviousAttestation(\n HydraS1Claim memory claim,\n address previousNullifierDestination\n ) internal {\n address[] memory attestationOwners = new address[](1);\n uint256[] memory attestationCollectionIds = new uint256[](1);\n\n attestationOwners[0] = previousNullifierDestination;\n attestationCollectionIds[0] = AUTHORIZED_COLLECTION_ID_FIRST + claim.groupProperties.groupIndex;\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n }\n\n function _setNullifierOnCooldownAndIncrementBurnCount(uint256 nullifier) internal {\n _nullifiersCooldownStart[nullifier] = uint32(block.timestamp);\n _nullifiersBurnCount[nullifier] += 1;\n emit NullifierSetOnCooldown(nullifier, _nullifiersBurnCount[nullifier]);\n }\n\n function _getNullifierCooldownStart(uint256 nullifier) internal view returns (uint32) {\n return _nullifiersCooldownStart[nullifier];\n }\n\n function _getNullifierBurnCount(uint256 nullifier) internal view returns (uint16) {\n return _nullifiersBurnCount[nullifier];\n }\n\n /**\n * @dev returns burn count or burn count + 1 if new burn will happen\n * @param nullifier user nullifier\n * @param claimDestination destination referenced in the user claim\n */\n function _getNextBurnCount(\n uint256 nullifier,\n address claimDestination\n ) public view virtual returns (uint16) {\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\n uint16 burnCount = _getNullifierBurnCount(nullifier);\n // If the attestation is minted on a new destination address\n // the burnCount that will be encoded in the extraData of the Attestation should be incremented\n if (\n previousNullifierDestination != address(0) && previousNullifierDestination != claimDestination\n ) {\n burnCount += 1;\n }\n return burnCount;\n }\n\n /*******************************************************\n GROUP CONFIGURATION LOGIC\n *******************************************************/\n\n /**\n * @dev Setter, sets the cooldown duration of a groupIndex\n * @notice set to 0 to deactivate the accountbound feature for this group\n * @param groupIndex internal collection id\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\n **/\n function setCooldownDurationForGroupIndex(\n uint256 groupIndex,\n uint32 cooldownDuration\n ) external onlyOwner {\n _cooldownDurations[groupIndex] = cooldownDuration;\n emit CooldownDurationSetForGroupIndex(groupIndex, cooldownDuration);\n }\n\n /**\n * @dev Getter, get the cooldown duration of a groupIndex\n * @notice returns 0 when the accountbound feature is deactivated for this group\n * @param groupIndex internal collection id\n **/\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32) {\n return _getCooldownDurationForGroupIndex(groupIndex);\n }\n\n // = 0 means that the accountbound feature is deactivated for this group\n function _getCooldownDurationForGroupIndex(uint256 groupIndex) internal view returns (uint32) {\n return _cooldownDurations[groupIndex];\n }\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\nimport {IHydraS1Base} from './base/IHydraS1Base.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Nullified\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * nullifier = hash(sourceSecret, externalNullifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - Renewable\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew their attestations\n **/\n\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n /*******************************************************\n Storage layout:\n 20 slots for HydraS1\n 1 slot used\n 19 place holders\n *******************************************************/\n\n mapping(uint256 => address) internal _nullifiersDestinations;\n\n // keeping some space for future\n uint256[19] private _placeHoldersHydraS1Simple;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\n HydraS1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n uint256 nullifier = proofData._getNullifier();\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n abi.encode(nullifier)\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if nullifier already used and not a renewal (e.g destination different that last)\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n // we get the nullifier used from the snark input in the data provided\n uint256 nullifier = proofData._getNullifier();\n address currentDestination = _getDestinationOfNullifier(nullifier);\n\n if (currentDestination != address(0) && currentDestination != request.destination) {\n revert NullifierUsed(nullifier);\n }\n\n _setDestinationForNullifier(nullifier, request.destination);\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the external nullifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose externalNullifier = hash(attesterAddress, claim.GroupId)\n * Creates one nullifier per group, per user and makes sure no collision with other attester's nullifiers\n **/\n function _getExternalNullifierOfClaim(\n HydraS1Claim memory claim\n ) internal view override returns (uint256) {\n uint256 externalNullifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.groupIndex\n );\n return externalNullifier;\n }\n\n /**\n * @dev returns the nullifier for a given extraData\n * @param extraData bytes where the nullifier is encoded\n */\n function getNullifierFromExtraData(\n bytes memory extraData\n ) external pure virtual override(IHydraS1Base, HydraS1Base) returns (uint256) {\n return abi.decode(extraData, (uint256));\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a nullifier\n * @param nullifier nullifier used\n **/\n function getDestinationOfNullifier(uint256 nullifier) external view override returns (address) {\n return _getDestinationOfNullifier(nullifier);\n }\n\n function _setDestinationForNullifier(uint256 nullifier, address destination) internal virtual {\n _nullifiersDestinations[nullifier] = destination;\n emit NullifierDestinationUpdated(nullifier, destination);\n }\n\n function _getDestinationOfNullifier(uint256 nullifier) internal view returns (address) {\n return _nullifiersDestinations[nullifier];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from '././IHydraS1SimpleAttester.sol';\n\n/**\n * @title Hydra-S1 Accountbound Interface\n * @author Sismo\n * @notice Interface of the HydraS1AccountboundAttester contract which inherits from the errors, events and methods specific to the HydraS1SimpleAttester interface.\n **/\ninterface IHydraS1AccountboundAttester is IHydraS1SimpleAttester {\n /**\n * @dev Event emitted when the duration of the cooldown duration for a group index (internal collection id) has been set\n * @param groupIndex internal collection id\n * @param cooldownDuration the duration of the cooldown period\n **/\n event CooldownDurationSetForGroupIndex(uint256 indexed groupIndex, uint32 cooldownDuration);\n\n /**\n * @dev Event emitted when the nullifier has been set on cooldown. This happens when the\n * attestation destination of a nullifier has been changed\n * @param nullifier user nullifier\n * @param burnCount the number of times the attestation destination of a nullifier has been changed\n **/\n event NullifierSetOnCooldown(uint256 indexed nullifier, uint16 burnCount);\n\n /**\n * @dev Error when the nullifier is on cooldown. The user have to wait the cooldownDuration\n * before being able to change again the destination address.\n **/\n error NullifierOnCooldown(\n uint256 nullifier,\n address destination,\n uint16 burnCount,\n uint32 cooldownStart\n );\n\n /**\n * @dev Error when the cooldown duration for a given groupIndex is equal to zero.\n * The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.\n **/\n error CooldownDurationNotSetForGroupIndex(uint256 groupIndex);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) external;\n\n /**\n * @dev returns the nullifier for a given extraData\n * @param extraData bytes where the nullifier is encoded\n */\n function getNullifierFromExtraData(bytes memory extraData) external pure returns (uint256);\n\n /**\n * @dev Returns the burn count for a given extraData\n * @param extraData bytes where the burnCount is encoded\n */\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16);\n\n /**\n * @dev Getter, returns the cooldown start of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32);\n\n /**\n * @dev Getter, returns the burnCount of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16);\n\n /**\n * @dev Setter, sets the cooldown duration of a groupIndex\n * @param groupIndex internal collection id\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\n **/\n function setCooldownDurationForGroupIndex(uint256 groupIndex, uint32 cooldownDuration) external;\n\n /*/**\n * @dev Getter, get the cooldown duration of a groupIndex\n * @notice returns 0 when the accountbound feature is deactivated for this group\n * @param groupIndex internal collection id\n **/\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32);\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Accountbound Interface\n * @author Sismo\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\n **/\ninterface IHydraS1SimpleAttester is IHydraS1Base {\n /**\n * @dev Error when the nullifier is already used for a destination address\n **/\n error NullifierUsed(uint256 nullifier);\n\n /**\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\n **/\n error CollectionIdOutOfBound(uint256 collectionId);\n\n /**\n * @dev Event emitted when the nullifier is associated to a destination address.\n **/\n event NullifierDestinationUpdated(uint256 nullifier, address newOwner);\n\n /**\n * @dev Getter, returns the last attestation destination of a nullifier\n * @param nullifier nullifier used\n **/\n function getDestinationOfNullifier(uint256 nullifier) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1AccountboundLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Lib, HydraS1Claim, HydraS1GroupProperties} from './HydraS1Lib.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1AccountboundClaim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1AccountboundGroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1AccountboundGroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n uint32 cooldownDuration;\n bool isScore;\n}\n\nlibrary HydraS1AccountboundLib {\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _hydraS1claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n HydraS1GroupProperties memory hydraS1GroupProperties = HydraS1GroupProperties(\n groupProperties.groupIndex,\n groupProperties.generationTimestamp,\n groupProperties.isScore\n );\n\n return (\n HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, hydraS1GroupProperties)\n );\n }\n\n function _hydraS1Accountboundclaim(\n Request memory self\n ) internal pure returns (HydraS1AccountboundClaim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory hydraS1AccountboundGroupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n return (\n HydraS1AccountboundClaim(\n claim.groupId,\n claim.claimedValue,\n self.destination,\n hydraS1AccountboundGroupProperties\n )\n );\n }\n\n function _generateGroupIdFromEncodedProperties(\n bytes memory encodedProperties\n ) internal pure returns (uint256) {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1GroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n bool isScore;\n}\n\nstruct HydraS1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct HydraS1ProofData {\n HydraS1CircomSnarkProof proof;\n uint256[10] input;\n // destination\n // chainId\n // commitmentMapperPubKey.x\n // commitmentMapperPubKey.y\n // registryTreeRoot\n // externalNullifier\n // nullifier\n // claimedValue\n // accountsTreeValue\n // isStrict\n}\n\nstruct HydraS1ProofInput {\n address destination;\n uint256 chainId;\n uint256 registryRoot;\n uint256 externalNullifier;\n uint256 nullifier;\n uint256 value;\n uint256 accountsTreeValue;\n bool isStrict;\n uint256[2] commitmentMapperPubKey;\n}\n\nlibrary HydraS1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\n return\n HydraS1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getRegistryRoot(self),\n _getExpectedExternalNullifier(self),\n _getNullifier(self),\n _getValue(self),\n _getAccountsTreeValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1GroupProperties)\n );\n\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(\n HydraS1ProofData memory self\n )\n internal\n pure\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[10] memory)\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(\n HydraS1ProofData memory self\n ) internal pure returns (uint256[2] memory) {\n return [self.input[2], self.input[3]];\n }\n\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(\n HydraS1ProofData memory self\n ) internal pure returns (uint256) {\n return self.input[5];\n }\n\n function _getNullifier(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[8];\n }\n\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\n return self.input[9] == 1;\n }\n\n function _getNullifier(bytes calldata self) internal pure returns (uint256) {\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\n uint256 nullifier = uint256(_getNullifier(snarkProofData));\n return nullifier;\n }\n\n function _generateGroupIdFromProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\n );\n }\n\n function _generateGroupIdFromEncodedProperties(\n bytes memory encodedProperties\n ) internal pure returns (uint256) {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(groupIndex, generationTimestamp, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/pythia-1/base/IPythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\n\ninterface IPythia1Base {\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error UserShouldOwnItsDestination(address sender, address inputdestination);\n error CommitmentSignerPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier);\n\n /**\n * @dev Getter of the Commitment Signer EdDSA Public Key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\n}\n" - }, - "contracts/attesters/pythia-1/base/Pythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IPythia1Base} from './IPythia1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Pythia 1 ZK Proving Scheme\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\n\n/**\n * @title Pythia-1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \n * without anyone being able to make the link between the offchain service and the onchain service.\n * It is inherited by the family of Pythia-1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n \n \n **/\nabstract contract Pythia1Base is IPythia1Base, Initializable {\n using Pythia1Lib for Pythia1ProofData;\n\n // ZK-SNARK Verifier\n Pythia1Verifier immutable VERIFIER;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\n */\n constructor(address Pythia1VerifierAddress) {\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\n }\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of the Commitment signer Eddsa Public key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\n return _getCommitmentSignerPubKey();\n }\n\n /*******************************************************\n Pythia-1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * the secretHash is a number only known by the user and is used in \n * the zero knowledge as a private input which guarantees privacy\n\n * This function MUST be implemented by Pythia-1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Pythia-1 Simple Attester for an example\n * @param claim user claim: a particular claim that a user have that he can prove s right.\n */\n function _getTicketIdentifierOfClaim(\n Pythia1Claim memory claim\n ) internal view virtual returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\n * prove the claim was correctly issued for the user.\n */\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(\n Pythia1Claim memory claim,\n Pythia1ProofInput memory input\n ) internal view virtual {\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (claim.destination != msg.sender)\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\n if (\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\n )\n revert CommitmentSignerPubKeyMismatch(\n commitmentSignerPubKey[0],\n commitmentSignerPubKey[1],\n input.commitmentSignerPubKey[0],\n input.commitmentSignerPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the plonk mathematical proof using the circom verifier contract\n * @param proofData snark public input\n */\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(uint256 /*errorCode*/) {\n revert InvalidGroth16Proof('');\n } catch (bytes memory /*lowLevelData*/) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\n\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\n error TicketUsed(uint256 userTicket);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/pythia-1/libs/Pythia1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\n\n// user Pythia-1 claim retrieved form his request\nstruct Pythia1Claim {\n uint256 groupId; // user claims be part of this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct Pythia1GroupProperties {\n uint128 internalCollectionId;\n bool isScore;\n}\n\nstruct Pythia1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct Pythia1ProofData {\n Pythia1CircomSnarkProof proof;\n uint256[9] input;\n // destination;\n // chainId;\n // commitmentSignerPubKey.x;\n // commitmentSignerPubKey.y;\n // groupId;\n // ticketIdentifier;\n // userTicket;\n // value;\n // isStrict;\n}\n\nstruct Pythia1ProofInput {\n address destination;\n uint256 chainId;\n uint256 groupId;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n bool isStrict;\n uint256[2] commitmentSignerPubKey;\n}\n\nlibrary Pythia1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\n return\n Pythia1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getGroupId(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n Pythia1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (Pythia1GroupProperties)\n );\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(\n Pythia1ProofData memory self\n )\n internal\n pure\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[9] memory)\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(\n Pythia1ProofData memory self\n ) internal pure returns (uint256[2] memory) {\n return [self.input[2], self.input[3]];\n }\n\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(\n Pythia1ProofData memory self\n ) internal pure returns (uint256) {\n return self.input[5];\n }\n\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\n return self.input[8] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(\n uint128 internalCollectionId,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\n }\n\n function _generateGroupIdFromEncodedProperties(\n bytes memory encodedProperties\n ) internal pure returns (uint256) {\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 internalCollectionId,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(internalCollectionId, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to Pythia1 Proving Scheme\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\n\n/**\n * @title Pythia-1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Pythia-1 Attesters.\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \n * offchain service in a privacy preserving way. \n * That means no-one can make the link between the account used in the offchain service\n * and the onchain account where the attestation is stored.\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each users gets one userTicket per claim\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n **/\n\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\n using Pythia1Lib for Pythia1ProofData;\n using Pythia1Lib for bytes;\n using Pythia1Lib for Request;\n\n uint8 public constant IMPLEMENTATION_VERSION = 3;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n uint256[2] internal _commitmentSignerPubKey;\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\n * @param owner The owner of the contract that can update the commitment signer pub key\n */\n constructor(\n address attestationsRegistryAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address pythia1VerifierAddress,\n uint256[2] memory commitmentSignerPubKey,\n address owner\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n initialize(commitmentSignerPubKey, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param ownerAddress Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n uint256[2] memory commitmentSignerPubKey,\n address ownerAddress\n ) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into Pythia1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\n Pythia1ProofInput memory snarkInput = snarkProof._input();\n Pythia1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\n Pythia1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.internalCollectionId;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n uint32(block.timestamp),\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used\n * @param request users request. Claim of beiing part of a group.\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0)) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * users bring secretHash as private input in snark which guarantees privacy\n * the secretHash is only known by the user and never escape the user's browser\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(\n Pythia1Claim memory claim\n ) internal view override returns (uint256) {\n uint256 ticketIdentifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.internalCollectionId\n );\n return ticketIdentifier;\n }\n\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\n return _commitmentSignerPubKey;\n }\n\n /*******************************************************\n Pythia-1 Attester Specific Functions\n *******************************************************/\n\n function updateCommitmentSignerPubKey(\n uint256[2] memory commitmentSignerPubKey\n ) external onlyOwner {\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\n _commitmentSignerPubKey = commitmentSignerPubKey;\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\n }\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/core/AttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\nimport {Attestation, AttestationData} from './libs/Structs.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Attestations Registry\n * @author Sismo\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\n * Only authorized attestations issuers can record attestation in the registry\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\n * For more information: https://attestations-registry.docs.sismo.io\n\n * For each attestation recorded, a badge is received by the user\n * The badge is the Non transferrable NFT representation of an attestation \n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\n * It enables off-chain apps such as opensea to catch the \"shadow mint\" of the badge\n **/\ncontract AttestationsRegistry is\n AttestationsRegistryState,\n IAttestationsRegistry,\n AttestationsRegistryConfigLogic\n{\n uint8 public constant IMPLEMENTATION_VERSION = 3;\n IBadges immutable BADGES;\n\n /**\n * @dev Constructor.\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @param badgesAddress Stateless ERC1155 Badges contract\n */\n constructor(address owner, address badgesAddress) {\n BADGES = IBadges(badgesAddress);\n initialize(owner);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n }\n }\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\n address issuer = _msgSender();\n for (uint256 i = 0; i < attestations.length; i++) {\n if (!_isAuthorized(issuer, attestations[i].collectionId))\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\n\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\n attestations[i].owner\n ].value;\n\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\n attestations[i].issuer,\n attestations[i].value,\n attestations[i].timestamp,\n attestations[i].extraData\n );\n\n _triggerBadgeTransferEvent(\n attestations[i].collectionId,\n attestations[i].owner,\n previousAttestationValue,\n attestations[i].value\n );\n emit AttestationRecorded(attestations[i]);\n }\n }\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(\n address[] calldata owners,\n uint256[] calldata collectionIds\n ) external override whenNotPaused {\n if (owners.length != collectionIds.length)\n revert OwnersAndCollectionIdsLengthMismatch(owners, collectionIds);\n\n address issuer = _msgSender();\n for (uint256 i = 0; i < owners.length; i++) {\n AttestationData memory attestationData = _attestationsData[collectionIds[i]][owners[i]];\n\n if (!_isAuthorized(issuer, collectionIds[i]))\n revert IssuerNotAuthorized(issuer, collectionIds[i]);\n delete _attestationsData[collectionIds[i]][owners[i]];\n\n _triggerBadgeTransferEvent(collectionIds[i], owners[i], attestationData.value, 0);\n\n emit AttestationDeleted(\n Attestation(\n collectionIds[i],\n owners[i],\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n )\n );\n }\n }\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(\n uint256 collectionId,\n address owner\n ) external view override returns (bool) {\n return _getAttestationValue(collectionId, owner) != 0;\n }\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(\n uint256 collectionId,\n address owner\n ) external view override returns (AttestationData memory) {\n return _getAttestationData(collectionId, owner);\n }\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(\n uint256 collectionId,\n address owner\n ) external view override returns (uint256) {\n return _getAttestationValue(collectionId, owner);\n }\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(\n uint256 collectionId,\n address owner\n ) external view override returns (address, uint256, uint32, bytes memory) {\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\n return (\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n );\n }\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(\n uint256 collectionId,\n address owner\n ) external view override returns (bytes memory) {\n return _attestationsData[collectionId][owner].extraData;\n }\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(\n uint256 collectionId,\n address owner\n ) external view override returns (address) {\n return _attestationsData[collectionId][owner].issuer;\n }\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(\n uint256 collectionId,\n address owner\n ) external view override returns (uint32) {\n return _attestationsData[collectionId][owner].timestamp;\n }\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view override returns (AttestationData[] memory) {\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\n }\n return attestationsDataArray;\n }\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view override returns (uint256[] memory) {\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\n }\n return attestationsValues;\n }\n\n /**\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\n * It enables off-chain apps such as opensea to catch the \"shadow mints/burns\" of badges\n */\n function _triggerBadgeTransferEvent(\n uint256 badgeTokenId,\n address owner,\n uint256 previousValue,\n uint256 newValue\n ) internal {\n bool isGreaterValue = newValue > previousValue;\n address operator = address(this);\n address from = isGreaterValue ? address(0) : owner;\n address to = isGreaterValue ? owner : address(0);\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\n\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\n }\n\n function _getAttestationData(\n uint256 collectionId,\n address owner\n ) internal view returns (AttestationData memory) {\n return (_attestationsData[collectionId][owner]);\n }\n\n function _getAttestationValue(\n uint256 collectionId,\n address owner\n ) internal view returns (uint256) {\n return _attestationsData[collectionId][owner].value;\n }\n}\n" - }, - "contracts/core/Attester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\n\n/**\n * @title Attester Abstract Contract\n * @author Sismo\n * @notice Contract to be inherited by Attesters\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\n * are recommended to implemented this abstract contract\n\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\n *\n * This contracts is built around two main external standard functions.\n * They must NOT be override them, unless your really know what you are doing\n \n * - generateAttestations(request, proof) => will write attestations in the registry\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\n\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\n\n * For more information: https://attesters.docs.sismo.io\n **/\nabstract contract Attester is IAttester {\n // Registry where all attestations are stored\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n // Verify if request is valid by verifying against proof\n _verifyRequest(request, proofData);\n\n // Generate the actual attestations from user request\n Attestation[] memory attestations = buildAttestations(request, proofData);\n\n _beforeRecordAttestations(request, proofData);\n\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n\n _afterRecordAttestations(attestations);\n\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationGenerated(attestations[i]);\n }\n\n return attestations;\n }\n\n /**\n * @dev External facing function. Allows to delete attestations by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that were deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n address[] memory attestationOwners = new address[](collectionIds.length);\n\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\n\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n // fetch attestations from the registry\n (\n address issuer,\n uint256 attestationValue,\n uint32 timestamp,\n bytes memory extraData\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\n\n attestationOwners[i] = attestationsOwner;\n attestationCollectionIds[i] = collectionIds[i];\n\n attestations[i] = (\n Attestation(\n collectionIds[i],\n attestationsOwner,\n issuer,\n attestationValue,\n timestamp,\n extraData\n )\n );\n }\n\n _verifyAttestationsDeletionRequest(attestations, proofData);\n\n _beforeDeleteAttestations(attestations, proofData);\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n\n _afterDeleteAttestations(attestations, proofData);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n emit AttestationDeleted(attestations[i]);\n }\n return attestations;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) public view virtual returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry getter\n * @return attestationRegistry\n */\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\n return ATTESTATIONS_REGISTRY;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should verify the user request is valid\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\n\n /**\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\n * Default behavior: throws\n * It should verify attestations deletion request is valid\n * @param attestations Attestations that will be deleted\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyAttestationsDeletionRequest(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {\n revert AttestationDeletionNotImplemented();\n }\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before recording attestations in the registry\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual {}\n\n /**\n * @dev (Optional) Can be overridden in attesters inheriting this contract\n * Will be called after recording an attestation\n * @param attestations Recorded attestations\n */\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _beforeDeleteAttestations(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called after deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _afterDeleteAttestations(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {}\n}\n" - }, - "contracts/core/Badges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Badges contract\n * @author Sismo\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n * For more information: https://badges.docs.sismo.io\n */\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\n uint8 public constant IMPLEMENTATION_VERSION = 3;\n\n IAttestationsRegistry internal _attestationsRegistry;\n\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\n\n /**\n * @dev Constructor\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n constructor(\n string memory uri,\n address owner // This is Sismo Frontend Contract\n ) ERC1155(uri) {\n initialize(uri, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n string memory uri,\n address owner\n ) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup uri yet or if called by constructor (for implem setup)\n if (bytes(ERC1155.uri(0)).length == 0 || address(this).code.length == 0) {\n _setURI(uri);\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n }\n }\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(\n address account,\n uint256 id\n ) public view virtual override(ERC1155, IBadges) returns (uint256) {\n return _attestationsRegistry.getAttestationValue(id, account);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function isApprovedForAll(\n address account,\n address operator\n ) public view virtual override returns (bool) {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\n emit TransferSingle(operator, from, to, id, value);\n }\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(\n address attestationsRegistry\n ) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\n }\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _setURI(uri);\n }\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view override returns (address) {\n return address(_attestationsRegistry);\n }\n\n /**\n * @dev Getter of the badge issuer\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeIssuer(address account, uint256 id) external view returns (address) {\n return _attestationsRegistry.getAttestationIssuer(id, account);\n }\n\n /**\n * @dev Getter of the badge timestamp\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32) {\n return _attestationsRegistry.getAttestationTimestamp(id, account);\n }\n\n /**\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory) {\n return _attestationsRegistry.getAttestationExtraData(id, account);\n }\n\n /**\n * @dev Getter of the value of a specific badge attribute\n * @param id Badge Id to check (= attestationCollectionId)\n * @param index Index of the attribute\n */\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8) {\n return _attestationsRegistry.getAttributeValueForAttestationsCollection(id, index);\n }\n\n /**\n * @dev Getter of all badge attributes and their values for a specific badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getAttributesNamesAndValuesForBadge(\n uint256 id\n ) external view returns (bytes32[] memory, uint8[] memory) {\n return _attestationsRegistry.getAttributesNamesAndValuesForAttestationsCollection(id);\n }\n\n /**\n * @dev ERC165\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(AccessControl, ERC1155) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n revert BadgesNonTransferrable();\n }\n}\n" - }, - "contracts/core/Front.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IFront} from './interfaces/IFront.sol';\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation} from './libs/Structs.sol';\n\n/**\n * @title Front\n * @author Sismo\n * @notice This is the Front contract of the Sismo protocol\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\n\n * For more information: https://front.docs.sismo.io\n */\ncontract Front is IFront {\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\n uint256 public constant EARLY_USER_COLLECTION = 0;\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress Attestations registry contract address\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n Attestation[] memory attestations = _forwardAttestationsGeneration(\n attester,\n request,\n proofData\n );\n _generateEarlyUserAttestation(request.destination);\n return attestations;\n }\n\n /**\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n address destination = requests[0].destination;\n for (uint256 i = 0; i < attesters.length; i++) {\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\n attestations[i] = _forwardAttestationsGeneration(\n attesters[i],\n requests[i],\n proofDataArray[i]\n );\n }\n _generateEarlyUserAttestation(destination);\n return attestations;\n }\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view override returns (Attestation[] memory) {\n return _forwardAttestationsBuild(attester, request, proofData);\n }\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function of targeted attester\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n\n for (uint256 i = 0; i < attesters.length; i++) {\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\n }\n return attestations;\n }\n\n function _forwardAttestationsBuild(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal view returns (Attestation[] memory) {\n return IAttester(attester).buildAttestations(request, proofData);\n }\n\n function _forwardAttestationsGeneration(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal returns (Attestation[] memory) {\n return IAttester(attester).generateAttestations(request, proofData);\n }\n\n function _generateEarlyUserAttestation(address destination) internal {\n uint32 currentTimestamp = uint32(block.timestamp);\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\n EARLY_USER_COLLECTION,\n destination\n );\n\n if (!alreadyHasAttestation) {\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n EARLY_USER_COLLECTION,\n destination,\n address(this),\n 1,\n currentTimestamp,\n 'With strong love from Sismo'\n );\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n emit EarlyUserAttestationGenerated(destination);\n }\n }\n }\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\n\n/**\n * @title IAttestationsRegistry\n * @author Sismo\n * @notice This is the interface of the AttestationRegistry\n */\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\n event AttestationRecorded(Attestation attestation);\n event AttestationDeleted(Attestation attestation);\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external;\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(\n uint256 collectionId,\n address owner\n ) external view returns (AttestationData memory);\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(\n uint256 collectionId,\n address owner\n ) external view returns (address, uint256, uint32, bytes memory);\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(\n uint256 collectionId,\n address owner\n ) external view returns (bytes memory);\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(\n uint256 collectionId,\n address owner\n ) external view returns (address);\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(\n uint256 collectionId,\n address owner\n ) external view returns (uint32);\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view returns (AttestationData[] memory);\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view returns (uint256[] memory);\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\n\ninterface IAttestationsRegistryConfigLogic {\n error AttesterNotFound(address issuer);\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\n error IdsMismatch(\n address issuer,\n uint256 rangeIndex,\n uint256 expectedFirstId,\n uint256 expectedLastId,\n uint256 FirstId,\n uint256 lastCollectionId\n );\n error AttributeDoesNotExist(uint8 attributeIndex);\n error AttributeAlreadyExists(uint8 attributeIndex);\n error ArgsLengthDoesNotMatch();\n\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\n event AttributeNameUpdated(\n uint8 attributeIndex,\n bytes32 newAttributeName,\n bytes32 previousAttributeName\n );\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\n\n event AttestationsCollectionAttributeSet(\n uint256 collectionId,\n uint8 attributeIndex,\n uint8 attributeValue\n );\n\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n\n /**\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute. Can go from 0 to 63.\n */\n function attestationsCollectionHasAttribute(\n uint256 collectionId,\n uint8 index\n ) external view returns (bool);\n\n function attestationsCollectionHasAttributes(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (bool);\n\n /**\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\n */\n function getAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 attributeIndex\n ) external view returns (uint8);\n\n function getAttributesValuesForAttestationsCollection(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (uint8[] memory);\n\n /**\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute (must be between 0 and 63)\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\n */\n function setAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 index,\n uint8 value\n ) external;\n\n function setAttributesValuesForAttestationsCollections(\n uint256[] memory collectionIds,\n uint8[] memory indices,\n uint8[] memory values\n ) external;\n\n /**\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n */\n function getAttributesNamesAndValuesForAttestationsCollection(\n uint256 collectionId\n ) external view returns (bytes32[] memory, uint8[] memory);\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external;\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external;\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external;\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external;\n\n /**\n * @dev Create a new attribute.\n * @param index Index of the attribute. Can go from 0 to 63.\n * @param name Name in bytes32 of the attribute\n */\n function createNewAttribute(uint8 index, bytes32 name) external;\n\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\n\n /**\n * @dev Update the name of an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\n * @param newName new name in bytes32 of the attribute\n */\n function updateAttributeName(uint8 index, bytes32 newName) external;\n\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\n\n /**\n * @dev Delete an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\n */\n function deleteAttribute(uint8 index) external;\n\n function deleteAttributes(uint8[] memory indices) external;\n}\n" - }, - "contracts/core/interfaces/IAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\n\n/**\n * @title IAttester\n * @author Sismo\n * @notice This is the interface for the attesters in Sismo Protocol\n */\ninterface IAttester {\n event AttestationGenerated(Attestation attestation);\n\n event AttestationDeleted(Attestation attestation);\n\n error AttestationDeletionNotImplemented();\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev External facing function. Allows to delete an attestation by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that was deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry address getter\n * @return attestationRegistry Address of the registry\n */\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\n}\n" - }, - "contracts/core/interfaces/IBadges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Interface for Badges contract\n * @author Sismo\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n */\ninterface IBadges {\n error BadgesNonTransferrable();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(string memory uri, address owner) external;\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external;\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry) external;\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external;\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view returns (address);\n\n /**\n * @dev Getter of the badge issuer\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeIssuer(address account, uint256 id) external view returns (address);\n\n /**\n * @dev Getter of the badge timestamp\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);\n\n /**\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);\n\n /**\n * @dev Getter of the value of a specific badge attribute\n * @param id Badge Id to check (= attestationCollectionId)\n * @param index Index of the attribute\n */\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);\n\n /**\n * @dev Getter of all badge attributes and their values for a specific badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getAttributesNamesAndValuesForBadge(\n uint256 id\n ) external view returns (bytes32[] memory, uint8[] memory);\n}\n" - }, - "contracts/core/interfaces/IFront.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\n\n/**\n * @title IFront\n * @author Sismo\n * @notice This is the interface of the Front Contract\n */\ninterface IFront {\n error DifferentRequestsDestinations();\n event EarlyUserAttestationGenerated(address destination);\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev generate multiple attestations at once, to the same destination\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external returns (Attestation[][] memory);\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function(s) of targeted attester(s)\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view returns (Attestation[][] memory);\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport './OwnableLogic.sol';\nimport './PausableLogic.sol';\nimport './InitializableLogic.sol';\nimport './AttestationsRegistryState.sol';\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\nimport {Bitmap256Bit} from '../utils/Bitmap256Bit.sol';\n\n/**\n * @title Attestations Registry Config Logic contract\n * @author Sismo\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\n **/\ncontract AttestationsRegistryConfigLogic is\n AttestationsRegistryState,\n IAttestationsRegistryConfigLogic,\n OwnableLogic,\n PausableLogic,\n InitializableLogic\n{\n using RangeUtils for Range[];\n using Bitmap256Bit for uint256;\n using Bitmap256Bit for uint8;\n\n /******************************************\n *\n * ATTESTATION REGISTRY WRITE ACCESS MANAGEMENT (ISSUERS)\n *\n *****************************************/\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external override onlyOwner {\n _pause();\n }\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external override onlyOwner {\n _unpause();\n }\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\n for (uint256 i = 0; i < ranges.length; i++) {\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external override onlyOwner {\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\n return _isAuthorized(issuer, collectionId);\n }\n\n /******************************************\n *\n * ATTRIBUTES CONFIG LOGIC\n *\n *****************************************/\n\n /**\n * @dev Create a new attribute.\n * @param index Index of the attribute. Can go from 0 to 63.\n * @param name Name in bytes32 of the attribute\n */\n function createNewAttribute(uint8 index, bytes32 name) public onlyOwner {\n index._checkIndexIsValid();\n if (_isAttributeCreated(index)) {\n revert AttributeAlreadyExists(index);\n }\n _createNewAttribute(index, name);\n }\n\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external onlyOwner {\n if (indices.length != names.length) {\n revert ArgsLengthDoesNotMatch();\n }\n\n for (uint256 i = 0; i < indices.length; i++) {\n createNewAttribute(indices[i], names[i]);\n }\n }\n\n /**\n * @dev Update the name of an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\n * @param newName new name in bytes32 of the attribute\n */\n function updateAttributeName(uint8 index, bytes32 newName) public onlyOwner {\n index._checkIndexIsValid();\n if (!_isAttributeCreated(index)) {\n revert AttributeDoesNotExist(index);\n }\n _updateAttributeName(index, newName);\n }\n\n function updateAttributesName(\n uint8[] memory indices,\n bytes32[] memory newNames\n ) external onlyOwner {\n if (indices.length != newNames.length) {\n revert ArgsLengthDoesNotMatch();\n }\n\n for (uint256 i = 0; i < indices.length; i++) {\n updateAttributeName(indices[i], newNames[i]);\n }\n }\n\n /**\n * @dev Delete an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must already exist\n */\n function deleteAttribute(uint8 index) public onlyOwner {\n index._checkIndexIsValid();\n if (!_isAttributeCreated(index)) {\n revert AttributeDoesNotExist(index);\n }\n _deleteAttribute(index);\n }\n\n function deleteAttributes(uint8[] memory indices) external onlyOwner {\n for (uint256 i = 0; i < indices.length; i++) {\n deleteAttribute(indices[i]);\n }\n }\n\n /**\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute (must be between 0 and 63)\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\n */\n function setAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 index,\n uint8 value\n ) public onlyOwner {\n index._checkIndexIsValid();\n\n if (!_isAttributeCreated(index)) {\n revert AttributeDoesNotExist(index);\n }\n\n _setAttributeForAttestationsCollection(collectionId, index, value);\n }\n\n function setAttributesValuesForAttestationsCollections(\n uint256[] memory collectionIds,\n uint8[] memory indices,\n uint8[] memory values\n ) external onlyOwner {\n if (collectionIds.length != indices.length || collectionIds.length != values.length) {\n revert ArgsLengthDoesNotMatch();\n }\n for (uint256 i = 0; i < collectionIds.length; i++) {\n setAttributeValueForAttestationsCollection(collectionIds[i], indices[i], values[i]);\n }\n }\n\n /**\n * @dev Returns the attribute's value (from 0 to 15) of an attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute. Can go from 0 to 63.\n */\n function getAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 index\n ) public view returns (uint8) {\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\n collectionId\n );\n return currentAttributesValues._get(index);\n }\n\n function getAttributesValuesForAttestationsCollection(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (uint8[] memory) {\n uint8[] memory attributesValues = new uint8[](indices.length);\n for (uint256 i = 0; i < indices.length; i++) {\n attributesValues[i] = getAttributeValueForAttestationsCollection(collectionId, indices[i]);\n }\n return attributesValues;\n }\n\n /**\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute. Can go from 0 to 63.\n */\n function attestationsCollectionHasAttribute(\n uint256 collectionId,\n uint8 index\n ) public view returns (bool) {\n uint256 currentAttributeValues = _getAttributesValuesBitmapForAttestationsCollection(\n collectionId\n );\n return currentAttributeValues._get(index) > 0;\n }\n\n function attestationsCollectionHasAttributes(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (bool) {\n for (uint256 i = 0; i < indices.length; i++) {\n if (!attestationsCollectionHasAttribute(collectionId, indices[i])) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n */\n function getAttributesNamesAndValuesForAttestationsCollection(\n uint256 collectionId\n ) public view returns (bytes32[] memory, uint8[] memory) {\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\n collectionId\n );\n\n (\n uint8[] memory indices,\n uint8[] memory values,\n uint8 nbOfNonZeroValues\n ) = currentAttributesValues._getAllNonZeroValues();\n\n bytes32[] memory attributesNames = new bytes32[](nbOfNonZeroValues);\n uint8[] memory attributesValues = new uint8[](nbOfNonZeroValues);\n for (uint8 i = 0; i < nbOfNonZeroValues; i++) {\n attributesNames[i] = _attributesNames[indices[i]];\n attributesValues[i] = values[i];\n }\n\n return (attributesNames, attributesValues);\n }\n\n /*****************************\n *\n * INTERNAL FUNCTIONS\n *\n *****************************/\n\n function _authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal {\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\n _authorizedRanges[issuer].push(newRange);\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal onlyOwner {\n if (rangeIndex >= _authorizedRanges[issuer].length)\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\n\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\n revert IdsMismatch(\n issuer,\n rangeIndex,\n expectedFirstId,\n expectedLastId,\n firstCollectionId,\n lastCollectionId\n );\n\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\n _authorizedRanges[issuer].length - 1\n ];\n _authorizedRanges[issuer].pop();\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\n return _authorizedRanges[issuer]._includes(collectionId);\n }\n\n function _setAttributeForAttestationsCollection(\n uint256 collectionId,\n uint8 index,\n uint8 value\n ) internal {\n uint256 currentAttributes = _getAttributesValuesBitmapForAttestationsCollection(collectionId);\n\n _attestationsCollectionAttributesValuesBitmap[collectionId] = currentAttributes._set(\n index,\n value\n );\n\n emit AttestationsCollectionAttributeSet(collectionId, index, value);\n }\n\n function _createNewAttribute(uint8 index, bytes32 name) internal {\n _attributesNames[index] = name;\n\n emit NewAttributeCreated(index, name);\n }\n\n function _updateAttributeName(uint8 index, bytes32 newName) internal {\n bytes32 previousName = _attributesNames[index];\n\n _attributesNames[index] = newName;\n\n emit AttributeNameUpdated(index, newName, previousName);\n }\n\n function _deleteAttribute(uint8 index) internal {\n bytes32 deletedName = _attributesNames[index];\n\n delete _attributesNames[index];\n\n emit AttributeDeleted(index, deletedName);\n }\n\n function _getAttributesValuesBitmapForAttestationsCollection(\n uint256 collectionId\n ) internal view returns (uint256) {\n return _attestationsCollectionAttributesValuesBitmap[collectionId];\n }\n\n function _isAttributeCreated(uint8 index) internal view returns (bool) {\n if (_attributesNames[index] == 0) {\n return false;\n }\n return true;\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryState.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Range} from '../utils/RangeLib.sol';\nimport {Attestation, AttestationData} from '../Structs.sol';\n\ncontract AttestationsRegistryState {\n /*******************************************************\n Storage layout:\n 19 slots for config\n 4 currently used for _initialized, _initializing, _paused, _owner\n 15 place holders\n 16 slots for logic\n 3 currently used for _authorizedRanges, _attestationsCollectionAttributesValuesBitmap, _attributesNames\n 13 place holders\n 1 slot for _attestationsData \n *******************************************************/\n\n // main config\n // changed `_initialized` from bool to uint8\n // as we were using OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n // and changed to OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n // PR: https://github.com/sismo-core/sismo-protocol/pull/41\n uint8 internal _initialized;\n bool internal _initializing;\n bool internal _paused;\n address internal _owner;\n // keeping some space for future\n uint256[15] private _placeHoldersAdmin;\n\n // storing the authorized ranges for each attesters\n mapping(address => Range[]) internal _authorizedRanges;\n // Storing the attributes values used for each attestations collection\n // Each attribute value is an hexadecimal\n mapping(uint256 => uint256) internal _attestationsCollectionAttributesValuesBitmap;\n // Storing the attribute name for each attributes index\n mapping(uint8 => bytes32) internal _attributesNames;\n // keeping some space for future\n uint256[13] private _placeHoldersConfig;\n // storing the data of attestations\n // =collectionId=> =owner=> attestationData\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\n}\n" - }, - "contracts/core/libs/attestations-registry/InitializableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Address.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract InitializableLogic is AttestationsRegistryState {\n // only diff with oz\n // /**\n // * @dev Indicates that the contract has been initialized.\n // */\n // bool private _initialized;\n\n // /**\n // * @dev Indicates that the contract is in the process of being initialized.\n // */\n // bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) ||\n (!Address.isContract(address(this)) && _initialized == 1),\n 'Initializable: contract is already initialized'\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(\n !_initializing && _initialized < version,\n 'Initializable: contract is already initialized'\n );\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, 'Initializable: contract is not initializing');\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, 'Initializable: contract is initializing');\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/OwnableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n // This is the only diff with OZ contract\n // address private _owner;\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/PausableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableLogic is Context, AttestationsRegistryState {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n // this is the only diff with OZ contract\n // bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), 'Pausable: paused');\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), 'Pausable: not paused');\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "contracts/core/libs/Structs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Attestations Registry State\n * @author Sismo\n * @notice This contract holds all of the storage variables and data\n * structures used by the AttestationsRegistry and parent\n * contracts.\n */\n\n// User Attestation Request, can be made by any user\n// The context of an Attestation Request is a specific attester contract\n// Each attester has groups of accounts in its available data\n// eg: for a specific attester:\n// group 1 <=> accounts that sent txs on mainnet\n// group 2 <=> accounts that sent txs on polygon\n// eg: for another attester:\n// group 1 <=> accounts that sent eth txs in 2022\n// group 2 <=> accounts sent eth txs in 2021\nstruct Request {\n // implicit address attester;\n // implicit uint256 chainId;\n Claim[] claims;\n address destination; // destination that will receive the end attestation\n}\n\nstruct Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\n}\n\n/**\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\n * @param collectionId Attestation collection\n * @param owner Attestation collection\n * @param issuer Attestation collection\n * @param value Attestation collection\n * @param timestamp Attestation collection\n * @param extraData Attestation collection\n */\nstruct Attestation {\n // implicit uint256 chainId;\n uint256 collectionId; // Id of the attestation collection (in the registry)\n address owner; // Owner of the attestation\n address issuer; // Contract that created or last updated the record.\n uint256 value; // Value of the attestation\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\n // it is different from the recording timestamp (date when the attestation was recorded)\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\n bytes extraData; // arbitrary data that can be added by the attester\n}\n\n// Attestation Data, stored in the registry\n// The context is a specific owner of a specific collection\nstruct AttestationData {\n // implicit uint256 chainId\n // implicit uint256 collectionId - from context\n // implicit owner\n address issuer; // Address of the contract that recorded the attestation\n uint256 value; // Value of the attestation\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\n bytes extraData; // arbitrary data that can be added by the attester\n}\n" - }, - "contracts/core/libs/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, 'Address: insufficient balance');\n\n (bool success, ) = recipient.call{value: amount}('');\n require(success, 'Address: unable to send value, recipient may have reverted');\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, 'Address: low-level call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, 'Address: insufficient balance for call');\n require(isContract(target), 'Address: call to non-contract');\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data\n ) internal view returns (bytes memory) {\n return functionStaticCall(target, data, 'Address: low-level static call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), 'Address: static call to non-contract');\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), 'Address: delegate call to non-contract');\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/core/libs/utils/Bitmap256Bit.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/*\n * The 256-bit bitmap is structured in 64 chuncks of 4 bits each.\n * The 4 bits can encode any value from 0 to 15.\n\n chunck63 chunck2 chunck1 chunck0\n bits bits bits bits \n ┌────────────┐ ┌────────────┬────────────┬────────────┐\n │ 1 1 1 1 │ .... │ 1 0 1 1 │ 0 0 0 0 │ 0 0 0 1 │\n └────────────┘ └────────────┴────────────┴────────────┘\n value 15 value 11 value 0 value 1\n\n * A chunck index must be between 0 and 63.\n * A value must be between 0 and 15.\n **/\n\nlibrary Bitmap256Bit {\n uint256 constant MAX_INT = 2 ** 256 - 1;\n\n error IndexOutOfBounds(uint8 index);\n error ValueOutOfBounds(uint8 value);\n\n /**\n * @dev Return the value at a given index of a 256-bit bitmap\n * @param index index where the value can be found. Can be between 0 and 63\n */\n function _get(uint256 self, uint8 index) internal pure returns (uint8) {\n uint256 currentValues = self;\n // Get the encoded 4-bit value by right shifting to the `index` position\n uint256 shifted = currentValues >> (4 * index);\n // Get the value by only masking the last 4 bits with an AND operator\n return uint8(shifted & (2 ** 4 - 1));\n }\n\n /**\n * @dev Set a value at a chosen index in a 256-bit bitmap\n * @param index index where the value will be stored. Can be between 0 and 63\n * @param value value to store. Can be between 0 and 15\n */\n function _set(uint256 self, uint8 index, uint8 value) internal pure returns (uint256) {\n _checkIndexIsValid(index);\n _checkValueIsValid(value);\n\n uint256 currentValues = self;\n // 1. first we need to remove the current value for the inputed `index`\n // Left Shift 4 bits mask (1111 mask) to the `index` position\n uint256 mask = (2 ** 4 - 1) << (4 * index);\n // Apply a XOR operation to obtain a mask with all bits set to 1 except the 4 bits that we want to remove\n uint256 negativeMask = MAX_INT ^ mask;\n // Apply a AND operation between the current values and the negative mask to remove the wanted bits\n uint256 newValues = currentValues & negativeMask;\n\n // 2. We set the new value wanted at the `index` position\n // Create the 4 bits encoding the new value and left shift them to the `index` position\n uint256 newValueMask = uint256(value) << (4 * index);\n // Apply an OR operation between the current values and the newValueMask to reference new value\n return newValues | newValueMask;\n }\n\n /**\n * @dev Get all the non-zero values in a 256-bit bitmap\n * @param self a 256-bit bitmap\n */\n function _getAllNonZeroValues(\n uint256 self\n ) internal pure returns (uint8[] memory, uint8[] memory, uint8) {\n uint8[] memory indices = new uint8[](64);\n uint8[] memory values = new uint8[](64);\n uint8 nbOfNonZeroValues = 0;\n for (uint8 i = 0; i < 63; i++) {\n uint8 value = _get(self, i);\n if (value > 0) {\n indices[nbOfNonZeroValues] = i;\n values[nbOfNonZeroValues] = value;\n nbOfNonZeroValues++;\n }\n }\n return (indices, values, nbOfNonZeroValues);\n }\n\n /**\n * @dev Check if the index is valid (is between 0 and 63)\n * @param index index of a chunck\n */\n function _checkIndexIsValid(uint8 index) internal pure {\n if (index > 63) {\n revert IndexOutOfBounds(index);\n }\n }\n\n /**\n * @dev Check if the value is valid (is between 0 and 15)\n * @param value value to encode in a chunck\n */\n function _checkValueIsValid(uint8 value) internal pure {\n if (value > 15) {\n revert ValueOutOfBounds(value);\n }\n }\n}\n" - }, - "contracts/core/libs/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.14;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "contracts/core/libs/utils/RangeLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nstruct Range {\n uint256 min;\n uint256 max;\n}\n\n// Range [0;3] includees 0 and 3\nlibrary RangeUtils {\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\n for (uint256 i = 0; i < ranges.length; i++) {\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\n return true;\n }\n }\n return false;\n }\n}\n" - }, - "contracts/periphery/badges-examples/BAYCOwnershipBadgeExample.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC721} from '@openzeppelin/contracts/token/ERC721/ERC721.sol';\nimport {IAttestationsRegistry} from '../../core/interfaces/IAttestationsRegistry.sol';\n\ncontract BAYCOwnershipBadge is ERC721 {\n IAttestationsRegistry immutable ATTESTATIONS_REGISTRY;\n uint256 constant HydraS1_BAYC_ATTESTATION_COLLECTION_ID = 100000001;\n uint256 constant SMPS_BAYC_ATTESTATION_COLLECTION_ID = 30000000000003;\n\n constructor(\n address attestationsRegistryAddress,\n string memory name,\n string memory symbol\n ) ERC721(name, symbol) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n function balanceOf(address account) public view virtual override returns (uint256) {\n bool hasZKAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n HydraS1_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n bool hasDoxingAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n SMPS_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n return hasZKAttestation || hasDoxingAttestation ? 1 : 0;\n }\n}\n" - }, - "contracts/periphery/utils/AvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n/**\n * @title Attesters Groups Registry\n * @author Sismo\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\n * For more information: https://available-roots-registry.docs.sismo.io\n *\n **/\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\n uint8 public constant IMPLEMENTATION_VERSION = 2;\n\n mapping(address => mapping(uint256 => bool)) public _roots;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can register/ unregister roots\n */\n constructor(address owner) {\n initialize(owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n }\n }\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\n _registerRootForAttester(attester, root);\n }\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\n _unregisterRootForAttester(attester, root);\n }\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external onlyOwner {\n _registerRootForAttester(address(0), root);\n }\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external onlyOwner {\n _unregisterRootForAttester(address(0), root);\n }\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\n return _roots[_msgSender()][root] || _roots[address(0)][root];\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\n return _roots[attester][root] || _roots[address(0)][root];\n }\n\n function _registerRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = true;\n if (attester == address(0)) {\n emit RegisteredRootForAll(root);\n } else {\n emit RegisteredRootForAttester(attester, root);\n }\n }\n\n function _unregisterRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = false;\n if (attester == address(0)) {\n emit UnregisteredRootForAll(root);\n } else {\n emit UnregisteredRootForAttester(attester, root);\n }\n }\n}\n" - }, - "contracts/periphery/utils/CommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\n\n/**\n * @title Commitment Mapper Registry Contract\n * @author Sismo\n * @notice This contract stores information about the commitment mapper.\n * Its ethereum address and its EdDSA public key\n * For more information: https://commitment-mapper.docs.sismo.io\n *\n **/\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\n uint8 public constant IMPLEMENTATION_VERSION = 2;\n\n uint256[2] internal _commitmentMapperPubKey;\n address _commitmentMapperAddress;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n constructor(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) {\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n address ownerAddress,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\n _updateCommitmentMapperAddress(commitmentMapperAddress);\n }\n }\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\n }\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\n _updateCommitmentMapperAddress(newAddress);\n }\n\n /**\n * @dev Getter of the EdDSA public key of the commitment mapper\n */\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\n return _commitmentMapperPubKey;\n }\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view override returns (address) {\n return _commitmentMapperAddress;\n }\n\n function _updateCommitmentMapperAddress(address newAddress) internal {\n _commitmentMapperAddress = newAddress;\n emit UpdatedCommitmentMapperAddress(newAddress);\n }\n\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\n _commitmentMapperPubKey = pubKey;\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\n }\n}\n" - }, - "contracts/periphery/utils/FrontendLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {HydraS1AccountboundAttester} from '../../attesters/hydra-s1/HydraS1AccountboundAttester.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\ncontract FrontendLib {\n address private immutable _hydraS1AccountboundAttester;\n\n constructor(address hydraS1AccountboundAttester) {\n _hydraS1AccountboundAttester = hydraS1AccountboundAttester;\n }\n\n function getHydraS1AccountboundAttesterDestinationOfNullifierBatch(\n uint256[] calldata nullifiers\n ) external view returns (address[] memory) {\n address[] memory destinations = new address[](nullifiers.length);\n\n for (uint256 i = 0; i < nullifiers.length; i++) {\n destinations[i] = HydraS1AccountboundAttester(_hydraS1AccountboundAttester)\n .getDestinationOfNullifier(nullifiers[i]);\n }\n\n return destinations;\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\n/**\n * @title IAvailableRootsRegistry\n * @author Sismo\n * @notice Interface for (Merkle) Roots Registry\n */\ninterface IAvailableRootsRegistry {\n event RegisteredRootForAttester(address attester, uint256 root);\n event RegisteredRootForAll(uint256 root);\n event UnregisteredRootForAttester(address attester, uint256 root);\n event UnregisteredRootForAll(uint256 root);\n\n error CannotRegisterForZeroAddress();\n error CannotUnregisterForZeroAddress();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address owner) external;\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external;\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external;\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\n}\n" - }, - "contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\ninterface ICommitmentMapperRegistry {\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\n event UpdatedCommitmentMapperAddress(address newAddress);\n error PubKeyNotValid(uint256[2] pubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) external;\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external;\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getEdDSAPubKey() external view returns (uint256[2] memory);\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view returns (address);\n}\n" - }, - "contracts/periphery/utils/TransparentUpgradeableProxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n// Note: we just copied so that we can see the contract used\npragma solidity ^0.8.14;\n\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(''), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(\n address newImplementation,\n bytes calldata data\n ) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(\n msg.sender != _getAdmin(),\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\n );\n super._beforeFallback();\n }\n}\n" - }, - "contracts/tests/MockAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttestationsRegistry} from '../core/interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from '../core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from '../core/libs/attestations-registry/AttestationsRegistryState.sol';\nimport {IBadges} from '../core/interfaces/IBadges.sol';\nimport {Attestation, AttestationData} from '../core/libs/Structs.sol';\n\ncontract MockAttestationsRegistry {\n uint256 immutable ATTESTATION_VALUE;\n\n event AttestationRecorded(Attestation attestation);\n\n constructor(uint256 attestationValue) {\n ATTESTATION_VALUE = attestationValue;\n }\n\n function getAttestationValue(\n uint256 collectionId,\n address owner\n ) external view returns (uint256) {\n return ATTESTATION_VALUE;\n }\n\n function recordAttestations(Attestation[] calldata attestations) external {\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationRecorded(attestations[i]);\n }\n }\n}\n" - }, - "contracts/tests/MockAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\nimport {Attestation, Request} from '../core/libs/Structs.sol';\nimport {Attester} from '../core/Attester.sol';\nimport {IAttester} from '../core/interfaces/IAttester.sol';\n\ncontract MockAttester is IAttester, Attester {\n uint256 public immutable ATTESTATION_ID_MIN;\n uint256 public immutable ATTESTATION_ID_MAX;\n\n constructor(\n address ATTESTATION_REGISTRY_ADDRESS,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n ) Attester(ATTESTATION_REGISTRY_ADDRESS) {\n ATTESTATION_ID_MIN = collectionIdFirst;\n ATTESTATION_ID_MAX = collectionIdLast;\n }\n\n function _verifyRequest(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {}\n\n function buildAttestations(\n Request calldata request,\n bytes calldata /*data*/\n ) public view virtual override(Attester, IAttester) returns (Attestation[] memory) {\n uint256 collectionId = ATTESTATION_ID_MIN + request.claims[0].groupId;\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n collectionId,\n request.destination,\n address(this),\n request.claims[0].claimedValue,\n abi.decode(request.claims[0].extraData, (uint32)),\n 'Mock Attester v0'\n );\n return (attestations);\n }\n}\n" - }, - "contracts/tests/MockHydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\nimport {Attestation, Request} from '../core/libs/Structs.sol';\nimport {Attester} from '../core/Attester.sol';\nimport {IAttester} from '../core/interfaces/IAttester.sol';\nimport {IHydraS1AccountboundAttester} from '../attesters/hydra-s1/interfaces/IHydraS1AccountboundAttester.sol';\n\ncontract MockHydraS1SimpleAttester {\n mapping(uint256 => address) internal _nullifiersDestinations;\n\n function getDestinationOfNullifier(uint256 nullifier) external view returns (address) {\n return _nullifiersDestinations[nullifier];\n }\n\n function setDestinationOfNullifier(uint256 nullifier, address destination) external {\n _nullifiersDestinations[nullifier] = destination;\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates", - "storageLayout" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/mumbai/solcInputs/6edb98fea2bf424a369954d0e80655f6.json b/deployments/mumbai/solcInputs/6edb98fea2bf424a369954d0e80655f6.json deleted file mode 100644 index 8f3bf5d..0000000 --- a/deployments/mumbai/solcInputs/6edb98fea2bf424a369954d0e80655f6.json +++ /dev/null @@ -1,237 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/access/AccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(account),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" - }, - "@openzeppelin/contracts/access/IAccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" - }, - "@openzeppelin/contracts/access/Ownable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" - }, - "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" - }, - "@openzeppelin/contracts/security/Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/ERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC1155.sol\";\nimport \"./IERC1155Receiver.sol\";\nimport \"./extensions/IERC1155MetadataURI.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of the basic standard multi-token.\n * See https://eips.ethereum.org/EIPS/eip-1155\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\n *\n * _Available since v3.1._\n */\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\n using Address for address;\n\n // Mapping from token ID to account balances\n mapping(uint256 => mapping(address => uint256)) private _balances;\n\n // Mapping from account to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n string private _uri;\n\n /**\n * @dev See {_setURI}.\n */\n constructor(string memory uri_) {\n _setURI(uri_);\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155).interfaceId ||\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC1155MetadataURI-uri}.\n *\n * This implementation returns the same URI for *all* token types. It relies\n * on the token type ID substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * Clients calling this function must replace the `\\{id\\}` substring with the\n * actual token type ID.\n */\n function uri(uint256) public view virtual override returns (string memory) {\n return _uri;\n }\n\n /**\n * @dev See {IERC1155-balanceOf}.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\n require(account != address(0), \"ERC1155: address zero is not a valid owner\");\n return _balances[id][account];\n }\n\n /**\n * @dev See {IERC1155-balanceOfBatch}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\n public\n view\n virtual\n override\n returns (uint256[] memory)\n {\n require(accounts.length == ids.length, \"ERC1155: accounts and ids length mismatch\");\n\n uint256[] memory batchBalances = new uint256[](accounts.length);\n\n for (uint256 i = 0; i < accounts.length; ++i) {\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\n }\n\n return batchBalances;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev See {IERC1155-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not token owner or approved\"\n );\n _safeTransferFrom(from, to, id, amount, data);\n }\n\n /**\n * @dev See {IERC1155-safeBatchTransferFrom}.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not token owner or approved\"\n );\n _safeBatchTransferFrom(from, to, ids, amounts, data);\n }\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n\n emit TransferSingle(operator, from, to, id, amount);\n\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\n\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; ++i) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n }\n\n emit TransferBatch(operator, from, to, ids, amounts);\n\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\n\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\n }\n\n /**\n * @dev Sets a new URI for all token types, by relying on the token type ID\n * substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * By this mechanism, any occurrence of the `\\{id\\}` substring in either the\n * URI or any of the amounts in the JSON file at said URI will be replaced by\n * clients with the token type ID.\n *\n * For example, the `https://token-cdn-domain/\\{id\\}.json` URI would be\n * interpreted by clients as\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\n * for token type ID 0x4cce0.\n *\n * See {uri}.\n *\n * Because these URIs cannot be meaningfully represented by the {URI} event,\n * this function emits no events.\n */\n function _setURI(string memory newuri) internal virtual {\n _uri = newuri;\n }\n\n /**\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _mint(\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _balances[id][to] += amount;\n emit TransferSingle(operator, address(0), to, id, amount);\n\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _mintBatch(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; i++) {\n _balances[ids[i]][to] += amounts[i];\n }\n\n emit TransferBatch(operator, address(0), to, ids, amounts);\n\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\n }\n\n /**\n * @dev Destroys `amount` tokens of token type `id` from `from`\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `from` must have at least `amount` tokens of token type `id`.\n */\n function _burn(\n address from,\n uint256 id,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n\n emit TransferSingle(operator, from, address(0), id, amount);\n\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n */\n function _burnBatch(\n address from,\n uint256[] memory ids,\n uint256[] memory amounts\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n for (uint256 i = 0; i < ids.length; i++) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n }\n\n emit TransferBatch(operator, from, address(0), ids, amounts);\n\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC1155: setting approval status for self\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `ids` and `amounts` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `id` and `amount` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n function _doSafeTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\n if (response != IERC1155Receiver.onERC1155Received.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non-ERC1155Receiver implementer\");\n }\n }\n }\n\n function _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\n bytes4 response\n ) {\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non-ERC1155Receiver implementer\");\n }\n }\n }\n\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\n uint256[] memory array = new uint256[](1);\n array[0] = element;\n\n return array;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1155.sol\";\nimport \"../../../security/Pausable.sol\";\n\n/**\n * @dev ERC1155 token with pausable token transfers, minting and burning.\n *\n * Useful for scenarios such as preventing trades until the end of an evaluation\n * period, or having an emergency switch for freezing all token transfers in the\n * event of a large bug.\n *\n * _Available since v3.1._\n */\nabstract contract ERC1155Pausable is ERC1155, Pausable {\n /**\n * @dev See {ERC1155-_beforeTokenTransfer}.\n *\n * Requirements:\n *\n * - the contract must not be paused.\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n require(!paused(), \"ERC1155Pausable: token transfer while paused\");\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155MetadataURI is IERC1155 {\n /**\n * @dev Returns the URI for token type `id`.\n *\n * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n * clients with the actual token type ID.\n */\n function uri(uint256 id) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/ERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"./extensions/IERC721Metadata.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/Strings.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: address zero is not a valid owner\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _ownerOf(tokenId);\n require(owner != address(0), \"ERC721: invalid token ID\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireMinted(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not token owner or approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n _requireMinted(tokenId);\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n _safeTransfer(from, to, tokenId, data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _ownerOf(tokenId) != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId, 1);\n\n // Check that tokenId was not minted by `_beforeTokenTransfer` hook\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n unchecked {\n // Will not overflow unless all 2**256 token ids are minted to the same owner.\n // Given that tokens are minted one by one, it is impossible in practice that\n // this ever happens. Might change if we allow batch minting.\n // The ERC fails to describe this case.\n _balances[to] += 1;\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId, 1);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId, 1);\n\n // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook\n owner = ERC721.ownerOf(tokenId);\n\n // Clear approvals\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // Cannot overflow, as that would require more tokens to be burned/transferred\n // out than the owner initially received through minting and transferring in.\n _balances[owner] -= 1;\n }\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId, 1);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId, 1);\n\n // Check that tokenId was not transferred by `_beforeTokenTransfer` hook\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n\n // Clear approvals from the previous owner\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // `_balances[from]` cannot overflow for the same reason as described in `_burn`:\n // `from`'s balance is the number of token held, which is at least one before the current\n // transfer.\n // `_balances[to]` could overflow in the conditions described in `_mint`. That would require\n // all 2**256 token ids to be minted, which in practice is impossible.\n _balances[from] -= 1;\n _balances[to] += 1;\n }\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId, 1);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits an {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` has not been minted yet.\n */\n function _requireMinted(uint256 tokenId) internal view virtual {\n require(_exists(tokenId), \"ERC721: invalid token ID\");\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.\n * - When `from` is zero, the tokens will be minted for `to`.\n * - When `to` is zero, ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256, /* firstTokenId */\n uint256 batchSize\n ) internal virtual {\n if (batchSize > 1) {\n if (from != address(0)) {\n _balances[from] -= batchSize;\n }\n if (to != address(0)) {\n _balances[to] += batchSize;\n }\n }\n }\n\n /**\n * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.\n * - When `from` is zero, the tokens were minted for `to`.\n * - When `to` is zero, ``from``'s tokens were burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 firstTokenId,\n uint256 batchSize\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/ERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/StorageSlot.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Strings.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" - }, - "@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract HydraS1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [8609986746108439658545470593166889256314951959466775818870246174320018498804,\n 6848251127850009101372611262053374737897586140140607384018397707035108265914],\n [21367916863936594568281095443965096905143705300114190558130516981138584550504,\n 13327705762185115653848159709412003423932761899188342359583872691135383932883]\n );\n vk.IC = new Pairing.G1Point[](11);\n \n vk.IC[0] = Pairing.G1Point( \n 19965766170734310004645394427613286415565755728797065894668054116047682895204,\n 6952067612339183672227137101423582097916038093373585908267153974352032944482\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 13987716160490730015463796942940452666334097189904948795214986996497499925899,\n 5336810094802209074340875836312868429276540870324469349093948627126061524544\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 14931593253473978964215343699995811275378324235306358485461293343370969283966,\n 564306919152089917957316877787764763278299990971316475606280877961553231205\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11591267743733991434114686002448165336885445656808796470854638278338319268343,\n 11495219763417990955889652410266075210402006084183208750635660647824890013350\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 8183184532870222270700473518157259944911700429689031755853536692005688965081,\n 9121077094104828462137861111631978599019724423614716723152060153405564278301\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 4314095526093128699362232919686741372014146055311239687202926853002748112330,\n 11665330391505820654128458332883010598817535082070674418723503440883598640597\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\n 181057165072599074288983745076121344893296348827576905983079816835912241514\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 18925967077785550270509493111690046951994174908254476036944536825999614778001,\n 4990629719417206796668074534812314525340851981015724652256935997545282642849\n ); \n \n vk.IC[10] = Pairing.G1Point( \n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[10] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "@sismo-core/pythia-1/contracts/Pythia1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract Pythia1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\n );\n vk.IC = new Pairing.G1Point[](10);\n \n vk.IC[0] = Pairing.G1Point( \n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 104028078850975554065172701281783302003220555203883119831575537681421753151,\n 19148240629904598794948591359118971959790791697910953160820265703277306346\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[9] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/HydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1Base} from './IHydraS1Base.sol';\nimport {Attester} from '../../../core/Attester.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Hydra S1 ZK Proving Scheme\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to the following:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n *\n */\nabstract contract HydraS1Base is IHydraS1Base, Attester, Initializable {\n using HydraS1Lib for HydraS1ProofData;\n\n // ZK-SNARK Verifier\n HydraS1Verifier immutable VERIFIER;\n // Registry storing the Commitment Mapper EdDSA Public key\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS\n *******************************************************/\n\n /**\n * @dev Constructor. Initializes the contract\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\n * @param commitmentMapperAddress Commitment mapper's public key registry\n */\n constructor(\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress\n ) {\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\n }\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\n return COMMITMENT_MAPPER_REGISTRY;\n }\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\n return AVAILABLE_ROOTS_REGISTRY;\n }\n\n /*******************************************************\n Hydra-S1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the nullifier from an attestation extraData\n * @dev Getter of a nullifier encoded in extraData\n * @notice Must be implemented by the inheriting contracts\n * @param extraData extraData where nullifier can be encoded\n */\n function getNullifierFromExtraData(\n bytes memory extraData\n ) external view virtual returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the external nullifier from a user request\n * so it can be checked against snark input\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\n * users bring sourceSecretHash as private input which guarantees privacy\n *\n * This function MUST be implemented by Hydra-S1 attesters.\n * This is the core function that implements the logic of external nullifiers\n *\n * Do they get one external nullifier per claim?\n * Do they get 2 external nullifiers per claim?\n * Do they get 1 external nullifier per claim, every month?\n * Take a look at Hydra-S1 Simple Attester for an example\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\n */\n function _getExternalNullifierOfClaim(\n HydraS1Claim memory claim\n ) internal view virtual returns (uint256);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(\n HydraS1Claim memory claim,\n HydraS1ProofInput memory input\n ) internal view virtual {\n if (input.accountsTreeValue != claim.groupId) {\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\n }\n\n if (input.isStrict == claim.groupProperties.isScore) {\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n }\n\n if (input.destination != claim.destination) {\n revert DestinationMismatch(claim.destination, input.destination);\n }\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot)) {\n revert RegistryRootMismatch(input.registryRoot);\n }\n\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\n if (\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\n ) {\n revert CommitmentMapperPubKeyMismatch(\n commitmentMapperPubKey[0],\n commitmentMapperPubKey[1],\n input.commitmentMapperPubKey[0],\n input.commitmentMapperPubKey[1]\n );\n }\n\n uint256 externalNullifier = _getExternalNullifierOfClaim(claim);\n\n if (input.externalNullifier != externalNullifier) {\n revert ExternalNullifierMismatch(externalNullifier, input.externalNullifier);\n }\n }\n\n /**\n * @dev verify the groth16 mathematical proof\n * @param proofData snark public input\n */\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(uint256 /*errorCode*/) {\n revert InvalidGroth16Proof('');\n } catch (bytes memory /*lowLevelData*/) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/IHydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Interface\n * @author Sismo\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\n * We invite readers to refer to the following:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n **/\ninterface IHydraS1Base is IAttester {\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\n error RegistryRootMismatch(uint256 inputRoot);\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error CommitmentMapperPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error ExternalNullifierMismatch(uint256 expectedExternalNullifier, uint256 externalNullifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error AccountsTreeValueMismatch(\n uint256 expectedAccountsTreeValue,\n uint256 inputAccountsTreeValue\n );\n error InvalidGroth16Proof(string reason);\n\n function getNullifierFromExtraData(bytes memory extraData) external view returns (uint256);\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier);\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\n\nimport {IHydraS1AccountboundAttester} from './interfaces/IHydraS1AccountboundAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from '../../core/libs/Structs.sol';\n\n// Imports related to Hydra-S1\nimport {HydraS1SimpleAttester, IAttester, HydraS1Lib, HydraS1ProofData, HydraS1Claim} from './HydraS1SimpleAttester.sol';\n\n/**\n * @title Hydra-S1 Accountbound Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic.\n * Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic.\n * However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation.\n * The _beforeRecordAttestations is also overriden to fit the Accountbound logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Nullified\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\n * While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier)\n * We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation.\n * We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation.\n * Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier)\n\n * - Accountbound (opt-in, with cooldown period)\n * The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group.\n * Users can update their attestation's destination by providing a new Hydra-S1 ZK proof \n * It means the attestation is bound to the source account, stored on an updatable destination account.\n * When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional.\n * A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred\n * One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations.\n \n * - Renewable\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew or update their attestations\n **/\n\ncontract HydraS1AccountboundAttester is\n IHydraS1AccountboundAttester,\n HydraS1SimpleAttester,\n Ownable\n{\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n uint8 public constant IMPLEMENTATION_VERSION = 4;\n\n /*******************************************************\n Storage layout:\n 20 slots between HydraS1SimpleAttester and HydraS1AccountboundAttester\n 1 currently used by Ownable\n 19 place holders\n 2O for config\n 1 currently used\n 19 place holders\n 20 for logic\n 2 currently used\n 18 place holders\n *******************************************************/\n\n // keeping some space for future config logics\n uint256[19] private _placeHolderBeforeHydraS1Accountbound;\n\n // cooldown durations for each groupIndex\n mapping(uint256 => uint32) internal _cooldownDurations;\n\n // keeping some space for future config logics\n uint256[19] private _placeHoldersHydraS1AccountboundConfig;\n\n mapping(uint256 => uint32) internal _nullifiersCooldownStart;\n mapping(uint256 => uint16) internal _nullifiersBurnCount;\n\n // keeping some space for future config logics\n uint256[18] private _placeHoldersHydraS1AccountboundLogic;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first attestation collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last attestation collection in which the attester is supposed to record\n * @param owner Address of attester's owner\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address owner\n )\n HydraS1SimpleAttester(\n attestationsRegistryAddress,\n hydraS1VerifierAddress,\n availableRootsRegistryAddress,\n commitmentMapperAddress,\n collectionIdFirst,\n collectionIdLast\n )\n {\n initialize(owner);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n }\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Returns the actual attestations constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark public input as well as snark proof\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) public view virtual override(IAttester, HydraS1SimpleAttester) returns (Attestation[] memory) {\n Attestation[] memory attestations = super.buildAttestations(request, proofData);\n\n uint256 nullifier = proofData._getNullifier();\n attestations[0].extraData = abi.encode(\n attestations[0].extraData, // nullifier, from HydraS1 Simple\n _getNextBurnCount(nullifier, attestations[0].owner) // BurnCount\n );\n\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Hook run before recording the attestation.\n * Throws if nullifier already used, not a renewal, and nullifier on cooldown.\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n uint256 nullifier = proofData._getNullifier();\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\n\n HydraS1Claim memory claim = request._claim();\n\n // check if the nullifier has already been used previously, if so it may be on cooldown\n if (\n previousNullifierDestination != address(0) &&\n previousNullifierDestination != claim.destination\n ) {\n uint32 cooldownDuration = _getCooldownDurationForGroupIndex(claim.groupProperties.groupIndex);\n if (cooldownDuration == 0) {\n revert CooldownDurationNotSetForGroupIndex(claim.groupProperties.groupIndex);\n }\n if (_isOnCooldown(nullifier, cooldownDuration)) {\n uint16 burnCount = _getNullifierBurnCount(nullifier);\n revert NullifierOnCooldown(\n nullifier,\n previousNullifierDestination,\n burnCount,\n cooldownDuration\n );\n }\n\n // Delete the old Attestation linked to the nullifier before recording the new one (accountbound feature)\n _deletePreviousAttestation(claim, previousNullifierDestination);\n\n _setNullifierOnCooldownAndIncrementBurnCount(nullifier);\n }\n _setDestinationForNullifier(nullifier, request.destination);\n }\n\n /*******************************************************\n LOGIC FUNCTIONS RELATED TO ACCOUNTBOUND FEATURE\n *******************************************************/\n\n /**\n * @dev Getter, returns the burnCount of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16) {\n return _getNullifierBurnCount(nullifier);\n }\n\n /**\n * @dev Getter, returns the cooldown start of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32) {\n return _getNullifierCooldownStart(nullifier);\n }\n\n /**\n * @dev returns the nullifier for a given extraData\n * @param extraData bytes where the nullifier is encoded\n */\n function getNullifierFromExtraData(\n bytes memory extraData\n ) external pure override(HydraS1SimpleAttester, IHydraS1AccountboundAttester) returns (uint256) {\n (uint256 nullifier, ) = abi.decode(extraData, (uint256, uint16));\n\n return nullifier;\n }\n\n /**\n * @dev Returns the burn count for a given extraData\n * @param extraData bytes where the burnCount is encoded\n */\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16) {\n (, uint16 burnCount) = abi.decode(extraData, (uint256, uint16));\n\n return burnCount;\n }\n\n /**\n * @dev Checks if a nullifier is on cooldown\n * @param nullifier user nullifier\n * @param cooldownDuration waiting time before the user can change its badge destination\n */\n function _isOnCooldown(uint256 nullifier, uint32 cooldownDuration) internal view returns (bool) {\n return _getNullifierCooldownStart(nullifier) + cooldownDuration > block.timestamp;\n }\n\n /**\n * @dev Delete the previous attestation created with this nullifier\n * @param claim user claim\n * @param previousNullifierDestination previous destination chosen for this user nullifier\n */\n function _deletePreviousAttestation(\n HydraS1Claim memory claim,\n address previousNullifierDestination\n ) internal {\n address[] memory attestationOwners = new address[](1);\n uint256[] memory attestationCollectionIds = new uint256[](1);\n\n attestationOwners[0] = previousNullifierDestination;\n attestationCollectionIds[0] = AUTHORIZED_COLLECTION_ID_FIRST + claim.groupProperties.groupIndex;\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n }\n\n function _setNullifierOnCooldownAndIncrementBurnCount(uint256 nullifier) internal {\n _nullifiersCooldownStart[nullifier] = uint32(block.timestamp);\n _nullifiersBurnCount[nullifier] += 1;\n emit NullifierSetOnCooldown(nullifier, _nullifiersBurnCount[nullifier]);\n }\n\n function _getNullifierCooldownStart(uint256 nullifier) internal view returns (uint32) {\n return _nullifiersCooldownStart[nullifier];\n }\n\n function _getNullifierBurnCount(uint256 nullifier) internal view returns (uint16) {\n return _nullifiersBurnCount[nullifier];\n }\n\n /**\n * @dev returns burn count or burn count + 1 if new burn will happen\n * @param nullifier user nullifier\n * @param claimDestination destination referenced in the user claim\n */\n function _getNextBurnCount(\n uint256 nullifier,\n address claimDestination\n ) public view virtual returns (uint16) {\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\n uint16 burnCount = _getNullifierBurnCount(nullifier);\n // If the attestation is minted on a new destination address\n // the burnCount that will be encoded in the extraData of the Attestation should be incremented\n if (\n previousNullifierDestination != address(0) && previousNullifierDestination != claimDestination\n ) {\n burnCount += 1;\n }\n return burnCount;\n }\n\n /*******************************************************\n GROUP CONFIGURATION LOGIC\n *******************************************************/\n\n /**\n * @dev Setter, sets the cooldown duration of a groupIndex\n * @notice set to 0 to deactivate the accountbound feature for this group\n * @param groupIndex internal collection id\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\n **/\n function setCooldownDurationForGroupIndex(\n uint256 groupIndex,\n uint32 cooldownDuration\n ) external onlyOwner {\n _cooldownDurations[groupIndex] = cooldownDuration;\n emit CooldownDurationSetForGroupIndex(groupIndex, cooldownDuration);\n }\n\n /**\n * @dev Getter, get the cooldown duration of a groupIndex\n * @notice returns 0 when the accountbound feature is deactivated for this group\n * @param groupIndex internal collection id\n **/\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32) {\n return _getCooldownDurationForGroupIndex(groupIndex);\n }\n\n // = 0 means that the accountbound feature is deactivated for this group\n function _getCooldownDurationForGroupIndex(uint256 groupIndex) internal view returns (uint32) {\n return _cooldownDurations[groupIndex];\n }\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\nimport {IHydraS1Base} from './base/IHydraS1Base.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Nullified\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * nullifier = hash(sourceSecret, externalNullifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - Renewable\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew their attestations\n **/\n\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n /*******************************************************\n Storage layout:\n 20 slots for HydraS1\n 1 slot used\n 19 place holders\n *******************************************************/\n\n mapping(uint256 => address) internal _nullifiersDestinations;\n\n // keeping some space for future\n uint256[19] private _placeHoldersHydraS1Simple;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\n HydraS1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n uint256 nullifier = proofData._getNullifier();\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n abi.encode(nullifier)\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if nullifier already used and not a renewal (e.g destination different that last)\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n // we get the nullifier used from the snark input in the data provided\n uint256 nullifier = proofData._getNullifier();\n address currentDestination = _getDestinationOfNullifier(nullifier);\n\n if (currentDestination != address(0) && currentDestination != request.destination) {\n revert NullifierUsed(nullifier);\n }\n\n _setDestinationForNullifier(nullifier, request.destination);\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the external nullifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose externalNullifier = hash(attesterAddress, claim.GroupId)\n * Creates one nullifier per group, per user and makes sure no collision with other attester's nullifiers\n **/\n function _getExternalNullifierOfClaim(\n HydraS1Claim memory claim\n ) internal view override returns (uint256) {\n uint256 externalNullifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.groupIndex\n );\n return externalNullifier;\n }\n\n /**\n * @dev returns the nullifier for a given extraData\n * @param extraData bytes where the nullifier is encoded\n */\n function getNullifierFromExtraData(\n bytes memory extraData\n ) external pure virtual override(IHydraS1Base, HydraS1Base) returns (uint256) {\n return abi.decode(extraData, (uint256));\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a nullifier\n * @param nullifier nullifier used\n **/\n function getDestinationOfNullifier(uint256 nullifier) external view override returns (address) {\n return _getDestinationOfNullifier(nullifier);\n }\n\n function _setDestinationForNullifier(uint256 nullifier, address destination) internal virtual {\n _nullifiersDestinations[nullifier] = destination;\n emit NullifierDestinationUpdated(nullifier, destination);\n }\n\n function _getDestinationOfNullifier(uint256 nullifier) internal view returns (address) {\n return _nullifiersDestinations[nullifier];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from '././IHydraS1SimpleAttester.sol';\n\n/**\n * @title Hydra-S1 Accountbound Interface\n * @author Sismo\n * @notice Interface of the HydraS1AccountboundAttester contract which inherits from the errors, events and methods specific to the HydraS1SimpleAttester interface.\n **/\ninterface IHydraS1AccountboundAttester is IHydraS1SimpleAttester {\n /**\n * @dev Event emitted when the duration of the cooldown duration for a group index (internal collection id) has been set\n * @param groupIndex internal collection id\n * @param cooldownDuration the duration of the cooldown period\n **/\n event CooldownDurationSetForGroupIndex(uint256 indexed groupIndex, uint32 cooldownDuration);\n\n /**\n * @dev Event emitted when the nullifier has been set on cooldown. This happens when the\n * attestation destination of a nullifier has been changed\n * @param nullifier user nullifier\n * @param burnCount the number of times the attestation destination of a nullifier has been changed\n **/\n event NullifierSetOnCooldown(uint256 indexed nullifier, uint16 burnCount);\n\n /**\n * @dev Error when the nullifier is on cooldown. The user have to wait the cooldownDuration\n * before being able to change again the destination address.\n **/\n error NullifierOnCooldown(\n uint256 nullifier,\n address destination,\n uint16 burnCount,\n uint32 cooldownStart\n );\n\n /**\n * @dev Error when the cooldown duration for a given groupIndex is equal to zero.\n * The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.\n **/\n error CooldownDurationNotSetForGroupIndex(uint256 groupIndex);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) external;\n\n /**\n * @dev returns the nullifier for a given extraData\n * @param extraData bytes where the nullifier is encoded\n */\n function getNullifierFromExtraData(bytes memory extraData) external pure returns (uint256);\n\n /**\n * @dev Returns the burn count for a given extraData\n * @param extraData bytes where the burnCount is encoded\n */\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16);\n\n /**\n * @dev Getter, returns the cooldown start of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32);\n\n /**\n * @dev Getter, returns the burnCount of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16);\n\n /**\n * @dev Setter, sets the cooldown duration of a groupIndex\n * @param groupIndex internal collection id\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\n **/\n function setCooldownDurationForGroupIndex(uint256 groupIndex, uint32 cooldownDuration) external;\n\n /*/**\n * @dev Getter, get the cooldown duration of a groupIndex\n * @notice returns 0 when the accountbound feature is deactivated for this group\n * @param groupIndex internal collection id\n **/\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32);\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Accountbound Interface\n * @author Sismo\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\n **/\ninterface IHydraS1SimpleAttester is IHydraS1Base {\n /**\n * @dev Error when the nullifier is already used for a destination address\n **/\n error NullifierUsed(uint256 nullifier);\n\n /**\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\n **/\n error CollectionIdOutOfBound(uint256 collectionId);\n\n /**\n * @dev Event emitted when the nullifier is associated to a destination address.\n **/\n event NullifierDestinationUpdated(uint256 nullifier, address newOwner);\n\n /**\n * @dev Getter, returns the last attestation destination of a nullifier\n * @param nullifier nullifier used\n **/\n function getDestinationOfNullifier(uint256 nullifier) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1AccountboundLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Lib, HydraS1Claim, HydraS1GroupProperties} from './HydraS1Lib.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1AccountboundClaim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1AccountboundGroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1AccountboundGroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n uint32 cooldownDuration;\n bool isScore;\n}\n\nlibrary HydraS1AccountboundLib {\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _hydraS1claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n HydraS1GroupProperties memory hydraS1GroupProperties = HydraS1GroupProperties(\n groupProperties.groupIndex,\n groupProperties.generationTimestamp,\n groupProperties.isScore\n );\n\n return (\n HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, hydraS1GroupProperties)\n );\n }\n\n function _hydraS1Accountboundclaim(\n Request memory self\n ) internal pure returns (HydraS1AccountboundClaim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory hydraS1AccountboundGroupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n return (\n HydraS1AccountboundClaim(\n claim.groupId,\n claim.claimedValue,\n self.destination,\n hydraS1AccountboundGroupProperties\n )\n );\n }\n\n function _generateGroupIdFromEncodedProperties(\n bytes memory encodedProperties\n ) internal pure returns (uint256) {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1GroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n bool isScore;\n}\n\nstruct HydraS1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct HydraS1ProofData {\n HydraS1CircomSnarkProof proof;\n uint256[10] input;\n // destination\n // chainId\n // commitmentMapperPubKey.x\n // commitmentMapperPubKey.y\n // registryTreeRoot\n // externalNullifier\n // nullifier\n // claimedValue\n // accountsTreeValue\n // isStrict\n}\n\nstruct HydraS1ProofInput {\n address destination;\n uint256 chainId;\n uint256 registryRoot;\n uint256 externalNullifier;\n uint256 nullifier;\n uint256 value;\n uint256 accountsTreeValue;\n bool isStrict;\n uint256[2] commitmentMapperPubKey;\n}\n\nlibrary HydraS1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\n return\n HydraS1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getRegistryRoot(self),\n _getExpectedExternalNullifier(self),\n _getNullifier(self),\n _getValue(self),\n _getAccountsTreeValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1GroupProperties)\n );\n\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(\n HydraS1ProofData memory self\n )\n internal\n pure\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[10] memory)\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(\n HydraS1ProofData memory self\n ) internal pure returns (uint256[2] memory) {\n return [self.input[2], self.input[3]];\n }\n\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(\n HydraS1ProofData memory self\n ) internal pure returns (uint256) {\n return self.input[5];\n }\n\n function _getNullifier(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[8];\n }\n\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\n return self.input[9] == 1;\n }\n\n function _getNullifier(bytes calldata self) internal pure returns (uint256) {\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\n uint256 nullifier = uint256(_getNullifier(snarkProofData));\n return nullifier;\n }\n\n function _generateGroupIdFromProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\n );\n }\n\n function _generateGroupIdFromEncodedProperties(\n bytes memory encodedProperties\n ) internal pure returns (uint256) {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(groupIndex, generationTimestamp, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/pythia-1/base/IPythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\n\ninterface IPythia1Base {\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error UserShouldOwnItsDestination(address sender, address inputdestination);\n error CommitmentSignerPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier);\n\n /**\n * @dev Getter of the Commitment Signer EdDSA Public Key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\n}\n" - }, - "contracts/attesters/pythia-1/base/Pythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IPythia1Base} from './IPythia1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Pythia 1 ZK Proving Scheme\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\n\n/**\n * @title Pythia-1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \n * without anyone being able to make the link between the offchain service and the onchain service.\n * It is inherited by the family of Pythia-1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n \n \n **/\nabstract contract Pythia1Base is IPythia1Base, Initializable {\n using Pythia1Lib for Pythia1ProofData;\n\n // ZK-SNARK Verifier\n Pythia1Verifier immutable VERIFIER;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\n */\n constructor(address Pythia1VerifierAddress) {\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\n }\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of the Commitment signer Eddsa Public key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\n return _getCommitmentSignerPubKey();\n }\n\n /*******************************************************\n Pythia-1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * the secretHash is a number only known by the user and is used in \n * the zero knowledge as a private input which guarantees privacy\n\n * This function MUST be implemented by Pythia-1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Pythia-1 Simple Attester for an example\n * @param claim user claim: a particular claim that a user have that he can prove s right.\n */\n function _getTicketIdentifierOfClaim(\n Pythia1Claim memory claim\n ) internal view virtual returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\n * prove the claim was correctly issued for the user.\n */\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(\n Pythia1Claim memory claim,\n Pythia1ProofInput memory input\n ) internal view virtual {\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (claim.destination != msg.sender)\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\n if (\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\n )\n revert CommitmentSignerPubKeyMismatch(\n commitmentSignerPubKey[0],\n commitmentSignerPubKey[1],\n input.commitmentSignerPubKey[0],\n input.commitmentSignerPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the plonk mathematical proof using the circom verifier contract\n * @param proofData snark public input\n */\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(uint256 /*errorCode*/) {\n revert InvalidGroth16Proof('');\n } catch (bytes memory /*lowLevelData*/) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\n\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\n error TicketUsed(uint256 userTicket);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/pythia-1/libs/Pythia1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\n\n// user Pythia-1 claim retrieved form his request\nstruct Pythia1Claim {\n uint256 groupId; // user claims be part of this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct Pythia1GroupProperties {\n uint128 internalCollectionId;\n bool isScore;\n}\n\nstruct Pythia1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct Pythia1ProofData {\n Pythia1CircomSnarkProof proof;\n uint256[9] input;\n // destination;\n // chainId;\n // commitmentSignerPubKey.x;\n // commitmentSignerPubKey.y;\n // groupId;\n // ticketIdentifier;\n // userTicket;\n // value;\n // isStrict;\n}\n\nstruct Pythia1ProofInput {\n address destination;\n uint256 chainId;\n uint256 groupId;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n bool isStrict;\n uint256[2] commitmentSignerPubKey;\n}\n\nlibrary Pythia1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\n return\n Pythia1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getGroupId(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n Pythia1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (Pythia1GroupProperties)\n );\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(\n Pythia1ProofData memory self\n )\n internal\n pure\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[9] memory)\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(\n Pythia1ProofData memory self\n ) internal pure returns (uint256[2] memory) {\n return [self.input[2], self.input[3]];\n }\n\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(\n Pythia1ProofData memory self\n ) internal pure returns (uint256) {\n return self.input[5];\n }\n\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\n return self.input[8] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(\n uint128 internalCollectionId,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\n }\n\n function _generateGroupIdFromEncodedProperties(\n bytes memory encodedProperties\n ) internal pure returns (uint256) {\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 internalCollectionId,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(internalCollectionId, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to Pythia1 Proving Scheme\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\n\n/**\n * @title Pythia-1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Pythia-1 Attesters.\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \n * offchain service in a privacy preserving way. \n * That means no-one can make the link between the account used in the offchain service\n * and the onchain account where the attestation is stored.\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each users gets one userTicket per claim\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n **/\n\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\n using Pythia1Lib for Pythia1ProofData;\n using Pythia1Lib for bytes;\n using Pythia1Lib for Request;\n\n uint8 public constant IMPLEMENTATION_VERSION = 3;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n uint256[2] internal _commitmentSignerPubKey;\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\n * @param owner The owner of the contract that can update the commitment signer pub key\n */\n constructor(\n address attestationsRegistryAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address pythia1VerifierAddress,\n uint256[2] memory commitmentSignerPubKey,\n address owner\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n initialize(commitmentSignerPubKey, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param ownerAddress Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n uint256[2] memory commitmentSignerPubKey,\n address ownerAddress\n ) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into Pythia1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\n Pythia1ProofInput memory snarkInput = snarkProof._input();\n Pythia1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\n Pythia1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.internalCollectionId;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n uint32(block.timestamp),\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used\n * @param request users request. Claim of beiing part of a group.\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0)) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * users bring secretHash as private input in snark which guarantees privacy\n * the secretHash is only known by the user and never escape the user's browser\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(\n Pythia1Claim memory claim\n ) internal view override returns (uint256) {\n uint256 ticketIdentifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.internalCollectionId\n );\n return ticketIdentifier;\n }\n\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\n return _commitmentSignerPubKey;\n }\n\n /*******************************************************\n Pythia-1 Attester Specific Functions\n *******************************************************/\n\n function updateCommitmentSignerPubKey(\n uint256[2] memory commitmentSignerPubKey\n ) external onlyOwner {\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\n _commitmentSignerPubKey = commitmentSignerPubKey;\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\n }\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/core/AttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\nimport {Attestation, AttestationData} from './libs/Structs.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Attestations Registry\n * @author Sismo\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\n * Only authorized attestations issuers can record attestation in the registry\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\n * For more information: https://attestations-registry.docs.sismo.io\n\n * For each attestation recorded, a badge is received by the user\n * The badge is the Non transferrable NFT representation of an attestation \n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\n * It enables off-chain apps such as opensea to catch the \"shadow mint\" of the badge\n **/\ncontract AttestationsRegistry is\n AttestationsRegistryState,\n IAttestationsRegistry,\n AttestationsRegistryConfigLogic\n{\n uint8 public constant IMPLEMENTATION_VERSION = 3;\n IBadges immutable BADGES;\n\n /**\n * @dev Constructor.\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @param badgesAddress Stateless ERC1155 Badges contract\n */\n constructor(address owner, address badgesAddress) {\n BADGES = IBadges(badgesAddress);\n initialize(owner);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n }\n }\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\n address issuer = _msgSender();\n for (uint256 i = 0; i < attestations.length; i++) {\n if (!_isAuthorized(issuer, attestations[i].collectionId))\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\n\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\n attestations[i].owner\n ].value;\n\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\n attestations[i].issuer,\n attestations[i].value,\n attestations[i].timestamp,\n attestations[i].extraData\n );\n\n _triggerBadgeTransferEvent(\n attestations[i].collectionId,\n attestations[i].owner,\n previousAttestationValue,\n attestations[i].value\n );\n emit AttestationRecorded(attestations[i]);\n }\n }\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(\n address[] calldata owners,\n uint256[] calldata collectionIds\n ) external override whenNotPaused {\n if (owners.length != collectionIds.length)\n revert OwnersAndCollectionIdsLengthMismatch(owners, collectionIds);\n\n address issuer = _msgSender();\n for (uint256 i = 0; i < owners.length; i++) {\n AttestationData memory attestationData = _attestationsData[collectionIds[i]][owners[i]];\n\n if (!_isAuthorized(issuer, collectionIds[i]))\n revert IssuerNotAuthorized(issuer, collectionIds[i]);\n delete _attestationsData[collectionIds[i]][owners[i]];\n\n _triggerBadgeTransferEvent(collectionIds[i], owners[i], attestationData.value, 0);\n\n emit AttestationDeleted(\n Attestation(\n collectionIds[i],\n owners[i],\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n )\n );\n }\n }\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(\n uint256 collectionId,\n address owner\n ) external view override returns (bool) {\n return _getAttestationValue(collectionId, owner) != 0;\n }\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(\n uint256 collectionId,\n address owner\n ) external view override returns (AttestationData memory) {\n return _getAttestationData(collectionId, owner);\n }\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(\n uint256 collectionId,\n address owner\n ) external view override returns (uint256) {\n return _getAttestationValue(collectionId, owner);\n }\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(\n uint256 collectionId,\n address owner\n ) external view override returns (address, uint256, uint32, bytes memory) {\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\n return (\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n );\n }\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(\n uint256 collectionId,\n address owner\n ) external view override returns (bytes memory) {\n return _attestationsData[collectionId][owner].extraData;\n }\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(\n uint256 collectionId,\n address owner\n ) external view override returns (address) {\n return _attestationsData[collectionId][owner].issuer;\n }\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(\n uint256 collectionId,\n address owner\n ) external view override returns (uint32) {\n return _attestationsData[collectionId][owner].timestamp;\n }\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view override returns (AttestationData[] memory) {\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\n }\n return attestationsDataArray;\n }\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view override returns (uint256[] memory) {\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\n }\n return attestationsValues;\n }\n\n /**\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\n * It enables off-chain apps such as opensea to catch the \"shadow mints/burns\" of badges\n */\n function _triggerBadgeTransferEvent(\n uint256 badgeTokenId,\n address owner,\n uint256 previousValue,\n uint256 newValue\n ) internal {\n bool isGreaterValue = newValue > previousValue;\n address operator = address(this);\n address from = isGreaterValue ? address(0) : owner;\n address to = isGreaterValue ? owner : address(0);\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\n\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\n }\n\n function _getAttestationData(\n uint256 collectionId,\n address owner\n ) internal view returns (AttestationData memory) {\n return (_attestationsData[collectionId][owner]);\n }\n\n function _getAttestationValue(\n uint256 collectionId,\n address owner\n ) internal view returns (uint256) {\n return _attestationsData[collectionId][owner].value;\n }\n}\n" - }, - "contracts/core/Attester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\n\n/**\n * @title Attester Abstract Contract\n * @author Sismo\n * @notice Contract to be inherited by Attesters\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\n * are recommended to implemented this abstract contract\n\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\n *\n * This contracts is built around two main external standard functions.\n * They must NOT be override them, unless your really know what you are doing\n \n * - generateAttestations(request, proof) => will write attestations in the registry\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\n\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\n\n * For more information: https://attesters.docs.sismo.io\n **/\nabstract contract Attester is IAttester {\n // Registry where all attestations are stored\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n // Verify if request is valid by verifying against proof\n _verifyRequest(request, proofData);\n\n // Generate the actual attestations from user request\n Attestation[] memory attestations = buildAttestations(request, proofData);\n\n _beforeRecordAttestations(request, proofData);\n\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n\n _afterRecordAttestations(attestations);\n\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationGenerated(attestations[i]);\n }\n\n return attestations;\n }\n\n /**\n * @dev External facing function. Allows to delete attestations by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that were deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n address[] memory attestationOwners = new address[](collectionIds.length);\n\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\n\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n // fetch attestations from the registry\n (\n address issuer,\n uint256 attestationValue,\n uint32 timestamp,\n bytes memory extraData\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\n\n attestationOwners[i] = attestationsOwner;\n attestationCollectionIds[i] = collectionIds[i];\n\n attestations[i] = (\n Attestation(\n collectionIds[i],\n attestationsOwner,\n issuer,\n attestationValue,\n timestamp,\n extraData\n )\n );\n }\n\n _verifyAttestationsDeletionRequest(attestations, proofData);\n\n _beforeDeleteAttestations(attestations, proofData);\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n\n _afterDeleteAttestations(attestations, proofData);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n emit AttestationDeleted(attestations[i]);\n }\n return attestations;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) public view virtual returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry getter\n * @return attestationRegistry\n */\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\n return ATTESTATIONS_REGISTRY;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should verify the user request is valid\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\n\n /**\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\n * Default behavior: throws\n * It should verify attestations deletion request is valid\n * @param attestations Attestations that will be deleted\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyAttestationsDeletionRequest(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {\n revert AttestationDeletionNotImplemented();\n }\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before recording attestations in the registry\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual {}\n\n /**\n * @dev (Optional) Can be overridden in attesters inheriting this contract\n * Will be called after recording an attestation\n * @param attestations Recorded attestations\n */\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _beforeDeleteAttestations(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called after deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _afterDeleteAttestations(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {}\n}\n" - }, - "contracts/core/Badges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Badges contract\n * @author Sismo\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n * For more information: https://badges.docs.sismo.io\n */\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\n uint8 public constant IMPLEMENTATION_VERSION = 3;\n\n IAttestationsRegistry internal _attestationsRegistry;\n\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\n\n /**\n * @dev Constructor\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n constructor(\n string memory uri,\n address owner // This is Sismo Frontend Contract\n ) ERC1155(uri) {\n initialize(uri, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n string memory uri,\n address owner\n ) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup uri yet or if called by constructor (for implem setup)\n if (bytes(ERC1155.uri(0)).length == 0 || address(this).code.length == 0) {\n _setURI(uri);\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n }\n }\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(\n address account,\n uint256 id\n ) public view virtual override(ERC1155, IBadges) returns (uint256) {\n return _attestationsRegistry.getAttestationValue(id, account);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function isApprovedForAll(\n address account,\n address operator\n ) public view virtual override returns (bool) {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\n emit TransferSingle(operator, from, to, id, value);\n }\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(\n address attestationsRegistry\n ) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\n }\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _setURI(uri);\n }\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view override returns (address) {\n return address(_attestationsRegistry);\n }\n\n /**\n * @dev Getter of the badge issuer\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeIssuer(address account, uint256 id) external view returns (address) {\n return _attestationsRegistry.getAttestationIssuer(id, account);\n }\n\n /**\n * @dev Getter of the badge timestamp\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32) {\n return _attestationsRegistry.getAttestationTimestamp(id, account);\n }\n\n /**\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory) {\n return _attestationsRegistry.getAttestationExtraData(id, account);\n }\n\n /**\n * @dev Getter of the value of a specific badge attribute\n * @param id Badge Id to check (= attestationCollectionId)\n * @param index Index of the attribute\n */\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8) {\n return _attestationsRegistry.getAttributeValueForAttestationsCollection(id, index);\n }\n\n /**\n * @dev Getter of all badge attributes and their values for a specific badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getAttributesNamesAndValuesForBadge(\n uint256 id\n ) external view returns (bytes32[] memory, uint8[] memory) {\n return _attestationsRegistry.getAttributesNamesAndValuesForAttestationsCollection(id);\n }\n\n /**\n * @dev ERC165\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(AccessControl, ERC1155) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n revert BadgesNonTransferrable();\n }\n}\n" - }, - "contracts/core/Front.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IFront} from './interfaces/IFront.sol';\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation} from './libs/Structs.sol';\n\n/**\n * @title Front\n * @author Sismo\n * @notice This is the Front contract of the Sismo protocol\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\n\n * For more information: https://front.docs.sismo.io\n */\ncontract Front is IFront {\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\n uint256 public constant EARLY_USER_COLLECTION = 0;\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress Attestations registry contract address\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n Attestation[] memory attestations = _forwardAttestationsGeneration(\n attester,\n request,\n proofData\n );\n _generateEarlyUserAttestation(request.destination);\n return attestations;\n }\n\n /**\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n address destination = requests[0].destination;\n for (uint256 i = 0; i < attesters.length; i++) {\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\n attestations[i] = _forwardAttestationsGeneration(\n attesters[i],\n requests[i],\n proofDataArray[i]\n );\n }\n _generateEarlyUserAttestation(destination);\n return attestations;\n }\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view override returns (Attestation[] memory) {\n return _forwardAttestationsBuild(attester, request, proofData);\n }\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function of targeted attester\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n\n for (uint256 i = 0; i < attesters.length; i++) {\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\n }\n return attestations;\n }\n\n function _forwardAttestationsBuild(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal view returns (Attestation[] memory) {\n return IAttester(attester).buildAttestations(request, proofData);\n }\n\n function _forwardAttestationsGeneration(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal returns (Attestation[] memory) {\n return IAttester(attester).generateAttestations(request, proofData);\n }\n\n function _generateEarlyUserAttestation(address destination) internal {\n uint32 currentTimestamp = uint32(block.timestamp);\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\n EARLY_USER_COLLECTION,\n destination\n );\n\n if (!alreadyHasAttestation) {\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n EARLY_USER_COLLECTION,\n destination,\n address(this),\n 1,\n currentTimestamp,\n 'With strong love from Sismo'\n );\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n emit EarlyUserAttestationGenerated(destination);\n }\n }\n }\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\n\n/**\n * @title IAttestationsRegistry\n * @author Sismo\n * @notice This is the interface of the AttestationRegistry\n */\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\n event AttestationRecorded(Attestation attestation);\n event AttestationDeleted(Attestation attestation);\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external;\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(\n uint256 collectionId,\n address owner\n ) external view returns (AttestationData memory);\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(\n uint256 collectionId,\n address owner\n ) external view returns (address, uint256, uint32, bytes memory);\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(\n uint256 collectionId,\n address owner\n ) external view returns (bytes memory);\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(\n uint256 collectionId,\n address owner\n ) external view returns (address);\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(\n uint256 collectionId,\n address owner\n ) external view returns (uint32);\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view returns (AttestationData[] memory);\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view returns (uint256[] memory);\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\n\ninterface IAttestationsRegistryConfigLogic {\n error AttesterNotFound(address issuer);\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\n error IdsMismatch(\n address issuer,\n uint256 rangeIndex,\n uint256 expectedFirstId,\n uint256 expectedLastId,\n uint256 FirstId,\n uint256 lastCollectionId\n );\n error AttributeDoesNotExist(uint8 attributeIndex);\n error AttributeAlreadyExists(uint8 attributeIndex);\n error ArgsLengthDoesNotMatch();\n\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\n event AttributeNameUpdated(\n uint8 attributeIndex,\n bytes32 newAttributeName,\n bytes32 previousAttributeName\n );\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\n\n event AttestationsCollectionAttributeSet(\n uint256 collectionId,\n uint8 attributeIndex,\n uint8 attributeValue\n );\n\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n\n /**\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute. Can go from 0 to 63.\n */\n function attestationsCollectionHasAttribute(\n uint256 collectionId,\n uint8 index\n ) external view returns (bool);\n\n function attestationsCollectionHasAttributes(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (bool);\n\n /**\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\n */\n function getAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 attributeIndex\n ) external view returns (uint8);\n\n function getAttributesValuesForAttestationsCollection(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (uint8[] memory);\n\n /**\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute (must be between 0 and 63)\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\n */\n function setAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 index,\n uint8 value\n ) external;\n\n function setAttributesValuesForAttestationsCollections(\n uint256[] memory collectionIds,\n uint8[] memory indices,\n uint8[] memory values\n ) external;\n\n /**\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n */\n function getAttributesNamesAndValuesForAttestationsCollection(\n uint256 collectionId\n ) external view returns (bytes32[] memory, uint8[] memory);\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external;\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external;\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external;\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external;\n\n /**\n * @dev Create a new attribute.\n * @param index Index of the attribute. Can go from 0 to 63.\n * @param name Name in bytes32 of the attribute\n */\n function createNewAttribute(uint8 index, bytes32 name) external;\n\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\n\n /**\n * @dev Update the name of an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\n * @param newName new name in bytes32 of the attribute\n */\n function updateAttributeName(uint8 index, bytes32 newName) external;\n\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\n\n /**\n * @dev Delete an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\n */\n function deleteAttribute(uint8 index) external;\n\n function deleteAttributes(uint8[] memory indices) external;\n}\n" - }, - "contracts/core/interfaces/IAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\n\n/**\n * @title IAttester\n * @author Sismo\n * @notice This is the interface for the attesters in Sismo Protocol\n */\ninterface IAttester {\n event AttestationGenerated(Attestation attestation);\n\n event AttestationDeleted(Attestation attestation);\n\n error AttestationDeletionNotImplemented();\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev External facing function. Allows to delete an attestation by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that was deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry address getter\n * @return attestationRegistry Address of the registry\n */\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\n}\n" - }, - "contracts/core/interfaces/IBadges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Interface for Badges contract\n * @author Sismo\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n */\ninterface IBadges {\n error BadgesNonTransferrable();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(string memory uri, address owner) external;\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external;\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry) external;\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external;\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view returns (address);\n\n /**\n * @dev Getter of the badge issuer\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeIssuer(address account, uint256 id) external view returns (address);\n\n /**\n * @dev Getter of the badge timestamp\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);\n\n /**\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);\n\n /**\n * @dev Getter of the value of a specific badge attribute\n * @param id Badge Id to check (= attestationCollectionId)\n * @param index Index of the attribute\n */\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);\n\n /**\n * @dev Getter of all badge attributes and their values for a specific badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getAttributesNamesAndValuesForBadge(\n uint256 id\n ) external view returns (bytes32[] memory, uint8[] memory);\n}\n" - }, - "contracts/core/interfaces/IFront.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\n\n/**\n * @title IFront\n * @author Sismo\n * @notice This is the interface of the Front Contract\n */\ninterface IFront {\n error DifferentRequestsDestinations();\n event EarlyUserAttestationGenerated(address destination);\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev generate multiple attestations at once, to the same destination\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external returns (Attestation[][] memory);\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function(s) of targeted attester(s)\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view returns (Attestation[][] memory);\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport './OwnableLogic.sol';\nimport './PausableLogic.sol';\nimport './InitializableLogic.sol';\nimport './AttestationsRegistryState.sol';\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\nimport {Bitmap256Bit} from '../utils/Bitmap256Bit.sol';\n\n/**\n * @title Attestations Registry Config Logic contract\n * @author Sismo\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\n **/\ncontract AttestationsRegistryConfigLogic is\n AttestationsRegistryState,\n IAttestationsRegistryConfigLogic,\n OwnableLogic,\n PausableLogic,\n InitializableLogic\n{\n using RangeUtils for Range[];\n using Bitmap256Bit for uint256;\n using Bitmap256Bit for uint8;\n\n /******************************************\n *\n * ATTESTATION REGISTRY WRITE ACCESS MANAGEMENT (ISSUERS)\n *\n *****************************************/\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external override onlyOwner {\n _pause();\n }\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external override onlyOwner {\n _unpause();\n }\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\n for (uint256 i = 0; i < ranges.length; i++) {\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external override onlyOwner {\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\n return _isAuthorized(issuer, collectionId);\n }\n\n /******************************************\n *\n * ATTRIBUTES CONFIG LOGIC\n *\n *****************************************/\n\n /**\n * @dev Create a new attribute.\n * @param index Index of the attribute. Can go from 0 to 63.\n * @param name Name in bytes32 of the attribute\n */\n function createNewAttribute(uint8 index, bytes32 name) public onlyOwner {\n index._checkIndexIsValid();\n if (_isAttributeCreated(index)) {\n revert AttributeAlreadyExists(index);\n }\n _createNewAttribute(index, name);\n }\n\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external onlyOwner {\n if (indices.length != names.length) {\n revert ArgsLengthDoesNotMatch();\n }\n\n for (uint256 i = 0; i < indices.length; i++) {\n createNewAttribute(indices[i], names[i]);\n }\n }\n\n /**\n * @dev Update the name of an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\n * @param newName new name in bytes32 of the attribute\n */\n function updateAttributeName(uint8 index, bytes32 newName) public onlyOwner {\n index._checkIndexIsValid();\n if (!_isAttributeCreated(index)) {\n revert AttributeDoesNotExist(index);\n }\n _updateAttributeName(index, newName);\n }\n\n function updateAttributesName(\n uint8[] memory indices,\n bytes32[] memory newNames\n ) external onlyOwner {\n if (indices.length != newNames.length) {\n revert ArgsLengthDoesNotMatch();\n }\n\n for (uint256 i = 0; i < indices.length; i++) {\n updateAttributeName(indices[i], newNames[i]);\n }\n }\n\n /**\n * @dev Delete an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must already exist\n */\n function deleteAttribute(uint8 index) public onlyOwner {\n index._checkIndexIsValid();\n if (!_isAttributeCreated(index)) {\n revert AttributeDoesNotExist(index);\n }\n _deleteAttribute(index);\n }\n\n function deleteAttributes(uint8[] memory indices) external onlyOwner {\n for (uint256 i = 0; i < indices.length; i++) {\n deleteAttribute(indices[i]);\n }\n }\n\n /**\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute (must be between 0 and 63)\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\n */\n function setAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 index,\n uint8 value\n ) public onlyOwner {\n index._checkIndexIsValid();\n\n if (!_isAttributeCreated(index)) {\n revert AttributeDoesNotExist(index);\n }\n\n _setAttributeForAttestationsCollection(collectionId, index, value);\n }\n\n function setAttributesValuesForAttestationsCollections(\n uint256[] memory collectionIds,\n uint8[] memory indices,\n uint8[] memory values\n ) external onlyOwner {\n if (collectionIds.length != indices.length || collectionIds.length != values.length) {\n revert ArgsLengthDoesNotMatch();\n }\n for (uint256 i = 0; i < collectionIds.length; i++) {\n setAttributeValueForAttestationsCollection(collectionIds[i], indices[i], values[i]);\n }\n }\n\n /**\n * @dev Returns the attribute's value (from 0 to 15) of an attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute. Can go from 0 to 63.\n */\n function getAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 index\n ) public view returns (uint8) {\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\n collectionId\n );\n return currentAttributesValues._get(index);\n }\n\n function getAttributesValuesForAttestationsCollection(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (uint8[] memory) {\n uint8[] memory attributesValues = new uint8[](indices.length);\n for (uint256 i = 0; i < indices.length; i++) {\n attributesValues[i] = getAttributeValueForAttestationsCollection(collectionId, indices[i]);\n }\n return attributesValues;\n }\n\n /**\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute. Can go from 0 to 63.\n */\n function attestationsCollectionHasAttribute(\n uint256 collectionId,\n uint8 index\n ) public view returns (bool) {\n uint256 currentAttributeValues = _getAttributesValuesBitmapForAttestationsCollection(\n collectionId\n );\n return currentAttributeValues._get(index) > 0;\n }\n\n function attestationsCollectionHasAttributes(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (bool) {\n for (uint256 i = 0; i < indices.length; i++) {\n if (!attestationsCollectionHasAttribute(collectionId, indices[i])) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n */\n function getAttributesNamesAndValuesForAttestationsCollection(\n uint256 collectionId\n ) public view returns (bytes32[] memory, uint8[] memory) {\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\n collectionId\n );\n\n (\n uint8[] memory indices,\n uint8[] memory values,\n uint8 nbOfNonZeroValues\n ) = currentAttributesValues._getAllNonZeroValues();\n\n bytes32[] memory attributesNames = new bytes32[](nbOfNonZeroValues);\n uint8[] memory attributesValues = new uint8[](nbOfNonZeroValues);\n for (uint8 i = 0; i < nbOfNonZeroValues; i++) {\n attributesNames[i] = _attributesNames[indices[i]];\n attributesValues[i] = values[i];\n }\n\n return (attributesNames, attributesValues);\n }\n\n /*****************************\n *\n * INTERNAL FUNCTIONS\n *\n *****************************/\n\n function _authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal {\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\n _authorizedRanges[issuer].push(newRange);\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal onlyOwner {\n if (rangeIndex >= _authorizedRanges[issuer].length)\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\n\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\n revert IdsMismatch(\n issuer,\n rangeIndex,\n expectedFirstId,\n expectedLastId,\n firstCollectionId,\n lastCollectionId\n );\n\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\n _authorizedRanges[issuer].length - 1\n ];\n _authorizedRanges[issuer].pop();\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\n return _authorizedRanges[issuer]._includes(collectionId);\n }\n\n function _setAttributeForAttestationsCollection(\n uint256 collectionId,\n uint8 index,\n uint8 value\n ) internal {\n uint256 currentAttributes = _getAttributesValuesBitmapForAttestationsCollection(collectionId);\n\n _attestationsCollectionAttributesValuesBitmap[collectionId] = currentAttributes._set(\n index,\n value\n );\n\n emit AttestationsCollectionAttributeSet(collectionId, index, value);\n }\n\n function _createNewAttribute(uint8 index, bytes32 name) internal {\n _attributesNames[index] = name;\n\n emit NewAttributeCreated(index, name);\n }\n\n function _updateAttributeName(uint8 index, bytes32 newName) internal {\n bytes32 previousName = _attributesNames[index];\n\n _attributesNames[index] = newName;\n\n emit AttributeNameUpdated(index, newName, previousName);\n }\n\n function _deleteAttribute(uint8 index) internal {\n bytes32 deletedName = _attributesNames[index];\n\n delete _attributesNames[index];\n\n emit AttributeDeleted(index, deletedName);\n }\n\n function _getAttributesValuesBitmapForAttestationsCollection(\n uint256 collectionId\n ) internal view returns (uint256) {\n return _attestationsCollectionAttributesValuesBitmap[collectionId];\n }\n\n function _isAttributeCreated(uint8 index) internal view returns (bool) {\n if (_attributesNames[index] == 0) {\n return false;\n }\n return true;\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryState.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Range} from '../utils/RangeLib.sol';\nimport {Attestation, AttestationData} from '../Structs.sol';\n\ncontract AttestationsRegistryState {\n /*******************************************************\n Storage layout:\n 19 slots for config\n 4 currently used for _initialized, _initializing, _paused, _owner\n 15 place holders\n 16 slots for logic\n 3 currently used for _authorizedRanges, _attestationsCollectionAttributesValuesBitmap, _attributesNames\n 13 place holders\n 1 slot for _attestationsData \n *******************************************************/\n\n // main config\n // changed `_initialized` from bool to uint8\n // as we were using OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n // and changed to OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n // PR: https://github.com/sismo-core/sismo-protocol/pull/41\n uint8 internal _initialized;\n bool internal _initializing;\n bool internal _paused;\n address internal _owner;\n // keeping some space for future\n uint256[15] private _placeHoldersAdmin;\n\n // storing the authorized ranges for each attesters\n mapping(address => Range[]) internal _authorizedRanges;\n // Storing the attributes values used for each attestations collection\n // Each attribute value is an hexadecimal\n mapping(uint256 => uint256) internal _attestationsCollectionAttributesValuesBitmap;\n // Storing the attribute name for each attributes index\n mapping(uint8 => bytes32) internal _attributesNames;\n // keeping some space for future\n uint256[13] private _placeHoldersConfig;\n // storing the data of attestations\n // =collectionId=> =owner=> attestationData\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\n}\n" - }, - "contracts/core/libs/attestations-registry/InitializableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Address.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract InitializableLogic is AttestationsRegistryState {\n // only diff with oz\n // /**\n // * @dev Indicates that the contract has been initialized.\n // */\n // bool private _initialized;\n\n // /**\n // * @dev Indicates that the contract is in the process of being initialized.\n // */\n // bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) ||\n (!Address.isContract(address(this)) && _initialized == 1),\n 'Initializable: contract is already initialized'\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(\n !_initializing && _initialized < version,\n 'Initializable: contract is already initialized'\n );\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, 'Initializable: contract is not initializing');\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, 'Initializable: contract is initializing');\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/OwnableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n // This is the only diff with OZ contract\n // address private _owner;\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/PausableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableLogic is Context, AttestationsRegistryState {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n // this is the only diff with OZ contract\n // bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), 'Pausable: paused');\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), 'Pausable: not paused');\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "contracts/core/libs/Structs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Attestations Registry State\n * @author Sismo\n * @notice This contract holds all of the storage variables and data\n * structures used by the AttestationsRegistry and parent\n * contracts.\n */\n\n// User Attestation Request, can be made by any user\n// The context of an Attestation Request is a specific attester contract\n// Each attester has groups of accounts in its available data\n// eg: for a specific attester:\n// group 1 <=> accounts that sent txs on mainnet\n// group 2 <=> accounts that sent txs on polygon\n// eg: for another attester:\n// group 1 <=> accounts that sent eth txs in 2022\n// group 2 <=> accounts sent eth txs in 2021\nstruct Request {\n // implicit address attester;\n // implicit uint256 chainId;\n Claim[] claims;\n address destination; // destination that will receive the end attestation\n}\n\nstruct Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\n}\n\n/**\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\n * @param collectionId Attestation collection\n * @param owner Attestation collection\n * @param issuer Attestation collection\n * @param value Attestation collection\n * @param timestamp Attestation collection\n * @param extraData Attestation collection\n */\nstruct Attestation {\n // implicit uint256 chainId;\n uint256 collectionId; // Id of the attestation collection (in the registry)\n address owner; // Owner of the attestation\n address issuer; // Contract that created or last updated the record.\n uint256 value; // Value of the attestation\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\n // it is different from the recording timestamp (date when the attestation was recorded)\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\n bytes extraData; // arbitrary data that can be added by the attester\n}\n\n// Attestation Data, stored in the registry\n// The context is a specific owner of a specific collection\nstruct AttestationData {\n // implicit uint256 chainId\n // implicit uint256 collectionId - from context\n // implicit owner\n address issuer; // Address of the contract that recorded the attestation\n uint256 value; // Value of the attestation\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\n bytes extraData; // arbitrary data that can be added by the attester\n}\n" - }, - "contracts/core/libs/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, 'Address: insufficient balance');\n\n (bool success, ) = recipient.call{value: amount}('');\n require(success, 'Address: unable to send value, recipient may have reverted');\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, 'Address: low-level call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, 'Address: insufficient balance for call');\n require(isContract(target), 'Address: call to non-contract');\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data\n ) internal view returns (bytes memory) {\n return functionStaticCall(target, data, 'Address: low-level static call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), 'Address: static call to non-contract');\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), 'Address: delegate call to non-contract');\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/core/libs/utils/Bitmap256Bit.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/*\n * The 256-bit bitmap is structured in 64 chuncks of 4 bits each.\n * The 4 bits can encode any value from 0 to 15.\n\n chunck63 chunck2 chunck1 chunck0\n bits bits bits bits \n ┌────────────┐ ┌────────────┬────────────┬────────────┐\n │ 1 1 1 1 │ .... │ 1 0 1 1 │ 0 0 0 0 │ 0 0 0 1 │\n └────────────┘ └────────────┴────────────┴────────────┘\n value 15 value 11 value 0 value 1\n\n * A chunck index must be between 0 and 63.\n * A value must be between 0 and 15.\n **/\n\nlibrary Bitmap256Bit {\n uint256 constant MAX_INT = 2 ** 256 - 1;\n\n error IndexOutOfBounds(uint8 index);\n error ValueOutOfBounds(uint8 value);\n\n /**\n * @dev Return the value at a given index of a 256-bit bitmap\n * @param index index where the value can be found. Can be between 0 and 63\n */\n function _get(uint256 self, uint8 index) internal pure returns (uint8) {\n uint256 currentValues = self;\n // Get the encoded 4-bit value by right shifting to the `index` position\n uint256 shifted = currentValues >> (4 * index);\n // Get the value by only masking the last 4 bits with an AND operator\n return uint8(shifted & (2 ** 4 - 1));\n }\n\n /**\n * @dev Set a value at a chosen index in a 256-bit bitmap\n * @param index index where the value will be stored. Can be between 0 and 63\n * @param value value to store. Can be between 0 and 15\n */\n function _set(uint256 self, uint8 index, uint8 value) internal pure returns (uint256) {\n _checkIndexIsValid(index);\n _checkValueIsValid(value);\n\n uint256 currentValues = self;\n // 1. first we need to remove the current value for the inputed `index`\n // Left Shift 4 bits mask (1111 mask) to the `index` position\n uint256 mask = (2 ** 4 - 1) << (4 * index);\n // Apply a XOR operation to obtain a mask with all bits set to 1 except the 4 bits that we want to remove\n uint256 negativeMask = MAX_INT ^ mask;\n // Apply a AND operation between the current values and the negative mask to remove the wanted bits\n uint256 newValues = currentValues & negativeMask;\n\n // 2. We set the new value wanted at the `index` position\n // Create the 4 bits encoding the new value and left shift them to the `index` position\n uint256 newValueMask = uint256(value) << (4 * index);\n // Apply an OR operation between the current values and the newValueMask to reference new value\n return newValues | newValueMask;\n }\n\n /**\n * @dev Get all the non-zero values in a 256-bit bitmap\n * @param self a 256-bit bitmap\n */\n function _getAllNonZeroValues(\n uint256 self\n ) internal pure returns (uint8[] memory, uint8[] memory, uint8) {\n uint8[] memory indices = new uint8[](64);\n uint8[] memory values = new uint8[](64);\n uint8 nbOfNonZeroValues = 0;\n for (uint8 i = 0; i < 63; i++) {\n uint8 value = _get(self, i);\n if (value > 0) {\n indices[nbOfNonZeroValues] = i;\n values[nbOfNonZeroValues] = value;\n nbOfNonZeroValues++;\n }\n }\n return (indices, values, nbOfNonZeroValues);\n }\n\n /**\n * @dev Check if the index is valid (is between 0 and 63)\n * @param index index of a chunck\n */\n function _checkIndexIsValid(uint8 index) internal pure {\n if (index > 63) {\n revert IndexOutOfBounds(index);\n }\n }\n\n /**\n * @dev Check if the value is valid (is between 0 and 15)\n * @param value value to encode in a chunck\n */\n function _checkValueIsValid(uint8 value) internal pure {\n if (value > 15) {\n revert ValueOutOfBounds(value);\n }\n }\n}\n" - }, - "contracts/core/libs/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.14;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "contracts/core/libs/utils/RangeLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nstruct Range {\n uint256 min;\n uint256 max;\n}\n\n// Range [0;3] includees 0 and 3\nlibrary RangeUtils {\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\n for (uint256 i = 0; i < ranges.length; i++) {\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\n return true;\n }\n }\n return false;\n }\n}\n" - }, - "contracts/periphery/badges-examples/BAYCOwnershipBadgeExample.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC721} from '@openzeppelin/contracts/token/ERC721/ERC721.sol';\nimport {IAttestationsRegistry} from '../../core/interfaces/IAttestationsRegistry.sol';\n\ncontract BAYCOwnershipBadge is ERC721 {\n IAttestationsRegistry immutable ATTESTATIONS_REGISTRY;\n uint256 constant HydraS1_BAYC_ATTESTATION_COLLECTION_ID = 100000001;\n uint256 constant SMPS_BAYC_ATTESTATION_COLLECTION_ID = 30000000000003;\n\n constructor(\n address attestationsRegistryAddress,\n string memory name,\n string memory symbol\n ) ERC721(name, symbol) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n function balanceOf(address account) public view virtual override returns (uint256) {\n bool hasZKAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n HydraS1_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n bool hasDoxingAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n SMPS_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n return hasZKAttestation || hasDoxingAttestation ? 1 : 0;\n }\n}\n" - }, - "contracts/periphery/utils/AvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n/**\n * @title Attesters Groups Registry\n * @author Sismo\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\n * For more information: https://available-roots-registry.docs.sismo.io\n *\n **/\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\n uint8 public constant IMPLEMENTATION_VERSION = 2;\n\n mapping(address => mapping(uint256 => bool)) public _roots;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can register/ unregister roots\n */\n constructor(address owner) {\n initialize(owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n }\n }\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\n _registerRootForAttester(attester, root);\n }\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\n _unregisterRootForAttester(attester, root);\n }\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external onlyOwner {\n _registerRootForAttester(address(0), root);\n }\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external onlyOwner {\n _unregisterRootForAttester(address(0), root);\n }\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\n return _roots[_msgSender()][root] || _roots[address(0)][root];\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\n return _roots[attester][root] || _roots[address(0)][root];\n }\n\n function _registerRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = true;\n if (attester == address(0)) {\n emit RegisteredRootForAll(root);\n } else {\n emit RegisteredRootForAttester(attester, root);\n }\n }\n\n function _unregisterRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = false;\n if (attester == address(0)) {\n emit UnregisteredRootForAll(root);\n } else {\n emit UnregisteredRootForAttester(attester, root);\n }\n }\n}\n" - }, - "contracts/periphery/utils/CommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\n\n/**\n * @title Commitment Mapper Registry Contract\n * @author Sismo\n * @notice This contract stores information about the commitment mapper.\n * Its ethereum address and its EdDSA public key\n * For more information: https://commitment-mapper.docs.sismo.io\n *\n **/\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\n uint8 public constant IMPLEMENTATION_VERSION = 2;\n\n uint256[2] internal _commitmentMapperPubKey;\n address _commitmentMapperAddress;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n constructor(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) {\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n address ownerAddress,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\n _updateCommitmentMapperAddress(commitmentMapperAddress);\n }\n }\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\n }\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\n _updateCommitmentMapperAddress(newAddress);\n }\n\n /**\n * @dev Getter of the EdDSA public key of the commitment mapper\n */\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\n return _commitmentMapperPubKey;\n }\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view override returns (address) {\n return _commitmentMapperAddress;\n }\n\n function _updateCommitmentMapperAddress(address newAddress) internal {\n _commitmentMapperAddress = newAddress;\n emit UpdatedCommitmentMapperAddress(newAddress);\n }\n\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\n _commitmentMapperPubKey = pubKey;\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\n/**\n * @title IAvailableRootsRegistry\n * @author Sismo\n * @notice Interface for (Merkle) Roots Registry\n */\ninterface IAvailableRootsRegistry {\n event RegisteredRootForAttester(address attester, uint256 root);\n event RegisteredRootForAll(uint256 root);\n event UnregisteredRootForAttester(address attester, uint256 root);\n event UnregisteredRootForAll(uint256 root);\n\n error CannotRegisterForZeroAddress();\n error CannotUnregisterForZeroAddress();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address owner) external;\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external;\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external;\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\n}\n" - }, - "contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\ninterface ICommitmentMapperRegistry {\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\n event UpdatedCommitmentMapperAddress(address newAddress);\n error PubKeyNotValid(uint256[2] pubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) external;\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external;\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getEdDSAPubKey() external view returns (uint256[2] memory);\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view returns (address);\n}\n" - }, - "contracts/periphery/utils/TransparentUpgradeableProxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n// Note: we just copied so that we can see the contract used\npragma solidity ^0.8.14;\n\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(''), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(\n address newImplementation,\n bytes calldata data\n ) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(\n msg.sender != _getAdmin(),\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\n );\n super._beforeFallback();\n }\n}\n" - }, - "contracts/tests/MockAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttestationsRegistry} from '../core/interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from '../core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from '../core/libs/attestations-registry/AttestationsRegistryState.sol';\nimport {IBadges} from '../core/interfaces/IBadges.sol';\nimport {Attestation, AttestationData} from '../core/libs/Structs.sol';\n\ncontract MockAttestationsRegistry {\n uint256 immutable ATTESTATION_VALUE;\n\n event AttestationRecorded(Attestation attestation);\n\n constructor(uint256 attestationValue) {\n ATTESTATION_VALUE = attestationValue;\n }\n\n function getAttestationValue(\n uint256 collectionId,\n address owner\n ) external view returns (uint256) {\n return ATTESTATION_VALUE;\n }\n\n function recordAttestations(Attestation[] calldata attestations) external {\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationRecorded(attestations[i]);\n }\n }\n}\n" - }, - "contracts/tests/MockAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\nimport {Attestation, Request} from '../core/libs/Structs.sol';\nimport {Attester} from '../core/Attester.sol';\nimport {IAttester} from '../core/interfaces/IAttester.sol';\n\ncontract MockAttester is IAttester, Attester {\n uint256 public immutable ATTESTATION_ID_MIN;\n uint256 public immutable ATTESTATION_ID_MAX;\n\n constructor(\n address ATTESTATION_REGISTRY_ADDRESS,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n ) Attester(ATTESTATION_REGISTRY_ADDRESS) {\n ATTESTATION_ID_MIN = collectionIdFirst;\n ATTESTATION_ID_MAX = collectionIdLast;\n }\n\n function _verifyRequest(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {}\n\n function buildAttestations(\n Request calldata request,\n bytes calldata /*data*/\n ) public view virtual override(Attester, IAttester) returns (Attestation[] memory) {\n uint256 collectionId = ATTESTATION_ID_MIN + request.claims[0].groupId;\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n collectionId,\n request.destination,\n address(this),\n request.claims[0].claimedValue,\n abi.decode(request.claims[0].extraData, (uint32)),\n 'Mock Attester v0'\n );\n return (attestations);\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates", - "storageLayout" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/mumbai/solcInputs/70d5ec851bd4311fac67c09b114b9c0c.json b/deployments/mumbai/solcInputs/70d5ec851bd4311fac67c09b114b9c0c.json deleted file mode 100644 index 1733491..0000000 --- a/deployments/mumbai/solcInputs/70d5ec851bd4311fac67c09b114b9c0c.json +++ /dev/null @@ -1,227 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/attesters/hydra-s1/base/HydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1Base} from './IHydraS1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Hydra S1 ZK Proving Scheme\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n \n \n **/\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\n using HydraS1Lib for HydraS1ProofData;\n\n // ZK-SNARK Verifier\n HydraS1Verifier immutable VERIFIER;\n // Registry storing the Commitment Mapper EdDSA Public key\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\n * @param commitmentMapperAddress Commitment mapper's public key registry\n */\n constructor(\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress\n ) {\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\n }\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\n return COMMITMENT_MAPPER_REGISTRY;\n }\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\n return AVAILABLE_ROOTS_REGISTRY;\n }\n\n /*******************************************************\n Hydra-S1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input which guarantees privacy\n\n * This function MUST be implemented by Hydra-S1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Hydra-S1 Simple Attester for an example\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\n */\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n virtual\n returns (uint256);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\n internal\n view\n virtual\n {\n if (input.accountsTreeValue != claim.groupId)\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\n revert RegistryRootMismatch(input.registryRoot);\n\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\n if (\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\n )\n revert CommitmentMapperPubKeyMismatch(\n commitmentMapperPubKey[0],\n commitmentMapperPubKey[1],\n input.commitmentMapperPubKey[0],\n input.commitmentMapperPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the groth16 mathematical proof\n * @param proofData snark public input\n */\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(\n uint256 /*errorCode*/\n ) {\n revert InvalidGroth16Proof('');\n } catch (\n bytes memory /*lowLevelData*/\n ) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/IHydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n// todo: explain well what is specific to this attester\ninterface IHydraS1Base {\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\n error RegistryRootMismatch(uint256 inputRoot);\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error CommitmentMapperPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error AccountsTreeValueMismatch(\n uint256 expectedAccountsTreeValue,\n uint256 inputAccountsTreeValue\n );\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier);\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\n}\n" - }, - "@openzeppelin/contracts/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" - }, - "contracts/core/libs/Structs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Attestations Registry State\n * @author Sismo\n * @notice This contract holds all of the storage variables and data\n * structures used by the AttestationsRegistry and parent\n * contracts.\n */\n\n// User Attestation Request, can be made by any user\n// The context of an Attestation Request is a specific attester contract\n// Each attester has groups of accounts in its available data\n// eg: for a specific attester:\n// group 1 <=> accounts that sent txs on mainnet\n// group 2 <=> accounts that sent txs on polygon\n// eg: for another attester:\n// group 1 <=> accounts that sent eth txs in 2022\n// group 2 <=> accounts sent eth txs in 2021\nstruct Request {\n // implicit address attester;\n // implicit uint256 chainId;\n Claim[] claims;\n address destination; // destination that will receive the end attestation\n}\n\nstruct Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\n}\n\n/**\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\n * @param collectionId Attestation collection\n * @param owner Attestation collection\n * @param issuer Attestation collection\n * @param value Attestation collection\n * @param timestamp Attestation collection\n * @param extraData Attestation collection\n */\nstruct Attestation {\n // implicit uint256 chainId;\n uint256 collectionId; // Id of the attestation collection (in the registry)\n address owner; // Owner of the attestation\n address issuer; // Contract that created or last updated the record.\n uint256 value; // Value of the attestation\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\n // it is different from the recording timestamp (date when the attestation was recorded)\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\n bytes extraData; // arbitrary data that can be added by the attester\n}\n\n// Attestation Data, stored in the registry\n// The context is a specific owner of a specific collection\nstruct AttestationData {\n // implicit uint256 chainId\n // implicit uint256 collectionId - from context\n // implicit owner\n address issuer; // Address of the contract that recorded the attestation\n uint256 value; // Value of the attestation\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\n bytes extraData; // arbitrary data that can be added by the attester\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1GroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n bool isScore;\n}\n\nstruct HydraS1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct HydraS1ProofData {\n HydraS1CircomSnarkProof proof;\n uint256[10] input;\n // destination\n // chainId\n // commitmentMapperPubKey.x\n // commitmentMapperPubKey.y\n // registryTreeRoot\n // ticketIdentifier\n // ticket\n // claimedValue\n // accountsTreeValue\n // isStrict\n}\n\nstruct HydraS1ProofInput {\n address destination;\n uint256 chainId;\n uint256 registryRoot;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n uint256 accountsTreeValue;\n bool isStrict;\n uint256[2] commitmentMapperPubKey;\n}\n\nlibrary HydraS1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\n return\n HydraS1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getRegistryRoot(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getAccountsTreeValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1GroupProperties)\n );\n\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(HydraS1ProofData memory self)\n internal\n pure\n returns (\n uint256[2] memory,\n uint256[2][2] memory,\n uint256[2] memory,\n uint256[10] memory\n )\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\n internal\n pure\n returns (uint256[2] memory)\n {\n return [self.input[2], self.input[3]];\n }\n\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\n internal\n pure\n returns (uint256)\n {\n return self.input[5];\n }\n\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[8];\n }\n\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\n return self.input[9] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\n );\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(groupIndex, generationTimestamp, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/periphery/utils/CommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\n\n/**\n * @title Commitment Mapper Registry Contract\n * @author Sismo\n * @notice This contract stores information about the commitment mapper.\n * Its ethereum address and its EdDSA public key\n * For more information: https://commitment-mapper.docs.sismo.io\n *\n **/\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\n uint256[2] internal _commitmentMapperPubKey;\n address _commitmentMapperAddress;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n constructor(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) {\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) public initializer {\n _transferOwnership(owner);\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\n _updateCommitmentMapperAddress(commitmentMapperAddress);\n }\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\n }\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\n _updateCommitmentMapperAddress(newAddress);\n }\n\n /**\n * @dev Getter of the EdDSA public key of the commitment mapper\n */\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\n return _commitmentMapperPubKey;\n }\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view override returns (address) {\n return _commitmentMapperAddress;\n }\n\n function _updateCommitmentMapperAddress(address newAddress) internal {\n _commitmentMapperAddress = newAddress;\n emit UpdatedCommitmentMapperAddress(newAddress);\n }\n\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\n _commitmentMapperPubKey = pubKey;\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\n }\n}\n" - }, - "contracts/periphery/utils/AvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n/**\n * @title Attesters Groups Registry\n * @author Sismo\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\n * For more information: https://available-roots-registry.docs.sismo.io\n *\n **/\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\n mapping(address => mapping(uint256 => bool)) public _roots;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can register/ unregister roots\n */\n constructor(address owner) {\n initialize(owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) public initializer {\n _transferOwnership(owner);\n }\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\n _registerRootForAttester(attester, root);\n }\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\n _unregisterRootForAttester(attester, root);\n }\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external onlyOwner {\n _registerRootForAttester(address(0), root);\n }\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external onlyOwner {\n _unregisterRootForAttester(address(0), root);\n }\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\n return _roots[_msgSender()][root] || _roots[address(0)][root];\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\n return _roots[attester][root] || _roots[address(0)][root];\n }\n\n function _registerRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = true;\n if (attester == address(0)) {\n emit RegisteredRootForAll(root);\n } else {\n emit RegisteredRootForAttester(attester, root);\n }\n }\n\n function _unregisterRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = false;\n if (attester == address(0)) {\n emit UnregisteredRootForAll(root);\n } else {\n emit UnregisteredRootForAttester(attester, root);\n }\n }\n}\n" - }, - "@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract HydraS1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\n );\n vk.IC = new Pairing.G1Point[](11);\n \n vk.IC[0] = Pairing.G1Point( \n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\n 546002182798634190282541153661423157791776194062719045593389981526666716416\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\n 181057165072599074288983745076121344893296348827576905983079816835912241514\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\n ); \n \n vk.IC[10] = Pairing.G1Point( \n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[10] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "@openzeppelin/contracts/access/Ownable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\ninterface ICommitmentMapperRegistry {\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\n event UpdatedCommitmentMapperAddress(address newAddress);\n error PubKeyNotValid(uint256[2] pubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) external;\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external;\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getEdDSAPubKey() external view returns (uint256[2] memory);\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\n/**\n * @title IAvailableRootsRegistry\n * @author Sismo\n * @notice Interface for (Merkle) Roots Registry\n */\ninterface IAvailableRootsRegistry {\n event RegisteredRootForAttester(address attester, uint256 root);\n event RegisteredRootForAll(uint256 root);\n event UnregisteredRootForAttester(address attester, uint256 root);\n event UnregisteredRootForAll(uint256 root);\n\n error CannotRegisterForZeroAddress();\n error CannotUnregisterForZeroAddress();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) external;\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external;\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external;\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\n}\n" - }, - "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SoulboundAttester} from '../interfaces/IHydraS1SoulboundAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from '../../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from '../base/HydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Soulbound Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - SoulBound (with cooldown period)\n * A user can chose to delete attestations or generate attestation to a new destination.\n * When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional\n * User will need to wait until the end of the cooldown period before being able to delete or switch destination again\n * One can however know that the former and the new destinations were created using the same userTicket\n \n * - Renewable\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew or update their attestations\n **/\ncontract HydraS1SoulboundAttester is IHydraS1SoulboundAttester, HydraS1Base, Attester {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n uint256 public immutable SOULBOUND_COOLDOWN_DURATION;\n\n mapping(uint256 => TicketData) internal _userTicketsData;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n uint256 soulboundCooldownDuration\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n SOULBOUND_COOLDOWN_DURATION = soulboundCooldownDuration;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user attestations request is invalid\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark proof backing the claim\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Throws if user attestations deletion request is not made by its owner\n * @param attestations attestations to delete\n */\n function _verifyAttestationsDeletionRequest(Attestation[] memory attestations, bytes calldata)\n internal\n view\n override\n {\n for (uint256 i = 0; i < attestations.length; i++) {\n uint256 userTicket = abi.decode(attestations[0].extraData, (uint256));\n if (_userTicketsData[userTicket].destination != msg.sender)\n revert NotAttestationOwner(userTicket, msg.sender);\n }\n }\n\n /**\n * @dev Returns the actual attestations constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark public input as well as snark proof\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n HydraS1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n // The issuer of attestations is the attester\n address issuer = address(this);\n // user sends the ticket as input in the data\n uint256 userTicket = proofData._getTicket();\n\n attestations[0] = Attestation(\n attestationCollectionId,\n request.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n abi.encode(userTicket)\n );\n\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used, not a renewal, and ticket on cooldown.\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n uint256 userTicket = proofData._getTicket();\n TicketData memory userTicketData = _userTicketsData[userTicket];\n\n if (\n userTicketData.destination != address(0) && userTicketData.destination != request.destination\n ) {\n if (_isOnCooldown(userTicketData)) revert TicketUsedAndOnCooldown(userTicketData);\n _setTicketOnCooldown(userTicket);\n }\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n override\n {\n // we retrieve the ticketUsed from attestations extraData\n for (uint256 i = 0; i < attestations.length; i++) {\n uint256 userTicket = abi.decode(attestations[i].extraData, (uint256));\n if (_isOnCooldown(_userTicketsData[userTicket]) == true) revert TicketFrozen(userTicket);\n _userTicketsData[userTicket].destination = address(0);\n }\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\n return ticketIdentifier;\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n /**\n * @dev Getter, returns the data linked to a ticket\n * @param userTicket ticket used\n **/\n function getTicketData(uint256 userTicket) external view override returns (TicketData memory) {\n return _getTicketData(userTicket);\n }\n\n /**\n * @dev returns whether a ticket is on cooldown or not\n * @param userTicket ticket used\n **/\n function isTicketOnCooldown(uint256 userTicket) external view override returns (bool) {\n return _isOnCooldown(_getTicketData(userTicket));\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _userTicketsData[userTicket].destination = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _setTicketOnCooldown(uint256 userTicket) internal {\n _userTicketsData[userTicket].cooldownStart = uint32(block.timestamp);\n emit TicketSetOnCooldown(userTicket);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _userTicketsData[userTicket].destination;\n }\n\n function _isOnCooldown(TicketData memory userTicketData) internal view returns (bool) {\n return userTicketData.cooldownStart + SOULBOUND_COOLDOWN_DURATION < block.timestamp;\n }\n\n function _getTicketData(uint256 userTicket) internal view returns (TicketData memory) {\n return _userTicketsData[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1SoulboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n// todo: explain well what is specific to this attester\ninterface IHydraS1SoulboundAttester is IHydraS1Base, IAttester {\n struct TicketData {\n address destination;\n uint32 cooldownStart;\n }\n error NotAttestationOwner(uint256 ticket, address sender);\n error TicketFrozen(uint256 ticketData);\n error TicketUsedAndOnCooldown(TicketData ticketData);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n event TicketSetOnCooldown(uint256 ticket);\n\n /**\n * @dev returns whether a ticket is on cooldown or not\n * @param userTicket ticket used\n **/\n function isTicketOnCooldown(uint256 userTicket) external view returns (bool);\n\n /**\n * @dev Getter, returns the data linked to a ticket\n * @param userTicket ticket used\n **/\n function getTicketData(uint256 userTicket) external view returns (TicketData memory);\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the duration of the cooldown period after having used a ticket\n **/\n function SOULBOUND_COOLDOWN_DURATION() external view returns (uint256);\n}\n" - }, - "contracts/core/Attester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\n\n/**\n * @title Attester Abstract Contract\n * @author Sismo\n * @notice Contract to be inherited by Attesters\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\n * are recommended to implemented this abstract contract\n\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\n *\n * This contracts is built around two main external standard functions.\n * They must NOT be override them, unless your really know what you are doing\n \n * - generateAttestations(request, proof) => will write attestations in the registry\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\n\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\n\n * For more information: https://attesters.docs.sismo.io\n **/\nabstract contract Attester is IAttester {\n // Registry where all attestations are stored\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(Request calldata request, bytes calldata proofData)\n external\n override\n returns (Attestation[] memory)\n {\n // Verify if request is valid by verifying against proof\n _verifyRequest(request, proofData);\n\n // Generate the actual attestations from user request\n Attestation[] memory attestations = buildAttestations(request, proofData);\n\n _beforeRecordAttestations(request, proofData);\n\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n\n _afterRecordAttestations(attestations);\n\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationGenerated(attestations[i]);\n }\n\n return attestations;\n }\n\n /**\n * @dev External facing function. Allows to delete attestations by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that were deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n // fetch attestations from the registry\n Attestation[] memory attestationsToDelete;\n for (uint256 i = 0; i < collectionIds.length; i++) {\n (\n address issuer,\n uint256 attestationValue,\n uint32 timestamp,\n bytes memory extraData\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\n\n attestationsToDelete[i] = (\n Attestation(\n collectionIds[i],\n attestationsOwner,\n issuer,\n attestationValue,\n timestamp,\n extraData\n )\n );\n }\n\n _verifyAttestationsDeletionRequest(attestationsToDelete, proofData);\n\n _beforeDeleteAttestations(attestationsToDelete, proofData);\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationsToDelete);\n\n _afterDeleteAttestations(attestationsToDelete, proofData);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n emit AttestationDeleted(attestationsToDelete[i]);\n }\n return attestationsToDelete;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n public\n view\n virtual\n returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry getter\n * @return attestationRegistry\n */\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\n return ATTESTATIONS_REGISTRY;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should verify the user request is valid\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\n\n /**\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\n * Default behavior: throws\n * It should verify attestations deletion request is valid\n * @param attestations Attestations that will be deleted\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyAttestationsDeletionRequest(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {\n revert AttestationDeletionNotImplemented();\n }\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before recording attestations in the registry\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n {}\n\n /**\n * @dev (Optional) Can be overridden in attesters inheriting this contract\n * Will be called after recording an attestation\n * @param attestations Recorded attestations\n */\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n virtual\n {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called after deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n virtual\n {}\n}\n" - }, - "contracts/core/interfaces/IAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\n\n/**\n * @title IAttester\n * @author Sismo\n * @notice This is the interface for the attesters in Sismo Protocol\n */\ninterface IAttester {\n event AttestationGenerated(Attestation attestation);\n\n event AttestationDeleted(Attestation attestation);\n\n error AttestationDeletionNotImplemented();\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(Request calldata request, bytes calldata proofData)\n external\n returns (Attestation[] memory);\n\n /**\n * @dev External facing function. Allows to delete an attestation by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that was deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n external\n view\n returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry address getter\n * @return attestationRegistry Address of the registry\n */\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\n\n/**\n * @title IAttestationsRegistry\n * @author Sismo\n * @notice This is the interface of the AttestationRegistry\n */\ninterface IAttestationsRegistry {\n event AttestationRecorded(Attestation attestation);\n event AttestationDeleted(Attestation attestation);\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external;\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param attestations Attestations to be deleted\n */\n function deleteAttestations(Attestation[] calldata attestations) external;\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(uint256 collectionId, address owner)\n external\n view\n returns (AttestationData memory);\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(uint256 collectionId, address owner)\n external\n view\n returns (\n address,\n uint256,\n uint32,\n bytes memory\n );\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(uint256 collectionId, address owner)\n external\n view\n returns (bytes memory);\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(uint256 collectionId, address owner)\n external\n view\n returns (address);\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(uint256 collectionId, address owner)\n external\n view\n returns (uint32);\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n returns (AttestationData[] memory);\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n returns (uint256[] memory);\n}\n" - }, - "contracts/tests/MockAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\nimport {Attestation, Request} from '../core/libs/Structs.sol';\nimport {Attester} from '../core/Attester.sol';\nimport {IAttester} from '../core/interfaces/IAttester.sol';\n\ncontract MockAttester is IAttester, Attester {\n uint256 public immutable ATTESTATION_ID_MIN;\n uint256 public immutable ATTESTATION_ID_MAX;\n\n constructor(\n address ATTESTATION_REGISTRY_ADDRESS,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n ) Attester(ATTESTATION_REGISTRY_ADDRESS) {\n ATTESTATION_ID_MIN = collectionIdFirst;\n ATTESTATION_ID_MAX = collectionIdLast;\n }\n\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {}\n\n function buildAttestations(\n Request calldata request,\n bytes calldata /*data*/\n ) public view virtual override(Attester, IAttester) returns (Attestation[] memory) {\n uint256 collectionId = ATTESTATION_ID_MIN + request.claims[0].groupId;\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n collectionId,\n request.destination,\n address(this),\n request.claims[0].claimedValue,\n abi.decode(request.claims[0].extraData, (uint32)),\n 'Mock Attester v0'\n );\n return (attestations);\n }\n}\n" - }, - "contracts/core/Front.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IFront} from './interfaces/IFront.sol';\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation} from './libs/Structs.sol';\n\n/**\n * @title Front\n * @author Sismo\n * @notice This is the Front contract of the Sismo protocol\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\n\n * For more information: https://front.docs.sismo.io\n */\ncontract Front is IFront {\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\n uint256 public constant EARLY_USER_COLLECTION = 0;\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress Attestations registry contract address\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n Attestation[] memory attestations = _forwardAttestationsGeneration(\n attester,\n request,\n proofData\n );\n _generateEarlyUserAttestation(request.destination);\n return attestations;\n }\n\n /**\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n address destination = requests[0].destination;\n for (uint256 i = 0; i < attesters.length; i++) {\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\n attestations[i] = _forwardAttestationsGeneration(\n attesters[i],\n requests[i],\n proofDataArray[i]\n );\n }\n _generateEarlyUserAttestation(destination);\n return attestations;\n }\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view override returns (Attestation[] memory) {\n return _forwardAttestationsBuild(attester, request, proofData);\n }\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function of targeted attester\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n\n for (uint256 i = 0; i < attesters.length; i++) {\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\n }\n return attestations;\n }\n\n function _forwardAttestationsBuild(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal view returns (Attestation[] memory) {\n return IAttester(attester).buildAttestations(request, proofData);\n }\n\n function _forwardAttestationsGeneration(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal returns (Attestation[] memory) {\n return IAttester(attester).generateAttestations(request, proofData);\n }\n\n function _generateEarlyUserAttestation(address destination) internal {\n uint32 currentTimestamp = uint32(block.timestamp);\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\n EARLY_USER_COLLECTION,\n destination\n );\n\n if (!alreadyHasAttestation) {\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n EARLY_USER_COLLECTION,\n destination,\n address(this),\n 1,\n currentTimestamp,\n 'With strong love from Sismo'\n );\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n emit EarlyUserAttestationGenerated(destination);\n }\n }\n }\n}\n" - }, - "contracts/core/interfaces/IFront.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\n\n/**\n * @title IFront\n * @author Sismo\n * @notice This is the interface of the Front Contract\n */\ninterface IFront {\n error DifferentRequestsDestinations();\n event EarlyUserAttestationGenerated(address destination);\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev generate multiple attestations at once, to the same destination\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external returns (Attestation[][] memory);\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function(s) of targeted attester(s)\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view returns (Attestation[][] memory);\n}\n" - }, - "contracts/tests/MockAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttestationsRegistry} from '../core/interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from '../core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from '../core/libs/attestations-registry/AttestationsRegistryState.sol';\nimport {IBadges} from '../core/interfaces/IBadges.sol';\nimport {Attestation, AttestationData} from '../core/libs/Structs.sol';\n\ncontract MockAttestationsRegistry {\n uint256 immutable ATTESTATION_VALUE;\n\n event AttestationRecorded(Attestation attestation);\n\n constructor(uint256 attestationValue) {\n ATTESTATION_VALUE = attestationValue;\n }\n\n function getAttestationValue(uint256 collectionId, address owner)\n external\n view\n returns (uint256)\n {\n return ATTESTATION_VALUE;\n }\n\n function recordAttestations(Attestation[] calldata attestations) external {\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationRecorded(attestations[i]);\n }\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport './OwnableLogic.sol';\nimport './PausableLogic.sol';\nimport './InitializableLogic.sol';\nimport './AttestationsRegistryState.sol';\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\n\n/**\n * @title Attestations Registry Config Logic contract\n * @author Sismo\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\n **/\ncontract AttestationsRegistryConfigLogic is\n AttestationsRegistryState,\n IAttestationsRegistryConfigLogic,\n OwnableLogic,\n PausableLogic,\n InitializableLogic\n{\n using RangeUtils for Range[];\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\n for (uint256 i = 0; i < ranges.length; i++) {\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external override onlyOwner {\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\n return _isAuthorized(issuer, collectionId);\n }\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external override onlyOwner {\n _pause();\n }\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external override onlyOwner {\n _unpause();\n }\n\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\n return _authorizedRanges[issuer]._includes(collectionId);\n }\n\n function _authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal {\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\n _authorizedRanges[issuer].push(newRange);\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal onlyOwner {\n if (rangeIndex >= _authorizedRanges[issuer].length)\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\n\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\n revert IdsMismatch(\n issuer,\n rangeIndex,\n expectedFirstId,\n expectedLastId,\n firstCollectionId,\n lastCollectionId\n );\n\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\n _authorizedRanges[issuer].length - 1\n ];\n _authorizedRanges[issuer].pop();\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryState.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Range} from '../utils/RangeLib.sol';\nimport {Attestation, AttestationData} from '../Structs.sol';\n\ncontract AttestationsRegistryState {\n // main config\n bool internal _initialized;\n bool internal _initializing;\n bool internal _paused;\n address internal _owner;\n // keeping some space for future\n uint256[15] private _placeHolders;\n\n // storing the authorized ranges for each attesters\n mapping(address => Range[]) internal _authorizedRanges;\n // keeping some space for future\n uint256[15] private _placeHolders2;\n // storing the data of attestations\n // =collectionId=> =owner=> attestationData\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\n}\n" - }, - "contracts/core/interfaces/IBadges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Interface for Badges contract\n * @author Sismo\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n */\ninterface IBadges {\n error BadgesNonTransferrable();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n function initialize(string memory uri, address owner) external;\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external;\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry) external;\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external;\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view returns (address);\n}\n" - }, - "contracts/core/libs/attestations-registry/OwnableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n // This is the only diff with OZ contract\n // address private _owner;\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/PausableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableLogic is Context, AttestationsRegistryState {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n // this is the only diff with OZ contract\n // bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), 'Pausable: paused');\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), 'Pausable: not paused');\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/InitializableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Address.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract InitializableLogic is AttestationsRegistryState {\n // only diff with oz\n // /**\n // * @dev Indicates that the contract has been initialized.\n // */\n // bool private _initialized;\n\n // /**\n // * @dev Indicates that the contract is in the process of being initialized.\n // */\n // bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(\n _initializing ? _isConstructor() : !_initialized,\n 'Initializable: contract is already initialized'\n );\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, 'Initializable: contract is not initializing');\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\n\ninterface IAttestationsRegistryConfigLogic {\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\n error AttesterNotFound(address issuer);\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\n error IdsMismatch(\n address issuer,\n uint256 rangeIndex,\n uint256 expectedFirstId,\n uint256 expectedLastId,\n uint256 FirstId,\n uint256 lastCollectionId\n );\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external;\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external;\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external;\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external;\n}\n" - }, - "contracts/core/libs/utils/RangeLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nstruct Range {\n uint256 min;\n uint256 max;\n}\n\n// Range [0;3] includees 0 and 3\nlibrary RangeUtils {\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\n for (uint256 i = 0; i < ranges.length; i++) {\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\n return true;\n }\n }\n return false;\n }\n}\n" - }, - "contracts/core/libs/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.14;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "contracts/core/libs/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, 'Address: insufficient balance');\n\n (bool success, ) = recipient.call{value: amount}('');\n require(success, 'Address: unable to send value, recipient may have reverted');\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, 'Address: low-level call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, 'Address: insufficient balance for call');\n require(isContract(target), 'Address: call to non-contract');\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data)\n internal\n view\n returns (bytes memory)\n {\n return functionStaticCall(target, data, 'Address: low-level static call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), 'Address: static call to non-contract');\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), 'Address: delegate call to non-contract');\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/core/Badges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Badges contract\n * @author Sismo\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n * For more information: https://badges.docs.sismo.io\n */\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\n IAttestationsRegistry internal _attestationsRegistry;\n\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\n\n /**\n * @dev Constructor\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n constructor(\n string memory uri,\n address owner // This is Sismo Frontend Contract\n ) ERC1155(uri) {\n initialize(uri, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n function initialize(string memory uri, address owner) public initializer {\n _setURI(uri);\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n }\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id)\n public\n view\n virtual\n override(ERC1155, IBadges)\n returns (uint256)\n {\n return _attestationsRegistry.getAttestationValue(id, account);\n }\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\n emit TransferSingle(operator, from, to, id, value);\n }\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry)\n external\n override\n onlyRole(DEFAULT_ADMIN_ROLE)\n {\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\n }\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _setURI(uri);\n }\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view override returns (address) {\n return address(_attestationsRegistry);\n }\n\n /**\n * @dev ERC165\n */\n function supportsInterface(bytes4 interfaceId)\n public\n view\n virtual\n override(AccessControl, ERC1155)\n returns (bool)\n {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n revert BadgesNonTransferrable();\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/ERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC1155.sol\";\nimport \"./IERC1155Receiver.sol\";\nimport \"./extensions/IERC1155MetadataURI.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of the basic standard multi-token.\n * See https://eips.ethereum.org/EIPS/eip-1155\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\n *\n * _Available since v3.1._\n */\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\n using Address for address;\n\n // Mapping from token ID to account balances\n mapping(uint256 => mapping(address => uint256)) private _balances;\n\n // Mapping from account to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n string private _uri;\n\n /**\n * @dev See {_setURI}.\n */\n constructor(string memory uri_) {\n _setURI(uri_);\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155).interfaceId ||\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC1155MetadataURI-uri}.\n *\n * This implementation returns the same URI for *all* token types. It relies\n * on the token type ID substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * Clients calling this function must replace the `\\{id\\}` substring with the\n * actual token type ID.\n */\n function uri(uint256) public view virtual override returns (string memory) {\n return _uri;\n }\n\n /**\n * @dev See {IERC1155-balanceOf}.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\n require(account != address(0), \"ERC1155: balance query for the zero address\");\n return _balances[id][account];\n }\n\n /**\n * @dev See {IERC1155-balanceOfBatch}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\n public\n view\n virtual\n override\n returns (uint256[] memory)\n {\n require(accounts.length == ids.length, \"ERC1155: accounts and ids length mismatch\");\n\n uint256[] memory batchBalances = new uint256[](accounts.length);\n\n for (uint256 i = 0; i < accounts.length; ++i) {\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\n }\n\n return batchBalances;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev See {IERC1155-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not owner nor approved\"\n );\n _safeTransferFrom(from, to, id, amount, data);\n }\n\n /**\n * @dev See {IERC1155-safeBatchTransferFrom}.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: transfer caller is not owner nor approved\"\n );\n _safeBatchTransferFrom(from, to, ids, amounts, data);\n }\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n\n emit TransferSingle(operator, from, to, id, amount);\n\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; ++i) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n }\n\n emit TransferBatch(operator, from, to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\n }\n\n /**\n * @dev Sets a new URI for all token types, by relying on the token type ID\n * substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * By this mechanism, any occurrence of the `\\{id\\}` substring in either the\n * URI or any of the amounts in the JSON file at said URI will be replaced by\n * clients with the token type ID.\n *\n * For example, the `https://token-cdn-domain/\\{id\\}.json` URI would be\n * interpreted by clients as\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\n * for token type ID 0x4cce0.\n *\n * See {uri}.\n *\n * Because these URIs cannot be meaningfully represented by the {URI} event,\n * this function emits no events.\n */\n function _setURI(string memory newuri) internal virtual {\n _uri = newuri;\n }\n\n /**\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _mint(\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);\n\n _balances[id][to] += amount;\n emit TransferSingle(operator, address(0), to, id, amount);\n\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _mintBatch(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; i++) {\n _balances[ids[i]][to] += amounts[i];\n }\n\n emit TransferBatch(operator, address(0), to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\n }\n\n /**\n * @dev Destroys `amount` tokens of token type `id` from `from`\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `from` must have at least `amount` tokens of token type `id`.\n */\n function _burn(\n address from,\n uint256 id,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), \"\");\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n\n emit TransferSingle(operator, from, address(0), id, amount);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n */\n function _burnBatch(\n address from,\n uint256[] memory ids,\n uint256[] memory amounts\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n for (uint256 i = 0; i < ids.length; i++) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n }\n\n emit TransferBatch(operator, from, address(0), ids, amounts);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits a {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC1155: setting approval status for self\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `id` and `amount` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n function _doSafeTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\n if (response != IERC1155Receiver.onERC1155Received.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\n bytes4 response\n ) {\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\n uint256[] memory array = new uint256[](1);\n array[0] = element;\n\n return array;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1155.sol\";\nimport \"../../../security/Pausable.sol\";\n\n/**\n * @dev ERC1155 token with pausable token transfers, minting and burning.\n *\n * Useful for scenarios such as preventing trades until the end of an evaluation\n * period, or having an emergency switch for freezing all token transfers in the\n * event of a large bug.\n *\n * _Available since v3.1._\n */\nabstract contract ERC1155Pausable is ERC1155, Pausable {\n /**\n * @dev See {ERC1155-_beforeTokenTransfer}.\n *\n * Requirements:\n *\n * - the contract must not be paused.\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n require(!paused(), \"ERC1155Pausable: token transfer while paused\");\n }\n}\n" - }, - "@openzeppelin/contracts/access/AccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role, _msgSender());\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(uint160(account), 20),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155MetadataURI is IERC1155 {\n /**\n * @dev Returns the URI for token type `id`.\n *\n * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n * clients with the actual token type ID.\n */\n function uri(uint256 id) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/ERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/security/Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), \"Pausable: paused\");\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), \"Pausable: not paused\");\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "@openzeppelin/contracts/access/IAccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" - }, - "@openzeppelin/contracts/utils/Strings.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n // Inspired by OraclizeAPI's implementation - MIT licence\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0x00\";\n }\n uint256 temp = value;\n uint256 length = 0;\n while (temp != 0) {\n length++;\n temp >>= 8;\n }\n return toHexString(value, length);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n}\n" - }, - "contracts/periphery/badges-examples/BAYCOwnershipBadgeExample.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC721} from '@openzeppelin/contracts/token/ERC721/ERC721.sol';\nimport {IAttestationsRegistry} from '../../core/interfaces/IAttestationsRegistry.sol';\n\ncontract BAYCOwnershipBadge is ERC721 {\n IAttestationsRegistry immutable ATTESTATIONS_REGISTRY;\n uint256 constant HydraS1_BAYC_ATTESTATION_COLLECTION_ID = 100000001;\n uint256 constant SMPS_BAYC_ATTESTATION_COLLECTION_ID = 30000000000003;\n\n constructor(\n address attestationsRegistryAddress,\n string memory name,\n string memory symbol\n ) ERC721(name, symbol) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n function balanceOf(address account) public view virtual override returns (uint256) {\n bool hasZKAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n HydraS1_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n bool hasDoxingAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n SMPS_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n return hasZKAttestation || hasDoxingAttestation ? 1 : 0;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/ERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"./extensions/IERC721Metadata.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/Strings.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: balance query for the zero address\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _owners[tokenId];\n require(owner != address(0), \"ERC721: owner query for nonexistent token\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n require(_exists(tokenId), \"ERC721Metadata: URI query for nonexistent token\");\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overriden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not owner nor approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n require(_exists(tokenId), \"ERC721: approved query for nonexistent token\");\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: transfer caller is not owner nor approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: transfer caller is not owner nor approved\");\n _safeTransfer(from, to, tokenId, _data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `_data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, _data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _owners[tokenId] != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n require(_exists(tokenId), \"ERC721: operator query for nonexistent token\");\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, _data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId);\n\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId);\n\n // Clear approvals\n _approve(address(0), tokenId);\n\n _balances[owner] -= 1;\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId);\n\n // Clear approvals from the previous owner\n _approve(address(0), tokenId);\n\n _balances[from] -= 1;\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits a {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits a {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param _data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, ``from``'s `tokenId` will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" - }, - "@openzeppelin/contracts/utils/StorageSlot.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" - }, - "contracts/periphery/utils/TransparentUpgradeableProxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n// Note: we just copied so that we can see the contract used\npragma solidity ^0.8.14;\n\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(''), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n ifAdmin\n {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(\n msg.sender != _getAdmin(),\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\n );\n super._beforeFallback();\n }\n}\n" - }, - "contracts/attesters/pythia-1/base/Pythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IPythia1Base} from './IPythia1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Pythia 1 ZK Proving Scheme\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\n\n/**\n * @title Pythia-1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \n * without anyone being able to make the link between the offchain service and the onchain service.\n * It is inherited by the family of Pythia-1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n \n \n **/\nabstract contract Pythia1Base is IPythia1Base, Initializable {\n using Pythia1Lib for Pythia1ProofData;\n\n // ZK-SNARK Verifier\n Pythia1Verifier immutable VERIFIER;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\n */\n constructor(address Pythia1VerifierAddress) {\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\n }\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of the Commitment signer Eddsa Public key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\n return _getCommitmentSignerPubKey();\n }\n\n /*******************************************************\n Pythia-1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * the secretHash is a number only known by the user and is used in \n * the zero knowledge as a private input which guarantees privacy\n\n * This function MUST be implemented by Pythia-1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Pythia-1 Simple Attester for an example\n * @param claim user claim: a particular claim that a user have that he can prove s right.\n */\n function _getTicketIdentifierOfClaim(Pythia1Claim memory claim)\n internal\n view\n virtual\n returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\n * prove the claim was correctly issued for the user.\n */\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(Pythia1Claim memory claim, Pythia1ProofInput memory input)\n internal\n view\n virtual\n {\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (claim.destination != msg.sender)\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\n if (\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\n )\n revert CommitmentSignerPubKeyMismatch(\n commitmentSignerPubKey[0],\n commitmentSignerPubKey[1],\n input.commitmentSignerPubKey[0],\n input.commitmentSignerPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the plonk mathematical proof using the circom verifier contract\n * @param proofData snark public input\n */\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(\n uint256 /*errorCode*/\n ) {\n revert InvalidGroth16Proof('');\n } catch (\n bytes memory /*lowLevelData*/\n ) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/pythia-1/base/IPythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\n\ninterface IPythia1Base {\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error UserShouldOwnItsDestination(address sender, address inputdestination);\n error CommitmentSignerPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier);\n\n /**\n * @dev Getter of the Commitment Signer EdDSA Public Key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\n}\n" - }, - "contracts/attesters/pythia-1/libs/Pythia1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\n\n// user Pythia-1 claim retrieved form his request\nstruct Pythia1Claim {\n uint256 groupId; // user claims be part of this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct Pythia1GroupProperties {\n uint128 internalCollectionId;\n bool isScore;\n}\n\nstruct Pythia1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct Pythia1ProofData {\n Pythia1CircomSnarkProof proof;\n uint256[9] input;\n // destination;\n // chainId;\n // commitmentSignerPubKey.x;\n // commitmentSignerPubKey.y;\n // groupId;\n // ticketIdentifier;\n // userTicket;\n // value;\n // isStrict;\n}\n\nstruct Pythia1ProofInput {\n address destination;\n uint256 chainId;\n uint256 groupId;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n bool isStrict;\n uint256[2] commitmentSignerPubKey;\n}\n\nlibrary Pythia1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\n return\n Pythia1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getGroupId(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n Pythia1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (Pythia1GroupProperties)\n );\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(Pythia1ProofData memory self)\n internal\n pure\n returns (\n uint256[2] memory,\n uint256[2][2] memory,\n uint256[2] memory,\n uint256[9] memory\n )\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(Pythia1ProofData memory self)\n internal\n pure\n returns (uint256[2] memory)\n {\n return [self.input[2], self.input[3]];\n }\n\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(Pythia1ProofData memory self)\n internal\n pure\n returns (uint256)\n {\n return self.input[5];\n }\n\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\n return self.input[8] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(uint128 internalCollectionId, bool isScore)\n internal\n pure\n returns (uint256)\n {\n return\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(uint128 internalCollectionId, bool isScore)\n internal\n pure\n returns (bytes memory)\n {\n return abi.encode(internalCollectionId, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "@sismo-core/pythia-1/contracts/Pythia1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract Pythia1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\n );\n vk.IC = new Pairing.G1Point[](10);\n \n vk.IC[0] = Pairing.G1Point( \n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 104028078850975554065172701281783302003220555203883119831575537681421753151,\n 19148240629904598794948591359118971959790791697910953160820265703277306346\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[9] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to Pythia1 Proving Scheme\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\n\n/**\n * @title Pythia-1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Pythia-1 Attesters.\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \n * offchain service in a privacy preserving way. \n * That means no-one can make the link between the account used in the offchain service\n * and the onchain account where the attestation is stored.\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each users gets one userTicket per claim\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n **/\n\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\n using Pythia1Lib for Pythia1ProofData;\n using Pythia1Lib for bytes;\n using Pythia1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n uint256[2] internal _commitmentSignerPubKey;\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\n * @param owner The owner of the contract that can update the commitment signer pub key\n */\n constructor(\n address attestationsRegistryAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address pythia1VerifierAddress,\n uint256[2] memory commitmentSignerPubKey,\n address owner\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n initialize(commitmentSignerPubKey, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) public initializer {\n _transferOwnership(owner);\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into Pythia1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\n Pythia1ProofInput memory snarkInput = snarkProof._input();\n Pythia1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(Request calldata request, bytes calldata)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n Pythia1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.internalCollectionId;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n uint32(block.timestamp),\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used\n * @param request users request. Claim of beiing part of a group.\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0)) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * users bring secretHash as private input in snark which guarantees privacy\n * the secretHash is only known by the user and never escape the user's browser\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(Pythia1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.internalCollectionId\n );\n return ticketIdentifier;\n }\n\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\n return _commitmentSignerPubKey;\n }\n\n /*******************************************************\n Pythia-1 Attester Specific Functions\n *******************************************************/\n\n function updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey)\n external\n onlyOwner\n {\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\n _commitmentSignerPubKey = commitmentSignerPubKey;\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\n }\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\n\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\n error TicketUsed(uint256 userTicket);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n// todo: explain well what is specific to this attester\ninterface IHydraS1SimpleAttester is IHydraS1Base, IAttester {\n error TicketUsed(uint256 userTicket);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - Renewable\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew their attestations\n **/\n\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base, Attester {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(Request calldata request, bytes calldata)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n HydraS1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used and not a renewal (e.g destination different that last)\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0) && currentDestination != request.destination) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\n return ticketIdentifier;\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/core/AttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\nimport {Attestation, AttestationData} from './libs/Structs.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Attestations Registry\n * @author Sismo\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\n * Only authorized attestations issuers can record attestation in the registry\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\n * For more information: https://attestations-registry.docs.sismo.io\n\n * For each attestation recorded, a badge is received by the user\n * The badge is the Non transferrable NFT representation of an attestation \n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\n * It enables off-chain apps such as opensea to catch the \"shadow mint\" of the badge\n **/\ncontract AttestationsRegistry is\n AttestationsRegistryState,\n IAttestationsRegistry,\n AttestationsRegistryConfigLogic\n{\n IBadges immutable BADGES;\n\n /**\n * @dev Constructor.\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @param badgesAddress Stateless ERC1155 Badges contract\n */\n constructor(address owner, address badgesAddress) {\n initialize(owner);\n BADGES = IBadges(badgesAddress);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n */\n function initialize(address owner) public initializer {\n _transferOwnership(owner);\n }\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\n address issuer = _msgSender();\n for (uint256 i = 0; i < attestations.length; i++) {\n if (!_isAuthorized(issuer, attestations[i].collectionId))\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\n\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\n attestations[i].owner\n ].value;\n\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\n attestations[i].issuer,\n attestations[i].value,\n attestations[i].timestamp,\n attestations[i].extraData\n );\n\n _triggerBadgeTransferEvent(\n attestations[i].collectionId,\n attestations[i].owner,\n previousAttestationValue,\n attestations[i].value\n );\n emit AttestationRecorded(attestations[i]);\n }\n }\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param attestations Attestations to be deleted\n */\n function deleteAttestations(Attestation[] memory attestations) external override whenNotPaused {\n address issuer = _msgSender();\n for (uint256 i = 0; i < attestations.length; i++) {\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\n attestations[i].owner\n ].value;\n\n if (!_isAuthorized(issuer, attestations[i].collectionId))\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\n delete _attestationsData[attestations[i].collectionId][attestations[i].owner];\n\n _triggerBadgeTransferEvent(\n attestations[i].collectionId,\n attestations[i].owner,\n previousAttestationValue,\n 0\n );\n\n emit AttestationDeleted(\n Attestation(\n attestations[i].collectionId,\n attestations[i].owner,\n attestations[i].issuer,\n attestations[i].value,\n attestations[i].timestamp,\n attestations[i].extraData\n )\n );\n }\n }\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner)\n external\n view\n override\n returns (bool)\n {\n return _getAttestationValue(collectionId, owner) != 0;\n }\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(uint256 collectionId, address owner)\n external\n view\n override\n returns (AttestationData memory)\n {\n return _getAttestationData(collectionId, owner);\n }\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner)\n external\n view\n override\n returns (uint256)\n {\n return _getAttestationValue(collectionId, owner);\n }\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(uint256 collectionId, address owner)\n external\n view\n override\n returns (\n address,\n uint256,\n uint32,\n bytes memory\n )\n {\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\n return (\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n );\n }\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(uint256 collectionId, address owner)\n external\n view\n override\n returns (bytes memory)\n {\n return _attestationsData[collectionId][owner].extraData;\n }\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(uint256 collectionId, address owner)\n external\n view\n override\n returns (address)\n {\n return _attestationsData[collectionId][owner].issuer;\n }\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(uint256 collectionId, address owner)\n external\n view\n override\n returns (uint32)\n {\n return _attestationsData[collectionId][owner].timestamp;\n }\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n override\n returns (AttestationData[] memory)\n {\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\n }\n return attestationsDataArray;\n }\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n override\n returns (uint256[] memory)\n {\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\n }\n return attestationsValues;\n }\n\n /**\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\n * It enables off-chain apps such as opensea to catch the \"shadow mints/burns\" of badges\n */\n function _triggerBadgeTransferEvent(\n uint256 badgeTokenId,\n address owner,\n uint256 previousValue,\n uint256 newValue\n ) internal {\n bool isGreaterValue = newValue > previousValue;\n address operator = address(this);\n address from = isGreaterValue ? address(0) : owner;\n address to = isGreaterValue ? owner : address(0);\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\n\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\n }\n\n function _getAttestationData(uint256 collectionId, address owner)\n internal\n view\n returns (AttestationData memory)\n {\n return (_attestationsData[collectionId][owner]);\n }\n\n function _getAttestationValue(uint256 collectionId, address owner)\n internal\n view\n returns (uint256)\n {\n return _attestationsData[collectionId][owner].value;\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/mumbai/solcInputs/c7c67c4a1ddf53de4ef76f8a114dfc39.json b/deployments/mumbai/solcInputs/c7c67c4a1ddf53de4ef76f8a114dfc39.json deleted file mode 100644 index 74d45b0..0000000 --- a/deployments/mumbai/solcInputs/c7c67c4a1ddf53de4ef76f8a114dfc39.json +++ /dev/null @@ -1,230 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/attesters/hydra-s1/base/HydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1Base} from './IHydraS1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Hydra S1 ZK Proving Scheme\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to the following:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n **/\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\n using HydraS1Lib for HydraS1ProofData;\n\n // ZK-SNARK Verifier\n HydraS1Verifier immutable VERIFIER;\n // Registry storing the Commitment Mapper EdDSA Public key\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\n * @param commitmentMapperAddress Commitment mapper's public key registry\n */\n constructor(\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress\n ) {\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\n }\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\n return COMMITMENT_MAPPER_REGISTRY;\n }\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\n return AVAILABLE_ROOTS_REGISTRY;\n }\n\n /*******************************************************\n Hydra-S1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input which guarantees privacy\n\n * This function MUST be implemented by Hydra-S1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Hydra-S1 Simple Attester for an example\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\n */\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n virtual\n returns (uint256);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\n internal\n view\n virtual\n {\n if (input.accountsTreeValue != claim.groupId)\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\n revert RegistryRootMismatch(input.registryRoot);\n\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\n if (\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\n )\n revert CommitmentMapperPubKeyMismatch(\n commitmentMapperPubKey[0],\n commitmentMapperPubKey[1],\n input.commitmentMapperPubKey[0],\n input.commitmentMapperPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the groth16 mathematical proof\n * @param proofData snark public input\n */\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(\n uint256 /*errorCode*/\n ) {\n revert InvalidGroth16Proof('');\n } catch (\n bytes memory /*lowLevelData*/\n ) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/IHydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Interface\n * @author Sismo\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\n * We invite readers to refer to the following:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n **/\ninterface IHydraS1Base {\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\n error RegistryRootMismatch(uint256 inputRoot);\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error CommitmentMapperPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error AccountsTreeValueMismatch(\n uint256 expectedAccountsTreeValue,\n uint256 inputAccountsTreeValue\n );\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier);\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\n}\n" - }, - "@openzeppelin/contracts/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" - }, - "contracts/core/libs/Structs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Attestations Registry State\n * @author Sismo\n * @notice This contract holds all of the storage variables and data\n * structures used by the AttestationsRegistry and parent\n * contracts.\n */\n\n// User Attestation Request, can be made by any user\n// The context of an Attestation Request is a specific attester contract\n// Each attester has groups of accounts in its available data\n// eg: for a specific attester:\n// group 1 <=> accounts that sent txs on mainnet\n// group 2 <=> accounts that sent txs on polygon\n// eg: for another attester:\n// group 1 <=> accounts that sent eth txs in 2022\n// group 2 <=> accounts sent eth txs in 2021\nstruct Request {\n // implicit address attester;\n // implicit uint256 chainId;\n Claim[] claims;\n address destination; // destination that will receive the end attestation\n}\n\nstruct Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\n}\n\n/**\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\n * @param collectionId Attestation collection\n * @param owner Attestation collection\n * @param issuer Attestation collection\n * @param value Attestation collection\n * @param timestamp Attestation collection\n * @param extraData Attestation collection\n */\nstruct Attestation {\n // implicit uint256 chainId;\n uint256 collectionId; // Id of the attestation collection (in the registry)\n address owner; // Owner of the attestation\n address issuer; // Contract that created or last updated the record.\n uint256 value; // Value of the attestation\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\n // it is different from the recording timestamp (date when the attestation was recorded)\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\n bytes extraData; // arbitrary data that can be added by the attester\n}\n\n// Attestation Data, stored in the registry\n// The context is a specific owner of a specific collection\nstruct AttestationData {\n // implicit uint256 chainId\n // implicit uint256 collectionId - from context\n // implicit owner\n address issuer; // Address of the contract that recorded the attestation\n uint256 value; // Value of the attestation\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\n bytes extraData; // arbitrary data that can be added by the attester\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1GroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n bool isScore;\n}\n\nstruct HydraS1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct HydraS1ProofData {\n HydraS1CircomSnarkProof proof;\n uint256[10] input;\n // destination\n // chainId\n // commitmentMapperPubKey.x\n // commitmentMapperPubKey.y\n // registryTreeRoot\n // ticketIdentifier\n // ticket\n // claimedValue\n // accountsTreeValue\n // isStrict\n}\n\nstruct HydraS1ProofInput {\n address destination;\n uint256 chainId;\n uint256 registryRoot;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n uint256 accountsTreeValue;\n bool isStrict;\n uint256[2] commitmentMapperPubKey;\n}\n\nlibrary HydraS1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\n return\n HydraS1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getRegistryRoot(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getAccountsTreeValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1GroupProperties)\n );\n\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(HydraS1ProofData memory self)\n internal\n pure\n returns (\n uint256[2] memory,\n uint256[2][2] memory,\n uint256[2] memory,\n uint256[10] memory\n )\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\n internal\n pure\n returns (uint256[2] memory)\n {\n return [self.input[2], self.input[3]];\n }\n\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\n internal\n pure\n returns (uint256)\n {\n return self.input[5];\n }\n\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[8];\n }\n\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\n return self.input[9] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\n );\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(groupIndex, generationTimestamp, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/periphery/utils/CommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\n\n/**\n * @title Commitment Mapper Registry Contract\n * @author Sismo\n * @notice This contract stores information about the commitment mapper.\n * Its ethereum address and its EdDSA public key\n * For more information: https://commitment-mapper.docs.sismo.io\n *\n **/\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\n uint256[2] internal _commitmentMapperPubKey;\n address _commitmentMapperAddress;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n constructor(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) {\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) public initializer {\n _transferOwnership(owner);\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\n _updateCommitmentMapperAddress(commitmentMapperAddress);\n }\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\n }\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\n _updateCommitmentMapperAddress(newAddress);\n }\n\n /**\n * @dev Getter of the EdDSA public key of the commitment mapper\n */\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\n return _commitmentMapperPubKey;\n }\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view override returns (address) {\n return _commitmentMapperAddress;\n }\n\n function _updateCommitmentMapperAddress(address newAddress) internal {\n _commitmentMapperAddress = newAddress;\n emit UpdatedCommitmentMapperAddress(newAddress);\n }\n\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\n _commitmentMapperPubKey = pubKey;\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\n }\n}\n" - }, - "contracts/periphery/utils/AvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n/**\n * @title Attesters Groups Registry\n * @author Sismo\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\n * For more information: https://available-roots-registry.docs.sismo.io\n *\n **/\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\n mapping(address => mapping(uint256 => bool)) public _roots;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can register/ unregister roots\n */\n constructor(address owner) {\n initialize(owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) public initializer {\n _transferOwnership(owner);\n }\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\n _registerRootForAttester(attester, root);\n }\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\n _unregisterRootForAttester(attester, root);\n }\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external onlyOwner {\n _registerRootForAttester(address(0), root);\n }\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external onlyOwner {\n _unregisterRootForAttester(address(0), root);\n }\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\n return _roots[_msgSender()][root] || _roots[address(0)][root];\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\n return _roots[attester][root] || _roots[address(0)][root];\n }\n\n function _registerRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = true;\n if (attester == address(0)) {\n emit RegisteredRootForAll(root);\n } else {\n emit RegisteredRootForAttester(attester, root);\n }\n }\n\n function _unregisterRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = false;\n if (attester == address(0)) {\n emit UnregisteredRootForAll(root);\n } else {\n emit UnregisteredRootForAttester(attester, root);\n }\n }\n}\n" - }, - "@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract HydraS1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\n );\n vk.IC = new Pairing.G1Point[](11);\n \n vk.IC[0] = Pairing.G1Point( \n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\n 546002182798634190282541153661423157791776194062719045593389981526666716416\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\n 181057165072599074288983745076121344893296348827576905983079816835912241514\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\n ); \n \n vk.IC[10] = Pairing.G1Point( \n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[10] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "@openzeppelin/contracts/access/Ownable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\ninterface ICommitmentMapperRegistry {\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\n event UpdatedCommitmentMapperAddress(address newAddress);\n error PubKeyNotValid(uint256[2] pubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) external;\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external;\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getEdDSAPubKey() external view returns (uint256[2] memory);\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\n/**\n * @title IAvailableRootsRegistry\n * @author Sismo\n * @notice Interface for (Merkle) Roots Registry\n */\ninterface IAvailableRootsRegistry {\n event RegisteredRootForAttester(address attester, uint256 root);\n event RegisteredRootForAll(uint256 root);\n event UnregisteredRootForAttester(address attester, uint256 root);\n event UnregisteredRootForAll(uint256 root);\n\n error CannotRegisterForZeroAddress();\n error CannotUnregisterForZeroAddress();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) external;\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external;\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external;\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\n}\n" - }, - "contracts/attesters/hydra-s1/variants/HydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1AccountboundAttester} from '../interfaces/IHydraS1AccountboundAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from '../../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from '../base/HydraS1Base.sol';\nimport {HydraS1AccountboundLib, HydraS1AccountboundClaim} from '../libs/HydraS1AccountboundLib.sol';\n\n/**\n * @title Hydra-S1 Accountbound Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - Accountbound (with cooldown period)\n * Users can choose to delete or generate attestations to a new destination using their source account.\n * The attestation is \"Accountbound\" to the source account.\n * When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional\n * User will need to wait until the end of the cooldown period before being able to delete or switch destination again\n * One can however know that the former and the new destinations were created using the same userTicket\n \n * - Renewable\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew or update their attestations\n **/\ncontract HydraS1AccountboundAttester is IHydraS1AccountboundAttester, HydraS1Base, Attester {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1AccountboundLib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n mapping(uint256 => TicketData) internal _userTicketsData;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user attestations request is invalid\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark proof backing the claim\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._hydraS1claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns the actual attestations constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark public input as well as snark proof\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n HydraS1AccountboundClaim memory claim = request._hydraS1Accountboundclaim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n // The issuer of attestations is the attester\n address issuer = address(this);\n // user sends the ticket as input in the data\n uint256 userTicket = proofData._getTicket();\n TicketData memory userTicketData = _userTicketsData[userTicket];\n\n uint16 burnCount = userTicketData.burnCount;\n // If the attestation is minted on a new destination address\n // the burnCount encoded in the extraData of the Attestation should be incremented\n if (\n userTicketData.destination != address(0) && userTicketData.destination != request.destination\n ) {\n burnCount += 1;\n }\n\n attestations[0] = Attestation(\n attestationCollectionId,\n request.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n abi.encode(userTicket, burnCount)\n );\n\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used, not a renewal, and ticket on cooldown.\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n uint256 userTicket = proofData._getTicket();\n TicketData memory userTicketData = _userTicketsData[userTicket];\n\n if (\n userTicketData.destination != address(0) && userTicketData.destination != request.destination\n ) {\n HydraS1AccountboundClaim memory claim = request._hydraS1Accountboundclaim();\n if (_isOnCooldown(userTicketData, claim.groupProperties.cooldownDuration))\n revert TicketOnCooldown(userTicketData, claim.groupProperties.cooldownDuration);\n\n // Delete the old Attestation on the account before recording the new one\n address[] memory attestationOwners = new address[](1);\n uint256[] memory attestationCollectionIds = new uint256[](1);\n\n attestationOwners[0] = userTicketData.destination;\n attestationCollectionIds[0] =\n AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n\n emit AttestationDeleted(\n Attestation(\n AUTHORIZED_COLLECTION_ID_FIRST + claim.groupProperties.groupIndex,\n userTicketData.destination,\n address(this),\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n abi.encode(userTicket, userTicketData.burnCount)\n )\n );\n _setTicketOnCooldown(userTicket);\n }\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\n return ticketIdentifier;\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n /**\n * @dev Getter, returns the data linked to a ticket\n * @param userTicket ticket used\n **/\n function getTicketData(uint256 userTicket) external view override returns (TicketData memory) {\n return _getTicketData(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _userTicketsData[userTicket].destination = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _setTicketOnCooldown(uint256 userTicket) internal {\n _userTicketsData[userTicket].cooldownStart = uint32(block.timestamp);\n _userTicketsData[userTicket].burnCount += 1;\n emit TicketSetOnCooldown(userTicket, _userTicketsData[userTicket].burnCount);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _userTicketsData[userTicket].destination;\n }\n\n function _isOnCooldown(TicketData memory userTicketData, uint32 cooldownDuration)\n internal\n view\n returns (bool)\n {\n return userTicketData.cooldownStart + cooldownDuration > block.timestamp;\n }\n\n function _getTicketData(uint256 userTicket) internal view returns (TicketData memory) {\n return _userTicketsData[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Accountbound Interface\n * @author Sismo\n * @notice Interface with the errors, events and methods specific to the HydraS1AcountboundAttester.\n **/\ninterface IHydraS1AccountboundAttester is IHydraS1Base, IAttester {\n struct TicketData {\n address destination;\n uint32 cooldownStart;\n uint16 burnCount;\n }\n\n /**\n * @dev Error when the userTicket is on cooldown. The user have to wait the cooldownDuration\n * before being able to change again the destination address.\n **/\n error TicketOnCooldown(TicketData ticketData, uint32 cooldownDuration);\n\n /**\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\n **/\n error CollectionIdOutOfBound(uint256 collectionId);\n\n /**\n * @dev Event emitted when the userTicket (or nullifierHash) is associated to a destination address.\n **/\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n\n /**\n * @dev Event emitted when the userTicket has been set on cooldown. This happens when the\n * attestation destination of a ticket has been changed\n **/\n event TicketSetOnCooldown(uint256 ticket, uint16 burnCount);\n\n /**\n * @dev Getter, returns the data linked to a ticket\n * @param userTicket ticket used\n **/\n function getTicketData(uint256 userTicket) external view returns (TicketData memory);\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/core/Attester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\n\n/**\n * @title Attester Abstract Contract\n * @author Sismo\n * @notice Contract to be inherited by Attesters\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\n * are recommended to implemented this abstract contract\n\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\n *\n * This contracts is built around two main external standard functions.\n * They must NOT be override them, unless your really know what you are doing\n \n * - generateAttestations(request, proof) => will write attestations in the registry\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\n\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\n\n * For more information: https://attesters.docs.sismo.io\n **/\nabstract contract Attester is IAttester {\n // Registry where all attestations are stored\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(Request calldata request, bytes calldata proofData)\n external\n override\n returns (Attestation[] memory)\n {\n // Verify if request is valid by verifying against proof\n _verifyRequest(request, proofData);\n\n // Generate the actual attestations from user request\n Attestation[] memory attestations = buildAttestations(request, proofData);\n\n _beforeRecordAttestations(request, proofData);\n\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n\n _afterRecordAttestations(attestations);\n\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationGenerated(attestations[i]);\n }\n\n return attestations;\n }\n\n /**\n * @dev External facing function. Allows to delete attestations by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that were deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n address[] memory attestationOwners = new address[](collectionIds.length);\n\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\n\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n // fetch attestations from the registry\n (\n address issuer,\n uint256 attestationValue,\n uint32 timestamp,\n bytes memory extraData\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\n\n attestationOwners[i] = attestationsOwner;\n attestationCollectionIds[i] = collectionIds[i];\n\n attestations[i] = (\n Attestation(\n collectionIds[i],\n attestationsOwner,\n issuer,\n attestationValue,\n timestamp,\n extraData\n )\n );\n }\n\n _verifyAttestationsDeletionRequest(attestations, proofData);\n\n _beforeDeleteAttestations(attestations, proofData);\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n\n _afterDeleteAttestations(attestations, proofData);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n emit AttestationDeleted(attestations[i]);\n }\n return attestations;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n public\n view\n virtual\n returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry getter\n * @return attestationRegistry\n */\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\n return ATTESTATIONS_REGISTRY;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should verify the user request is valid\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\n\n /**\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\n * Default behavior: throws\n * It should verify attestations deletion request is valid\n * @param attestations Attestations that will be deleted\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyAttestationsDeletionRequest(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {\n revert AttestationDeletionNotImplemented();\n }\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before recording attestations in the registry\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n {}\n\n /**\n * @dev (Optional) Can be overridden in attesters inheriting this contract\n * Will be called after recording an attestation\n * @param attestations Recorded attestations\n */\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n virtual\n {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called after deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n virtual\n {}\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1AccountboundLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Lib, HydraS1Claim, HydraS1GroupProperties} from './HydraS1Lib.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1AccountboundClaim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1AccountboundGroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1AccountboundGroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n uint32 cooldownDuration;\n bool isScore;\n}\n\nlibrary HydraS1AccountboundLib {\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _hydraS1claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n HydraS1GroupProperties memory hydraS1GroupProperties = HydraS1GroupProperties(\n groupProperties.groupIndex,\n groupProperties.generationTimestamp,\n groupProperties.isScore\n );\n\n return (\n HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, hydraS1GroupProperties)\n );\n }\n\n function _hydraS1Accountboundclaim(Request memory self)\n internal\n pure\n returns (HydraS1AccountboundClaim memory)\n {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory hydraS1AccountboundGroupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n return (\n HydraS1AccountboundClaim(\n claim.groupId,\n claim.claimedValue,\n self.destination,\n hydraS1AccountboundGroupProperties\n )\n );\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/core/interfaces/IAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\n\n/**\n * @title IAttester\n * @author Sismo\n * @notice This is the interface for the attesters in Sismo Protocol\n */\ninterface IAttester {\n event AttestationGenerated(Attestation attestation);\n\n event AttestationDeleted(Attestation attestation);\n\n error AttestationDeletionNotImplemented();\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(Request calldata request, bytes calldata proofData)\n external\n returns (Attestation[] memory);\n\n /**\n * @dev External facing function. Allows to delete an attestation by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that was deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n external\n view\n returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry address getter\n * @return attestationRegistry Address of the registry\n */\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\n\n/**\n * @title IAttestationsRegistry\n * @author Sismo\n * @notice This is the interface of the AttestationRegistry\n */\ninterface IAttestationsRegistry {\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\n event AttestationRecorded(Attestation attestation);\n event AttestationDeleted(Attestation attestation);\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external;\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(uint256 collectionId, address owner)\n external\n view\n returns (AttestationData memory);\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(uint256 collectionId, address owner)\n external\n view\n returns (\n address,\n uint256,\n uint32,\n bytes memory\n );\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(uint256 collectionId, address owner)\n external\n view\n returns (bytes memory);\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(uint256 collectionId, address owner)\n external\n view\n returns (address);\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(uint256 collectionId, address owner)\n external\n view\n returns (uint32);\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n returns (AttestationData[] memory);\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n returns (uint256[] memory);\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Accountbound Interface\n * @author Sismo\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\n **/\ninterface IHydraS1SimpleAttester is IHydraS1Base, IAttester {\n /**\n * @dev Error when the userTicket (or nullifierHash) is already used for a destination address\n **/\n error TicketUsed(uint256 userTicket);\n\n /**\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\n **/\n error CollectionIdOutOfBound(uint256 collectionId);\n\n /**\n * @dev Event emitted when the userTicket (or nullifierHash) is associated to a destination address.\n **/\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/core/Badges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Badges contract\n * @author Sismo\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n * For more information: https://badges.docs.sismo.io\n */\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\n IAttestationsRegistry internal _attestationsRegistry;\n\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\n\n /**\n * @dev Constructor\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n constructor(\n string memory uri,\n address owner // This is Sismo Frontend Contract\n ) ERC1155(uri) {\n initialize(uri, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n function initialize(string memory uri, address owner) public initializer {\n _setURI(uri);\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n }\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id)\n public\n view\n virtual\n override(ERC1155, IBadges)\n returns (uint256)\n {\n return _attestationsRegistry.getAttestationValue(id, account);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function isApprovedForAll(address account, address operator)\n public\n view\n virtual\n override\n returns (bool)\n {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\n emit TransferSingle(operator, from, to, id, value);\n }\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry)\n external\n override\n onlyRole(DEFAULT_ADMIN_ROLE)\n {\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\n }\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _setURI(uri);\n }\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view override returns (address) {\n return address(_attestationsRegistry);\n }\n\n /**\n * @dev ERC165\n */\n function supportsInterface(bytes4 interfaceId)\n public\n view\n virtual\n override(AccessControl, ERC1155)\n returns (bool)\n {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n revert BadgesNonTransferrable();\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/ERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC1155.sol\";\nimport \"./IERC1155Receiver.sol\";\nimport \"./extensions/IERC1155MetadataURI.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of the basic standard multi-token.\n * See https://eips.ethereum.org/EIPS/eip-1155\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\n *\n * _Available since v3.1._\n */\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\n using Address for address;\n\n // Mapping from token ID to account balances\n mapping(uint256 => mapping(address => uint256)) private _balances;\n\n // Mapping from account to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n string private _uri;\n\n /**\n * @dev See {_setURI}.\n */\n constructor(string memory uri_) {\n _setURI(uri_);\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155).interfaceId ||\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC1155MetadataURI-uri}.\n *\n * This implementation returns the same URI for *all* token types. It relies\n * on the token type ID substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * Clients calling this function must replace the `\\{id\\}` substring with the\n * actual token type ID.\n */\n function uri(uint256) public view virtual override returns (string memory) {\n return _uri;\n }\n\n /**\n * @dev See {IERC1155-balanceOf}.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\n require(account != address(0), \"ERC1155: balance query for the zero address\");\n return _balances[id][account];\n }\n\n /**\n * @dev See {IERC1155-balanceOfBatch}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\n public\n view\n virtual\n override\n returns (uint256[] memory)\n {\n require(accounts.length == ids.length, \"ERC1155: accounts and ids length mismatch\");\n\n uint256[] memory batchBalances = new uint256[](accounts.length);\n\n for (uint256 i = 0; i < accounts.length; ++i) {\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\n }\n\n return batchBalances;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev See {IERC1155-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not owner nor approved\"\n );\n _safeTransferFrom(from, to, id, amount, data);\n }\n\n /**\n * @dev See {IERC1155-safeBatchTransferFrom}.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: transfer caller is not owner nor approved\"\n );\n _safeBatchTransferFrom(from, to, ids, amounts, data);\n }\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n\n emit TransferSingle(operator, from, to, id, amount);\n\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; ++i) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n }\n\n emit TransferBatch(operator, from, to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\n }\n\n /**\n * @dev Sets a new URI for all token types, by relying on the token type ID\n * substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * By this mechanism, any occurrence of the `\\{id\\}` substring in either the\n * URI or any of the amounts in the JSON file at said URI will be replaced by\n * clients with the token type ID.\n *\n * For example, the `https://token-cdn-domain/\\{id\\}.json` URI would be\n * interpreted by clients as\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\n * for token type ID 0x4cce0.\n *\n * See {uri}.\n *\n * Because these URIs cannot be meaningfully represented by the {URI} event,\n * this function emits no events.\n */\n function _setURI(string memory newuri) internal virtual {\n _uri = newuri;\n }\n\n /**\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _mint(\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);\n\n _balances[id][to] += amount;\n emit TransferSingle(operator, address(0), to, id, amount);\n\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _mintBatch(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; i++) {\n _balances[ids[i]][to] += amounts[i];\n }\n\n emit TransferBatch(operator, address(0), to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\n }\n\n /**\n * @dev Destroys `amount` tokens of token type `id` from `from`\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `from` must have at least `amount` tokens of token type `id`.\n */\n function _burn(\n address from,\n uint256 id,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), \"\");\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n\n emit TransferSingle(operator, from, address(0), id, amount);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n */\n function _burnBatch(\n address from,\n uint256[] memory ids,\n uint256[] memory amounts\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n for (uint256 i = 0; i < ids.length; i++) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n }\n\n emit TransferBatch(operator, from, address(0), ids, amounts);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits a {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC1155: setting approval status for self\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `id` and `amount` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n function _doSafeTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\n if (response != IERC1155Receiver.onERC1155Received.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\n bytes4 response\n ) {\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\n uint256[] memory array = new uint256[](1);\n array[0] = element;\n\n return array;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1155.sol\";\nimport \"../../../security/Pausable.sol\";\n\n/**\n * @dev ERC1155 token with pausable token transfers, minting and burning.\n *\n * Useful for scenarios such as preventing trades until the end of an evaluation\n * period, or having an emergency switch for freezing all token transfers in the\n * event of a large bug.\n *\n * _Available since v3.1._\n */\nabstract contract ERC1155Pausable is ERC1155, Pausable {\n /**\n * @dev See {ERC1155-_beforeTokenTransfer}.\n *\n * Requirements:\n *\n * - the contract must not be paused.\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n require(!paused(), \"ERC1155Pausable: token transfer while paused\");\n }\n}\n" - }, - "@openzeppelin/contracts/access/AccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role, _msgSender());\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(uint160(account), 20),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" - }, - "contracts/core/interfaces/IBadges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Interface for Badges contract\n * @author Sismo\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n */\ninterface IBadges {\n error BadgesNonTransferrable();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n function initialize(string memory uri, address owner) external;\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external;\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry) external;\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external;\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155MetadataURI is IERC1155 {\n /**\n * @dev Returns the URI for token type `id`.\n *\n * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n * clients with the actual token type ID.\n */\n function uri(uint256 id) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/ERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/security/Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), \"Pausable: paused\");\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), \"Pausable: not paused\");\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "@openzeppelin/contracts/access/IAccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" - }, - "@openzeppelin/contracts/utils/Strings.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n // Inspired by OraclizeAPI's implementation - MIT licence\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0x00\";\n }\n uint256 temp = value;\n uint256 length = 0;\n while (temp != 0) {\n length++;\n temp >>= 8;\n }\n return toHexString(value, length);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n}\n" - }, - "contracts/tests/MockAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttestationsRegistry} from '../core/interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from '../core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from '../core/libs/attestations-registry/AttestationsRegistryState.sol';\nimport {IBadges} from '../core/interfaces/IBadges.sol';\nimport {Attestation, AttestationData} from '../core/libs/Structs.sol';\n\ncontract MockAttestationsRegistry {\n uint256 immutable ATTESTATION_VALUE;\n\n event AttestationRecorded(Attestation attestation);\n\n constructor(uint256 attestationValue) {\n ATTESTATION_VALUE = attestationValue;\n }\n\n function getAttestationValue(uint256 collectionId, address owner)\n external\n view\n returns (uint256)\n {\n return ATTESTATION_VALUE;\n }\n\n function recordAttestations(Attestation[] calldata attestations) external {\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationRecorded(attestations[i]);\n }\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport './OwnableLogic.sol';\nimport './PausableLogic.sol';\nimport './InitializableLogic.sol';\nimport './AttestationsRegistryState.sol';\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\n\n/**\n * @title Attestations Registry Config Logic contract\n * @author Sismo\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\n **/\ncontract AttestationsRegistryConfigLogic is\n AttestationsRegistryState,\n IAttestationsRegistryConfigLogic,\n OwnableLogic,\n PausableLogic,\n InitializableLogic\n{\n using RangeUtils for Range[];\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\n for (uint256 i = 0; i < ranges.length; i++) {\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external override onlyOwner {\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\n return _isAuthorized(issuer, collectionId);\n }\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external override onlyOwner {\n _pause();\n }\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external override onlyOwner {\n _unpause();\n }\n\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\n return _authorizedRanges[issuer]._includes(collectionId);\n }\n\n function _authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal {\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\n _authorizedRanges[issuer].push(newRange);\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal onlyOwner {\n if (rangeIndex >= _authorizedRanges[issuer].length)\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\n\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\n revert IdsMismatch(\n issuer,\n rangeIndex,\n expectedFirstId,\n expectedLastId,\n firstCollectionId,\n lastCollectionId\n );\n\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\n _authorizedRanges[issuer].length - 1\n ];\n _authorizedRanges[issuer].pop();\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryState.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Range} from '../utils/RangeLib.sol';\nimport {Attestation, AttestationData} from '../Structs.sol';\n\ncontract AttestationsRegistryState {\n // main config\n bool internal _initialized;\n bool internal _initializing;\n bool internal _paused;\n address internal _owner;\n // keeping some space for future\n uint256[15] private _placeHolders;\n\n // storing the authorized ranges for each attesters\n mapping(address => Range[]) internal _authorizedRanges;\n // keeping some space for future\n uint256[15] private _placeHolders2;\n // storing the data of attestations\n // =collectionId=> =owner=> attestationData\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\n}\n" - }, - "contracts/core/libs/attestations-registry/OwnableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n // This is the only diff with OZ contract\n // address private _owner;\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/PausableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableLogic is Context, AttestationsRegistryState {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n // this is the only diff with OZ contract\n // bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), 'Pausable: paused');\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), 'Pausable: not paused');\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/InitializableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Address.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract InitializableLogic is AttestationsRegistryState {\n // only diff with oz\n // /**\n // * @dev Indicates that the contract has been initialized.\n // */\n // bool private _initialized;\n\n // /**\n // * @dev Indicates that the contract is in the process of being initialized.\n // */\n // bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(\n _initializing ? _isConstructor() : !_initialized,\n 'Initializable: contract is already initialized'\n );\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, 'Initializable: contract is not initializing');\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\n\ninterface IAttestationsRegistryConfigLogic {\n error AttesterNotFound(address issuer);\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\n error IdsMismatch(\n address issuer,\n uint256 rangeIndex,\n uint256 expectedFirstId,\n uint256 expectedLastId,\n uint256 FirstId,\n uint256 lastCollectionId\n );\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external;\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external;\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external;\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external;\n}\n" - }, - "contracts/core/libs/utils/RangeLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nstruct Range {\n uint256 min;\n uint256 max;\n}\n\n// Range [0;3] includees 0 and 3\nlibrary RangeUtils {\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\n for (uint256 i = 0; i < ranges.length; i++) {\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\n return true;\n }\n }\n return false;\n }\n}\n" - }, - "contracts/core/libs/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.14;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "contracts/core/libs/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, 'Address: insufficient balance');\n\n (bool success, ) = recipient.call{value: amount}('');\n require(success, 'Address: unable to send value, recipient may have reverted');\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, 'Address: low-level call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, 'Address: insufficient balance for call');\n require(isContract(target), 'Address: call to non-contract');\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data)\n internal\n view\n returns (bytes memory)\n {\n return functionStaticCall(target, data, 'Address: low-level static call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), 'Address: static call to non-contract');\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), 'Address: delegate call to non-contract');\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/tests/MockAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\nimport {Attestation, Request} from '../core/libs/Structs.sol';\nimport {Attester} from '../core/Attester.sol';\nimport {IAttester} from '../core/interfaces/IAttester.sol';\n\ncontract MockAttester is IAttester, Attester {\n uint256 public immutable ATTESTATION_ID_MIN;\n uint256 public immutable ATTESTATION_ID_MAX;\n\n constructor(\n address ATTESTATION_REGISTRY_ADDRESS,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n ) Attester(ATTESTATION_REGISTRY_ADDRESS) {\n ATTESTATION_ID_MIN = collectionIdFirst;\n ATTESTATION_ID_MAX = collectionIdLast;\n }\n\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {}\n\n function buildAttestations(\n Request calldata request,\n bytes calldata /*data*/\n ) public view virtual override(Attester, IAttester) returns (Attestation[] memory) {\n uint256 collectionId = ATTESTATION_ID_MIN + request.claims[0].groupId;\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n collectionId,\n request.destination,\n address(this),\n request.claims[0].claimedValue,\n abi.decode(request.claims[0].extraData, (uint32)),\n 'Mock Attester v0'\n );\n return (attestations);\n }\n}\n" - }, - "contracts/core/Front.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IFront} from './interfaces/IFront.sol';\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation} from './libs/Structs.sol';\n\n/**\n * @title Front\n * @author Sismo\n * @notice This is the Front contract of the Sismo protocol\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\n\n * For more information: https://front.docs.sismo.io\n */\ncontract Front is IFront {\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\n uint256 public constant EARLY_USER_COLLECTION = 0;\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress Attestations registry contract address\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n Attestation[] memory attestations = _forwardAttestationsGeneration(\n attester,\n request,\n proofData\n );\n _generateEarlyUserAttestation(request.destination);\n return attestations;\n }\n\n /**\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n address destination = requests[0].destination;\n for (uint256 i = 0; i < attesters.length; i++) {\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\n attestations[i] = _forwardAttestationsGeneration(\n attesters[i],\n requests[i],\n proofDataArray[i]\n );\n }\n _generateEarlyUserAttestation(destination);\n return attestations;\n }\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view override returns (Attestation[] memory) {\n return _forwardAttestationsBuild(attester, request, proofData);\n }\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function of targeted attester\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n\n for (uint256 i = 0; i < attesters.length; i++) {\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\n }\n return attestations;\n }\n\n function _forwardAttestationsBuild(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal view returns (Attestation[] memory) {\n return IAttester(attester).buildAttestations(request, proofData);\n }\n\n function _forwardAttestationsGeneration(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal returns (Attestation[] memory) {\n return IAttester(attester).generateAttestations(request, proofData);\n }\n\n function _generateEarlyUserAttestation(address destination) internal {\n uint32 currentTimestamp = uint32(block.timestamp);\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\n EARLY_USER_COLLECTION,\n destination\n );\n\n if (!alreadyHasAttestation) {\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n EARLY_USER_COLLECTION,\n destination,\n address(this),\n 1,\n currentTimestamp,\n 'With strong love from Sismo'\n );\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n emit EarlyUserAttestationGenerated(destination);\n }\n }\n }\n}\n" - }, - "contracts/core/interfaces/IFront.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\n\n/**\n * @title IFront\n * @author Sismo\n * @notice This is the interface of the Front Contract\n */\ninterface IFront {\n error DifferentRequestsDestinations();\n event EarlyUserAttestationGenerated(address destination);\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev generate multiple attestations at once, to the same destination\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external returns (Attestation[][] memory);\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function(s) of targeted attester(s)\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view returns (Attestation[][] memory);\n}\n" - }, - "contracts/periphery/badges-examples/BAYCOwnershipBadgeExample.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC721} from '@openzeppelin/contracts/token/ERC721/ERC721.sol';\nimport {IAttestationsRegistry} from '../../core/interfaces/IAttestationsRegistry.sol';\n\ncontract BAYCOwnershipBadge is ERC721 {\n IAttestationsRegistry immutable ATTESTATIONS_REGISTRY;\n uint256 constant HydraS1_BAYC_ATTESTATION_COLLECTION_ID = 100000001;\n uint256 constant SMPS_BAYC_ATTESTATION_COLLECTION_ID = 30000000000003;\n\n constructor(\n address attestationsRegistryAddress,\n string memory name,\n string memory symbol\n ) ERC721(name, symbol) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n function balanceOf(address account) public view virtual override returns (uint256) {\n bool hasZKAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n HydraS1_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n bool hasDoxingAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n SMPS_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n return hasZKAttestation || hasDoxingAttestation ? 1 : 0;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/ERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"./extensions/IERC721Metadata.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/Strings.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: balance query for the zero address\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _owners[tokenId];\n require(owner != address(0), \"ERC721: owner query for nonexistent token\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n require(_exists(tokenId), \"ERC721Metadata: URI query for nonexistent token\");\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overriden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not owner nor approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n require(_exists(tokenId), \"ERC721: approved query for nonexistent token\");\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: transfer caller is not owner nor approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: transfer caller is not owner nor approved\");\n _safeTransfer(from, to, tokenId, _data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `_data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, _data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _owners[tokenId] != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n require(_exists(tokenId), \"ERC721: operator query for nonexistent token\");\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, _data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId);\n\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId);\n\n // Clear approvals\n _approve(address(0), tokenId);\n\n _balances[owner] -= 1;\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId);\n\n // Clear approvals from the previous owner\n _approve(address(0), tokenId);\n\n _balances[from] -= 1;\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits a {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits a {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param _data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, ``from``'s `tokenId` will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" - }, - "@openzeppelin/contracts/utils/StorageSlot.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" - }, - "contracts/periphery/utils/TransparentUpgradeableProxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n// Note: we just copied so that we can see the contract used\npragma solidity ^0.8.14;\n\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(''), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n ifAdmin\n {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(\n msg.sender != _getAdmin(),\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\n );\n super._beforeFallback();\n }\n}\n" - }, - "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to Pythia1 Proving Scheme\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\n\n/**\n * @title Pythia-1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Pythia-1 Attesters.\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \n * offchain service in a privacy preserving way. \n * That means no-one can make the link between the account used in the offchain service\n * and the onchain account where the attestation is stored.\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each users gets one userTicket per claim\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n **/\n\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\n using Pythia1Lib for Pythia1ProofData;\n using Pythia1Lib for bytes;\n using Pythia1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n uint256[2] internal _commitmentSignerPubKey;\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\n * @param owner The owner of the contract that can update the commitment signer pub key\n */\n constructor(\n address attestationsRegistryAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address pythia1VerifierAddress,\n uint256[2] memory commitmentSignerPubKey,\n address owner\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n initialize(commitmentSignerPubKey, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) public initializer {\n _transferOwnership(owner);\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into Pythia1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\n Pythia1ProofInput memory snarkInput = snarkProof._input();\n Pythia1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(Request calldata request, bytes calldata)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n Pythia1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.internalCollectionId;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n uint32(block.timestamp),\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used\n * @param request users request. Claim of beiing part of a group.\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0)) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * users bring secretHash as private input in snark which guarantees privacy\n * the secretHash is only known by the user and never escape the user's browser\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(Pythia1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.internalCollectionId\n );\n return ticketIdentifier;\n }\n\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\n return _commitmentSignerPubKey;\n }\n\n /*******************************************************\n Pythia-1 Attester Specific Functions\n *******************************************************/\n\n function updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey)\n external\n onlyOwner\n {\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\n _commitmentSignerPubKey = commitmentSignerPubKey;\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\n }\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\n\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\n error TicketUsed(uint256 userTicket);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/pythia-1/base/Pythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IPythia1Base} from './IPythia1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Pythia 1 ZK Proving Scheme\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\n\n/**\n * @title Pythia-1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \n * without anyone being able to make the link between the offchain service and the onchain service.\n * It is inherited by the family of Pythia-1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n \n \n **/\nabstract contract Pythia1Base is IPythia1Base, Initializable {\n using Pythia1Lib for Pythia1ProofData;\n\n // ZK-SNARK Verifier\n Pythia1Verifier immutable VERIFIER;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\n */\n constructor(address Pythia1VerifierAddress) {\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\n }\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of the Commitment signer Eddsa Public key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\n return _getCommitmentSignerPubKey();\n }\n\n /*******************************************************\n Pythia-1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * the secretHash is a number only known by the user and is used in \n * the zero knowledge as a private input which guarantees privacy\n\n * This function MUST be implemented by Pythia-1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Pythia-1 Simple Attester for an example\n * @param claim user claim: a particular claim that a user have that he can prove s right.\n */\n function _getTicketIdentifierOfClaim(Pythia1Claim memory claim)\n internal\n view\n virtual\n returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\n * prove the claim was correctly issued for the user.\n */\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(Pythia1Claim memory claim, Pythia1ProofInput memory input)\n internal\n view\n virtual\n {\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (claim.destination != msg.sender)\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\n if (\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\n )\n revert CommitmentSignerPubKeyMismatch(\n commitmentSignerPubKey[0],\n commitmentSignerPubKey[1],\n input.commitmentSignerPubKey[0],\n input.commitmentSignerPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the plonk mathematical proof using the circom verifier contract\n * @param proofData snark public input\n */\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(\n uint256 /*errorCode*/\n ) {\n revert InvalidGroth16Proof('');\n } catch (\n bytes memory /*lowLevelData*/\n ) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/pythia-1/libs/Pythia1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\n\n// user Pythia-1 claim retrieved form his request\nstruct Pythia1Claim {\n uint256 groupId; // user claims be part of this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct Pythia1GroupProperties {\n uint128 internalCollectionId;\n bool isScore;\n}\n\nstruct Pythia1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct Pythia1ProofData {\n Pythia1CircomSnarkProof proof;\n uint256[9] input;\n // destination;\n // chainId;\n // commitmentSignerPubKey.x;\n // commitmentSignerPubKey.y;\n // groupId;\n // ticketIdentifier;\n // userTicket;\n // value;\n // isStrict;\n}\n\nstruct Pythia1ProofInput {\n address destination;\n uint256 chainId;\n uint256 groupId;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n bool isStrict;\n uint256[2] commitmentSignerPubKey;\n}\n\nlibrary Pythia1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\n return\n Pythia1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getGroupId(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n Pythia1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (Pythia1GroupProperties)\n );\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(Pythia1ProofData memory self)\n internal\n pure\n returns (\n uint256[2] memory,\n uint256[2][2] memory,\n uint256[2] memory,\n uint256[9] memory\n )\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(Pythia1ProofData memory self)\n internal\n pure\n returns (uint256[2] memory)\n {\n return [self.input[2], self.input[3]];\n }\n\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(Pythia1ProofData memory self)\n internal\n pure\n returns (uint256)\n {\n return self.input[5];\n }\n\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\n return self.input[8] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(uint128 internalCollectionId, bool isScore)\n internal\n pure\n returns (uint256)\n {\n return\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(uint128 internalCollectionId, bool isScore)\n internal\n pure\n returns (bytes memory)\n {\n return abi.encode(internalCollectionId, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/pythia-1/base/IPythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\n\ninterface IPythia1Base {\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error UserShouldOwnItsDestination(address sender, address inputdestination);\n error CommitmentSignerPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier);\n\n /**\n * @dev Getter of the Commitment Signer EdDSA Public Key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\n}\n" - }, - "@sismo-core/pythia-1/contracts/Pythia1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract Pythia1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\n );\n vk.IC = new Pairing.G1Point[](10);\n \n vk.IC[0] = Pairing.G1Point( \n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 104028078850975554065172701281783302003220555203883119831575537681421753151,\n 19148240629904598794948591359118971959790791697910953160820265703277306346\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[9] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - Renewable\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew their attestations\n **/\n\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base, Attester {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(Request calldata request, bytes calldata)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n HydraS1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used and not a renewal (e.g destination different that last)\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0) && currentDestination != request.destination) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\n return ticketIdentifier;\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/core/AttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\nimport {Attestation, AttestationData} from './libs/Structs.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Attestations Registry\n * @author Sismo\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\n * Only authorized attestations issuers can record attestation in the registry\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\n * For more information: https://attestations-registry.docs.sismo.io\n\n * For each attestation recorded, a badge is received by the user\n * The badge is the Non transferrable NFT representation of an attestation \n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\n * It enables off-chain apps such as opensea to catch the \"shadow mint\" of the badge\n **/\ncontract AttestationsRegistry is\n AttestationsRegistryState,\n IAttestationsRegistry,\n AttestationsRegistryConfigLogic\n{\n IBadges immutable BADGES;\n\n /**\n * @dev Constructor.\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @param badgesAddress Stateless ERC1155 Badges contract\n */\n constructor(address owner, address badgesAddress) {\n initialize(owner);\n BADGES = IBadges(badgesAddress);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n */\n function initialize(address owner) public initializer {\n _transferOwnership(owner);\n }\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\n address issuer = _msgSender();\n for (uint256 i = 0; i < attestations.length; i++) {\n if (!_isAuthorized(issuer, attestations[i].collectionId))\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\n\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\n attestations[i].owner\n ].value;\n\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\n attestations[i].issuer,\n attestations[i].value,\n attestations[i].timestamp,\n attestations[i].extraData\n );\n\n _triggerBadgeTransferEvent(\n attestations[i].collectionId,\n attestations[i].owner,\n previousAttestationValue,\n attestations[i].value\n );\n emit AttestationRecorded(attestations[i]);\n }\n }\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds)\n external\n override\n whenNotPaused\n {\n if (owners.length != collectionIds.length)\n revert OwnersAndCollectionIdsLengthMismatch(owners, collectionIds);\n\n address issuer = _msgSender();\n for (uint256 i = 0; i < owners.length; i++) {\n AttestationData memory attestationData = _attestationsData[collectionIds[i]][owners[i]];\n\n if (!_isAuthorized(issuer, collectionIds[i]))\n revert IssuerNotAuthorized(issuer, collectionIds[i]);\n delete _attestationsData[collectionIds[i]][owners[i]];\n\n _triggerBadgeTransferEvent(collectionIds[i], owners[i], attestationData.value, 0);\n\n emit AttestationDeleted(\n Attestation(\n collectionIds[i],\n owners[i],\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n )\n );\n }\n }\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner)\n external\n view\n override\n returns (bool)\n {\n return _getAttestationValue(collectionId, owner) != 0;\n }\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(uint256 collectionId, address owner)\n external\n view\n override\n returns (AttestationData memory)\n {\n return _getAttestationData(collectionId, owner);\n }\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner)\n external\n view\n override\n returns (uint256)\n {\n return _getAttestationValue(collectionId, owner);\n }\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(uint256 collectionId, address owner)\n external\n view\n override\n returns (\n address,\n uint256,\n uint32,\n bytes memory\n )\n {\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\n return (\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n );\n }\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(uint256 collectionId, address owner)\n external\n view\n override\n returns (bytes memory)\n {\n return _attestationsData[collectionId][owner].extraData;\n }\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(uint256 collectionId, address owner)\n external\n view\n override\n returns (address)\n {\n return _attestationsData[collectionId][owner].issuer;\n }\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(uint256 collectionId, address owner)\n external\n view\n override\n returns (uint32)\n {\n return _attestationsData[collectionId][owner].timestamp;\n }\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n override\n returns (AttestationData[] memory)\n {\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\n }\n return attestationsDataArray;\n }\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n override\n returns (uint256[] memory)\n {\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\n }\n return attestationsValues;\n }\n\n /**\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\n * It enables off-chain apps such as opensea to catch the \"shadow mints/burns\" of badges\n */\n function _triggerBadgeTransferEvent(\n uint256 badgeTokenId,\n address owner,\n uint256 previousValue,\n uint256 newValue\n ) internal {\n bool isGreaterValue = newValue > previousValue;\n address operator = address(this);\n address from = isGreaterValue ? address(0) : owner;\n address to = isGreaterValue ? owner : address(0);\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\n\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\n }\n\n function _getAttestationData(uint256 collectionId, address owner)\n internal\n view\n returns (AttestationData memory)\n {\n return (_attestationsData[collectionId][owner]);\n }\n\n function _getAttestationValue(uint256 collectionId, address owner)\n internal\n view\n returns (uint256)\n {\n return _attestationsData[collectionId][owner].value;\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/mumbai/.chainId b/deployments/mumbaiTestnet/.chainId similarity index 100% rename from deployments/mumbai/.chainId rename to deployments/mumbaiTestnet/.chainId diff --git a/deployments/sandboxPolygon/AttestationsRegistry.json b/deployments/mumbaiTestnet/AttestationsRegistry.json similarity index 98% rename from deployments/sandboxPolygon/AttestationsRegistry.json rename to deployments/mumbaiTestnet/AttestationsRegistry.json index abab2bb..668f16d 100644 --- a/deployments/sandboxPolygon/AttestationsRegistry.json +++ b/deployments/mumbaiTestnet/AttestationsRegistry.json @@ -1,5 +1,5 @@ { - "address": "0xC999390A856e0633f945dD851DeeCE15b533ccA3", + "address": "0xc24F86a8D9f82401b693d4FFaa1DCf3109d88524", "abi": [ { "inputs": [ @@ -1281,84 +1281,84 @@ "type": "function" } ], - "transactionHash": "0x79b653db80a14ae8fe71d69be12e0e92802e84b6f850d3f5c03bb7f649b046d1", + "transactionHash": "0x20b00ff10274a1fa4a01ad301a333886cb4699f1520b452457bb0155deca5f3c", "receipt": { "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0x7FaBc0a314Ad5c92eB3b01c9f2FA2E2115A8ba60", - "transactionIndex": 49, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xfF3A1A1aa75003cD208a27Bc3689507A5fBCaA8C", + "transactionIndex": 12, "gasUsed": "3121566", - "logsBloom": "0x00000000000000200000000000000000002000000000000000800000000000000000000000000000000000000000000000008000000000000000000000000000800000000000000000000002000000800001000000000000000100000000000100000000020000000000000000000800000000010000000080000000000000400000000000010000000000100000000000000000000080000000000001000000200000000000000000000000000400000000000000000000000000000000004000000000000000040001000000040000000000000000000000100004000020000000000000000400000000000000000000000000000000000000000000100000", - "blockHash": "0xfe05756158e9e9080318ae0e64c949f013e6b306a57020b8d478315b272685e7", - "transactionHash": "0x79b653db80a14ae8fe71d69be12e0e92802e84b6f850d3f5c03bb7f649b046d1", + "logsBloom": "0x00000000000000020000000000000000000000000000000002800000000000000000000000000000000000000000000000008000000000000000000000000000000000000040000000000000000000800001000000000000000100000000000200000000020000000000000000000800000000000000000080000000000000400000000000000000000000000000000000000000000080000000000040000000200000000000000020000000000402000001000000000000000000000000004000008000000000000001000000040000000000000000000000100000000020000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x83dcfd6f0af1ebb3e768085e3f9d375dfde36624eadc2f0b4e18199d52b4a68f", + "transactionHash": "0x20b00ff10274a1fa4a01ad301a333886cb4699f1520b452457bb0155deca5f3c", "logs": [ { - "transactionIndex": 49, - "blockNumber": 36626268, - "transactionHash": "0x79b653db80a14ae8fe71d69be12e0e92802e84b6f850d3f5c03bb7f649b046d1", - "address": "0x7FaBc0a314Ad5c92eB3b01c9f2FA2E2115A8ba60", + "transactionIndex": 12, + "blockNumber": 29771738, + "transactionHash": "0x20b00ff10274a1fa4a01ad301a333886cb4699f1520b452457bb0155deca5f3c", + "address": "0xfF3A1A1aa75003cD208a27Bc3689507A5fBCaA8C", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 242, - "blockHash": "0xfe05756158e9e9080318ae0e64c949f013e6b306a57020b8d478315b272685e7" + "logIndex": 45, + "blockHash": "0x83dcfd6f0af1ebb3e768085e3f9d375dfde36624eadc2f0b4e18199d52b4a68f" }, { - "transactionIndex": 49, - "blockNumber": 36626268, - "transactionHash": "0x79b653db80a14ae8fe71d69be12e0e92802e84b6f850d3f5c03bb7f649b046d1", - "address": "0x7FaBc0a314Ad5c92eB3b01c9f2FA2E2115A8ba60", + "transactionIndex": 12, + "blockNumber": 29771738, + "transactionHash": "0x20b00ff10274a1fa4a01ad301a333886cb4699f1520b452457bb0155deca5f3c", + "address": "0xfF3A1A1aa75003cD208a27Bc3689507A5fBCaA8C", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x000000000000000000000000aee4acd5c4bf516330ca8fe11b07206fc6709294" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 243, - "blockHash": "0xfe05756158e9e9080318ae0e64c949f013e6b306a57020b8d478315b272685e7" + "logIndex": 46, + "blockHash": "0x83dcfd6f0af1ebb3e768085e3f9d375dfde36624eadc2f0b4e18199d52b4a68f" }, { - "transactionIndex": 49, - "blockNumber": 36626268, - "transactionHash": "0x79b653db80a14ae8fe71d69be12e0e92802e84b6f850d3f5c03bb7f649b046d1", - "address": "0x7FaBc0a314Ad5c92eB3b01c9f2FA2E2115A8ba60", + "transactionIndex": 12, + "blockNumber": 29771738, + "transactionHash": "0x20b00ff10274a1fa4a01ad301a333886cb4699f1520b452457bb0155deca5f3c", + "address": "0xfF3A1A1aa75003cD208a27Bc3689507A5fBCaA8C", "topics": [ "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 244, - "blockHash": "0xfe05756158e9e9080318ae0e64c949f013e6b306a57020b8d478315b272685e7" + "logIndex": 47, + "blockHash": "0x83dcfd6f0af1ebb3e768085e3f9d375dfde36624eadc2f0b4e18199d52b4a68f" }, { - "transactionIndex": 49, - "blockNumber": 36626268, - "transactionHash": "0x79b653db80a14ae8fe71d69be12e0e92802e84b6f850d3f5c03bb7f649b046d1", + "transactionIndex": 12, + "blockNumber": 29771738, + "transactionHash": "0x20b00ff10274a1fa4a01ad301a333886cb4699f1520b452457bb0155deca5f3c", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x000000000000000000000000b95d435df3f8b2a8d8b9c2b7c8766c9ae6ed8cc9" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" ], - "data": "0x0000000000000000000000000000000000000000000000000170a681c10cf0b0000000000000000000000000000000000000000000000000bdc13dbd227cad9c000000000000000000000000000000000000000000004cf4c9d8a66f622dbf6a000000000000000000000000000000000000000000000000bc50973b616fbcec000000000000000000000000000000000000000000004cf4cb494cf1233ab01a", - "logIndex": 245, - "blockHash": "0xfe05756158e9e9080318ae0e64c949f013e6b306a57020b8d478315b272685e7" + "data": "0x0000000000000000000000000000000000000000000000000010a292544d1d260000000000000000000000000000000000000000000000001bb2505a5ebf134600000000000000000000000000000000000000000000187add1f02e156f142700000000000000000000000000000000000000000000000001ba1adc80a71f62000000000000000000000000000000000000000000000187add2fa573ab3e5f96", + "logIndex": 48, + "blockHash": "0x83dcfd6f0af1ebb3e768085e3f9d375dfde36624eadc2f0b4e18199d52b4a68f" } ], - "blockNumber": 36626268, - "cumulativeGasUsed": "11787529", + "blockNumber": 29771738, + "cumulativeGasUsed": "6473318", "status": 1, "byzantium": true }, "args": [ - "0xaee4acd5c4Bf516330ca8fe11B07206fC6709294", - "0x71a7089C56DFf528f330Bc0116C0917cd05B51Fc" + "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "0xc3Ee5Aad6Fb987cF69a2EE7B3B2c92E21E42F34B" ], - "numDeployments": 9, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"badgesAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ArgsLengthDoesNotMatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"}],\"name\":\"AttesterNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"}],\"name\":\"AttributeAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"}],\"name\":\"AttributeDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rangeIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedFirstId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedLastId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"FirstId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"IdsMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"IndexOutOfBounds\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"IssuerNotAuthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"}],\"name\":\"OwnersAndCollectionIdsLengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"expectedArrayLength\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rangeIndex\",\"type\":\"uint256\"}],\"name\":\"RangeIndexOutOfBounds\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"value\",\"type\":\"uint8\"}],\"name\":\"ValueOutOfBounds\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationRecorded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeValue\",\"type\":\"uint8\"}],\"name\":\"AttestationsCollectionAttributeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"deletedAttributeName\",\"type\":\"bytes32\"}],\"name\":\"AttributeDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"newAttributeName\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"previousAttributeName\",\"type\":\"bytes32\"}],\"name\":\"AttributeNameUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"IssuerAuthorized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"IssuerUnauthorized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"attributeName\",\"type\":\"bytes32\"}],\"name\":\"NewAttributeCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"attestationsCollectionHasAttribute\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"}],\"name\":\"attestationsCollectionHasAttributes\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"authorizeRange\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"internalType\":\"struct Range[]\",\"name\":\"ranges\",\"type\":\"tuple[]\"}],\"name\":\"authorizeRanges\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"createNewAttribute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"names\",\"type\":\"bytes32[]\"}],\"name\":\"createNewAttributes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"}],\"name\":\"deleteAttestations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"deleteAttribute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"}],\"name\":\"deleteAttributes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationData\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct AttestationData\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"}],\"name\":\"getAttestationDataBatch\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct AttestationData[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationDataTuple\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationIssuer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationTimestamp\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationValue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"}],\"name\":\"getAttestationValueBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"getAttributeValueForAttestationsCollection\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"getAttributesNamesAndValuesForAttestationsCollection\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"}],\"name\":\"getAttributesValuesForAttestationsCollection\",\"outputs\":[{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"hasAttestation\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"isAuthorized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"attestations\",\"type\":\"tuple[]\"}],\"name\":\"recordAttestations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"value\",\"type\":\"uint8\"}],\"name\":\"setAttributeValueForAttestationsCollection\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"},{\"internalType\":\"uint8[]\",\"name\":\"values\",\"type\":\"uint8[]\"}],\"name\":\"setAttributesValuesForAttestationsCollections\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rangeIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"unauthorizeRange\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"internalType\":\"struct Range[]\",\"name\":\"ranges\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256[]\",\"name\":\"rangeIndexes\",\"type\":\"uint256[]\"}],\"name\":\"unauthorizeRanges\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"newName\",\"type\":\"bytes32\"}],\"name\":\"updateAttributeName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"newNames\",\"type\":\"bytes32[]\"}],\"name\":\"updateAttributesName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"attestationsCollectionHasAttribute(uint256,uint8)\":{\"details\":\"Returns whether an attestationsCollection has a specific attribute referenced by its index\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\",\"index\":\"Index of the attribute. Can go from 0 to 63.\"}},\"authorizeRange(address,uint256,uint256)\":{\"details\":\"Authorize an issuer for a specific range\",\"params\":{\"firstCollectionId\":\"First collection Id of the range for which the issuer will be authorized\",\"issuer\":\"Issuer that will be authorized\",\"lastCollectionId\":\"Last collection Id of the range for which the issuer will be authorized\"}},\"authorizeRanges(address,(uint256,uint256)[])\":{\"details\":\"Authorize an issuer for specific ranges\",\"params\":{\"issuer\":\"Issuer that will be authorized\",\"ranges\":\"Ranges for which the issuer will be authorized\"}},\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"badgesAddress\":\"Stateless ERC1155 Badges contract\",\"owner\":\"Owner of the contract, has the right to authorize/unauthorize attestations issuers\"}},\"createNewAttribute(uint8,bytes32)\":{\"details\":\"Create a new attribute.\",\"params\":{\"index\":\"Index of the attribute. Can go from 0 to 63.\",\"name\":\"Name in bytes32 of the attribute\"}},\"deleteAttestations(address[],uint256[])\":{\"details\":\"Delete function to be called by authorized issuers\",\"params\":{\"collectionIds\":\"The collection ids of the attestations to be deleted\",\"owners\":\"The owners of the attestations to be deleted\"}},\"deleteAttribute(uint8)\":{\"details\":\"Delete an existing attribute\",\"params\":{\"index\":\"Index of the attribute. Can go from 0 to 63. The attribute must already exist\"}},\"getAttestationData(uint256,address)\":{\"details\":\"Getter of the data of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationDataBatch(uint256[],address[])\":{\"details\":\"Getter of the data of specific attestations\",\"params\":{\"collectionIds\":\"Collection identifiers of the targeted attestations\",\"owners\":\"Owners of the targeted attestations\"}},\"getAttestationDataTuple(uint256,address)\":{\"details\":\"Getter of the data of a specific attestation as tuple\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationExtraData(uint256,address)\":{\"details\":\"Getter of the extraData of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationIssuer(uint256,address)\":{\"details\":\"Getter of the issuer of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationTimestamp(uint256,address)\":{\"details\":\"Getter of the timestamp of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationValue(uint256,address)\":{\"details\":\"Getter of the value of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationValueBatch(uint256[],address[])\":{\"details\":\"Getter of the values of specific attestations\",\"params\":{\"collectionIds\":\"Collection identifiers of the targeted attestations\",\"owners\":\"Owners of the targeted attestations\"}},\"getAttributeValueForAttestationsCollection(uint256,uint8)\":{\"details\":\"Returns the attribute's value (from 0 to 15) of an attestationsCollection\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\",\"index\":\"Index of the attribute. Can go from 0 to 63.\"}},\"getAttributesNamesAndValuesForAttestationsCollection(uint256)\":{\"details\":\"Returns all the enabled attributes names and their values for a specific attestationsCollection\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\"}},\"hasAttestation(uint256,address)\":{\"details\":\"Returns whether a user has an attestation from a collection\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"initialize(address)\":{\"details\":\"Initialize function, to be called by the proxy delegating calls to this implementation\",\"params\":{\"ownerAddress\":\"Owner of the contract, has the right to authorize/unauthorize attestations issuers\"}},\"isAuthorized(address,uint256)\":{\"details\":\"Returns whether a specific issuer is authorized or not to record in a specific attestations collection\",\"params\":{\"collectionId\":\"Collection Id for which the issuer will be checked\",\"issuer\":\"Issuer to be checked\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pause()\":{\"details\":\"Pauses the registry. Issuers can no longer record or delete attestations\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"recordAttestations((uint256,address,address,uint256,uint32,bytes)[])\":{\"details\":\"Main function to be called by authorized issuers\",\"params\":{\"attestations\":\"Attestations to be recorded (creates a new one or overrides an existing one)\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAttributeValueForAttestationsCollection(uint256,uint8,uint8)\":{\"details\":\"Set a value for an attribute of an attestationsCollection. The attribute should already be created.\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\",\"index\":\"Index of the attribute (must be between 0 and 63)\",\"value\":\"Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unauthorizeRange(address,uint256,uint256,uint256)\":{\"details\":\"Unauthorize an issuer for a specific range\",\"params\":{\"firstCollectionId\":\"First collection Id of the range for which the issuer will be unauthorized\",\"issuer\":\"Issuer that will be unauthorized\",\"lastCollectionId\":\"Last collection Id of the range for which the issuer will be unauthorized\",\"rangeIndex\":\"Index of the range to be unauthorized\"}},\"unauthorizeRanges(address,(uint256,uint256)[],uint256[])\":{\"details\":\"Unauthorize an issuer for specific ranges\",\"params\":{\"issuer\":\"Issuer that will be unauthorized\",\"ranges\":\"Ranges for which the issuer will be unauthorized\"}},\"unpause()\":{\"details\":\"Unpauses the registry\"},\"updateAttributeName(uint8,bytes32)\":{\"details\":\"Update the name of an existing attribute\",\"params\":{\"index\":\"Index of the attribute. Can go from 0 to 63. The attribute must exist\",\"newName\":\"new name in bytes32 of the attribute\"}}},\"title\":\"Attestations Registry\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"Main contract of Sismo, stores all recorded attestations in attestations collections Only authorized attestations issuers can record attestation in the registry Attesters that expect to record in the Attestations Registry must be authorized issuers For more information: https://attestations-registry.docs.sismo.io For each attestation recorded, a badge is received by the user The badge is the Non transferrable NFT representation of an attestation Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts It enables off-chain apps such as opensea to catch the \\\"shadow mint\\\" of the badge*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/AttestationsRegistry.sol\":\"AttestationsRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/core/AttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\\nimport {Attestation, AttestationData} from './libs/Structs.sol';\\nimport {IBadges} from './interfaces/IBadges.sol';\\n\\n/**\\n * @title Attestations Registry\\n * @author Sismo\\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\\n * Only authorized attestations issuers can record attestation in the registry\\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\\n * For more information: https://attestations-registry.docs.sismo.io\\n\\n * For each attestation recorded, a badge is received by the user\\n * The badge is the Non transferrable NFT representation of an attestation \\n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\\n * It enables off-chain apps such as opensea to catch the \\\"shadow mint\\\" of the badge\\n **/\\ncontract AttestationsRegistry is\\n AttestationsRegistryState,\\n IAttestationsRegistry,\\n AttestationsRegistryConfigLogic\\n{\\n uint8 public constant IMPLEMENTATION_VERSION = 3;\\n IBadges immutable BADGES;\\n\\n /**\\n * @dev Constructor.\\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @param badgesAddress Stateless ERC1155 Badges contract\\n */\\n constructor(address owner, address badgesAddress) {\\n BADGES = IBadges(badgesAddress);\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\\n address issuer = _msgSender();\\n for (uint256 i = 0; i < attestations.length; i++) {\\n if (!_isAuthorized(issuer, attestations[i].collectionId))\\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\\n\\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\\n attestations[i].owner\\n ].value;\\n\\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\\n attestations[i].issuer,\\n attestations[i].value,\\n attestations[i].timestamp,\\n attestations[i].extraData\\n );\\n\\n _triggerBadgeTransferEvent(\\n attestations[i].collectionId,\\n attestations[i].owner,\\n previousAttestationValue,\\n attestations[i].value\\n );\\n emit AttestationRecorded(attestations[i]);\\n }\\n }\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(\\n address[] calldata owners,\\n uint256[] calldata collectionIds\\n ) external override whenNotPaused {\\n if (owners.length != collectionIds.length)\\n revert OwnersAndCollectionIdsLengthMismatch(owners, collectionIds);\\n\\n address issuer = _msgSender();\\n for (uint256 i = 0; i < owners.length; i++) {\\n AttestationData memory attestationData = _attestationsData[collectionIds[i]][owners[i]];\\n\\n if (!_isAuthorized(issuer, collectionIds[i]))\\n revert IssuerNotAuthorized(issuer, collectionIds[i]);\\n delete _attestationsData[collectionIds[i]][owners[i]];\\n\\n _triggerBadgeTransferEvent(collectionIds[i], owners[i], attestationData.value, 0);\\n\\n emit AttestationDeleted(\\n Attestation(\\n collectionIds[i],\\n owners[i],\\n attestationData.issuer,\\n attestationData.value,\\n attestationData.timestamp,\\n attestationData.extraData\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (bool) {\\n return _getAttestationValue(collectionId, owner) != 0;\\n }\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (AttestationData memory) {\\n return _getAttestationData(collectionId, owner);\\n }\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (uint256) {\\n return _getAttestationValue(collectionId, owner);\\n }\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (address, uint256, uint32, bytes memory) {\\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\\n return (\\n attestationData.issuer,\\n attestationData.value,\\n attestationData.timestamp,\\n attestationData.extraData\\n );\\n }\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (bytes memory) {\\n return _attestationsData[collectionId][owner].extraData;\\n }\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (address) {\\n return _attestationsData[collectionId][owner].issuer;\\n }\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (uint32) {\\n return _attestationsData[collectionId][owner].timestamp;\\n }\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view override returns (AttestationData[] memory) {\\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\\n }\\n return attestationsDataArray;\\n }\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view override returns (uint256[] memory) {\\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\\n }\\n return attestationsValues;\\n }\\n\\n /**\\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\\n * It enables off-chain apps such as opensea to catch the \\\"shadow mints/burns\\\" of badges\\n */\\n function _triggerBadgeTransferEvent(\\n uint256 badgeTokenId,\\n address owner,\\n uint256 previousValue,\\n uint256 newValue\\n ) internal {\\n bool isGreaterValue = newValue > previousValue;\\n address operator = address(this);\\n address from = isGreaterValue ? address(0) : owner;\\n address to = isGreaterValue ? owner : address(0);\\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\\n\\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\\n }\\n\\n function _getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) internal view returns (AttestationData memory) {\\n return (_attestationsData[collectionId][owner]);\\n }\\n\\n function _getAttestationValue(\\n uint256 collectionId,\\n address owner\\n ) internal view returns (uint256) {\\n return _attestationsData[collectionId][owner].value;\\n }\\n}\\n\",\"keccak256\":\"0xc21afe30d8096d2bab3683ca28b2533f99f53fa20a1f2c13aa44f1d46ecb9ae6\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IBadges.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Interface for Badges contract\\n * @author Sismo\\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\\n * The associated attestations registry triggers TransferSingle events from this contract\\n * It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms\\n */\\ninterface IBadges {\\n error BadgesNonTransferrable();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(string memory uri, address owner) external;\\n\\n /**\\n * @dev Main function of the ERC1155 badge\\n * The balance of a user is equal to the value of the underlying attestation.\\n * attestationCollectionId == badgeId\\n * @param account Address to check badge balance (= value of attestation)\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\\n * @param operator who is calling the TransferEvent\\n * @param from address(0) if minting, address of the badge holder if burning\\n * @param to address of the badge holder is minting, address(0) if burning\\n * @param id badgeId for which to trigger the event\\n * @param value minted/burned balance\\n */\\n function triggerTransferEvent(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 value\\n ) external;\\n\\n /**\\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\\n * @param attestationsRegistry new attestations registry address\\n */\\n function setAttestationsRegistry(address attestationsRegistry) external;\\n\\n /**\\n * @dev Set the URI. Can only be called by owner (default admin)\\n * @param uri new attestations registry address\\n */\\n function setUri(string memory uri) external;\\n\\n /**\\n * @dev Getter of the attestations registry\\n */\\n function getAttestationsRegistry() external view returns (address);\\n\\n /**\\n * @dev Getter of the badge issuer\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeIssuer(address account, uint256 id) external view returns (address);\\n\\n /**\\n * @dev Getter of the badge timestamp\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the value of a specific badge attribute\\n * @param id Badge Id to check (= attestationCollectionId)\\n * @param index Index of the attribute\\n */\\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);\\n\\n /**\\n * @dev Getter of all badge attributes and their values for a specific badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getAttributesNamesAndValuesForBadge(\\n uint256 id\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n}\\n\",\"keccak256\":\"0xd6bdfc887ef15ee022eb05d89dbe2e2938ee6c0a55a55f8db527ef650242c6bb\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport './OwnableLogic.sol';\\nimport './PausableLogic.sol';\\nimport './InitializableLogic.sol';\\nimport './AttestationsRegistryState.sol';\\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\\nimport {Bitmap256Bit} from '../utils/Bitmap256Bit.sol';\\n\\n/**\\n * @title Attestations Registry Config Logic contract\\n * @author Sismo\\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\\n **/\\ncontract AttestationsRegistryConfigLogic is\\n AttestationsRegistryState,\\n IAttestationsRegistryConfigLogic,\\n OwnableLogic,\\n PausableLogic,\\n InitializableLogic\\n{\\n using RangeUtils for Range[];\\n using Bitmap256Bit for uint256;\\n using Bitmap256Bit for uint8;\\n\\n /******************************************\\n *\\n * ATTESTATION REGISTRY WRITE ACCESS MANAGEMENT (ISSUERS)\\n *\\n *****************************************/\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external override onlyOwner {\\n _pause();\\n }\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external override onlyOwner {\\n _unpause();\\n }\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external override onlyOwner {\\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\\n }\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external override onlyOwner {\\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\\n }\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\\n }\\n }\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external override onlyOwner {\\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\\n return _isAuthorized(issuer, collectionId);\\n }\\n\\n /******************************************\\n *\\n * ATTRIBUTES CONFIG LOGIC\\n *\\n *****************************************/\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) public onlyOwner {\\n index._checkIndexIsValid();\\n if (_isAttributeCreated(index)) {\\n revert AttributeAlreadyExists(index);\\n }\\n _createNewAttribute(index, name);\\n }\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external onlyOwner {\\n if (indices.length != names.length) {\\n revert ArgsLengthDoesNotMatch();\\n }\\n\\n for (uint256 i = 0; i < indices.length; i++) {\\n createNewAttribute(indices[i], names[i]);\\n }\\n }\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) public onlyOwner {\\n index._checkIndexIsValid();\\n if (!_isAttributeCreated(index)) {\\n revert AttributeDoesNotExist(index);\\n }\\n _updateAttributeName(index, newName);\\n }\\n\\n function updateAttributesName(\\n uint8[] memory indices,\\n bytes32[] memory newNames\\n ) external onlyOwner {\\n if (indices.length != newNames.length) {\\n revert ArgsLengthDoesNotMatch();\\n }\\n\\n for (uint256 i = 0; i < indices.length; i++) {\\n updateAttributeName(indices[i], newNames[i]);\\n }\\n }\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must already exist\\n */\\n function deleteAttribute(uint8 index) public onlyOwner {\\n index._checkIndexIsValid();\\n if (!_isAttributeCreated(index)) {\\n revert AttributeDoesNotExist(index);\\n }\\n _deleteAttribute(index);\\n }\\n\\n function deleteAttributes(uint8[] memory indices) external onlyOwner {\\n for (uint256 i = 0; i < indices.length; i++) {\\n deleteAttribute(indices[i]);\\n }\\n }\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) public onlyOwner {\\n index._checkIndexIsValid();\\n\\n if (!_isAttributeCreated(index)) {\\n revert AttributeDoesNotExist(index);\\n }\\n\\n _setAttributeForAttestationsCollection(collectionId, index, value);\\n }\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external onlyOwner {\\n if (collectionIds.length != indices.length || collectionIds.length != values.length) {\\n revert ArgsLengthDoesNotMatch();\\n }\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n setAttributeValueForAttestationsCollection(collectionIds[i], indices[i], values[i]);\\n }\\n }\\n\\n /**\\n * @dev Returns the attribute's value (from 0 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index\\n ) public view returns (uint8) {\\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\\n collectionId\\n );\\n return currentAttributesValues._get(index);\\n }\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory) {\\n uint8[] memory attributesValues = new uint8[](indices.length);\\n for (uint256 i = 0; i < indices.length; i++) {\\n attributesValues[i] = getAttributeValueForAttestationsCollection(collectionId, indices[i]);\\n }\\n return attributesValues;\\n }\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) public view returns (bool) {\\n uint256 currentAttributeValues = _getAttributesValuesBitmapForAttestationsCollection(\\n collectionId\\n );\\n return currentAttributeValues._get(index) > 0;\\n }\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool) {\\n for (uint256 i = 0; i < indices.length; i++) {\\n if (!attestationsCollectionHasAttribute(collectionId, indices[i])) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) public view returns (bytes32[] memory, uint8[] memory) {\\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\\n collectionId\\n );\\n\\n (\\n uint8[] memory indices,\\n uint8[] memory values,\\n uint8 nbOfNonZeroValues\\n ) = currentAttributesValues._getAllNonZeroValues();\\n\\n bytes32[] memory attributesNames = new bytes32[](nbOfNonZeroValues);\\n uint8[] memory attributesValues = new uint8[](nbOfNonZeroValues);\\n for (uint8 i = 0; i < nbOfNonZeroValues; i++) {\\n attributesNames[i] = _attributesNames[indices[i]];\\n attributesValues[i] = values[i];\\n }\\n\\n return (attributesNames, attributesValues);\\n }\\n\\n /*****************************\\n *\\n * INTERNAL FUNCTIONS\\n *\\n *****************************/\\n\\n function _authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) internal {\\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\\n _authorizedRanges[issuer].push(newRange);\\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\\n }\\n\\n function _unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) internal onlyOwner {\\n if (rangeIndex >= _authorizedRanges[issuer].length)\\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\\n\\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\\n revert IdsMismatch(\\n issuer,\\n rangeIndex,\\n expectedFirstId,\\n expectedLastId,\\n firstCollectionId,\\n lastCollectionId\\n );\\n\\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\\n _authorizedRanges[issuer].length - 1\\n ];\\n _authorizedRanges[issuer].pop();\\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\\n }\\n\\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\\n return _authorizedRanges[issuer]._includes(collectionId);\\n }\\n\\n function _setAttributeForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) internal {\\n uint256 currentAttributes = _getAttributesValuesBitmapForAttestationsCollection(collectionId);\\n\\n _attestationsCollectionAttributesValuesBitmap[collectionId] = currentAttributes._set(\\n index,\\n value\\n );\\n\\n emit AttestationsCollectionAttributeSet(collectionId, index, value);\\n }\\n\\n function _createNewAttribute(uint8 index, bytes32 name) internal {\\n _attributesNames[index] = name;\\n\\n emit NewAttributeCreated(index, name);\\n }\\n\\n function _updateAttributeName(uint8 index, bytes32 newName) internal {\\n bytes32 previousName = _attributesNames[index];\\n\\n _attributesNames[index] = newName;\\n\\n emit AttributeNameUpdated(index, newName, previousName);\\n }\\n\\n function _deleteAttribute(uint8 index) internal {\\n bytes32 deletedName = _attributesNames[index];\\n\\n delete _attributesNames[index];\\n\\n emit AttributeDeleted(index, deletedName);\\n }\\n\\n function _getAttributesValuesBitmapForAttestationsCollection(\\n uint256 collectionId\\n ) internal view returns (uint256) {\\n return _attestationsCollectionAttributesValuesBitmap[collectionId];\\n }\\n\\n function _isAttributeCreated(uint8 index) internal view returns (bool) {\\n if (_attributesNames[index] == 0) {\\n return false;\\n }\\n return true;\\n }\\n}\\n\",\"keccak256\":\"0xa48b3131a3870684389282cb863a34734c67194d7f50d266ed8421114b3d786a\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/AttestationsRegistryState.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Range} from '../utils/RangeLib.sol';\\nimport {Attestation, AttestationData} from '../Structs.sol';\\n\\ncontract AttestationsRegistryState {\\n /*******************************************************\\n Storage layout:\\n 19 slots for config\\n 4 currently used for _initialized, _initializing, _paused, _owner\\n 15 place holders\\n 16 slots for logic\\n 3 currently used for _authorizedRanges, _attestationsCollectionAttributesValuesBitmap, _attributesNames\\n 13 place holders\\n 1 slot for _attestationsData \\n *******************************************************/\\n\\n // main config\\n // changed `_initialized` from bool to uint8\\n // as we were using OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n // and changed to OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n // PR: https://github.com/sismo-core/sismo-protocol/pull/41\\n uint8 internal _initialized;\\n bool internal _initializing;\\n bool internal _paused;\\n address internal _owner;\\n // keeping some space for future\\n uint256[15] private _placeHoldersAdmin;\\n\\n // storing the authorized ranges for each attesters\\n mapping(address => Range[]) internal _authorizedRanges;\\n // Storing the attributes values used for each attestations collection\\n // Each attribute value is an hexadecimal\\n mapping(uint256 => uint256) internal _attestationsCollectionAttributesValuesBitmap;\\n // Storing the attribute name for each attributes index\\n mapping(uint8 => bytes32) internal _attributesNames;\\n // keeping some space for future\\n uint256[13] private _placeHoldersConfig;\\n // storing the data of attestations\\n // =collectionId=> =owner=> attestationData\\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\\n}\\n\",\"keccak256\":\"0xabd7a629901a128cc32f80102ce06db228a76bd04f27818ccaf54827921eb149\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/InitializableLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport '../utils/Address.sol';\\nimport './AttestationsRegistryState.sol';\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract InitializableLogic is AttestationsRegistryState {\\n // only diff with oz\\n // /**\\n // * @dev Indicates that the contract has been initialized.\\n // */\\n // bool private _initialized;\\n\\n // /**\\n // * @dev Indicates that the contract is in the process of being initialized.\\n // */\\n // bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) ||\\n (!Address.isContract(address(this)) && _initialized == 1),\\n 'Initializable: contract is already initialized'\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(\\n !_initializing && _initialized < version,\\n 'Initializable: contract is already initialized'\\n );\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, 'Initializable: contract is not initializing');\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, 'Initializable: contract is initializing');\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x64d931c5e29318bd4ae2ec44b3be45783ad7ad20431594bbcb9ae4e2014bc5ef\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/OwnableLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport '../utils/Context.sol';\\nimport './AttestationsRegistryState.sol';\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n // This is the only diff with OZ contract\\n // address private _owner;\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x74ff8ebdd6ad706a45354f1045ef623840aa1dbde37874dde2b6bfa498e0bdb3\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/PausableLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport '../utils/Context.sol';\\nimport './AttestationsRegistryState.sol';\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableLogic is Context, AttestationsRegistryState {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n // this is the only diff with OZ contract\\n // bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n require(!paused(), 'Pausable: paused');\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n require(paused(), 'Pausable: not paused');\\n _;\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0x234c48f5eb48bb15b6c2535428f1e28e172bc2c6fbf58c99ba7b3ca75e884c60\",\"license\":\"MIT\"},\"contracts/core/libs/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, 'Address: insufficient balance');\\n\\n (bool success, ) = recipient.call{value: amount}('');\\n require(success, 'Address: unable to send value, recipient may have reverted');\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, 'Address: low-level call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, 'Address: insufficient balance for call');\\n require(isContract(target), 'Address: call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data\\n ) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, 'Address: low-level static call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), 'Address: static call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), 'Address: delegate call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xdbca640e165333604a6121b07d206eea2b596dd3c3bb4d62caa436a05ac1d91d\",\"license\":\"MIT\"},\"contracts/core/libs/utils/Bitmap256Bit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/*\\n * The 256-bit bitmap is structured in 64 chuncks of 4 bits each.\\n * The 4 bits can encode any value from 0 to 15.\\n\\n chunck63 chunck2 chunck1 chunck0\\n bits bits bits bits \\n \\u250c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510 \\u250c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u252c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u252c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510\\n \\u2502 1 1 1 1 \\u2502 .... \\u2502 1 0 1 1 \\u2502 0 0 0 0 \\u2502 0 0 0 1 \\u2502\\n \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518 \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2534\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2534\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518\\n value 15 value 11 value 0 value 1\\n\\n * A chunck index must be between 0 and 63.\\n * A value must be between 0 and 15.\\n **/\\n\\nlibrary Bitmap256Bit {\\n uint256 constant MAX_INT = 2 ** 256 - 1;\\n\\n error IndexOutOfBounds(uint8 index);\\n error ValueOutOfBounds(uint8 value);\\n\\n /**\\n * @dev Return the value at a given index of a 256-bit bitmap\\n * @param index index where the value can be found. Can be between 0 and 63\\n */\\n function _get(uint256 self, uint8 index) internal pure returns (uint8) {\\n uint256 currentValues = self;\\n // Get the encoded 4-bit value by right shifting to the `index` position\\n uint256 shifted = currentValues >> (4 * index);\\n // Get the value by only masking the last 4 bits with an AND operator\\n return uint8(shifted & (2 ** 4 - 1));\\n }\\n\\n /**\\n * @dev Set a value at a chosen index in a 256-bit bitmap\\n * @param index index where the value will be stored. Can be between 0 and 63\\n * @param value value to store. Can be between 0 and 15\\n */\\n function _set(uint256 self, uint8 index, uint8 value) internal pure returns (uint256) {\\n _checkIndexIsValid(index);\\n _checkValueIsValid(value);\\n\\n uint256 currentValues = self;\\n // 1. first we need to remove the current value for the inputed `index`\\n // Left Shift 4 bits mask (1111 mask) to the `index` position\\n uint256 mask = (2 ** 4 - 1) << (4 * index);\\n // Apply a XOR operation to obtain a mask with all bits set to 1 except the 4 bits that we want to remove\\n uint256 negativeMask = MAX_INT ^ mask;\\n // Apply a AND operation between the current values and the negative mask to remove the wanted bits\\n uint256 newValues = currentValues & negativeMask;\\n\\n // 2. We set the new value wanted at the `index` position\\n // Create the 4 bits encoding the new value and left shift them to the `index` position\\n uint256 newValueMask = uint256(value) << (4 * index);\\n // Apply an OR operation between the current values and the newValueMask to reference new value\\n return newValues | newValueMask;\\n }\\n\\n /**\\n * @dev Get all the non-zero values in a 256-bit bitmap\\n * @param self a 256-bit bitmap\\n */\\n function _getAllNonZeroValues(\\n uint256 self\\n ) internal pure returns (uint8[] memory, uint8[] memory, uint8) {\\n uint8[] memory indices = new uint8[](64);\\n uint8[] memory values = new uint8[](64);\\n uint8 nbOfNonZeroValues = 0;\\n for (uint8 i = 0; i < 63; i++) {\\n uint8 value = _get(self, i);\\n if (value > 0) {\\n indices[nbOfNonZeroValues] = i;\\n values[nbOfNonZeroValues] = value;\\n nbOfNonZeroValues++;\\n }\\n }\\n return (indices, values, nbOfNonZeroValues);\\n }\\n\\n /**\\n * @dev Check if the index is valid (is between 0 and 63)\\n * @param index index of a chunck\\n */\\n function _checkIndexIsValid(uint8 index) internal pure {\\n if (index > 63) {\\n revert IndexOutOfBounds(index);\\n }\\n }\\n\\n /**\\n * @dev Check if the value is valid (is between 0 and 15)\\n * @param value value to encode in a chunck\\n */\\n function _checkValueIsValid(uint8 value) internal pure {\\n if (value > 15) {\\n revert ValueOutOfBounds(value);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xac6ca38e106fb9e999b0c765dba0f8894697c3aead9459ffeab6b32e3560b39e\",\"license\":\"MIT\"},\"contracts/core/libs/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2dba7215628ceb3bb6f28422c7ca48d79615dd7aa8ba54978d4d8cad996f57e\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x60a06040523480156200001157600080fd5b506040516200393538038062003935833981016040819052620000349162000209565b6200003f336200006b565b6000805462ff0000191690556001600160a01b0381166080526200006382620000c8565b505062000241565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600390610100900460ff16158015620000eb575060005460ff8083169116105b620001535760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff83161761010017815562000181600054630100000090046001600160a01b031690565b6001600160a01b03161480620001965750303b155b15620001a757620001a7826200006b565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b80516001600160a01b03811681146200020457600080fd5b919050565b600080604083850312156200021d57600080fd5b6200022883620001ec565b91506200023860208401620001ec565b90509250929050565b6080516136d86200025d600039600061258301526136d86000f3fe608060405234801561001057600080fd5b50600436106102275760003560e01c80637ffe93fc11610130578063b8865673116100b8578063dc873d011161007c578063dc873d0114610566578063e78d54bb14610586578063e972f91014610599578063ebc5c093146105ac578063f2fde38b146105bf57600080fd5b8063b8865673146104e5578063c06d5db6146104f8578063c4d66de81461050b578063c7da9aa61461051e578063da5d314b1461055357600080fd5b806384c2ad82116100ff57806384c2ad821461044d5780638c3c9e321461046d5780638da5cb5b1461048e578063aad9a979146104bf578063b1cb1662146104d257600080fd5b80637ffe93fc1461040c578063811a6af71461041f57806381213f22146104325780638456cb591461044557600080fd5b8063436a76f3116101b35780636d7fbb67116101825780636d7fbb67146103a4578063715018a6146103c4578063754b377c146103cc5780637cc920b4146103e65780637cde0fe2146103f957600080fd5b8063436a76f31461033f5780635657f0361461035f5780635c975abb1461038057806364fff83c1461039157600080fd5b80631538ff08116101fa5780631538ff08146102db578063181dfdff146102ee5780632972b0f0146103015780633be1ced7146103145780633f4ba83a1461033757600080fd5b8063011023901461022c57806305b374211461025457806314067f8b1461026957806315027bda146102bb575b600080fd5b61023f61023a366004612932565b6105d2565b60405190151581526020015b60405180910390f35b61026761026236600461296f565b6105e9565b005b6102a6610277366004612932565b6000918252602080805260408084206001600160a01b0393909316845291905290206002015463ffffffff1690565b60405163ffffffff909116815260200161024b565b6102ce6102c9366004612a95565b610669565b60405161024b9190612be4565b6102676102e9366004612ca8565b61075a565b6102676102fc366004612dd2565b61080d565b61023f61030f366004612e45565b6108cd565b610327610322366004612932565b6108e0565b60405161024b9493929190612e61565b6102676109f6565b61035261034d366004612e9e565b610a32565b60405161024b9190612f22565b61037261036d366004612f35565b610ae0565b60405161024b929190612f4e565b60005462010000900460ff1661023f565b61026761039f366004612f9b565b610c65565b6103b76103b2366004612932565b610cd7565b60405161024b9190612fcf565b610267610d8f565b6103d4600381565b60405160ff909116815260200161024b565b6102676103f4366004612fe2565b610dcb565b61026761040736600461305f565b610ea2565b61026761041a366004613092565b610edf565b61026761042d3660046130f8565b610f54565b61023f610440366004612e9e565b611330565b61026761138a565b61046061045b366004612932565b6113c4565b60405161024b9190613163565b61048061047b366004612932565b6113f1565b60405190815260200161024b565b6104a7600054630100000090046001600160a01b031690565b6040516001600160a01b03909116815260200161024b565b6102676104cd36600461296f565b6113fd565b6102676104e0366004612ca8565b611471565b6102676104f3366004613176565b61151f565b6102676105063660046131b9565b6115b4565b6102676105193660046131f2565b6115f2565b6104a761052c366004612932565b6000918252602080805260408084206001600160a01b039384168552909152909120541690565b61023f61056136600461320d565b61170c565b610579610574366004612a95565b611733565b60405161024b9190613230565b610267610594366004613274565b6117f3565b6103d46105a736600461320d565b611867565b6102676105ba3660046132b0565b611888565b6102676105cd3660046131f2565b611ce0565b60006105de8383611d80565b151590505b92915050565b6000546001600160a01b0363010000009091041633146106245760405162461bcd60e51b815260040161061b906132f1565b60405180910390fd5b6106308260ff16611da9565b61063982611dd3565b61065b5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6106658282611dfc565b5050565b6060600083516001600160401b0381111561068657610686612999565b6040519080825280602002602001820160405280156106d757816020015b60408051608081018252600080825260208083018290529282015260608082015282526000199092019101816106a45790505b50905060005b8451811015610752576107228582815181106106fb576106fb613326565b602002602001015185838151811061071557610715613326565b6020026020010151611e5c565b82828151811061073457610734613326565b6020026020010181905250808061074a90613352565b9150506106dd565b509392505050565b6000546001600160a01b03630100000090910416331461078c5760405162461bcd60e51b815260040161061b906132f1565b80518251146107ae57604051636e37235160e11b815260040160405180910390fd5b60005b8251811015610808576107f68382815181106107cf576107cf613326565b60200260200101518383815181106107e9576107e9613326565b60200260200101516105e9565b8061080081613352565b9150506107b1565b505050565b6000546001600160a01b03630100000090910416331461083f5760405162461bcd60e51b815260040161061b906132f1565b60005b81518110156108c7576108b5848284848151811061086257610862613326565b6020026020010151610874919061336b565b85848151811061088657610886613326565b6020026020010151600001518685815181106108a4576108a4613326565b602002602001015160200151611f6b565b806108bf81613352565b915050610842565b50505050565b60006108d9838361220a565b9392505050565b6000828152602080805260408083206001600160a01b038086168552908352818420825160808101845281549092168252600181015493820193909352600283015463ffffffff1691810191909152600382018054849384936060938593919291838601919061094f90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461097b90613382565b80156109c85780601f1061099d576101008083540402835291602001916109c8565b820191906000526020600020905b8154815290600101906020018083116109ab57829003601f168201915b505050919092525050815160208301516040840151606090940151919b909a50929850965090945050505050565b6000546001600160a01b036301000000909104163314610a285760405162461bcd60e51b815260040161061b906132f1565b610a3061222c565b565b6060600082516001600160401b03811115610a4f57610a4f612999565b604051908082528060200260200182016040528015610a78578160200160208202803683370190505b50905060005b835181101561075257610aaa85858381518110610a9d57610a9d613326565b6020026020010151611867565b828281518110610abc57610abc613326565b60ff9092166020928302919091019091015280610ad881613352565b915050610a7e565b6000818152601160205260408120546060918291908080610b00846122c7565b92509250925060008160ff166001600160401b03811115610b2357610b23612999565b604051908082528060200260200182016040528015610b4c578160200160208202803683370190505b50905060008260ff166001600160401b03811115610b6c57610b6c612999565b604051908082528060200260200182016040528015610b95578160200160208202803683370190505b50905060005b8360ff168160ff161015610c565760126000878360ff1681518110610bc257610bc2613326565b602002602001015160ff1660ff16815260200190815260200160002054838260ff1681518110610bf457610bf4613326565b602002602001018181525050848160ff1681518110610c1557610c15613326565b6020026020010151828260ff1681518110610c3257610c32613326565b60ff9092166020928302919091019091015280610c4e816133bc565b915050610b9b565b50909890975095505050505050565b6000546001600160a01b036301000000909104163314610c975760405162461bcd60e51b815260040161061b906132f1565b60005b815181101561066557610cc5828281518110610cb857610cb8613326565b6020026020010151610edf565b80610ccf81613352565b915050610c9a565b6000828152602080805260408083206001600160a01b03851684529091529020600301805460609190610d0990613382565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3590613382565b8015610d825780601f10610d5757610100808354040283529160200191610d82565b820191906000526020600020905b815481529060010190602001808311610d6557829003601f168201915b5050505050905092915050565b6000546001600160a01b036301000000909104163314610dc15760405162461bcd60e51b815260040161061b906132f1565b610a3060006123bc565b6000546001600160a01b036301000000909104163314610dfd5760405162461bcd60e51b815260040161061b906132f1565b81518351141580610e1057508051835114155b15610e2e57604051636e37235160e11b815260040160405180910390fd5b60005b83518110156108c757610e90848281518110610e4f57610e4f613326565b6020026020010151848381518110610e6957610e69613326565b6020026020010151848481518110610e8357610e83613326565b60200260200101516117f3565b80610e9a81613352565b915050610e31565b6000546001600160a01b036301000000909104163314610ed45760405162461bcd60e51b815260040161061b906132f1565b610808838383612419565b6000546001600160a01b036301000000909104163314610f115760405162461bcd60e51b815260040161061b906132f1565b610f1d8160ff16611da9565b610f2681611dd3565b610f485760405163eabeadd360e01b815260ff8216600482015260240161061b565b610f51816124ac565b50565b60005462010000900460ff1615610f7d5760405162461bcd60e51b815260040161061b906133db565b828114610fa55783838383604051638ceb003d60e01b815260040161061b9493929190613405565b3360005b8481101561132857600060206000868685818110610fc957610fc9613326565b9050602002013581526020019081526020016000206000888885818110610ff257610ff2613326565b905060200201602081019061100791906131f2565b6001600160a01b0390811682526020808301939093526040918201600020825160808101845281549092168252600181015493820193909352600283015463ffffffff169181019190915260038201805491929160608401919061106a90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461109690613382565b80156110e35780601f106110b8576101008083540402835291602001916110e3565b820191906000526020600020905b8154815290600101906020018083116110c657829003601f168201915b50505050508152505090506111108386868581811061110457611104613326565b9050602002013561220a565b61115a578285858481811061112757611127613326565b60405163c522f21160e01b81526001600160a01b039094166004850152602002919091013560248301525060440161061b565b6020600086868581811061117057611170613326565b905060200201358152602001908152602001600020600088888581811061119957611199613326565b90506020020160208101906111ae91906131f2565b6001600160a01b031681526020810191909152604001600090812080546001600160a01b03191681556001810182905560028101805463ffffffff19169055906111fb6003830182612843565b505061124c85858481811061121257611212613326565b9050602002013588888581811061122b5761122b613326565b905060200201602081019061124091906131f2565b836020015160006124fb565b7f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b6040518060c0016040528087878681811061128a5761128a613326565b9050602002013581526020018989868181106112a8576112a8613326565b90506020020160208101906112bd91906131f2565b6001600160a01b0316815260200183600001516001600160a01b0316815260200183602001518152602001836040015163ffffffff168152602001836060015181525060405161130d9190613487565b60405180910390a1508061132081613352565b915050610fa9565b505050505050565b6000805b8251811015611380576113608484838151811061135357611353613326565b602002602001015161170c565b61136e5760009150506105e3565b8061137881613352565b915050611334565b5060019392505050565b6000546001600160a01b0363010000009091041633146113bc5760405162461bcd60e51b815260040161061b906132f1565b610a306125ec565b60408051608081018252600080825260208201819052918101919091526060808201526108d98383611e5c565b60006108d98383611d80565b6000546001600160a01b03630100000090910416331461142f5760405162461bcd60e51b815260040161061b906132f1565b61143b8260ff16611da9565b61144482611dd3565b1561146757604051635d04d75160e01b815260ff8316600482015260240161061b565b610665828261264e565b6000546001600160a01b0363010000009091041633146114a35760405162461bcd60e51b815260040161061b906132f1565b80518251146114c557604051636e37235160e11b815260040160405180910390fd5b60005b82518110156108085761150d8382815181106114e6576114e6613326565b602002602001015183838151811061150057611500613326565b60200260200101516113fd565b8061151781613352565b9150506114c8565b6000546001600160a01b0363010000009091041633146115515760405162461bcd60e51b815260040161061b906132f1565b60005b8151811015610808576115a28383838151811061157357611573613326565b60200260200101516000015184848151811061159157611591613326565b602002602001015160200151612419565b806115ac81613352565b915050611554565b6000546001600160a01b0363010000009091041633146115e65760405162461bcd60e51b815260040161061b906132f1565b6108c784848484611f6b565b600054600390610100900460ff16158015611614575060005460ff8083169116105b6116775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161061b565b6000805461ffff191660ff8316176101001781556116a4600054630100000090046001600160a01b031690565b6001600160a01b031614806116b85750303b155b156116c6576116c6826123bc565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60008281526011602052604081205460006117278285612699565b60ff1611949350505050565b6060600083516001600160401b0381111561175057611750612999565b604051908082528060200260200182016040528015611779578160200160208202803683370190505b50905060005b8451811015610752576117c485828151811061179d5761179d613326565b60200260200101518583815181106117b7576117b7613326565b6020026020010151611d80565b8282815181106117d6576117d6613326565b6020908102919091010152806117eb81613352565b91505061177f565b6000546001600160a01b0363010000009091041633146118255760405162461bcd60e51b815260040161061b906132f1565b6118318260ff16611da9565b61183a82611dd3565b61185c5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6108088383836126be565b6000828152601160205260408120546118808184612699565b949350505050565b60005462010000900460ff16156118b15760405162461bcd60e51b815260040161061b906133db565b3360005b828110156108c7576118eb828585848181106118d3576118d3613326565b90506020028101906118e591906134e8565b3561220a565b61193f578184848381811061190257611902613326565b905060200281019061191491906134e8565b60405163c522f21160e01b81526001600160a01b03909216600483015235602482015260440161061b565b60006020600086868581811061195757611957613326565b905060200281019061196991906134e8565b600001358152602001908152602001600020600086868581811061198f5761198f613326565b90506020028101906119a191906134e8565b6119b29060408101906020016131f2565b6001600160a01b03166001600160a01b0316815260200190815260200160002060010154905060405180608001604052808686858181106119f5576119f5613326565b9050602002810190611a0791906134e8565b611a189060608101906040016131f2565b6001600160a01b03168152602001868685818110611a3857611a38613326565b9050602002810190611a4a91906134e8565b606001358152602001868685818110611a6557611a65613326565b9050602002810190611a7791906134e8565b611a889060a081019060800161351c565b63ffffffff168152602001868685818110611aa557611aa5613326565b9050602002810190611ab791906134e8565b611ac59060a0810190613537565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250602092508890508786818110611b1257611b12613326565b9050602002810190611b2491906134e8565b6000013581526020019081526020016000206000878786818110611b4a57611b4a613326565b9050602002810190611b5c91906134e8565b611b6d9060408101906020016131f2565b6001600160a01b0390811682526020808301939093526040918201600020845181546001600160a01b03191692169190911781558383015160018201559083015160028201805463ffffffff191663ffffffff909216919091179055606083015180519192611be49260038501929091019061287d565b50905050611c73858584818110611bfd57611bfd613326565b9050602002810190611c0f91906134e8565b35868685818110611c2257611c22613326565b9050602002810190611c3491906134e8565b611c459060408101906020016131f2565b83888887818110611c5857611c58613326565b9050602002810190611c6a91906134e8565b606001356124fb565b7f8c20c3acb6b5208b7affea2fd90dabc8d47e77cee9766c855ce42730505cb205858584818110611ca657611ca6613326565b9050602002810190611cb891906134e8565b604051611cc591906135a6565b60405180910390a15080611cd881613352565b9150506118b5565b6000546001600160a01b036301000000909104163314611d125760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b038116611d775760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061b565b610f51816123bc565b6000918252602080805260408084206001600160a01b0393909316845291905290206001015490565b603f8160ff161115610f515760405163453e14b960e01b815260ff8216600482015260240161061b565b60ff81166000908152601260205260408120548103611df457506000919050565b506001919050565b60ff82166000818152601260209081526040918290208054908590558251938452908301849052908201819052907f0d3d8d66bac9b2a9f0e5c83181a30443294ab849472526080d03fffd7187f7169060600160405180910390a1505050565b60408051608081018252600080825260208201819052918101919091526060808201526000838152602080805260408083206001600160a01b03808716855290835292819020815160808101835281549094168452600181015492840192909252600282015463ffffffff1690830152600381018054606084019190611ee190613382565b80601f0160208091040260200160405190810160405280929190818152602001828054611f0d90613382565b8015611f5a5780601f10611f2f57610100808354040283529160200191611f5a565b820191906000526020600020905b815481529060010190602001808311611f3d57829003601f168201915b505050505081525050905092915050565b6000546001600160a01b036301000000909104163314611f9d5760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b0384166000908152601060205260409020548310611fff576001600160a01b038416600081815260106020526040908190205490516345e388eb60e01b8152600481019290925260248201526044810184905260640161061b565b6001600160a01b038416600090815260106020526040812080548590811061202957612029613326565b600091825260208083206002909202909101546001600160a01b03881683526010909152604082208054919350908690811061206757612067613326565b9060005260206000209060020201600101549050818414158061208a5750808314155b156120d657604051637a4dd76560e01b81526001600160a01b03871660048201526024810186905260448101839052606481018290526084810185905260a4810184905260c40161061b565b6001600160a01b038616600090815260106020526040902080546120fc9060019061336b565b8154811061210c5761210c613326565b906000526020600020906002020160106000886001600160a01b03166001600160a01b03168152602001908152602001600020868154811061215057612150613326565b60009182526020808320845460029093020191825560019384015493909101929092556001600160a01b038816815260109091526040902080548061219757612197613663565b6000828152602080822060026000199490940193840201828155600101919091559155604080516001600160a01b038916815291820186905281018490527f33cff58e54c3a8acae85cad63487b5dcf617521e33bb03f071299f374c29de1f9060600160405180910390a1505050505050565b6001600160a01b03821660009081526010602052604081206108d99083612732565b60005462010000900460ff1661227b5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161061b565b6000805462ff0000191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60408051818152610820810182526060918291600091829190602082016108008036833750506040805181815261082081018252929350600092915060208201610800803683370190505090506000805b603f8160ff1610156123ae5760006123308983612699565b905060ff81161561239b5781858460ff168151811061235157612351613326565b602002602001019060ff16908160ff168152505080848460ff168151811061237b5761237b613326565b60ff9092166020928302919091019091015282612397816133bc565b9350505b50806123a6816133bc565b915050612318565b509196909550909350915050565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60408051808201825283815260208082018481526001600160a01b03871660008181526010845285812080546001808201835591835291859020865160029093020191825592519201919091558351908152908101859052918201839052907fe7d6ac0b740347f7f96a97e6a9dc0f20f4f11eca65495315adc009a55b6762f8906060015b60405180910390a150505050565b60ff811660008181526012602090815260408083208054939055805193845290830182905290917feb82955a27e39ea7559b6ec7e7d8b371081ab0d8783c7b0d01597555e7dcadbf9101611700565b8181113060008261250c578561250f565b60005b905060008361251f576000612521565b865b905060008461253957612534868861336b565b612543565b612543878761336b565b604051633885984b60e11b81526001600160a01b03868116600483015285811660248301528481166044830152606482018c9052608482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063710b30969060a401600060405180830381600087803b1580156125c957600080fd5b505af11580156125dd573d6000803e3d6000fd5b50505050505050505050505050565b60005462010000900460ff16156126155760405162461bcd60e51b815260040161061b906133db565b6000805462ff00001916620100001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122aa3390565b60ff8216600081815260126020908152604091829020849055815192835282018390527f16f0bfe4b02efd5423ef8906906b049c0943f21df8f10347d319fddbc59222079101611700565b600082816126a8846004613679565b60ff1682901c905080600f169250505092915050565b6000838152601160205260409020546126d88184846127c0565b6000858152601160205260409081902091909155517f393b86c90799fa411201ae723a54e105823fcf7c6c8dffa90903fc44c03b4ac79061249e9086908690869092835260ff918216602084015216604082015260600190565b6000805b83548110156127b65783818154811061275157612751613326565b9060005260206000209060020201600001548310158015612795575083818154811061277f5761277f613326565b9060005260206000209060020201600101548311155b156127a45760019150506105e3565b806127ae81613352565b915050612736565b5060009392505050565b60006127cb83611da9565b6127d482612819565b8360006127e2856004613679565b600f60ff919091161b905060001981188281166000612802886004613679565b60ff97881697169690961b17979650505050505050565b600f8160ff161115610f51576040516329afd27b60e21b815260ff8216600482015260240161061b565b50805461284f90613382565b6000825580601f1061285f575050565b601f016020900490600052602060002090810190610f519190612901565b82805461288990613382565b90600052602060002090601f0160209004810192826128ab57600085556128f1565b82601f106128c457805160ff19168380011785556128f1565b828001600101855582156128f1579182015b828111156128f15782518255916020019190600101906128d6565b506128fd929150612901565b5090565b5b808211156128fd5760008155600101612902565b80356001600160a01b038116811461292d57600080fd5b919050565b6000806040838503121561294557600080fd5b8235915061295560208401612916565b90509250929050565b803560ff8116811461292d57600080fd5b6000806040838503121561298257600080fd5b61298b8361295e565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156129d1576129d1612999565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129ff576129ff612999565b604052919050565b60006001600160401b03821115612a2057612a20612999565b5060051b60200190565b600082601f830112612a3b57600080fd5b81356020612a50612a4b83612a07565b6129d7565b82815260059290921b84018101918181019086841115612a6f57600080fd5b8286015b84811015612a8a5780358352918301918301612a73565b509695505050505050565b60008060408385031215612aa857600080fd5b82356001600160401b0380821115612abf57600080fd5b612acb86838701612a2a565b9350602091508185013581811115612ae257600080fd5b85019050601f81018613612af557600080fd5b8035612b03612a4b82612a07565b81815260059190911b82018301908381019088831115612b2257600080fd5b928401925b82841015612b4757612b3884612916565b82529284019290840190612b27565b80955050505050509250929050565b6000815180845260005b81811015612b7c57602081850181015186830182015201612b60565b81811115612b8e576000602083870101525b50601f01601f19169290920160200192915050565b60018060a01b0381511682526020810151602083015263ffffffff604082015116604083015260006060820151608060608501526118806080850182612b56565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612c3957603f19888603018452612c27858351612ba3565b94509285019290850190600101612c0b565b5092979650505050505050565b600082601f830112612c5757600080fd5b81356020612c67612a4b83612a07565b82815260059290921b84018101918181019086841115612c8657600080fd5b8286015b84811015612a8a57612c9b8161295e565b8352918301918301612c8a565b60008060408385031215612cbb57600080fd5b82356001600160401b0380821115612cd257600080fd5b612cde86838701612c46565b9350602091508185013581811115612cf557600080fd5b85019050601f81018613612d0857600080fd5b8035612d16612a4b82612a07565b81815260059190911b82018301908381019088831115612d3557600080fd5b928401925b82841015612b4757833582529284019290840190612d3a565b600082601f830112612d6457600080fd5b81356020612d74612a4b83612a07565b82815260069290921b84018101918181019086841115612d9357600080fd5b8286015b84811015612a8a5760408189031215612db05760008081fd5b612db86129af565b813581528482013585820152835291830191604001612d97565b600080600060608486031215612de757600080fd5b612df084612916565b925060208401356001600160401b0380821115612e0c57600080fd5b612e1887838801612d53565b93506040860135915080821115612e2e57600080fd5b50612e3b86828701612a2a565b9150509250925092565b60008060408385031215612e5857600080fd5b61298b83612916565b60018060a01b038516815283602082015263ffffffff83166040820152608060608201526000612e946080830184612b56565b9695505050505050565b60008060408385031215612eb157600080fd5b8235915060208301356001600160401b03811115612ece57600080fd5b612eda85828601612c46565b9150509250929050565b600081518084526020808501945080840160005b83811015612f1757815160ff1687529582019590820190600101612ef8565b509495945050505050565b6020815260006108d96020830184612ee4565b600060208284031215612f4757600080fd5b5035919050565b604080825283519082018190526000906020906060840190828701845b82811015612f8757815184529284019290840190600101612f6b565b50505083810382850152612e948186612ee4565b600060208284031215612fad57600080fd5b81356001600160401b03811115612fc357600080fd5b61188084828501612c46565b6020815260006108d96020830184612b56565b600080600060608486031215612ff757600080fd5b83356001600160401b038082111561300e57600080fd5b61301a87838801612a2a565b9450602086013591508082111561303057600080fd5b61303c87838801612c46565b9350604086013591508082111561305257600080fd5b50612e3b86828701612c46565b60008060006060848603121561307457600080fd5b61307d84612916565b95602085013595506040909401359392505050565b6000602082840312156130a457600080fd5b6108d98261295e565b60008083601f8401126130bf57600080fd5b5081356001600160401b038111156130d657600080fd5b6020830191508360208260051b85010111156130f157600080fd5b9250929050565b6000806000806040858703121561310e57600080fd5b84356001600160401b038082111561312557600080fd5b613131888389016130ad565b9096509450602087013591508082111561314a57600080fd5b50613157878288016130ad565b95989497509550505050565b6020815260006108d96020830184612ba3565b6000806040838503121561318957600080fd5b61319283612916565b915060208301356001600160401b038111156131ad57600080fd5b612eda85828601612d53565b600080600080608085870312156131cf57600080fd5b6131d885612916565b966020860135965060408601359560600135945092505050565b60006020828403121561320457600080fd5b6108d982612916565b6000806040838503121561322057600080fd5b823591506129556020840161295e565b6020808252825182820181905260009190848201906040850190845b818110156132685783518352928401929184019160010161324c565b50909695505050505050565b60008060006060848603121561328957600080fd5b833592506132996020850161295e565b91506132a76040850161295e565b90509250925092565b600080602083850312156132c357600080fd5b82356001600160401b038111156132d957600080fd5b6132e5858286016130ad565b90969095509350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016133645761336461333c565b5060010190565b60008282101561337d5761337d61333c565b500390565b600181811c9082168061339657607f821691505b6020821081036133b657634e487b7160e01b600052602260045260246000fd5b50919050565b600060ff821660ff81036133d2576133d261333c565b60010192915050565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6040808252810184905260008560608301825b87811015613446576001600160a01b0361343184612916565b16825260209283019290910190600101613418565b5083810360208501528481526001600160fb1b0385111561346657600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b60208152815160208201526000602083015160018060a01b03808216604085015280604086015116606085015250506060830151608083015263ffffffff60808401511660a083015260a083015160c08084015261188060e0840182612b56565b6000823560be198336030181126134fe57600080fd5b9190910192915050565b803563ffffffff8116811461292d57600080fd5b60006020828403121561352e57600080fd5b6108d982613508565b6000808335601e1984360301811261354e57600080fd5b8301803591506001600160401b0382111561356857600080fd5b6020019150368190038213156130f157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b602081528135602082015260006135bf60208401612916565b60018060a01b038082166040850152806135db60408701612916565b16606085015250506060830135608083015263ffffffff6135fe60808501613508565b1660a083015260a0830135601e1984360301811261361b57600080fd5b83016020810190356001600160401b0381111561363757600080fd5b80360382131561364657600080fd5b60c08085015261365a60e08501828461357d565b95945050505050565b634e487b7160e01b600052603160045260246000fd5b600060ff821660ff84168160ff048111821515161561369a5761369a61333c565b02939250505056fea26469706673582212209714c1001d19740a655ea4426b52e9f5d8348f9df38d027a88d1f1095e244e9464736f6c634300080e0033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102275760003560e01c80637ffe93fc11610130578063b8865673116100b8578063dc873d011161007c578063dc873d0114610566578063e78d54bb14610586578063e972f91014610599578063ebc5c093146105ac578063f2fde38b146105bf57600080fd5b8063b8865673146104e5578063c06d5db6146104f8578063c4d66de81461050b578063c7da9aa61461051e578063da5d314b1461055357600080fd5b806384c2ad82116100ff57806384c2ad821461044d5780638c3c9e321461046d5780638da5cb5b1461048e578063aad9a979146104bf578063b1cb1662146104d257600080fd5b80637ffe93fc1461040c578063811a6af71461041f57806381213f22146104325780638456cb591461044557600080fd5b8063436a76f3116101b35780636d7fbb67116101825780636d7fbb67146103a4578063715018a6146103c4578063754b377c146103cc5780637cc920b4146103e65780637cde0fe2146103f957600080fd5b8063436a76f31461033f5780635657f0361461035f5780635c975abb1461038057806364fff83c1461039157600080fd5b80631538ff08116101fa5780631538ff08146102db578063181dfdff146102ee5780632972b0f0146103015780633be1ced7146103145780633f4ba83a1461033757600080fd5b8063011023901461022c57806305b374211461025457806314067f8b1461026957806315027bda146102bb575b600080fd5b61023f61023a366004612932565b6105d2565b60405190151581526020015b60405180910390f35b61026761026236600461296f565b6105e9565b005b6102a6610277366004612932565b6000918252602080805260408084206001600160a01b0393909316845291905290206002015463ffffffff1690565b60405163ffffffff909116815260200161024b565b6102ce6102c9366004612a95565b610669565b60405161024b9190612be4565b6102676102e9366004612ca8565b61075a565b6102676102fc366004612dd2565b61080d565b61023f61030f366004612e45565b6108cd565b610327610322366004612932565b6108e0565b60405161024b9493929190612e61565b6102676109f6565b61035261034d366004612e9e565b610a32565b60405161024b9190612f22565b61037261036d366004612f35565b610ae0565b60405161024b929190612f4e565b60005462010000900460ff1661023f565b61026761039f366004612f9b565b610c65565b6103b76103b2366004612932565b610cd7565b60405161024b9190612fcf565b610267610d8f565b6103d4600381565b60405160ff909116815260200161024b565b6102676103f4366004612fe2565b610dcb565b61026761040736600461305f565b610ea2565b61026761041a366004613092565b610edf565b61026761042d3660046130f8565b610f54565b61023f610440366004612e9e565b611330565b61026761138a565b61046061045b366004612932565b6113c4565b60405161024b9190613163565b61048061047b366004612932565b6113f1565b60405190815260200161024b565b6104a7600054630100000090046001600160a01b031690565b6040516001600160a01b03909116815260200161024b565b6102676104cd36600461296f565b6113fd565b6102676104e0366004612ca8565b611471565b6102676104f3366004613176565b61151f565b6102676105063660046131b9565b6115b4565b6102676105193660046131f2565b6115f2565b6104a761052c366004612932565b6000918252602080805260408084206001600160a01b039384168552909152909120541690565b61023f61056136600461320d565b61170c565b610579610574366004612a95565b611733565b60405161024b9190613230565b610267610594366004613274565b6117f3565b6103d46105a736600461320d565b611867565b6102676105ba3660046132b0565b611888565b6102676105cd3660046131f2565b611ce0565b60006105de8383611d80565b151590505b92915050565b6000546001600160a01b0363010000009091041633146106245760405162461bcd60e51b815260040161061b906132f1565b60405180910390fd5b6106308260ff16611da9565b61063982611dd3565b61065b5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6106658282611dfc565b5050565b6060600083516001600160401b0381111561068657610686612999565b6040519080825280602002602001820160405280156106d757816020015b60408051608081018252600080825260208083018290529282015260608082015282526000199092019101816106a45790505b50905060005b8451811015610752576107228582815181106106fb576106fb613326565b602002602001015185838151811061071557610715613326565b6020026020010151611e5c565b82828151811061073457610734613326565b6020026020010181905250808061074a90613352565b9150506106dd565b509392505050565b6000546001600160a01b03630100000090910416331461078c5760405162461bcd60e51b815260040161061b906132f1565b80518251146107ae57604051636e37235160e11b815260040160405180910390fd5b60005b8251811015610808576107f68382815181106107cf576107cf613326565b60200260200101518383815181106107e9576107e9613326565b60200260200101516105e9565b8061080081613352565b9150506107b1565b505050565b6000546001600160a01b03630100000090910416331461083f5760405162461bcd60e51b815260040161061b906132f1565b60005b81518110156108c7576108b5848284848151811061086257610862613326565b6020026020010151610874919061336b565b85848151811061088657610886613326565b6020026020010151600001518685815181106108a4576108a4613326565b602002602001015160200151611f6b565b806108bf81613352565b915050610842565b50505050565b60006108d9838361220a565b9392505050565b6000828152602080805260408083206001600160a01b038086168552908352818420825160808101845281549092168252600181015493820193909352600283015463ffffffff1691810191909152600382018054849384936060938593919291838601919061094f90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461097b90613382565b80156109c85780601f1061099d576101008083540402835291602001916109c8565b820191906000526020600020905b8154815290600101906020018083116109ab57829003601f168201915b505050919092525050815160208301516040840151606090940151919b909a50929850965090945050505050565b6000546001600160a01b036301000000909104163314610a285760405162461bcd60e51b815260040161061b906132f1565b610a3061222c565b565b6060600082516001600160401b03811115610a4f57610a4f612999565b604051908082528060200260200182016040528015610a78578160200160208202803683370190505b50905060005b835181101561075257610aaa85858381518110610a9d57610a9d613326565b6020026020010151611867565b828281518110610abc57610abc613326565b60ff9092166020928302919091019091015280610ad881613352565b915050610a7e565b6000818152601160205260408120546060918291908080610b00846122c7565b92509250925060008160ff166001600160401b03811115610b2357610b23612999565b604051908082528060200260200182016040528015610b4c578160200160208202803683370190505b50905060008260ff166001600160401b03811115610b6c57610b6c612999565b604051908082528060200260200182016040528015610b95578160200160208202803683370190505b50905060005b8360ff168160ff161015610c565760126000878360ff1681518110610bc257610bc2613326565b602002602001015160ff1660ff16815260200190815260200160002054838260ff1681518110610bf457610bf4613326565b602002602001018181525050848160ff1681518110610c1557610c15613326565b6020026020010151828260ff1681518110610c3257610c32613326565b60ff9092166020928302919091019091015280610c4e816133bc565b915050610b9b565b50909890975095505050505050565b6000546001600160a01b036301000000909104163314610c975760405162461bcd60e51b815260040161061b906132f1565b60005b815181101561066557610cc5828281518110610cb857610cb8613326565b6020026020010151610edf565b80610ccf81613352565b915050610c9a565b6000828152602080805260408083206001600160a01b03851684529091529020600301805460609190610d0990613382565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3590613382565b8015610d825780601f10610d5757610100808354040283529160200191610d82565b820191906000526020600020905b815481529060010190602001808311610d6557829003601f168201915b5050505050905092915050565b6000546001600160a01b036301000000909104163314610dc15760405162461bcd60e51b815260040161061b906132f1565b610a3060006123bc565b6000546001600160a01b036301000000909104163314610dfd5760405162461bcd60e51b815260040161061b906132f1565b81518351141580610e1057508051835114155b15610e2e57604051636e37235160e11b815260040160405180910390fd5b60005b83518110156108c757610e90848281518110610e4f57610e4f613326565b6020026020010151848381518110610e6957610e69613326565b6020026020010151848481518110610e8357610e83613326565b60200260200101516117f3565b80610e9a81613352565b915050610e31565b6000546001600160a01b036301000000909104163314610ed45760405162461bcd60e51b815260040161061b906132f1565b610808838383612419565b6000546001600160a01b036301000000909104163314610f115760405162461bcd60e51b815260040161061b906132f1565b610f1d8160ff16611da9565b610f2681611dd3565b610f485760405163eabeadd360e01b815260ff8216600482015260240161061b565b610f51816124ac565b50565b60005462010000900460ff1615610f7d5760405162461bcd60e51b815260040161061b906133db565b828114610fa55783838383604051638ceb003d60e01b815260040161061b9493929190613405565b3360005b8481101561132857600060206000868685818110610fc957610fc9613326565b9050602002013581526020019081526020016000206000888885818110610ff257610ff2613326565b905060200201602081019061100791906131f2565b6001600160a01b0390811682526020808301939093526040918201600020825160808101845281549092168252600181015493820193909352600283015463ffffffff169181019190915260038201805491929160608401919061106a90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461109690613382565b80156110e35780601f106110b8576101008083540402835291602001916110e3565b820191906000526020600020905b8154815290600101906020018083116110c657829003601f168201915b50505050508152505090506111108386868581811061110457611104613326565b9050602002013561220a565b61115a578285858481811061112757611127613326565b60405163c522f21160e01b81526001600160a01b039094166004850152602002919091013560248301525060440161061b565b6020600086868581811061117057611170613326565b905060200201358152602001908152602001600020600088888581811061119957611199613326565b90506020020160208101906111ae91906131f2565b6001600160a01b031681526020810191909152604001600090812080546001600160a01b03191681556001810182905560028101805463ffffffff19169055906111fb6003830182612843565b505061124c85858481811061121257611212613326565b9050602002013588888581811061122b5761122b613326565b905060200201602081019061124091906131f2565b836020015160006124fb565b7f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b6040518060c0016040528087878681811061128a5761128a613326565b9050602002013581526020018989868181106112a8576112a8613326565b90506020020160208101906112bd91906131f2565b6001600160a01b0316815260200183600001516001600160a01b0316815260200183602001518152602001836040015163ffffffff168152602001836060015181525060405161130d9190613487565b60405180910390a1508061132081613352565b915050610fa9565b505050505050565b6000805b8251811015611380576113608484838151811061135357611353613326565b602002602001015161170c565b61136e5760009150506105e3565b8061137881613352565b915050611334565b5060019392505050565b6000546001600160a01b0363010000009091041633146113bc5760405162461bcd60e51b815260040161061b906132f1565b610a306125ec565b60408051608081018252600080825260208201819052918101919091526060808201526108d98383611e5c565b60006108d98383611d80565b6000546001600160a01b03630100000090910416331461142f5760405162461bcd60e51b815260040161061b906132f1565b61143b8260ff16611da9565b61144482611dd3565b1561146757604051635d04d75160e01b815260ff8316600482015260240161061b565b610665828261264e565b6000546001600160a01b0363010000009091041633146114a35760405162461bcd60e51b815260040161061b906132f1565b80518251146114c557604051636e37235160e11b815260040160405180910390fd5b60005b82518110156108085761150d8382815181106114e6576114e6613326565b602002602001015183838151811061150057611500613326565b60200260200101516113fd565b8061151781613352565b9150506114c8565b6000546001600160a01b0363010000009091041633146115515760405162461bcd60e51b815260040161061b906132f1565b60005b8151811015610808576115a28383838151811061157357611573613326565b60200260200101516000015184848151811061159157611591613326565b602002602001015160200151612419565b806115ac81613352565b915050611554565b6000546001600160a01b0363010000009091041633146115e65760405162461bcd60e51b815260040161061b906132f1565b6108c784848484611f6b565b600054600390610100900460ff16158015611614575060005460ff8083169116105b6116775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161061b565b6000805461ffff191660ff8316176101001781556116a4600054630100000090046001600160a01b031690565b6001600160a01b031614806116b85750303b155b156116c6576116c6826123bc565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60008281526011602052604081205460006117278285612699565b60ff1611949350505050565b6060600083516001600160401b0381111561175057611750612999565b604051908082528060200260200182016040528015611779578160200160208202803683370190505b50905060005b8451811015610752576117c485828151811061179d5761179d613326565b60200260200101518583815181106117b7576117b7613326565b6020026020010151611d80565b8282815181106117d6576117d6613326565b6020908102919091010152806117eb81613352565b91505061177f565b6000546001600160a01b0363010000009091041633146118255760405162461bcd60e51b815260040161061b906132f1565b6118318260ff16611da9565b61183a82611dd3565b61185c5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6108088383836126be565b6000828152601160205260408120546118808184612699565b949350505050565b60005462010000900460ff16156118b15760405162461bcd60e51b815260040161061b906133db565b3360005b828110156108c7576118eb828585848181106118d3576118d3613326565b90506020028101906118e591906134e8565b3561220a565b61193f578184848381811061190257611902613326565b905060200281019061191491906134e8565b60405163c522f21160e01b81526001600160a01b03909216600483015235602482015260440161061b565b60006020600086868581811061195757611957613326565b905060200281019061196991906134e8565b600001358152602001908152602001600020600086868581811061198f5761198f613326565b90506020028101906119a191906134e8565b6119b29060408101906020016131f2565b6001600160a01b03166001600160a01b0316815260200190815260200160002060010154905060405180608001604052808686858181106119f5576119f5613326565b9050602002810190611a0791906134e8565b611a189060608101906040016131f2565b6001600160a01b03168152602001868685818110611a3857611a38613326565b9050602002810190611a4a91906134e8565b606001358152602001868685818110611a6557611a65613326565b9050602002810190611a7791906134e8565b611a889060a081019060800161351c565b63ffffffff168152602001868685818110611aa557611aa5613326565b9050602002810190611ab791906134e8565b611ac59060a0810190613537565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250602092508890508786818110611b1257611b12613326565b9050602002810190611b2491906134e8565b6000013581526020019081526020016000206000878786818110611b4a57611b4a613326565b9050602002810190611b5c91906134e8565b611b6d9060408101906020016131f2565b6001600160a01b0390811682526020808301939093526040918201600020845181546001600160a01b03191692169190911781558383015160018201559083015160028201805463ffffffff191663ffffffff909216919091179055606083015180519192611be49260038501929091019061287d565b50905050611c73858584818110611bfd57611bfd613326565b9050602002810190611c0f91906134e8565b35868685818110611c2257611c22613326565b9050602002810190611c3491906134e8565b611c459060408101906020016131f2565b83888887818110611c5857611c58613326565b9050602002810190611c6a91906134e8565b606001356124fb565b7f8c20c3acb6b5208b7affea2fd90dabc8d47e77cee9766c855ce42730505cb205858584818110611ca657611ca6613326565b9050602002810190611cb891906134e8565b604051611cc591906135a6565b60405180910390a15080611cd881613352565b9150506118b5565b6000546001600160a01b036301000000909104163314611d125760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b038116611d775760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061b565b610f51816123bc565b6000918252602080805260408084206001600160a01b0393909316845291905290206001015490565b603f8160ff161115610f515760405163453e14b960e01b815260ff8216600482015260240161061b565b60ff81166000908152601260205260408120548103611df457506000919050565b506001919050565b60ff82166000818152601260209081526040918290208054908590558251938452908301849052908201819052907f0d3d8d66bac9b2a9f0e5c83181a30443294ab849472526080d03fffd7187f7169060600160405180910390a1505050565b60408051608081018252600080825260208201819052918101919091526060808201526000838152602080805260408083206001600160a01b03808716855290835292819020815160808101835281549094168452600181015492840192909252600282015463ffffffff1690830152600381018054606084019190611ee190613382565b80601f0160208091040260200160405190810160405280929190818152602001828054611f0d90613382565b8015611f5a5780601f10611f2f57610100808354040283529160200191611f5a565b820191906000526020600020905b815481529060010190602001808311611f3d57829003601f168201915b505050505081525050905092915050565b6000546001600160a01b036301000000909104163314611f9d5760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b0384166000908152601060205260409020548310611fff576001600160a01b038416600081815260106020526040908190205490516345e388eb60e01b8152600481019290925260248201526044810184905260640161061b565b6001600160a01b038416600090815260106020526040812080548590811061202957612029613326565b600091825260208083206002909202909101546001600160a01b03881683526010909152604082208054919350908690811061206757612067613326565b9060005260206000209060020201600101549050818414158061208a5750808314155b156120d657604051637a4dd76560e01b81526001600160a01b03871660048201526024810186905260448101839052606481018290526084810185905260a4810184905260c40161061b565b6001600160a01b038616600090815260106020526040902080546120fc9060019061336b565b8154811061210c5761210c613326565b906000526020600020906002020160106000886001600160a01b03166001600160a01b03168152602001908152602001600020868154811061215057612150613326565b60009182526020808320845460029093020191825560019384015493909101929092556001600160a01b038816815260109091526040902080548061219757612197613663565b6000828152602080822060026000199490940193840201828155600101919091559155604080516001600160a01b038916815291820186905281018490527f33cff58e54c3a8acae85cad63487b5dcf617521e33bb03f071299f374c29de1f9060600160405180910390a1505050505050565b6001600160a01b03821660009081526010602052604081206108d99083612732565b60005462010000900460ff1661227b5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161061b565b6000805462ff0000191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60408051818152610820810182526060918291600091829190602082016108008036833750506040805181815261082081018252929350600092915060208201610800803683370190505090506000805b603f8160ff1610156123ae5760006123308983612699565b905060ff81161561239b5781858460ff168151811061235157612351613326565b602002602001019060ff16908160ff168152505080848460ff168151811061237b5761237b613326565b60ff9092166020928302919091019091015282612397816133bc565b9350505b50806123a6816133bc565b915050612318565b509196909550909350915050565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60408051808201825283815260208082018481526001600160a01b03871660008181526010845285812080546001808201835591835291859020865160029093020191825592519201919091558351908152908101859052918201839052907fe7d6ac0b740347f7f96a97e6a9dc0f20f4f11eca65495315adc009a55b6762f8906060015b60405180910390a150505050565b60ff811660008181526012602090815260408083208054939055805193845290830182905290917feb82955a27e39ea7559b6ec7e7d8b371081ab0d8783c7b0d01597555e7dcadbf9101611700565b8181113060008261250c578561250f565b60005b905060008361251f576000612521565b865b905060008461253957612534868861336b565b612543565b612543878761336b565b604051633885984b60e11b81526001600160a01b03868116600483015285811660248301528481166044830152606482018c9052608482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063710b30969060a401600060405180830381600087803b1580156125c957600080fd5b505af11580156125dd573d6000803e3d6000fd5b50505050505050505050505050565b60005462010000900460ff16156126155760405162461bcd60e51b815260040161061b906133db565b6000805462ff00001916620100001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122aa3390565b60ff8216600081815260126020908152604091829020849055815192835282018390527f16f0bfe4b02efd5423ef8906906b049c0943f21df8f10347d319fddbc59222079101611700565b600082816126a8846004613679565b60ff1682901c905080600f169250505092915050565b6000838152601160205260409020546126d88184846127c0565b6000858152601160205260409081902091909155517f393b86c90799fa411201ae723a54e105823fcf7c6c8dffa90903fc44c03b4ac79061249e9086908690869092835260ff918216602084015216604082015260600190565b6000805b83548110156127b65783818154811061275157612751613326565b9060005260206000209060020201600001548310158015612795575083818154811061277f5761277f613326565b9060005260206000209060020201600101548311155b156127a45760019150506105e3565b806127ae81613352565b915050612736565b5060009392505050565b60006127cb83611da9565b6127d482612819565b8360006127e2856004613679565b600f60ff919091161b905060001981188281166000612802886004613679565b60ff97881697169690961b17979650505050505050565b600f8160ff161115610f51576040516329afd27b60e21b815260ff8216600482015260240161061b565b50805461284f90613382565b6000825580601f1061285f575050565b601f016020900490600052602060002090810190610f519190612901565b82805461288990613382565b90600052602060002090601f0160209004810192826128ab57600085556128f1565b82601f106128c457805160ff19168380011785556128f1565b828001600101855582156128f1579182015b828111156128f15782518255916020019190600101906128d6565b506128fd929150612901565b5090565b5b808211156128fd5760008155600101612902565b80356001600160a01b038116811461292d57600080fd5b919050565b6000806040838503121561294557600080fd5b8235915061295560208401612916565b90509250929050565b803560ff8116811461292d57600080fd5b6000806040838503121561298257600080fd5b61298b8361295e565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156129d1576129d1612999565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129ff576129ff612999565b604052919050565b60006001600160401b03821115612a2057612a20612999565b5060051b60200190565b600082601f830112612a3b57600080fd5b81356020612a50612a4b83612a07565b6129d7565b82815260059290921b84018101918181019086841115612a6f57600080fd5b8286015b84811015612a8a5780358352918301918301612a73565b509695505050505050565b60008060408385031215612aa857600080fd5b82356001600160401b0380821115612abf57600080fd5b612acb86838701612a2a565b9350602091508185013581811115612ae257600080fd5b85019050601f81018613612af557600080fd5b8035612b03612a4b82612a07565b81815260059190911b82018301908381019088831115612b2257600080fd5b928401925b82841015612b4757612b3884612916565b82529284019290840190612b27565b80955050505050509250929050565b6000815180845260005b81811015612b7c57602081850181015186830182015201612b60565b81811115612b8e576000602083870101525b50601f01601f19169290920160200192915050565b60018060a01b0381511682526020810151602083015263ffffffff604082015116604083015260006060820151608060608501526118806080850182612b56565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612c3957603f19888603018452612c27858351612ba3565b94509285019290850190600101612c0b565b5092979650505050505050565b600082601f830112612c5757600080fd5b81356020612c67612a4b83612a07565b82815260059290921b84018101918181019086841115612c8657600080fd5b8286015b84811015612a8a57612c9b8161295e565b8352918301918301612c8a565b60008060408385031215612cbb57600080fd5b82356001600160401b0380821115612cd257600080fd5b612cde86838701612c46565b9350602091508185013581811115612cf557600080fd5b85019050601f81018613612d0857600080fd5b8035612d16612a4b82612a07565b81815260059190911b82018301908381019088831115612d3557600080fd5b928401925b82841015612b4757833582529284019290840190612d3a565b600082601f830112612d6457600080fd5b81356020612d74612a4b83612a07565b82815260069290921b84018101918181019086841115612d9357600080fd5b8286015b84811015612a8a5760408189031215612db05760008081fd5b612db86129af565b813581528482013585820152835291830191604001612d97565b600080600060608486031215612de757600080fd5b612df084612916565b925060208401356001600160401b0380821115612e0c57600080fd5b612e1887838801612d53565b93506040860135915080821115612e2e57600080fd5b50612e3b86828701612a2a565b9150509250925092565b60008060408385031215612e5857600080fd5b61298b83612916565b60018060a01b038516815283602082015263ffffffff83166040820152608060608201526000612e946080830184612b56565b9695505050505050565b60008060408385031215612eb157600080fd5b8235915060208301356001600160401b03811115612ece57600080fd5b612eda85828601612c46565b9150509250929050565b600081518084526020808501945080840160005b83811015612f1757815160ff1687529582019590820190600101612ef8565b509495945050505050565b6020815260006108d96020830184612ee4565b600060208284031215612f4757600080fd5b5035919050565b604080825283519082018190526000906020906060840190828701845b82811015612f8757815184529284019290840190600101612f6b565b50505083810382850152612e948186612ee4565b600060208284031215612fad57600080fd5b81356001600160401b03811115612fc357600080fd5b61188084828501612c46565b6020815260006108d96020830184612b56565b600080600060608486031215612ff757600080fd5b83356001600160401b038082111561300e57600080fd5b61301a87838801612a2a565b9450602086013591508082111561303057600080fd5b61303c87838801612c46565b9350604086013591508082111561305257600080fd5b50612e3b86828701612c46565b60008060006060848603121561307457600080fd5b61307d84612916565b95602085013595506040909401359392505050565b6000602082840312156130a457600080fd5b6108d98261295e565b60008083601f8401126130bf57600080fd5b5081356001600160401b038111156130d657600080fd5b6020830191508360208260051b85010111156130f157600080fd5b9250929050565b6000806000806040858703121561310e57600080fd5b84356001600160401b038082111561312557600080fd5b613131888389016130ad565b9096509450602087013591508082111561314a57600080fd5b50613157878288016130ad565b95989497509550505050565b6020815260006108d96020830184612ba3565b6000806040838503121561318957600080fd5b61319283612916565b915060208301356001600160401b038111156131ad57600080fd5b612eda85828601612d53565b600080600080608085870312156131cf57600080fd5b6131d885612916565b966020860135965060408601359560600135945092505050565b60006020828403121561320457600080fd5b6108d982612916565b6000806040838503121561322057600080fd5b823591506129556020840161295e565b6020808252825182820181905260009190848201906040850190845b818110156132685783518352928401929184019160010161324c565b50909695505050505050565b60008060006060848603121561328957600080fd5b833592506132996020850161295e565b91506132a76040850161295e565b90509250925092565b600080602083850312156132c357600080fd5b82356001600160401b038111156132d957600080fd5b6132e5858286016130ad565b90969095509350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016133645761336461333c565b5060010190565b60008282101561337d5761337d61333c565b500390565b600181811c9082168061339657607f821691505b6020821081036133b657634e487b7160e01b600052602260045260246000fd5b50919050565b600060ff821660ff81036133d2576133d261333c565b60010192915050565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6040808252810184905260008560608301825b87811015613446576001600160a01b0361343184612916565b16825260209283019290910190600101613418565b5083810360208501528481526001600160fb1b0385111561346657600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b60208152815160208201526000602083015160018060a01b03808216604085015280604086015116606085015250506060830151608083015263ffffffff60808401511660a083015260a083015160c08084015261188060e0840182612b56565b6000823560be198336030181126134fe57600080fd5b9190910192915050565b803563ffffffff8116811461292d57600080fd5b60006020828403121561352e57600080fd5b6108d982613508565b6000808335601e1984360301811261354e57600080fd5b8301803591506001600160401b0382111561356857600080fd5b6020019150368190038213156130f157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b602081528135602082015260006135bf60208401612916565b60018060a01b038082166040850152806135db60408701612916565b16606085015250506060830135608083015263ffffffff6135fe60808501613508565b1660a083015260a0830135601e1984360301811261361b57600080fd5b83016020810190356001600160401b0381111561363757600080fd5b80360382131561364657600080fd5b60c08085015261365a60e08501828461357d565b95945050505050565b634e487b7160e01b600052603160045260246000fd5b600060ff821660ff84168160ff048111821515161561369a5761369a61333c565b02939250505056fea26469706673582212209714c1001d19740a655ea4426b52e9f5d8348f9df38d027a88d1f1095e244e9464736f6c634300080e0033", diff --git a/deployments/sandboxPolygon/AttestationsRegistryImplem.json b/deployments/mumbaiTestnet/AttestationsRegistryImplem.json similarity index 98% rename from deployments/sandboxPolygon/AttestationsRegistryImplem.json rename to deployments/mumbaiTestnet/AttestationsRegistryImplem.json index 7f6e619..2be0031 100644 --- a/deployments/sandboxPolygon/AttestationsRegistryImplem.json +++ b/deployments/mumbaiTestnet/AttestationsRegistryImplem.json @@ -1,5 +1,5 @@ { - "address": "0x7FaBc0a314Ad5c92eB3b01c9f2FA2E2115A8ba60", + "address": "0xfF3A1A1aa75003cD208a27Bc3689507A5fBCaA8C", "abi": [ { "inputs": [ @@ -1281,84 +1281,84 @@ "type": "function" } ], - "transactionHash": "0x79b653db80a14ae8fe71d69be12e0e92802e84b6f850d3f5c03bb7f649b046d1", + "transactionHash": "0x20b00ff10274a1fa4a01ad301a333886cb4699f1520b452457bb0155deca5f3c", "receipt": { "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0x7FaBc0a314Ad5c92eB3b01c9f2FA2E2115A8ba60", - "transactionIndex": 49, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xfF3A1A1aa75003cD208a27Bc3689507A5fBCaA8C", + "transactionIndex": 12, "gasUsed": "3121566", - "logsBloom": "0x00000000000000200000000000000000002000000000000000800000000000000000000000000000000000000000000000008000000000000000000000000000800000000000000000000002000000800001000000000000000100000000000100000000020000000000000000000800000000010000000080000000000000400000000000010000000000100000000000000000000080000000000001000000200000000000000000000000000400000000000000000000000000000000004000000000000000040001000000040000000000000000000000100004000020000000000000000400000000000000000000000000000000000000000000100000", - "blockHash": "0xfe05756158e9e9080318ae0e64c949f013e6b306a57020b8d478315b272685e7", - "transactionHash": "0x79b653db80a14ae8fe71d69be12e0e92802e84b6f850d3f5c03bb7f649b046d1", + "logsBloom": "0x00000000000000020000000000000000000000000000000002800000000000000000000000000000000000000000000000008000000000000000000000000000000000000040000000000000000000800001000000000000000100000000000200000000020000000000000000000800000000000000000080000000000000400000000000000000000000000000000000000000000080000000000040000000200000000000000020000000000402000001000000000000000000000000004000008000000000000001000000040000000000000000000000100000000020000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x83dcfd6f0af1ebb3e768085e3f9d375dfde36624eadc2f0b4e18199d52b4a68f", + "transactionHash": "0x20b00ff10274a1fa4a01ad301a333886cb4699f1520b452457bb0155deca5f3c", "logs": [ { - "transactionIndex": 49, - "blockNumber": 36626268, - "transactionHash": "0x79b653db80a14ae8fe71d69be12e0e92802e84b6f850d3f5c03bb7f649b046d1", - "address": "0x7FaBc0a314Ad5c92eB3b01c9f2FA2E2115A8ba60", + "transactionIndex": 12, + "blockNumber": 29771738, + "transactionHash": "0x20b00ff10274a1fa4a01ad301a333886cb4699f1520b452457bb0155deca5f3c", + "address": "0xfF3A1A1aa75003cD208a27Bc3689507A5fBCaA8C", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 242, - "blockHash": "0xfe05756158e9e9080318ae0e64c949f013e6b306a57020b8d478315b272685e7" + "logIndex": 45, + "blockHash": "0x83dcfd6f0af1ebb3e768085e3f9d375dfde36624eadc2f0b4e18199d52b4a68f" }, { - "transactionIndex": 49, - "blockNumber": 36626268, - "transactionHash": "0x79b653db80a14ae8fe71d69be12e0e92802e84b6f850d3f5c03bb7f649b046d1", - "address": "0x7FaBc0a314Ad5c92eB3b01c9f2FA2E2115A8ba60", + "transactionIndex": 12, + "blockNumber": 29771738, + "transactionHash": "0x20b00ff10274a1fa4a01ad301a333886cb4699f1520b452457bb0155deca5f3c", + "address": "0xfF3A1A1aa75003cD208a27Bc3689507A5fBCaA8C", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x000000000000000000000000aee4acd5c4bf516330ca8fe11b07206fc6709294" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 243, - "blockHash": "0xfe05756158e9e9080318ae0e64c949f013e6b306a57020b8d478315b272685e7" + "logIndex": 46, + "blockHash": "0x83dcfd6f0af1ebb3e768085e3f9d375dfde36624eadc2f0b4e18199d52b4a68f" }, { - "transactionIndex": 49, - "blockNumber": 36626268, - "transactionHash": "0x79b653db80a14ae8fe71d69be12e0e92802e84b6f850d3f5c03bb7f649b046d1", - "address": "0x7FaBc0a314Ad5c92eB3b01c9f2FA2E2115A8ba60", + "transactionIndex": 12, + "blockNumber": 29771738, + "transactionHash": "0x20b00ff10274a1fa4a01ad301a333886cb4699f1520b452457bb0155deca5f3c", + "address": "0xfF3A1A1aa75003cD208a27Bc3689507A5fBCaA8C", "topics": [ "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 244, - "blockHash": "0xfe05756158e9e9080318ae0e64c949f013e6b306a57020b8d478315b272685e7" + "logIndex": 47, + "blockHash": "0x83dcfd6f0af1ebb3e768085e3f9d375dfde36624eadc2f0b4e18199d52b4a68f" }, { - "transactionIndex": 49, - "blockNumber": 36626268, - "transactionHash": "0x79b653db80a14ae8fe71d69be12e0e92802e84b6f850d3f5c03bb7f649b046d1", + "transactionIndex": 12, + "blockNumber": 29771738, + "transactionHash": "0x20b00ff10274a1fa4a01ad301a333886cb4699f1520b452457bb0155deca5f3c", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x000000000000000000000000b95d435df3f8b2a8d8b9c2b7c8766c9ae6ed8cc9" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" ], - "data": "0x0000000000000000000000000000000000000000000000000170a681c10cf0b0000000000000000000000000000000000000000000000000bdc13dbd227cad9c000000000000000000000000000000000000000000004cf4c9d8a66f622dbf6a000000000000000000000000000000000000000000000000bc50973b616fbcec000000000000000000000000000000000000000000004cf4cb494cf1233ab01a", - "logIndex": 245, - "blockHash": "0xfe05756158e9e9080318ae0e64c949f013e6b306a57020b8d478315b272685e7" + "data": "0x0000000000000000000000000000000000000000000000000010a292544d1d260000000000000000000000000000000000000000000000001bb2505a5ebf134600000000000000000000000000000000000000000000187add1f02e156f142700000000000000000000000000000000000000000000000001ba1adc80a71f62000000000000000000000000000000000000000000000187add2fa573ab3e5f96", + "logIndex": 48, + "blockHash": "0x83dcfd6f0af1ebb3e768085e3f9d375dfde36624eadc2f0b4e18199d52b4a68f" } ], - "blockNumber": 36626268, - "cumulativeGasUsed": "11787529", + "blockNumber": 29771738, + "cumulativeGasUsed": "6473318", "status": 1, "byzantium": true }, "args": [ - "0xaee4acd5c4Bf516330ca8fe11B07206fC6709294", - "0x71a7089C56DFf528f330Bc0116C0917cd05B51Fc" + "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "0xc3Ee5Aad6Fb987cF69a2EE7B3B2c92E21E42F34B" ], - "numDeployments": 2, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"badgesAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"ArgsLengthDoesNotMatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"}],\"name\":\"AttesterNotFound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"}],\"name\":\"AttributeAlreadyExists\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"}],\"name\":\"AttributeDoesNotExist\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rangeIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedFirstId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedLastId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"FirstId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"IdsMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"IndexOutOfBounds\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"IssuerNotAuthorized\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"}],\"name\":\"OwnersAndCollectionIdsLengthMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"expectedArrayLength\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rangeIndex\",\"type\":\"uint256\"}],\"name\":\"RangeIndexOutOfBounds\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"value\",\"type\":\"uint8\"}],\"name\":\"ValueOutOfBounds\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationRecorded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeValue\",\"type\":\"uint8\"}],\"name\":\"AttestationsCollectionAttributeSet\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"deletedAttributeName\",\"type\":\"bytes32\"}],\"name\":\"AttributeDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"newAttributeName\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"previousAttributeName\",\"type\":\"bytes32\"}],\"name\":\"AttributeNameUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"IssuerAuthorized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"IssuerUnauthorized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"attributeIndex\",\"type\":\"uint8\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"attributeName\",\"type\":\"bytes32\"}],\"name\":\"NewAttributeCreated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Paused\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"Unpaused\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"attestationsCollectionHasAttribute\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"}],\"name\":\"attestationsCollectionHasAttributes\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"authorizeRange\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"internalType\":\"struct Range[]\",\"name\":\"ranges\",\"type\":\"tuple[]\"}],\"name\":\"authorizeRanges\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"name\",\"type\":\"bytes32\"}],\"name\":\"createNewAttribute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"names\",\"type\":\"bytes32[]\"}],\"name\":\"createNewAttributes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"}],\"name\":\"deleteAttestations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"deleteAttribute\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"}],\"name\":\"deleteAttributes\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationData\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct AttestationData\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"}],\"name\":\"getAttestationDataBatch\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct AttestationData[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationDataTuple\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationIssuer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationTimestamp\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"getAttestationValue\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address[]\",\"name\":\"owners\",\"type\":\"address[]\"}],\"name\":\"getAttestationValueBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"getAttributeValueForAttestationsCollection\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"getAttributesNamesAndValuesForAttestationsCollection\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"}],\"name\":\"getAttributesValuesForAttestationsCollection\",\"outputs\":[{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"hasAttestation\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"isAuthorized\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"pause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"paused\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"attestations\",\"type\":\"tuple[]\"}],\"name\":\"recordAttestations\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"uint8\",\"name\":\"value\",\"type\":\"uint8\"}],\"name\":\"setAttributeValueForAttestationsCollection\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"},{\"internalType\":\"uint8[]\",\"name\":\"values\",\"type\":\"uint8[]\"}],\"name\":\"setAttributesValuesForAttestationsCollections\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"rangeIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"firstCollectionId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"lastCollectionId\",\"type\":\"uint256\"}],\"name\":\"unauthorizeRange\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"components\":[{\"internalType\":\"uint256\",\"name\":\"min\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"max\",\"type\":\"uint256\"}],\"internalType\":\"struct Range[]\",\"name\":\"ranges\",\"type\":\"tuple[]\"},{\"internalType\":\"uint256[]\",\"name\":\"rangeIndexes\",\"type\":\"uint256[]\"}],\"name\":\"unauthorizeRanges\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"unpause\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"},{\"internalType\":\"bytes32\",\"name\":\"newName\",\"type\":\"bytes32\"}],\"name\":\"updateAttributeName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint8[]\",\"name\":\"indices\",\"type\":\"uint8[]\"},{\"internalType\":\"bytes32[]\",\"name\":\"newNames\",\"type\":\"bytes32[]\"}],\"name\":\"updateAttributesName\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"attestationsCollectionHasAttribute(uint256,uint8)\":{\"details\":\"Returns whether an attestationsCollection has a specific attribute referenced by its index\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\",\"index\":\"Index of the attribute. Can go from 0 to 63.\"}},\"authorizeRange(address,uint256,uint256)\":{\"details\":\"Authorize an issuer for a specific range\",\"params\":{\"firstCollectionId\":\"First collection Id of the range for which the issuer will be authorized\",\"issuer\":\"Issuer that will be authorized\",\"lastCollectionId\":\"Last collection Id of the range for which the issuer will be authorized\"}},\"authorizeRanges(address,(uint256,uint256)[])\":{\"details\":\"Authorize an issuer for specific ranges\",\"params\":{\"issuer\":\"Issuer that will be authorized\",\"ranges\":\"Ranges for which the issuer will be authorized\"}},\"constructor\":{\"details\":\"Constructor.\",\"params\":{\"badgesAddress\":\"Stateless ERC1155 Badges contract\",\"owner\":\"Owner of the contract, has the right to authorize/unauthorize attestations issuers\"}},\"createNewAttribute(uint8,bytes32)\":{\"details\":\"Create a new attribute.\",\"params\":{\"index\":\"Index of the attribute. Can go from 0 to 63.\",\"name\":\"Name in bytes32 of the attribute\"}},\"deleteAttestations(address[],uint256[])\":{\"details\":\"Delete function to be called by authorized issuers\",\"params\":{\"collectionIds\":\"The collection ids of the attestations to be deleted\",\"owners\":\"The owners of the attestations to be deleted\"}},\"deleteAttribute(uint8)\":{\"details\":\"Delete an existing attribute\",\"params\":{\"index\":\"Index of the attribute. Can go from 0 to 63. The attribute must already exist\"}},\"getAttestationData(uint256,address)\":{\"details\":\"Getter of the data of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationDataBatch(uint256[],address[])\":{\"details\":\"Getter of the data of specific attestations\",\"params\":{\"collectionIds\":\"Collection identifiers of the targeted attestations\",\"owners\":\"Owners of the targeted attestations\"}},\"getAttestationDataTuple(uint256,address)\":{\"details\":\"Getter of the data of a specific attestation as tuple\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationExtraData(uint256,address)\":{\"details\":\"Getter of the extraData of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationIssuer(uint256,address)\":{\"details\":\"Getter of the issuer of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationTimestamp(uint256,address)\":{\"details\":\"Getter of the timestamp of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationValue(uint256,address)\":{\"details\":\"Getter of the value of a specific attestation\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"getAttestationValueBatch(uint256[],address[])\":{\"details\":\"Getter of the values of specific attestations\",\"params\":{\"collectionIds\":\"Collection identifiers of the targeted attestations\",\"owners\":\"Owners of the targeted attestations\"}},\"getAttributeValueForAttestationsCollection(uint256,uint8)\":{\"details\":\"Returns the attribute's value (from 0 to 15) of an attestationsCollection\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\",\"index\":\"Index of the attribute. Can go from 0 to 63.\"}},\"getAttributesNamesAndValuesForAttestationsCollection(uint256)\":{\"details\":\"Returns all the enabled attributes names and their values for a specific attestationsCollection\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\"}},\"hasAttestation(uint256,address)\":{\"details\":\"Returns whether a user has an attestation from a collection\",\"params\":{\"collectionId\":\"Collection identifier of the targeted attestation\",\"owner\":\"Owner of the targeted attestation\"}},\"initialize(address)\":{\"details\":\"Initialize function, to be called by the proxy delegating calls to this implementation\",\"params\":{\"ownerAddress\":\"Owner of the contract, has the right to authorize/unauthorize attestations issuers\"}},\"isAuthorized(address,uint256)\":{\"details\":\"Returns whether a specific issuer is authorized or not to record in a specific attestations collection\",\"params\":{\"collectionId\":\"Collection Id for which the issuer will be checked\",\"issuer\":\"Issuer to be checked\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"pause()\":{\"details\":\"Pauses the registry. Issuers can no longer record or delete attestations\"},\"paused()\":{\"details\":\"Returns true if the contract is paused, and false otherwise.\"},\"recordAttestations((uint256,address,address,uint256,uint32,bytes)[])\":{\"details\":\"Main function to be called by authorized issuers\",\"params\":{\"attestations\":\"Attestations to be recorded (creates a new one or overrides an existing one)\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setAttributeValueForAttestationsCollection(uint256,uint8,uint8)\":{\"details\":\"Set a value for an attribute of an attestationsCollection. The attribute should already be created.\",\"params\":{\"collectionId\":\"Collection Id of the targeted attestationsCollection\",\"index\":\"Index of the attribute (must be between 0 and 63)\",\"value\":\"Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unauthorizeRange(address,uint256,uint256,uint256)\":{\"details\":\"Unauthorize an issuer for a specific range\",\"params\":{\"firstCollectionId\":\"First collection Id of the range for which the issuer will be unauthorized\",\"issuer\":\"Issuer that will be unauthorized\",\"lastCollectionId\":\"Last collection Id of the range for which the issuer will be unauthorized\",\"rangeIndex\":\"Index of the range to be unauthorized\"}},\"unauthorizeRanges(address,(uint256,uint256)[],uint256[])\":{\"details\":\"Unauthorize an issuer for specific ranges\",\"params\":{\"issuer\":\"Issuer that will be unauthorized\",\"ranges\":\"Ranges for which the issuer will be unauthorized\"}},\"unpause()\":{\"details\":\"Unpauses the registry\"},\"updateAttributeName(uint8,bytes32)\":{\"details\":\"Update the name of an existing attribute\",\"params\":{\"index\":\"Index of the attribute. Can go from 0 to 63. The attribute must exist\",\"newName\":\"new name in bytes32 of the attribute\"}}},\"title\":\"Attestations Registry\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"Main contract of Sismo, stores all recorded attestations in attestations collections Only authorized attestations issuers can record attestation in the registry Attesters that expect to record in the Attestations Registry must be authorized issuers For more information: https://attestations-registry.docs.sismo.io For each attestation recorded, a badge is received by the user The badge is the Non transferrable NFT representation of an attestation Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts It enables off-chain apps such as opensea to catch the \\\"shadow mint\\\" of the badge*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/AttestationsRegistry.sol\":\"AttestationsRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/core/AttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\\nimport {Attestation, AttestationData} from './libs/Structs.sol';\\nimport {IBadges} from './interfaces/IBadges.sol';\\n\\n/**\\n * @title Attestations Registry\\n * @author Sismo\\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\\n * Only authorized attestations issuers can record attestation in the registry\\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\\n * For more information: https://attestations-registry.docs.sismo.io\\n\\n * For each attestation recorded, a badge is received by the user\\n * The badge is the Non transferrable NFT representation of an attestation \\n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\\n * It enables off-chain apps such as opensea to catch the \\\"shadow mint\\\" of the badge\\n **/\\ncontract AttestationsRegistry is\\n AttestationsRegistryState,\\n IAttestationsRegistry,\\n AttestationsRegistryConfigLogic\\n{\\n uint8 public constant IMPLEMENTATION_VERSION = 3;\\n IBadges immutable BADGES;\\n\\n /**\\n * @dev Constructor.\\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @param badgesAddress Stateless ERC1155 Badges contract\\n */\\n constructor(address owner, address badgesAddress) {\\n BADGES = IBadges(badgesAddress);\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\\n address issuer = _msgSender();\\n for (uint256 i = 0; i < attestations.length; i++) {\\n if (!_isAuthorized(issuer, attestations[i].collectionId))\\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\\n\\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\\n attestations[i].owner\\n ].value;\\n\\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\\n attestations[i].issuer,\\n attestations[i].value,\\n attestations[i].timestamp,\\n attestations[i].extraData\\n );\\n\\n _triggerBadgeTransferEvent(\\n attestations[i].collectionId,\\n attestations[i].owner,\\n previousAttestationValue,\\n attestations[i].value\\n );\\n emit AttestationRecorded(attestations[i]);\\n }\\n }\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(\\n address[] calldata owners,\\n uint256[] calldata collectionIds\\n ) external override whenNotPaused {\\n if (owners.length != collectionIds.length)\\n revert OwnersAndCollectionIdsLengthMismatch(owners, collectionIds);\\n\\n address issuer = _msgSender();\\n for (uint256 i = 0; i < owners.length; i++) {\\n AttestationData memory attestationData = _attestationsData[collectionIds[i]][owners[i]];\\n\\n if (!_isAuthorized(issuer, collectionIds[i]))\\n revert IssuerNotAuthorized(issuer, collectionIds[i]);\\n delete _attestationsData[collectionIds[i]][owners[i]];\\n\\n _triggerBadgeTransferEvent(collectionIds[i], owners[i], attestationData.value, 0);\\n\\n emit AttestationDeleted(\\n Attestation(\\n collectionIds[i],\\n owners[i],\\n attestationData.issuer,\\n attestationData.value,\\n attestationData.timestamp,\\n attestationData.extraData\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (bool) {\\n return _getAttestationValue(collectionId, owner) != 0;\\n }\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (AttestationData memory) {\\n return _getAttestationData(collectionId, owner);\\n }\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (uint256) {\\n return _getAttestationValue(collectionId, owner);\\n }\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (address, uint256, uint32, bytes memory) {\\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\\n return (\\n attestationData.issuer,\\n attestationData.value,\\n attestationData.timestamp,\\n attestationData.extraData\\n );\\n }\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (bytes memory) {\\n return _attestationsData[collectionId][owner].extraData;\\n }\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (address) {\\n return _attestationsData[collectionId][owner].issuer;\\n }\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view override returns (uint32) {\\n return _attestationsData[collectionId][owner].timestamp;\\n }\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view override returns (AttestationData[] memory) {\\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\\n }\\n return attestationsDataArray;\\n }\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view override returns (uint256[] memory) {\\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\\n }\\n return attestationsValues;\\n }\\n\\n /**\\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\\n * It enables off-chain apps such as opensea to catch the \\\"shadow mints/burns\\\" of badges\\n */\\n function _triggerBadgeTransferEvent(\\n uint256 badgeTokenId,\\n address owner,\\n uint256 previousValue,\\n uint256 newValue\\n ) internal {\\n bool isGreaterValue = newValue > previousValue;\\n address operator = address(this);\\n address from = isGreaterValue ? address(0) : owner;\\n address to = isGreaterValue ? owner : address(0);\\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\\n\\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\\n }\\n\\n function _getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) internal view returns (AttestationData memory) {\\n return (_attestationsData[collectionId][owner]);\\n }\\n\\n function _getAttestationValue(\\n uint256 collectionId,\\n address owner\\n ) internal view returns (uint256) {\\n return _attestationsData[collectionId][owner].value;\\n }\\n}\\n\",\"keccak256\":\"0xc21afe30d8096d2bab3683ca28b2533f99f53fa20a1f2c13aa44f1d46ecb9ae6\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IBadges.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Interface for Badges contract\\n * @author Sismo\\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\\n * The associated attestations registry triggers TransferSingle events from this contract\\n * It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms\\n */\\ninterface IBadges {\\n error BadgesNonTransferrable();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(string memory uri, address owner) external;\\n\\n /**\\n * @dev Main function of the ERC1155 badge\\n * The balance of a user is equal to the value of the underlying attestation.\\n * attestationCollectionId == badgeId\\n * @param account Address to check badge balance (= value of attestation)\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\\n * @param operator who is calling the TransferEvent\\n * @param from address(0) if minting, address of the badge holder if burning\\n * @param to address of the badge holder is minting, address(0) if burning\\n * @param id badgeId for which to trigger the event\\n * @param value minted/burned balance\\n */\\n function triggerTransferEvent(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 value\\n ) external;\\n\\n /**\\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\\n * @param attestationsRegistry new attestations registry address\\n */\\n function setAttestationsRegistry(address attestationsRegistry) external;\\n\\n /**\\n * @dev Set the URI. Can only be called by owner (default admin)\\n * @param uri new attestations registry address\\n */\\n function setUri(string memory uri) external;\\n\\n /**\\n * @dev Getter of the attestations registry\\n */\\n function getAttestationsRegistry() external view returns (address);\\n\\n /**\\n * @dev Getter of the badge issuer\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeIssuer(address account, uint256 id) external view returns (address);\\n\\n /**\\n * @dev Getter of the badge timestamp\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the value of a specific badge attribute\\n * @param id Badge Id to check (= attestationCollectionId)\\n * @param index Index of the attribute\\n */\\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);\\n\\n /**\\n * @dev Getter of all badge attributes and their values for a specific badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getAttributesNamesAndValuesForBadge(\\n uint256 id\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n}\\n\",\"keccak256\":\"0xd6bdfc887ef15ee022eb05d89dbe2e2938ee6c0a55a55f8db527ef650242c6bb\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport './OwnableLogic.sol';\\nimport './PausableLogic.sol';\\nimport './InitializableLogic.sol';\\nimport './AttestationsRegistryState.sol';\\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\\nimport {Bitmap256Bit} from '../utils/Bitmap256Bit.sol';\\n\\n/**\\n * @title Attestations Registry Config Logic contract\\n * @author Sismo\\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\\n **/\\ncontract AttestationsRegistryConfigLogic is\\n AttestationsRegistryState,\\n IAttestationsRegistryConfigLogic,\\n OwnableLogic,\\n PausableLogic,\\n InitializableLogic\\n{\\n using RangeUtils for Range[];\\n using Bitmap256Bit for uint256;\\n using Bitmap256Bit for uint8;\\n\\n /******************************************\\n *\\n * ATTESTATION REGISTRY WRITE ACCESS MANAGEMENT (ISSUERS)\\n *\\n *****************************************/\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external override onlyOwner {\\n _pause();\\n }\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external override onlyOwner {\\n _unpause();\\n }\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external override onlyOwner {\\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\\n }\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external override onlyOwner {\\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\\n }\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\\n }\\n }\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external override onlyOwner {\\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\\n }\\n }\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\\n return _isAuthorized(issuer, collectionId);\\n }\\n\\n /******************************************\\n *\\n * ATTRIBUTES CONFIG LOGIC\\n *\\n *****************************************/\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) public onlyOwner {\\n index._checkIndexIsValid();\\n if (_isAttributeCreated(index)) {\\n revert AttributeAlreadyExists(index);\\n }\\n _createNewAttribute(index, name);\\n }\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external onlyOwner {\\n if (indices.length != names.length) {\\n revert ArgsLengthDoesNotMatch();\\n }\\n\\n for (uint256 i = 0; i < indices.length; i++) {\\n createNewAttribute(indices[i], names[i]);\\n }\\n }\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) public onlyOwner {\\n index._checkIndexIsValid();\\n if (!_isAttributeCreated(index)) {\\n revert AttributeDoesNotExist(index);\\n }\\n _updateAttributeName(index, newName);\\n }\\n\\n function updateAttributesName(\\n uint8[] memory indices,\\n bytes32[] memory newNames\\n ) external onlyOwner {\\n if (indices.length != newNames.length) {\\n revert ArgsLengthDoesNotMatch();\\n }\\n\\n for (uint256 i = 0; i < indices.length; i++) {\\n updateAttributeName(indices[i], newNames[i]);\\n }\\n }\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must already exist\\n */\\n function deleteAttribute(uint8 index) public onlyOwner {\\n index._checkIndexIsValid();\\n if (!_isAttributeCreated(index)) {\\n revert AttributeDoesNotExist(index);\\n }\\n _deleteAttribute(index);\\n }\\n\\n function deleteAttributes(uint8[] memory indices) external onlyOwner {\\n for (uint256 i = 0; i < indices.length; i++) {\\n deleteAttribute(indices[i]);\\n }\\n }\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) public onlyOwner {\\n index._checkIndexIsValid();\\n\\n if (!_isAttributeCreated(index)) {\\n revert AttributeDoesNotExist(index);\\n }\\n\\n _setAttributeForAttestationsCollection(collectionId, index, value);\\n }\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external onlyOwner {\\n if (collectionIds.length != indices.length || collectionIds.length != values.length) {\\n revert ArgsLengthDoesNotMatch();\\n }\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n setAttributeValueForAttestationsCollection(collectionIds[i], indices[i], values[i]);\\n }\\n }\\n\\n /**\\n * @dev Returns the attribute's value (from 0 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index\\n ) public view returns (uint8) {\\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\\n collectionId\\n );\\n return currentAttributesValues._get(index);\\n }\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory) {\\n uint8[] memory attributesValues = new uint8[](indices.length);\\n for (uint256 i = 0; i < indices.length; i++) {\\n attributesValues[i] = getAttributeValueForAttestationsCollection(collectionId, indices[i]);\\n }\\n return attributesValues;\\n }\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) public view returns (bool) {\\n uint256 currentAttributeValues = _getAttributesValuesBitmapForAttestationsCollection(\\n collectionId\\n );\\n return currentAttributeValues._get(index) > 0;\\n }\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool) {\\n for (uint256 i = 0; i < indices.length; i++) {\\n if (!attestationsCollectionHasAttribute(collectionId, indices[i])) {\\n return false;\\n }\\n }\\n return true;\\n }\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) public view returns (bytes32[] memory, uint8[] memory) {\\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\\n collectionId\\n );\\n\\n (\\n uint8[] memory indices,\\n uint8[] memory values,\\n uint8 nbOfNonZeroValues\\n ) = currentAttributesValues._getAllNonZeroValues();\\n\\n bytes32[] memory attributesNames = new bytes32[](nbOfNonZeroValues);\\n uint8[] memory attributesValues = new uint8[](nbOfNonZeroValues);\\n for (uint8 i = 0; i < nbOfNonZeroValues; i++) {\\n attributesNames[i] = _attributesNames[indices[i]];\\n attributesValues[i] = values[i];\\n }\\n\\n return (attributesNames, attributesValues);\\n }\\n\\n /*****************************\\n *\\n * INTERNAL FUNCTIONS\\n *\\n *****************************/\\n\\n function _authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) internal {\\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\\n _authorizedRanges[issuer].push(newRange);\\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\\n }\\n\\n function _unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) internal onlyOwner {\\n if (rangeIndex >= _authorizedRanges[issuer].length)\\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\\n\\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\\n revert IdsMismatch(\\n issuer,\\n rangeIndex,\\n expectedFirstId,\\n expectedLastId,\\n firstCollectionId,\\n lastCollectionId\\n );\\n\\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\\n _authorizedRanges[issuer].length - 1\\n ];\\n _authorizedRanges[issuer].pop();\\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\\n }\\n\\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\\n return _authorizedRanges[issuer]._includes(collectionId);\\n }\\n\\n function _setAttributeForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) internal {\\n uint256 currentAttributes = _getAttributesValuesBitmapForAttestationsCollection(collectionId);\\n\\n _attestationsCollectionAttributesValuesBitmap[collectionId] = currentAttributes._set(\\n index,\\n value\\n );\\n\\n emit AttestationsCollectionAttributeSet(collectionId, index, value);\\n }\\n\\n function _createNewAttribute(uint8 index, bytes32 name) internal {\\n _attributesNames[index] = name;\\n\\n emit NewAttributeCreated(index, name);\\n }\\n\\n function _updateAttributeName(uint8 index, bytes32 newName) internal {\\n bytes32 previousName = _attributesNames[index];\\n\\n _attributesNames[index] = newName;\\n\\n emit AttributeNameUpdated(index, newName, previousName);\\n }\\n\\n function _deleteAttribute(uint8 index) internal {\\n bytes32 deletedName = _attributesNames[index];\\n\\n delete _attributesNames[index];\\n\\n emit AttributeDeleted(index, deletedName);\\n }\\n\\n function _getAttributesValuesBitmapForAttestationsCollection(\\n uint256 collectionId\\n ) internal view returns (uint256) {\\n return _attestationsCollectionAttributesValuesBitmap[collectionId];\\n }\\n\\n function _isAttributeCreated(uint8 index) internal view returns (bool) {\\n if (_attributesNames[index] == 0) {\\n return false;\\n }\\n return true;\\n }\\n}\\n\",\"keccak256\":\"0xa48b3131a3870684389282cb863a34734c67194d7f50d266ed8421114b3d786a\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/AttestationsRegistryState.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Range} from '../utils/RangeLib.sol';\\nimport {Attestation, AttestationData} from '../Structs.sol';\\n\\ncontract AttestationsRegistryState {\\n /*******************************************************\\n Storage layout:\\n 19 slots for config\\n 4 currently used for _initialized, _initializing, _paused, _owner\\n 15 place holders\\n 16 slots for logic\\n 3 currently used for _authorizedRanges, _attestationsCollectionAttributesValuesBitmap, _attributesNames\\n 13 place holders\\n 1 slot for _attestationsData \\n *******************************************************/\\n\\n // main config\\n // changed `_initialized` from bool to uint8\\n // as we were using OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n // and changed to OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n // PR: https://github.com/sismo-core/sismo-protocol/pull/41\\n uint8 internal _initialized;\\n bool internal _initializing;\\n bool internal _paused;\\n address internal _owner;\\n // keeping some space for future\\n uint256[15] private _placeHoldersAdmin;\\n\\n // storing the authorized ranges for each attesters\\n mapping(address => Range[]) internal _authorizedRanges;\\n // Storing the attributes values used for each attestations collection\\n // Each attribute value is an hexadecimal\\n mapping(uint256 => uint256) internal _attestationsCollectionAttributesValuesBitmap;\\n // Storing the attribute name for each attributes index\\n mapping(uint8 => bytes32) internal _attributesNames;\\n // keeping some space for future\\n uint256[13] private _placeHoldersConfig;\\n // storing the data of attestations\\n // =collectionId=> =owner=> attestationData\\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\\n}\\n\",\"keccak256\":\"0xabd7a629901a128cc32f80102ce06db228a76bd04f27818ccaf54827921eb149\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/InitializableLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport '../utils/Address.sol';\\nimport './AttestationsRegistryState.sol';\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract InitializableLogic is AttestationsRegistryState {\\n // only diff with oz\\n // /**\\n // * @dev Indicates that the contract has been initialized.\\n // */\\n // bool private _initialized;\\n\\n // /**\\n // * @dev Indicates that the contract is in the process of being initialized.\\n // */\\n // bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) ||\\n (!Address.isContract(address(this)) && _initialized == 1),\\n 'Initializable: contract is already initialized'\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(\\n !_initializing && _initialized < version,\\n 'Initializable: contract is already initialized'\\n );\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, 'Initializable: contract is not initializing');\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, 'Initializable: contract is initializing');\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0x64d931c5e29318bd4ae2ec44b3be45783ad7ad20431594bbcb9ae4e2014bc5ef\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/OwnableLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport '../utils/Context.sol';\\nimport './AttestationsRegistryState.sol';\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n // This is the only diff with OZ contract\\n // address private _owner;\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x74ff8ebdd6ad706a45354f1045ef623840aa1dbde37874dde2b6bfa498e0bdb3\",\"license\":\"MIT\"},\"contracts/core/libs/attestations-registry/PausableLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport '../utils/Context.sol';\\nimport './AttestationsRegistryState.sol';\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract PausableLogic is Context, AttestationsRegistryState {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n // this is the only diff with OZ contract\\n // bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n require(!paused(), 'Pausable: paused');\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n require(paused(), 'Pausable: not paused');\\n _;\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0x234c48f5eb48bb15b6c2535428f1e28e172bc2c6fbf58c99ba7b3ca75e884c60\",\"license\":\"MIT\"},\"contracts/core/libs/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, 'Address: insufficient balance');\\n\\n (bool success, ) = recipient.call{value: amount}('');\\n require(success, 'Address: unable to send value, recipient may have reverted');\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, 'Address: low-level call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, 'Address: insufficient balance for call');\\n require(isContract(target), 'Address: call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data\\n ) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, 'Address: low-level static call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), 'Address: static call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), 'Address: delegate call to non-contract');\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xdbca640e165333604a6121b07d206eea2b596dd3c3bb4d62caa436a05ac1d91d\",\"license\":\"MIT\"},\"contracts/core/libs/utils/Bitmap256Bit.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/*\\n * The 256-bit bitmap is structured in 64 chuncks of 4 bits each.\\n * The 4 bits can encode any value from 0 to 15.\\n\\n chunck63 chunck2 chunck1 chunck0\\n bits bits bits bits \\n \\u250c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510 \\u250c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u252c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u252c\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2510\\n \\u2502 1 1 1 1 \\u2502 .... \\u2502 1 0 1 1 \\u2502 0 0 0 0 \\u2502 0 0 0 1 \\u2502\\n \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518 \\u2514\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2534\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2534\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2500\\u2518\\n value 15 value 11 value 0 value 1\\n\\n * A chunck index must be between 0 and 63.\\n * A value must be between 0 and 15.\\n **/\\n\\nlibrary Bitmap256Bit {\\n uint256 constant MAX_INT = 2 ** 256 - 1;\\n\\n error IndexOutOfBounds(uint8 index);\\n error ValueOutOfBounds(uint8 value);\\n\\n /**\\n * @dev Return the value at a given index of a 256-bit bitmap\\n * @param index index where the value can be found. Can be between 0 and 63\\n */\\n function _get(uint256 self, uint8 index) internal pure returns (uint8) {\\n uint256 currentValues = self;\\n // Get the encoded 4-bit value by right shifting to the `index` position\\n uint256 shifted = currentValues >> (4 * index);\\n // Get the value by only masking the last 4 bits with an AND operator\\n return uint8(shifted & (2 ** 4 - 1));\\n }\\n\\n /**\\n * @dev Set a value at a chosen index in a 256-bit bitmap\\n * @param index index where the value will be stored. Can be between 0 and 63\\n * @param value value to store. Can be between 0 and 15\\n */\\n function _set(uint256 self, uint8 index, uint8 value) internal pure returns (uint256) {\\n _checkIndexIsValid(index);\\n _checkValueIsValid(value);\\n\\n uint256 currentValues = self;\\n // 1. first we need to remove the current value for the inputed `index`\\n // Left Shift 4 bits mask (1111 mask) to the `index` position\\n uint256 mask = (2 ** 4 - 1) << (4 * index);\\n // Apply a XOR operation to obtain a mask with all bits set to 1 except the 4 bits that we want to remove\\n uint256 negativeMask = MAX_INT ^ mask;\\n // Apply a AND operation between the current values and the negative mask to remove the wanted bits\\n uint256 newValues = currentValues & negativeMask;\\n\\n // 2. We set the new value wanted at the `index` position\\n // Create the 4 bits encoding the new value and left shift them to the `index` position\\n uint256 newValueMask = uint256(value) << (4 * index);\\n // Apply an OR operation between the current values and the newValueMask to reference new value\\n return newValues | newValueMask;\\n }\\n\\n /**\\n * @dev Get all the non-zero values in a 256-bit bitmap\\n * @param self a 256-bit bitmap\\n */\\n function _getAllNonZeroValues(\\n uint256 self\\n ) internal pure returns (uint8[] memory, uint8[] memory, uint8) {\\n uint8[] memory indices = new uint8[](64);\\n uint8[] memory values = new uint8[](64);\\n uint8 nbOfNonZeroValues = 0;\\n for (uint8 i = 0; i < 63; i++) {\\n uint8 value = _get(self, i);\\n if (value > 0) {\\n indices[nbOfNonZeroValues] = i;\\n values[nbOfNonZeroValues] = value;\\n nbOfNonZeroValues++;\\n }\\n }\\n return (indices, values, nbOfNonZeroValues);\\n }\\n\\n /**\\n * @dev Check if the index is valid (is between 0 and 63)\\n * @param index index of a chunck\\n */\\n function _checkIndexIsValid(uint8 index) internal pure {\\n if (index > 63) {\\n revert IndexOutOfBounds(index);\\n }\\n }\\n\\n /**\\n * @dev Check if the value is valid (is between 0 and 15)\\n * @param value value to encode in a chunck\\n */\\n function _checkValueIsValid(uint8 value) internal pure {\\n if (value > 15) {\\n revert ValueOutOfBounds(value);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xac6ca38e106fb9e999b0c765dba0f8894697c3aead9459ffeab6b32e3560b39e\",\"license\":\"MIT\"},\"contracts/core/libs/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2dba7215628ceb3bb6f28422c7ca48d79615dd7aa8ba54978d4d8cad996f57e\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x60a06040523480156200001157600080fd5b506040516200393538038062003935833981016040819052620000349162000209565b6200003f336200006b565b6000805462ff0000191690556001600160a01b0381166080526200006382620000c8565b505062000241565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600390610100900460ff16158015620000eb575060005460ff8083169116105b620001535760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff83161761010017815562000181600054630100000090046001600160a01b031690565b6001600160a01b03161480620001965750303b155b15620001a757620001a7826200006b565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b80516001600160a01b03811681146200020457600080fd5b919050565b600080604083850312156200021d57600080fd5b6200022883620001ec565b91506200023860208401620001ec565b90509250929050565b6080516136d86200025d600039600061258301526136d86000f3fe608060405234801561001057600080fd5b50600436106102275760003560e01c80637ffe93fc11610130578063b8865673116100b8578063dc873d011161007c578063dc873d0114610566578063e78d54bb14610586578063e972f91014610599578063ebc5c093146105ac578063f2fde38b146105bf57600080fd5b8063b8865673146104e5578063c06d5db6146104f8578063c4d66de81461050b578063c7da9aa61461051e578063da5d314b1461055357600080fd5b806384c2ad82116100ff57806384c2ad821461044d5780638c3c9e321461046d5780638da5cb5b1461048e578063aad9a979146104bf578063b1cb1662146104d257600080fd5b80637ffe93fc1461040c578063811a6af71461041f57806381213f22146104325780638456cb591461044557600080fd5b8063436a76f3116101b35780636d7fbb67116101825780636d7fbb67146103a4578063715018a6146103c4578063754b377c146103cc5780637cc920b4146103e65780637cde0fe2146103f957600080fd5b8063436a76f31461033f5780635657f0361461035f5780635c975abb1461038057806364fff83c1461039157600080fd5b80631538ff08116101fa5780631538ff08146102db578063181dfdff146102ee5780632972b0f0146103015780633be1ced7146103145780633f4ba83a1461033757600080fd5b8063011023901461022c57806305b374211461025457806314067f8b1461026957806315027bda146102bb575b600080fd5b61023f61023a366004612932565b6105d2565b60405190151581526020015b60405180910390f35b61026761026236600461296f565b6105e9565b005b6102a6610277366004612932565b6000918252602080805260408084206001600160a01b0393909316845291905290206002015463ffffffff1690565b60405163ffffffff909116815260200161024b565b6102ce6102c9366004612a95565b610669565b60405161024b9190612be4565b6102676102e9366004612ca8565b61075a565b6102676102fc366004612dd2565b61080d565b61023f61030f366004612e45565b6108cd565b610327610322366004612932565b6108e0565b60405161024b9493929190612e61565b6102676109f6565b61035261034d366004612e9e565b610a32565b60405161024b9190612f22565b61037261036d366004612f35565b610ae0565b60405161024b929190612f4e565b60005462010000900460ff1661023f565b61026761039f366004612f9b565b610c65565b6103b76103b2366004612932565b610cd7565b60405161024b9190612fcf565b610267610d8f565b6103d4600381565b60405160ff909116815260200161024b565b6102676103f4366004612fe2565b610dcb565b61026761040736600461305f565b610ea2565b61026761041a366004613092565b610edf565b61026761042d3660046130f8565b610f54565b61023f610440366004612e9e565b611330565b61026761138a565b61046061045b366004612932565b6113c4565b60405161024b9190613163565b61048061047b366004612932565b6113f1565b60405190815260200161024b565b6104a7600054630100000090046001600160a01b031690565b6040516001600160a01b03909116815260200161024b565b6102676104cd36600461296f565b6113fd565b6102676104e0366004612ca8565b611471565b6102676104f3366004613176565b61151f565b6102676105063660046131b9565b6115b4565b6102676105193660046131f2565b6115f2565b6104a761052c366004612932565b6000918252602080805260408084206001600160a01b039384168552909152909120541690565b61023f61056136600461320d565b61170c565b610579610574366004612a95565b611733565b60405161024b9190613230565b610267610594366004613274565b6117f3565b6103d46105a736600461320d565b611867565b6102676105ba3660046132b0565b611888565b6102676105cd3660046131f2565b611ce0565b60006105de8383611d80565b151590505b92915050565b6000546001600160a01b0363010000009091041633146106245760405162461bcd60e51b815260040161061b906132f1565b60405180910390fd5b6106308260ff16611da9565b61063982611dd3565b61065b5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6106658282611dfc565b5050565b6060600083516001600160401b0381111561068657610686612999565b6040519080825280602002602001820160405280156106d757816020015b60408051608081018252600080825260208083018290529282015260608082015282526000199092019101816106a45790505b50905060005b8451811015610752576107228582815181106106fb576106fb613326565b602002602001015185838151811061071557610715613326565b6020026020010151611e5c565b82828151811061073457610734613326565b6020026020010181905250808061074a90613352565b9150506106dd565b509392505050565b6000546001600160a01b03630100000090910416331461078c5760405162461bcd60e51b815260040161061b906132f1565b80518251146107ae57604051636e37235160e11b815260040160405180910390fd5b60005b8251811015610808576107f68382815181106107cf576107cf613326565b60200260200101518383815181106107e9576107e9613326565b60200260200101516105e9565b8061080081613352565b9150506107b1565b505050565b6000546001600160a01b03630100000090910416331461083f5760405162461bcd60e51b815260040161061b906132f1565b60005b81518110156108c7576108b5848284848151811061086257610862613326565b6020026020010151610874919061336b565b85848151811061088657610886613326565b6020026020010151600001518685815181106108a4576108a4613326565b602002602001015160200151611f6b565b806108bf81613352565b915050610842565b50505050565b60006108d9838361220a565b9392505050565b6000828152602080805260408083206001600160a01b038086168552908352818420825160808101845281549092168252600181015493820193909352600283015463ffffffff1691810191909152600382018054849384936060938593919291838601919061094f90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461097b90613382565b80156109c85780601f1061099d576101008083540402835291602001916109c8565b820191906000526020600020905b8154815290600101906020018083116109ab57829003601f168201915b505050919092525050815160208301516040840151606090940151919b909a50929850965090945050505050565b6000546001600160a01b036301000000909104163314610a285760405162461bcd60e51b815260040161061b906132f1565b610a3061222c565b565b6060600082516001600160401b03811115610a4f57610a4f612999565b604051908082528060200260200182016040528015610a78578160200160208202803683370190505b50905060005b835181101561075257610aaa85858381518110610a9d57610a9d613326565b6020026020010151611867565b828281518110610abc57610abc613326565b60ff9092166020928302919091019091015280610ad881613352565b915050610a7e565b6000818152601160205260408120546060918291908080610b00846122c7565b92509250925060008160ff166001600160401b03811115610b2357610b23612999565b604051908082528060200260200182016040528015610b4c578160200160208202803683370190505b50905060008260ff166001600160401b03811115610b6c57610b6c612999565b604051908082528060200260200182016040528015610b95578160200160208202803683370190505b50905060005b8360ff168160ff161015610c565760126000878360ff1681518110610bc257610bc2613326565b602002602001015160ff1660ff16815260200190815260200160002054838260ff1681518110610bf457610bf4613326565b602002602001018181525050848160ff1681518110610c1557610c15613326565b6020026020010151828260ff1681518110610c3257610c32613326565b60ff9092166020928302919091019091015280610c4e816133bc565b915050610b9b565b50909890975095505050505050565b6000546001600160a01b036301000000909104163314610c975760405162461bcd60e51b815260040161061b906132f1565b60005b815181101561066557610cc5828281518110610cb857610cb8613326565b6020026020010151610edf565b80610ccf81613352565b915050610c9a565b6000828152602080805260408083206001600160a01b03851684529091529020600301805460609190610d0990613382565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3590613382565b8015610d825780601f10610d5757610100808354040283529160200191610d82565b820191906000526020600020905b815481529060010190602001808311610d6557829003601f168201915b5050505050905092915050565b6000546001600160a01b036301000000909104163314610dc15760405162461bcd60e51b815260040161061b906132f1565b610a3060006123bc565b6000546001600160a01b036301000000909104163314610dfd5760405162461bcd60e51b815260040161061b906132f1565b81518351141580610e1057508051835114155b15610e2e57604051636e37235160e11b815260040160405180910390fd5b60005b83518110156108c757610e90848281518110610e4f57610e4f613326565b6020026020010151848381518110610e6957610e69613326565b6020026020010151848481518110610e8357610e83613326565b60200260200101516117f3565b80610e9a81613352565b915050610e31565b6000546001600160a01b036301000000909104163314610ed45760405162461bcd60e51b815260040161061b906132f1565b610808838383612419565b6000546001600160a01b036301000000909104163314610f115760405162461bcd60e51b815260040161061b906132f1565b610f1d8160ff16611da9565b610f2681611dd3565b610f485760405163eabeadd360e01b815260ff8216600482015260240161061b565b610f51816124ac565b50565b60005462010000900460ff1615610f7d5760405162461bcd60e51b815260040161061b906133db565b828114610fa55783838383604051638ceb003d60e01b815260040161061b9493929190613405565b3360005b8481101561132857600060206000868685818110610fc957610fc9613326565b9050602002013581526020019081526020016000206000888885818110610ff257610ff2613326565b905060200201602081019061100791906131f2565b6001600160a01b0390811682526020808301939093526040918201600020825160808101845281549092168252600181015493820193909352600283015463ffffffff169181019190915260038201805491929160608401919061106a90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461109690613382565b80156110e35780601f106110b8576101008083540402835291602001916110e3565b820191906000526020600020905b8154815290600101906020018083116110c657829003601f168201915b50505050508152505090506111108386868581811061110457611104613326565b9050602002013561220a565b61115a578285858481811061112757611127613326565b60405163c522f21160e01b81526001600160a01b039094166004850152602002919091013560248301525060440161061b565b6020600086868581811061117057611170613326565b905060200201358152602001908152602001600020600088888581811061119957611199613326565b90506020020160208101906111ae91906131f2565b6001600160a01b031681526020810191909152604001600090812080546001600160a01b03191681556001810182905560028101805463ffffffff19169055906111fb6003830182612843565b505061124c85858481811061121257611212613326565b9050602002013588888581811061122b5761122b613326565b905060200201602081019061124091906131f2565b836020015160006124fb565b7f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b6040518060c0016040528087878681811061128a5761128a613326565b9050602002013581526020018989868181106112a8576112a8613326565b90506020020160208101906112bd91906131f2565b6001600160a01b0316815260200183600001516001600160a01b0316815260200183602001518152602001836040015163ffffffff168152602001836060015181525060405161130d9190613487565b60405180910390a1508061132081613352565b915050610fa9565b505050505050565b6000805b8251811015611380576113608484838151811061135357611353613326565b602002602001015161170c565b61136e5760009150506105e3565b8061137881613352565b915050611334565b5060019392505050565b6000546001600160a01b0363010000009091041633146113bc5760405162461bcd60e51b815260040161061b906132f1565b610a306125ec565b60408051608081018252600080825260208201819052918101919091526060808201526108d98383611e5c565b60006108d98383611d80565b6000546001600160a01b03630100000090910416331461142f5760405162461bcd60e51b815260040161061b906132f1565b61143b8260ff16611da9565b61144482611dd3565b1561146757604051635d04d75160e01b815260ff8316600482015260240161061b565b610665828261264e565b6000546001600160a01b0363010000009091041633146114a35760405162461bcd60e51b815260040161061b906132f1565b80518251146114c557604051636e37235160e11b815260040160405180910390fd5b60005b82518110156108085761150d8382815181106114e6576114e6613326565b602002602001015183838151811061150057611500613326565b60200260200101516113fd565b8061151781613352565b9150506114c8565b6000546001600160a01b0363010000009091041633146115515760405162461bcd60e51b815260040161061b906132f1565b60005b8151811015610808576115a28383838151811061157357611573613326565b60200260200101516000015184848151811061159157611591613326565b602002602001015160200151612419565b806115ac81613352565b915050611554565b6000546001600160a01b0363010000009091041633146115e65760405162461bcd60e51b815260040161061b906132f1565b6108c784848484611f6b565b600054600390610100900460ff16158015611614575060005460ff8083169116105b6116775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161061b565b6000805461ffff191660ff8316176101001781556116a4600054630100000090046001600160a01b031690565b6001600160a01b031614806116b85750303b155b156116c6576116c6826123bc565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60008281526011602052604081205460006117278285612699565b60ff1611949350505050565b6060600083516001600160401b0381111561175057611750612999565b604051908082528060200260200182016040528015611779578160200160208202803683370190505b50905060005b8451811015610752576117c485828151811061179d5761179d613326565b60200260200101518583815181106117b7576117b7613326565b6020026020010151611d80565b8282815181106117d6576117d6613326565b6020908102919091010152806117eb81613352565b91505061177f565b6000546001600160a01b0363010000009091041633146118255760405162461bcd60e51b815260040161061b906132f1565b6118318260ff16611da9565b61183a82611dd3565b61185c5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6108088383836126be565b6000828152601160205260408120546118808184612699565b949350505050565b60005462010000900460ff16156118b15760405162461bcd60e51b815260040161061b906133db565b3360005b828110156108c7576118eb828585848181106118d3576118d3613326565b90506020028101906118e591906134e8565b3561220a565b61193f578184848381811061190257611902613326565b905060200281019061191491906134e8565b60405163c522f21160e01b81526001600160a01b03909216600483015235602482015260440161061b565b60006020600086868581811061195757611957613326565b905060200281019061196991906134e8565b600001358152602001908152602001600020600086868581811061198f5761198f613326565b90506020028101906119a191906134e8565b6119b29060408101906020016131f2565b6001600160a01b03166001600160a01b0316815260200190815260200160002060010154905060405180608001604052808686858181106119f5576119f5613326565b9050602002810190611a0791906134e8565b611a189060608101906040016131f2565b6001600160a01b03168152602001868685818110611a3857611a38613326565b9050602002810190611a4a91906134e8565b606001358152602001868685818110611a6557611a65613326565b9050602002810190611a7791906134e8565b611a889060a081019060800161351c565b63ffffffff168152602001868685818110611aa557611aa5613326565b9050602002810190611ab791906134e8565b611ac59060a0810190613537565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250602092508890508786818110611b1257611b12613326565b9050602002810190611b2491906134e8565b6000013581526020019081526020016000206000878786818110611b4a57611b4a613326565b9050602002810190611b5c91906134e8565b611b6d9060408101906020016131f2565b6001600160a01b0390811682526020808301939093526040918201600020845181546001600160a01b03191692169190911781558383015160018201559083015160028201805463ffffffff191663ffffffff909216919091179055606083015180519192611be49260038501929091019061287d565b50905050611c73858584818110611bfd57611bfd613326565b9050602002810190611c0f91906134e8565b35868685818110611c2257611c22613326565b9050602002810190611c3491906134e8565b611c459060408101906020016131f2565b83888887818110611c5857611c58613326565b9050602002810190611c6a91906134e8565b606001356124fb565b7f8c20c3acb6b5208b7affea2fd90dabc8d47e77cee9766c855ce42730505cb205858584818110611ca657611ca6613326565b9050602002810190611cb891906134e8565b604051611cc591906135a6565b60405180910390a15080611cd881613352565b9150506118b5565b6000546001600160a01b036301000000909104163314611d125760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b038116611d775760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061b565b610f51816123bc565b6000918252602080805260408084206001600160a01b0393909316845291905290206001015490565b603f8160ff161115610f515760405163453e14b960e01b815260ff8216600482015260240161061b565b60ff81166000908152601260205260408120548103611df457506000919050565b506001919050565b60ff82166000818152601260209081526040918290208054908590558251938452908301849052908201819052907f0d3d8d66bac9b2a9f0e5c83181a30443294ab849472526080d03fffd7187f7169060600160405180910390a1505050565b60408051608081018252600080825260208201819052918101919091526060808201526000838152602080805260408083206001600160a01b03808716855290835292819020815160808101835281549094168452600181015492840192909252600282015463ffffffff1690830152600381018054606084019190611ee190613382565b80601f0160208091040260200160405190810160405280929190818152602001828054611f0d90613382565b8015611f5a5780601f10611f2f57610100808354040283529160200191611f5a565b820191906000526020600020905b815481529060010190602001808311611f3d57829003601f168201915b505050505081525050905092915050565b6000546001600160a01b036301000000909104163314611f9d5760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b0384166000908152601060205260409020548310611fff576001600160a01b038416600081815260106020526040908190205490516345e388eb60e01b8152600481019290925260248201526044810184905260640161061b565b6001600160a01b038416600090815260106020526040812080548590811061202957612029613326565b600091825260208083206002909202909101546001600160a01b03881683526010909152604082208054919350908690811061206757612067613326565b9060005260206000209060020201600101549050818414158061208a5750808314155b156120d657604051637a4dd76560e01b81526001600160a01b03871660048201526024810186905260448101839052606481018290526084810185905260a4810184905260c40161061b565b6001600160a01b038616600090815260106020526040902080546120fc9060019061336b565b8154811061210c5761210c613326565b906000526020600020906002020160106000886001600160a01b03166001600160a01b03168152602001908152602001600020868154811061215057612150613326565b60009182526020808320845460029093020191825560019384015493909101929092556001600160a01b038816815260109091526040902080548061219757612197613663565b6000828152602080822060026000199490940193840201828155600101919091559155604080516001600160a01b038916815291820186905281018490527f33cff58e54c3a8acae85cad63487b5dcf617521e33bb03f071299f374c29de1f9060600160405180910390a1505050505050565b6001600160a01b03821660009081526010602052604081206108d99083612732565b60005462010000900460ff1661227b5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161061b565b6000805462ff0000191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60408051818152610820810182526060918291600091829190602082016108008036833750506040805181815261082081018252929350600092915060208201610800803683370190505090506000805b603f8160ff1610156123ae5760006123308983612699565b905060ff81161561239b5781858460ff168151811061235157612351613326565b602002602001019060ff16908160ff168152505080848460ff168151811061237b5761237b613326565b60ff9092166020928302919091019091015282612397816133bc565b9350505b50806123a6816133bc565b915050612318565b509196909550909350915050565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60408051808201825283815260208082018481526001600160a01b03871660008181526010845285812080546001808201835591835291859020865160029093020191825592519201919091558351908152908101859052918201839052907fe7d6ac0b740347f7f96a97e6a9dc0f20f4f11eca65495315adc009a55b6762f8906060015b60405180910390a150505050565b60ff811660008181526012602090815260408083208054939055805193845290830182905290917feb82955a27e39ea7559b6ec7e7d8b371081ab0d8783c7b0d01597555e7dcadbf9101611700565b8181113060008261250c578561250f565b60005b905060008361251f576000612521565b865b905060008461253957612534868861336b565b612543565b612543878761336b565b604051633885984b60e11b81526001600160a01b03868116600483015285811660248301528481166044830152606482018c9052608482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063710b30969060a401600060405180830381600087803b1580156125c957600080fd5b505af11580156125dd573d6000803e3d6000fd5b50505050505050505050505050565b60005462010000900460ff16156126155760405162461bcd60e51b815260040161061b906133db565b6000805462ff00001916620100001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122aa3390565b60ff8216600081815260126020908152604091829020849055815192835282018390527f16f0bfe4b02efd5423ef8906906b049c0943f21df8f10347d319fddbc59222079101611700565b600082816126a8846004613679565b60ff1682901c905080600f169250505092915050565b6000838152601160205260409020546126d88184846127c0565b6000858152601160205260409081902091909155517f393b86c90799fa411201ae723a54e105823fcf7c6c8dffa90903fc44c03b4ac79061249e9086908690869092835260ff918216602084015216604082015260600190565b6000805b83548110156127b65783818154811061275157612751613326565b9060005260206000209060020201600001548310158015612795575083818154811061277f5761277f613326565b9060005260206000209060020201600101548311155b156127a45760019150506105e3565b806127ae81613352565b915050612736565b5060009392505050565b60006127cb83611da9565b6127d482612819565b8360006127e2856004613679565b600f60ff919091161b905060001981188281166000612802886004613679565b60ff97881697169690961b17979650505050505050565b600f8160ff161115610f51576040516329afd27b60e21b815260ff8216600482015260240161061b565b50805461284f90613382565b6000825580601f1061285f575050565b601f016020900490600052602060002090810190610f519190612901565b82805461288990613382565b90600052602060002090601f0160209004810192826128ab57600085556128f1565b82601f106128c457805160ff19168380011785556128f1565b828001600101855582156128f1579182015b828111156128f15782518255916020019190600101906128d6565b506128fd929150612901565b5090565b5b808211156128fd5760008155600101612902565b80356001600160a01b038116811461292d57600080fd5b919050565b6000806040838503121561294557600080fd5b8235915061295560208401612916565b90509250929050565b803560ff8116811461292d57600080fd5b6000806040838503121561298257600080fd5b61298b8361295e565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156129d1576129d1612999565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129ff576129ff612999565b604052919050565b60006001600160401b03821115612a2057612a20612999565b5060051b60200190565b600082601f830112612a3b57600080fd5b81356020612a50612a4b83612a07565b6129d7565b82815260059290921b84018101918181019086841115612a6f57600080fd5b8286015b84811015612a8a5780358352918301918301612a73565b509695505050505050565b60008060408385031215612aa857600080fd5b82356001600160401b0380821115612abf57600080fd5b612acb86838701612a2a565b9350602091508185013581811115612ae257600080fd5b85019050601f81018613612af557600080fd5b8035612b03612a4b82612a07565b81815260059190911b82018301908381019088831115612b2257600080fd5b928401925b82841015612b4757612b3884612916565b82529284019290840190612b27565b80955050505050509250929050565b6000815180845260005b81811015612b7c57602081850181015186830182015201612b60565b81811115612b8e576000602083870101525b50601f01601f19169290920160200192915050565b60018060a01b0381511682526020810151602083015263ffffffff604082015116604083015260006060820151608060608501526118806080850182612b56565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612c3957603f19888603018452612c27858351612ba3565b94509285019290850190600101612c0b565b5092979650505050505050565b600082601f830112612c5757600080fd5b81356020612c67612a4b83612a07565b82815260059290921b84018101918181019086841115612c8657600080fd5b8286015b84811015612a8a57612c9b8161295e565b8352918301918301612c8a565b60008060408385031215612cbb57600080fd5b82356001600160401b0380821115612cd257600080fd5b612cde86838701612c46565b9350602091508185013581811115612cf557600080fd5b85019050601f81018613612d0857600080fd5b8035612d16612a4b82612a07565b81815260059190911b82018301908381019088831115612d3557600080fd5b928401925b82841015612b4757833582529284019290840190612d3a565b600082601f830112612d6457600080fd5b81356020612d74612a4b83612a07565b82815260069290921b84018101918181019086841115612d9357600080fd5b8286015b84811015612a8a5760408189031215612db05760008081fd5b612db86129af565b813581528482013585820152835291830191604001612d97565b600080600060608486031215612de757600080fd5b612df084612916565b925060208401356001600160401b0380821115612e0c57600080fd5b612e1887838801612d53565b93506040860135915080821115612e2e57600080fd5b50612e3b86828701612a2a565b9150509250925092565b60008060408385031215612e5857600080fd5b61298b83612916565b60018060a01b038516815283602082015263ffffffff83166040820152608060608201526000612e946080830184612b56565b9695505050505050565b60008060408385031215612eb157600080fd5b8235915060208301356001600160401b03811115612ece57600080fd5b612eda85828601612c46565b9150509250929050565b600081518084526020808501945080840160005b83811015612f1757815160ff1687529582019590820190600101612ef8565b509495945050505050565b6020815260006108d96020830184612ee4565b600060208284031215612f4757600080fd5b5035919050565b604080825283519082018190526000906020906060840190828701845b82811015612f8757815184529284019290840190600101612f6b565b50505083810382850152612e948186612ee4565b600060208284031215612fad57600080fd5b81356001600160401b03811115612fc357600080fd5b61188084828501612c46565b6020815260006108d96020830184612b56565b600080600060608486031215612ff757600080fd5b83356001600160401b038082111561300e57600080fd5b61301a87838801612a2a565b9450602086013591508082111561303057600080fd5b61303c87838801612c46565b9350604086013591508082111561305257600080fd5b50612e3b86828701612c46565b60008060006060848603121561307457600080fd5b61307d84612916565b95602085013595506040909401359392505050565b6000602082840312156130a457600080fd5b6108d98261295e565b60008083601f8401126130bf57600080fd5b5081356001600160401b038111156130d657600080fd5b6020830191508360208260051b85010111156130f157600080fd5b9250929050565b6000806000806040858703121561310e57600080fd5b84356001600160401b038082111561312557600080fd5b613131888389016130ad565b9096509450602087013591508082111561314a57600080fd5b50613157878288016130ad565b95989497509550505050565b6020815260006108d96020830184612ba3565b6000806040838503121561318957600080fd5b61319283612916565b915060208301356001600160401b038111156131ad57600080fd5b612eda85828601612d53565b600080600080608085870312156131cf57600080fd5b6131d885612916565b966020860135965060408601359560600135945092505050565b60006020828403121561320457600080fd5b6108d982612916565b6000806040838503121561322057600080fd5b823591506129556020840161295e565b6020808252825182820181905260009190848201906040850190845b818110156132685783518352928401929184019160010161324c565b50909695505050505050565b60008060006060848603121561328957600080fd5b833592506132996020850161295e565b91506132a76040850161295e565b90509250925092565b600080602083850312156132c357600080fd5b82356001600160401b038111156132d957600080fd5b6132e5858286016130ad565b90969095509350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016133645761336461333c565b5060010190565b60008282101561337d5761337d61333c565b500390565b600181811c9082168061339657607f821691505b6020821081036133b657634e487b7160e01b600052602260045260246000fd5b50919050565b600060ff821660ff81036133d2576133d261333c565b60010192915050565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6040808252810184905260008560608301825b87811015613446576001600160a01b0361343184612916565b16825260209283019290910190600101613418565b5083810360208501528481526001600160fb1b0385111561346657600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b60208152815160208201526000602083015160018060a01b03808216604085015280604086015116606085015250506060830151608083015263ffffffff60808401511660a083015260a083015160c08084015261188060e0840182612b56565b6000823560be198336030181126134fe57600080fd5b9190910192915050565b803563ffffffff8116811461292d57600080fd5b60006020828403121561352e57600080fd5b6108d982613508565b6000808335601e1984360301811261354e57600080fd5b8301803591506001600160401b0382111561356857600080fd5b6020019150368190038213156130f157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b602081528135602082015260006135bf60208401612916565b60018060a01b038082166040850152806135db60408701612916565b16606085015250506060830135608083015263ffffffff6135fe60808501613508565b1660a083015260a0830135601e1984360301811261361b57600080fd5b83016020810190356001600160401b0381111561363757600080fd5b80360382131561364657600080fd5b60c08085015261365a60e08501828461357d565b95945050505050565b634e487b7160e01b600052603160045260246000fd5b600060ff821660ff84168160ff048111821515161561369a5761369a61333c565b02939250505056fea26469706673582212209714c1001d19740a655ea4426b52e9f5d8348f9df38d027a88d1f1095e244e9464736f6c634300080e0033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106102275760003560e01c80637ffe93fc11610130578063b8865673116100b8578063dc873d011161007c578063dc873d0114610566578063e78d54bb14610586578063e972f91014610599578063ebc5c093146105ac578063f2fde38b146105bf57600080fd5b8063b8865673146104e5578063c06d5db6146104f8578063c4d66de81461050b578063c7da9aa61461051e578063da5d314b1461055357600080fd5b806384c2ad82116100ff57806384c2ad821461044d5780638c3c9e321461046d5780638da5cb5b1461048e578063aad9a979146104bf578063b1cb1662146104d257600080fd5b80637ffe93fc1461040c578063811a6af71461041f57806381213f22146104325780638456cb591461044557600080fd5b8063436a76f3116101b35780636d7fbb67116101825780636d7fbb67146103a4578063715018a6146103c4578063754b377c146103cc5780637cc920b4146103e65780637cde0fe2146103f957600080fd5b8063436a76f31461033f5780635657f0361461035f5780635c975abb1461038057806364fff83c1461039157600080fd5b80631538ff08116101fa5780631538ff08146102db578063181dfdff146102ee5780632972b0f0146103015780633be1ced7146103145780633f4ba83a1461033757600080fd5b8063011023901461022c57806305b374211461025457806314067f8b1461026957806315027bda146102bb575b600080fd5b61023f61023a366004612932565b6105d2565b60405190151581526020015b60405180910390f35b61026761026236600461296f565b6105e9565b005b6102a6610277366004612932565b6000918252602080805260408084206001600160a01b0393909316845291905290206002015463ffffffff1690565b60405163ffffffff909116815260200161024b565b6102ce6102c9366004612a95565b610669565b60405161024b9190612be4565b6102676102e9366004612ca8565b61075a565b6102676102fc366004612dd2565b61080d565b61023f61030f366004612e45565b6108cd565b610327610322366004612932565b6108e0565b60405161024b9493929190612e61565b6102676109f6565b61035261034d366004612e9e565b610a32565b60405161024b9190612f22565b61037261036d366004612f35565b610ae0565b60405161024b929190612f4e565b60005462010000900460ff1661023f565b61026761039f366004612f9b565b610c65565b6103b76103b2366004612932565b610cd7565b60405161024b9190612fcf565b610267610d8f565b6103d4600381565b60405160ff909116815260200161024b565b6102676103f4366004612fe2565b610dcb565b61026761040736600461305f565b610ea2565b61026761041a366004613092565b610edf565b61026761042d3660046130f8565b610f54565b61023f610440366004612e9e565b611330565b61026761138a565b61046061045b366004612932565b6113c4565b60405161024b9190613163565b61048061047b366004612932565b6113f1565b60405190815260200161024b565b6104a7600054630100000090046001600160a01b031690565b6040516001600160a01b03909116815260200161024b565b6102676104cd36600461296f565b6113fd565b6102676104e0366004612ca8565b611471565b6102676104f3366004613176565b61151f565b6102676105063660046131b9565b6115b4565b6102676105193660046131f2565b6115f2565b6104a761052c366004612932565b6000918252602080805260408084206001600160a01b039384168552909152909120541690565b61023f61056136600461320d565b61170c565b610579610574366004612a95565b611733565b60405161024b9190613230565b610267610594366004613274565b6117f3565b6103d46105a736600461320d565b611867565b6102676105ba3660046132b0565b611888565b6102676105cd3660046131f2565b611ce0565b60006105de8383611d80565b151590505b92915050565b6000546001600160a01b0363010000009091041633146106245760405162461bcd60e51b815260040161061b906132f1565b60405180910390fd5b6106308260ff16611da9565b61063982611dd3565b61065b5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6106658282611dfc565b5050565b6060600083516001600160401b0381111561068657610686612999565b6040519080825280602002602001820160405280156106d757816020015b60408051608081018252600080825260208083018290529282015260608082015282526000199092019101816106a45790505b50905060005b8451811015610752576107228582815181106106fb576106fb613326565b602002602001015185838151811061071557610715613326565b6020026020010151611e5c565b82828151811061073457610734613326565b6020026020010181905250808061074a90613352565b9150506106dd565b509392505050565b6000546001600160a01b03630100000090910416331461078c5760405162461bcd60e51b815260040161061b906132f1565b80518251146107ae57604051636e37235160e11b815260040160405180910390fd5b60005b8251811015610808576107f68382815181106107cf576107cf613326565b60200260200101518383815181106107e9576107e9613326565b60200260200101516105e9565b8061080081613352565b9150506107b1565b505050565b6000546001600160a01b03630100000090910416331461083f5760405162461bcd60e51b815260040161061b906132f1565b60005b81518110156108c7576108b5848284848151811061086257610862613326565b6020026020010151610874919061336b565b85848151811061088657610886613326565b6020026020010151600001518685815181106108a4576108a4613326565b602002602001015160200151611f6b565b806108bf81613352565b915050610842565b50505050565b60006108d9838361220a565b9392505050565b6000828152602080805260408083206001600160a01b038086168552908352818420825160808101845281549092168252600181015493820193909352600283015463ffffffff1691810191909152600382018054849384936060938593919291838601919061094f90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461097b90613382565b80156109c85780601f1061099d576101008083540402835291602001916109c8565b820191906000526020600020905b8154815290600101906020018083116109ab57829003601f168201915b505050919092525050815160208301516040840151606090940151919b909a50929850965090945050505050565b6000546001600160a01b036301000000909104163314610a285760405162461bcd60e51b815260040161061b906132f1565b610a3061222c565b565b6060600082516001600160401b03811115610a4f57610a4f612999565b604051908082528060200260200182016040528015610a78578160200160208202803683370190505b50905060005b835181101561075257610aaa85858381518110610a9d57610a9d613326565b6020026020010151611867565b828281518110610abc57610abc613326565b60ff9092166020928302919091019091015280610ad881613352565b915050610a7e565b6000818152601160205260408120546060918291908080610b00846122c7565b92509250925060008160ff166001600160401b03811115610b2357610b23612999565b604051908082528060200260200182016040528015610b4c578160200160208202803683370190505b50905060008260ff166001600160401b03811115610b6c57610b6c612999565b604051908082528060200260200182016040528015610b95578160200160208202803683370190505b50905060005b8360ff168160ff161015610c565760126000878360ff1681518110610bc257610bc2613326565b602002602001015160ff1660ff16815260200190815260200160002054838260ff1681518110610bf457610bf4613326565b602002602001018181525050848160ff1681518110610c1557610c15613326565b6020026020010151828260ff1681518110610c3257610c32613326565b60ff9092166020928302919091019091015280610c4e816133bc565b915050610b9b565b50909890975095505050505050565b6000546001600160a01b036301000000909104163314610c975760405162461bcd60e51b815260040161061b906132f1565b60005b815181101561066557610cc5828281518110610cb857610cb8613326565b6020026020010151610edf565b80610ccf81613352565b915050610c9a565b6000828152602080805260408083206001600160a01b03851684529091529020600301805460609190610d0990613382565b80601f0160208091040260200160405190810160405280929190818152602001828054610d3590613382565b8015610d825780601f10610d5757610100808354040283529160200191610d82565b820191906000526020600020905b815481529060010190602001808311610d6557829003601f168201915b5050505050905092915050565b6000546001600160a01b036301000000909104163314610dc15760405162461bcd60e51b815260040161061b906132f1565b610a3060006123bc565b6000546001600160a01b036301000000909104163314610dfd5760405162461bcd60e51b815260040161061b906132f1565b81518351141580610e1057508051835114155b15610e2e57604051636e37235160e11b815260040160405180910390fd5b60005b83518110156108c757610e90848281518110610e4f57610e4f613326565b6020026020010151848381518110610e6957610e69613326565b6020026020010151848481518110610e8357610e83613326565b60200260200101516117f3565b80610e9a81613352565b915050610e31565b6000546001600160a01b036301000000909104163314610ed45760405162461bcd60e51b815260040161061b906132f1565b610808838383612419565b6000546001600160a01b036301000000909104163314610f115760405162461bcd60e51b815260040161061b906132f1565b610f1d8160ff16611da9565b610f2681611dd3565b610f485760405163eabeadd360e01b815260ff8216600482015260240161061b565b610f51816124ac565b50565b60005462010000900460ff1615610f7d5760405162461bcd60e51b815260040161061b906133db565b828114610fa55783838383604051638ceb003d60e01b815260040161061b9493929190613405565b3360005b8481101561132857600060206000868685818110610fc957610fc9613326565b9050602002013581526020019081526020016000206000888885818110610ff257610ff2613326565b905060200201602081019061100791906131f2565b6001600160a01b0390811682526020808301939093526040918201600020825160808101845281549092168252600181015493820193909352600283015463ffffffff169181019190915260038201805491929160608401919061106a90613382565b80601f016020809104026020016040519081016040528092919081815260200182805461109690613382565b80156110e35780601f106110b8576101008083540402835291602001916110e3565b820191906000526020600020905b8154815290600101906020018083116110c657829003601f168201915b50505050508152505090506111108386868581811061110457611104613326565b9050602002013561220a565b61115a578285858481811061112757611127613326565b60405163c522f21160e01b81526001600160a01b039094166004850152602002919091013560248301525060440161061b565b6020600086868581811061117057611170613326565b905060200201358152602001908152602001600020600088888581811061119957611199613326565b90506020020160208101906111ae91906131f2565b6001600160a01b031681526020810191909152604001600090812080546001600160a01b03191681556001810182905560028101805463ffffffff19169055906111fb6003830182612843565b505061124c85858481811061121257611212613326565b9050602002013588888581811061122b5761122b613326565b905060200201602081019061124091906131f2565b836020015160006124fb565b7f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b6040518060c0016040528087878681811061128a5761128a613326565b9050602002013581526020018989868181106112a8576112a8613326565b90506020020160208101906112bd91906131f2565b6001600160a01b0316815260200183600001516001600160a01b0316815260200183602001518152602001836040015163ffffffff168152602001836060015181525060405161130d9190613487565b60405180910390a1508061132081613352565b915050610fa9565b505050505050565b6000805b8251811015611380576113608484838151811061135357611353613326565b602002602001015161170c565b61136e5760009150506105e3565b8061137881613352565b915050611334565b5060019392505050565b6000546001600160a01b0363010000009091041633146113bc5760405162461bcd60e51b815260040161061b906132f1565b610a306125ec565b60408051608081018252600080825260208201819052918101919091526060808201526108d98383611e5c565b60006108d98383611d80565b6000546001600160a01b03630100000090910416331461142f5760405162461bcd60e51b815260040161061b906132f1565b61143b8260ff16611da9565b61144482611dd3565b1561146757604051635d04d75160e01b815260ff8316600482015260240161061b565b610665828261264e565b6000546001600160a01b0363010000009091041633146114a35760405162461bcd60e51b815260040161061b906132f1565b80518251146114c557604051636e37235160e11b815260040160405180910390fd5b60005b82518110156108085761150d8382815181106114e6576114e6613326565b602002602001015183838151811061150057611500613326565b60200260200101516113fd565b8061151781613352565b9150506114c8565b6000546001600160a01b0363010000009091041633146115515760405162461bcd60e51b815260040161061b906132f1565b60005b8151811015610808576115a28383838151811061157357611573613326565b60200260200101516000015184848151811061159157611591613326565b602002602001015160200151612419565b806115ac81613352565b915050611554565b6000546001600160a01b0363010000009091041633146115e65760405162461bcd60e51b815260040161061b906132f1565b6108c784848484611f6b565b600054600390610100900460ff16158015611614575060005460ff8083169116105b6116775760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840161061b565b6000805461ffff191660ff8316176101001781556116a4600054630100000090046001600160a01b031690565b6001600160a01b031614806116b85750303b155b156116c6576116c6826123bc565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60008281526011602052604081205460006117278285612699565b60ff1611949350505050565b6060600083516001600160401b0381111561175057611750612999565b604051908082528060200260200182016040528015611779578160200160208202803683370190505b50905060005b8451811015610752576117c485828151811061179d5761179d613326565b60200260200101518583815181106117b7576117b7613326565b6020026020010151611d80565b8282815181106117d6576117d6613326565b6020908102919091010152806117eb81613352565b91505061177f565b6000546001600160a01b0363010000009091041633146118255760405162461bcd60e51b815260040161061b906132f1565b6118318260ff16611da9565b61183a82611dd3565b61185c5760405163eabeadd360e01b815260ff8316600482015260240161061b565b6108088383836126be565b6000828152601160205260408120546118808184612699565b949350505050565b60005462010000900460ff16156118b15760405162461bcd60e51b815260040161061b906133db565b3360005b828110156108c7576118eb828585848181106118d3576118d3613326565b90506020028101906118e591906134e8565b3561220a565b61193f578184848381811061190257611902613326565b905060200281019061191491906134e8565b60405163c522f21160e01b81526001600160a01b03909216600483015235602482015260440161061b565b60006020600086868581811061195757611957613326565b905060200281019061196991906134e8565b600001358152602001908152602001600020600086868581811061198f5761198f613326565b90506020028101906119a191906134e8565b6119b29060408101906020016131f2565b6001600160a01b03166001600160a01b0316815260200190815260200160002060010154905060405180608001604052808686858181106119f5576119f5613326565b9050602002810190611a0791906134e8565b611a189060608101906040016131f2565b6001600160a01b03168152602001868685818110611a3857611a38613326565b9050602002810190611a4a91906134e8565b606001358152602001868685818110611a6557611a65613326565b9050602002810190611a7791906134e8565b611a889060a081019060800161351c565b63ffffffff168152602001868685818110611aa557611aa5613326565b9050602002810190611ab791906134e8565b611ac59060a0810190613537565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509390945250602092508890508786818110611b1257611b12613326565b9050602002810190611b2491906134e8565b6000013581526020019081526020016000206000878786818110611b4a57611b4a613326565b9050602002810190611b5c91906134e8565b611b6d9060408101906020016131f2565b6001600160a01b0390811682526020808301939093526040918201600020845181546001600160a01b03191692169190911781558383015160018201559083015160028201805463ffffffff191663ffffffff909216919091179055606083015180519192611be49260038501929091019061287d565b50905050611c73858584818110611bfd57611bfd613326565b9050602002810190611c0f91906134e8565b35868685818110611c2257611c22613326565b9050602002810190611c3491906134e8565b611c459060408101906020016131f2565b83888887818110611c5857611c58613326565b9050602002810190611c6a91906134e8565b606001356124fb565b7f8c20c3acb6b5208b7affea2fd90dabc8d47e77cee9766c855ce42730505cb205858584818110611ca657611ca6613326565b9050602002810190611cb891906134e8565b604051611cc591906135a6565b60405180910390a15080611cd881613352565b9150506118b5565b6000546001600160a01b036301000000909104163314611d125760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b038116611d775760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b606482015260840161061b565b610f51816123bc565b6000918252602080805260408084206001600160a01b0393909316845291905290206001015490565b603f8160ff161115610f515760405163453e14b960e01b815260ff8216600482015260240161061b565b60ff81166000908152601260205260408120548103611df457506000919050565b506001919050565b60ff82166000818152601260209081526040918290208054908590558251938452908301849052908201819052907f0d3d8d66bac9b2a9f0e5c83181a30443294ab849472526080d03fffd7187f7169060600160405180910390a1505050565b60408051608081018252600080825260208201819052918101919091526060808201526000838152602080805260408083206001600160a01b03808716855290835292819020815160808101835281549094168452600181015492840192909252600282015463ffffffff1690830152600381018054606084019190611ee190613382565b80601f0160208091040260200160405190810160405280929190818152602001828054611f0d90613382565b8015611f5a5780601f10611f2f57610100808354040283529160200191611f5a565b820191906000526020600020905b815481529060010190602001808311611f3d57829003601f168201915b505050505081525050905092915050565b6000546001600160a01b036301000000909104163314611f9d5760405162461bcd60e51b815260040161061b906132f1565b6001600160a01b0384166000908152601060205260409020548310611fff576001600160a01b038416600081815260106020526040908190205490516345e388eb60e01b8152600481019290925260248201526044810184905260640161061b565b6001600160a01b038416600090815260106020526040812080548590811061202957612029613326565b600091825260208083206002909202909101546001600160a01b03881683526010909152604082208054919350908690811061206757612067613326565b9060005260206000209060020201600101549050818414158061208a5750808314155b156120d657604051637a4dd76560e01b81526001600160a01b03871660048201526024810186905260448101839052606481018290526084810185905260a4810184905260c40161061b565b6001600160a01b038616600090815260106020526040902080546120fc9060019061336b565b8154811061210c5761210c613326565b906000526020600020906002020160106000886001600160a01b03166001600160a01b03168152602001908152602001600020868154811061215057612150613326565b60009182526020808320845460029093020191825560019384015493909101929092556001600160a01b038816815260109091526040902080548061219757612197613663565b6000828152602080822060026000199490940193840201828155600101919091559155604080516001600160a01b038916815291820186905281018490527f33cff58e54c3a8acae85cad63487b5dcf617521e33bb03f071299f374c29de1f9060600160405180910390a1505050505050565b6001600160a01b03821660009081526010602052604081206108d99083612732565b60005462010000900460ff1661227b5760405162461bcd60e51b815260206004820152601460248201527314185d5cd8589b194e881b9bdd081c185d5cd95960621b604482015260640161061b565b6000805462ff0000191690557f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa335b6040516001600160a01b03909116815260200160405180910390a1565b60408051818152610820810182526060918291600091829190602082016108008036833750506040805181815261082081018252929350600092915060208201610800803683370190505090506000805b603f8160ff1610156123ae5760006123308983612699565b905060ff81161561239b5781858460ff168151811061235157612351613326565b602002602001019060ff16908160ff168152505080848460ff168151811061237b5761237b613326565b60ff9092166020928302919091019091015282612397816133bc565b9350505b50806123a6816133bc565b915050612318565b509196909550909350915050565b600080546001600160a01b0383811663010000008181026301000000600160b81b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b60408051808201825283815260208082018481526001600160a01b03871660008181526010845285812080546001808201835591835291859020865160029093020191825592519201919091558351908152908101859052918201839052907fe7d6ac0b740347f7f96a97e6a9dc0f20f4f11eca65495315adc009a55b6762f8906060015b60405180910390a150505050565b60ff811660008181526012602090815260408083208054939055805193845290830182905290917feb82955a27e39ea7559b6ec7e7d8b371081ab0d8783c7b0d01597555e7dcadbf9101611700565b8181113060008261250c578561250f565b60005b905060008361251f576000612521565b865b905060008461253957612534868861336b565b612543565b612543878761336b565b604051633885984b60e11b81526001600160a01b03868116600483015285811660248301528481166044830152606482018c9052608482018390529192507f00000000000000000000000000000000000000000000000000000000000000009091169063710b30969060a401600060405180830381600087803b1580156125c957600080fd5b505af11580156125dd573d6000803e3d6000fd5b50505050505050505050505050565b60005462010000900460ff16156126155760405162461bcd60e51b815260040161061b906133db565b6000805462ff00001916620100001790557f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586122aa3390565b60ff8216600081815260126020908152604091829020849055815192835282018390527f16f0bfe4b02efd5423ef8906906b049c0943f21df8f10347d319fddbc59222079101611700565b600082816126a8846004613679565b60ff1682901c905080600f169250505092915050565b6000838152601160205260409020546126d88184846127c0565b6000858152601160205260409081902091909155517f393b86c90799fa411201ae723a54e105823fcf7c6c8dffa90903fc44c03b4ac79061249e9086908690869092835260ff918216602084015216604082015260600190565b6000805b83548110156127b65783818154811061275157612751613326565b9060005260206000209060020201600001548310158015612795575083818154811061277f5761277f613326565b9060005260206000209060020201600101548311155b156127a45760019150506105e3565b806127ae81613352565b915050612736565b5060009392505050565b60006127cb83611da9565b6127d482612819565b8360006127e2856004613679565b600f60ff919091161b905060001981188281166000612802886004613679565b60ff97881697169690961b17979650505050505050565b600f8160ff161115610f51576040516329afd27b60e21b815260ff8216600482015260240161061b565b50805461284f90613382565b6000825580601f1061285f575050565b601f016020900490600052602060002090810190610f519190612901565b82805461288990613382565b90600052602060002090601f0160209004810192826128ab57600085556128f1565b82601f106128c457805160ff19168380011785556128f1565b828001600101855582156128f1579182015b828111156128f15782518255916020019190600101906128d6565b506128fd929150612901565b5090565b5b808211156128fd5760008155600101612902565b80356001600160a01b038116811461292d57600080fd5b919050565b6000806040838503121561294557600080fd5b8235915061295560208401612916565b90509250929050565b803560ff8116811461292d57600080fd5b6000806040838503121561298257600080fd5b61298b8361295e565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156129d1576129d1612999565b60405290565b604051601f8201601f191681016001600160401b03811182821017156129ff576129ff612999565b604052919050565b60006001600160401b03821115612a2057612a20612999565b5060051b60200190565b600082601f830112612a3b57600080fd5b81356020612a50612a4b83612a07565b6129d7565b82815260059290921b84018101918181019086841115612a6f57600080fd5b8286015b84811015612a8a5780358352918301918301612a73565b509695505050505050565b60008060408385031215612aa857600080fd5b82356001600160401b0380821115612abf57600080fd5b612acb86838701612a2a565b9350602091508185013581811115612ae257600080fd5b85019050601f81018613612af557600080fd5b8035612b03612a4b82612a07565b81815260059190911b82018301908381019088831115612b2257600080fd5b928401925b82841015612b4757612b3884612916565b82529284019290840190612b27565b80955050505050509250929050565b6000815180845260005b81811015612b7c57602081850181015186830182015201612b60565b81811115612b8e576000602083870101525b50601f01601f19169290920160200192915050565b60018060a01b0381511682526020810151602083015263ffffffff604082015116604083015260006060820151608060608501526118806080850182612b56565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015612c3957603f19888603018452612c27858351612ba3565b94509285019290850190600101612c0b565b5092979650505050505050565b600082601f830112612c5757600080fd5b81356020612c67612a4b83612a07565b82815260059290921b84018101918181019086841115612c8657600080fd5b8286015b84811015612a8a57612c9b8161295e565b8352918301918301612c8a565b60008060408385031215612cbb57600080fd5b82356001600160401b0380821115612cd257600080fd5b612cde86838701612c46565b9350602091508185013581811115612cf557600080fd5b85019050601f81018613612d0857600080fd5b8035612d16612a4b82612a07565b81815260059190911b82018301908381019088831115612d3557600080fd5b928401925b82841015612b4757833582529284019290840190612d3a565b600082601f830112612d6457600080fd5b81356020612d74612a4b83612a07565b82815260069290921b84018101918181019086841115612d9357600080fd5b8286015b84811015612a8a5760408189031215612db05760008081fd5b612db86129af565b813581528482013585820152835291830191604001612d97565b600080600060608486031215612de757600080fd5b612df084612916565b925060208401356001600160401b0380821115612e0c57600080fd5b612e1887838801612d53565b93506040860135915080821115612e2e57600080fd5b50612e3b86828701612a2a565b9150509250925092565b60008060408385031215612e5857600080fd5b61298b83612916565b60018060a01b038516815283602082015263ffffffff83166040820152608060608201526000612e946080830184612b56565b9695505050505050565b60008060408385031215612eb157600080fd5b8235915060208301356001600160401b03811115612ece57600080fd5b612eda85828601612c46565b9150509250929050565b600081518084526020808501945080840160005b83811015612f1757815160ff1687529582019590820190600101612ef8565b509495945050505050565b6020815260006108d96020830184612ee4565b600060208284031215612f4757600080fd5b5035919050565b604080825283519082018190526000906020906060840190828701845b82811015612f8757815184529284019290840190600101612f6b565b50505083810382850152612e948186612ee4565b600060208284031215612fad57600080fd5b81356001600160401b03811115612fc357600080fd5b61188084828501612c46565b6020815260006108d96020830184612b56565b600080600060608486031215612ff757600080fd5b83356001600160401b038082111561300e57600080fd5b61301a87838801612a2a565b9450602086013591508082111561303057600080fd5b61303c87838801612c46565b9350604086013591508082111561305257600080fd5b50612e3b86828701612c46565b60008060006060848603121561307457600080fd5b61307d84612916565b95602085013595506040909401359392505050565b6000602082840312156130a457600080fd5b6108d98261295e565b60008083601f8401126130bf57600080fd5b5081356001600160401b038111156130d657600080fd5b6020830191508360208260051b85010111156130f157600080fd5b9250929050565b6000806000806040858703121561310e57600080fd5b84356001600160401b038082111561312557600080fd5b613131888389016130ad565b9096509450602087013591508082111561314a57600080fd5b50613157878288016130ad565b95989497509550505050565b6020815260006108d96020830184612ba3565b6000806040838503121561318957600080fd5b61319283612916565b915060208301356001600160401b038111156131ad57600080fd5b612eda85828601612d53565b600080600080608085870312156131cf57600080fd5b6131d885612916565b966020860135965060408601359560600135945092505050565b60006020828403121561320457600080fd5b6108d982612916565b6000806040838503121561322057600080fd5b823591506129556020840161295e565b6020808252825182820181905260009190848201906040850190845b818110156132685783518352928401929184019160010161324c565b50909695505050505050565b60008060006060848603121561328957600080fd5b833592506132996020850161295e565b91506132a76040850161295e565b90509250925092565b600080602083850312156132c357600080fd5b82356001600160401b038111156132d957600080fd5b6132e5858286016130ad565b90969095509350505050565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016133645761336461333c565b5060010190565b60008282101561337d5761337d61333c565b500390565b600181811c9082168061339657607f821691505b6020821081036133b657634e487b7160e01b600052602260045260246000fd5b50919050565b600060ff821660ff81036133d2576133d261333c565b60010192915050565b60208082526010908201526f14185d5cd8589b194e881c185d5cd95960821b604082015260600190565b6040808252810184905260008560608301825b87811015613446576001600160a01b0361343184612916565b16825260209283019290910190600101613418565b5083810360208501528481526001600160fb1b0385111561346657600080fd5b8460051b915081866020830137600091016020019081529695505050505050565b60208152815160208201526000602083015160018060a01b03808216604085015280604086015116606085015250506060830151608083015263ffffffff60808401511660a083015260a083015160c08084015261188060e0840182612b56565b6000823560be198336030181126134fe57600080fd5b9190910192915050565b803563ffffffff8116811461292d57600080fd5b60006020828403121561352e57600080fd5b6108d982613508565b6000808335601e1984360301811261354e57600080fd5b8301803591506001600160401b0382111561356857600080fd5b6020019150368190038213156130f157600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b602081528135602082015260006135bf60208401612916565b60018060a01b038082166040850152806135db60408701612916565b16606085015250506060830135608083015263ffffffff6135fe60808501613508565b1660a083015260a0830135601e1984360301811261361b57600080fd5b83016020810190356001600160401b0381111561363757600080fd5b80360382131561364657600080fd5b60c08085015261365a60e08501828461357d565b95945050505050565b634e487b7160e01b600052603160045260246000fd5b600060ff821660ff84168160ff048111821515161561369a5761369a61333c565b02939250505056fea26469706673582212209714c1001d19740a655ea4426b52e9f5d8348f9df38d027a88d1f1095e244e9464736f6c634300080e0033", diff --git a/deployments/mumbaiTestnet/AttestationsRegistryProxy.json b/deployments/mumbaiTestnet/AttestationsRegistryProxy.json new file mode 100644 index 0000000..aeb61a7 --- /dev/null +++ b/deployments/mumbaiTestnet/AttestationsRegistryProxy.json @@ -0,0 +1,276 @@ +{ + "address": "0xc24F86a8D9f82401b693d4FFaa1DCf3109d88524", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x895bf0f687c521400bfd889873224e5349913bc833e6d87c7a6423c3897ed595", + "receipt": { + "to": null, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xc24F86a8D9f82401b693d4FFaa1DCf3109d88524", + "transactionIndex": 13, + "gasUsed": "612587", + "logsBloom": "0x000000000000010200000000000000004000000000000000008000000000000000000000000000000000000000002000000080000000000000000000000000000000000000000000000000000000028000010000000000000001000000000000000000000200000000000000000008000000008000000040a0000000000000400000000000000000000000000002000000000000000080000000000040800000200000000000000020000000000402000001000000000000000000000000004000008020000000000001000040040000000000000400000000100000000020000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x2d8d1679b6d624c18056ca585c37d54597572f691396822ea9f9a01e9dc322ba", + "transactionHash": "0x895bf0f687c521400bfd889873224e5349913bc833e6d87c7a6423c3897ed595", + "logs": [ + { + "transactionIndex": 13, + "blockNumber": 29771741, + "transactionHash": "0x895bf0f687c521400bfd889873224e5349913bc833e6d87c7a6423c3897ed595", + "address": "0xc24F86a8D9f82401b693d4FFaa1DCf3109d88524", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000ff3a1a1aa75003cd208a27bc3689507a5fbcaa8c" + ], + "data": "0x", + "logIndex": 55, + "blockHash": "0x2d8d1679b6d624c18056ca585c37d54597572f691396822ea9f9a01e9dc322ba" + }, + { + "transactionIndex": 13, + "blockNumber": 29771741, + "transactionHash": "0x895bf0f687c521400bfd889873224e5349913bc833e6d87c7a6423c3897ed595", + "address": "0xc24F86a8D9f82401b693d4FFaa1DCf3109d88524", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" + ], + "data": "0x", + "logIndex": 56, + "blockHash": "0x2d8d1679b6d624c18056ca585c37d54597572f691396822ea9f9a01e9dc322ba" + }, + { + "transactionIndex": 13, + "blockNumber": 29771741, + "transactionHash": "0x895bf0f687c521400bfd889873224e5349913bc833e6d87c7a6423c3897ed595", + "address": "0xc24F86a8D9f82401b693d4FFaa1DCf3109d88524", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000003", + "logIndex": 57, + "blockHash": "0x2d8d1679b6d624c18056ca585c37d54597572f691396822ea9f9a01e9dc322ba" + }, + { + "transactionIndex": 13, + "blockNumber": 29771741, + "transactionHash": "0x895bf0f687c521400bfd889873224e5349913bc833e6d87c7a6423c3897ed595", + "address": "0xc24F86a8D9f82401b693d4FFaa1DCf3109d88524", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002110475dfbb8d331b300178a867372991ff35fa3", + "logIndex": 58, + "blockHash": "0x2d8d1679b6d624c18056ca585c37d54597572f691396822ea9f9a01e9dc322ba" + }, + { + "transactionIndex": 13, + "blockNumber": 29771741, + "transactionHash": "0x895bf0f687c521400bfd889873224e5349913bc833e6d87c7a6423c3897ed595", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" + ], + "data": "0x000000000000000000000000000000000000000000000000000343b789a5c1540000000000000000000000000000000000000000000000001ba1adc8062a70ee00000000000000000000000000000000000000000000187ae43ecd265d5f71800000000000000000000000000000000000000000000000001b9e6a107c84af9a00000000000000000000000000000000000000000000187ae44210dde70532d4", + "logIndex": 59, + "blockHash": "0x2d8d1679b6d624c18056ca585c37d54597572f691396822ea9f9a01e9dc322ba" + } + ], + "blockNumber": 29771741, + "cumulativeGasUsed": "9518215", + "status": 1, + "byzantium": true + }, + "args": [ + "0xfF3A1A1aa75003cD208a27Bc3689507A5fBCaA8C", + "0x2110475dfbB8d331b300178A867372991ff35fA3", + "0xc4d66de8000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" + ], + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", + "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(\\n address newImplementation,\\n bytes calldata data\\n ) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x1663761dc98da7a84e6570b428877de7de9859e34f99c7002cad71ccfc9d6283\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405162000eeb38038062000eeb8339810160408190526200002691620004ed565b828162000036828260006200009a565b5062000066905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005cd565b60008051602062000ea483398151915214620000865762000086620005f3565b6200009182620000d7565b5050506200065c565b620000a58362000132565b600082511180620000b35750805b15620000d257620000d083836200017460201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f62000102620001a3565b604080516001600160a01b03928316815291841660208301520160405180910390a16200012f81620001dc565b50565b6200013d8162000291565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606200019c838360405180606001604052806027815260200162000ec46027913962000345565b9392505050565b6000620001cd60008051602062000ea483398151915260001b620003c460201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002475760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b806200027060008051602062000ea483398151915260001b620003c460201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002a781620003c760201b6200025a1760201c565b6200030b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200023e565b80620002707f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b620003c460201b620001ea1760201c565b6060600080856001600160a01b03168560405162000364919062000609565b600060405180830381855af49150503d8060008114620003a1576040519150601f19603f3d011682016040523d82523d6000602084013e620003a6565b606091505b509092509050620003ba86838387620003d6565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200044a57825160000362000442576001600160a01b0385163b620004425760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016200023e565b508162000456565b6200045683836200045e565b949350505050565b8151156200046f5781518083602001fd5b8060405162461bcd60e51b81526004016200023e919062000627565b80516001600160a01b0381168114620004a357600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004db578181015183820152602001620004c1565b83811115620000d05750506000910152565b6000806000606084860312156200050357600080fd5b6200050e846200048b565b92506200051e602085016200048b565b60408501519092506001600160401b03808211156200053c57600080fd5b818601915086601f8301126200055157600080fd5b815181811115620005665762000566620004a8565b604051601f8201601f19908116603f01168101908382118183101715620005915762000591620004a8565b81604052828152896020848701011115620005ab57600080fd5b620005be836020830160208801620004be565b80955050505050509250925092565b600082821015620005ee57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b600082516200061d818460208701620004be565b9190910192915050565b602081526000825180602084015262000648816040850160208701620004be565b601f01601f19169190910160400192915050565b610838806200066c6000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106c2565b610118565b61005b6100933660046106dd565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106c2565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107dc602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd610456565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b6103688361047e565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a816104be565b6060600080856001600160a01b0316856040516103fb919061078c565b600060405180830381855af49150503d8060008114610436576040519150601f19603f3d011682016040523d82523d6000602084013e61043b565b606091505b509150915061044c86838387610567565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b610487816105e8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105235760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105d65782516000036105cf576001600160a01b0385163b6105cf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102f5565b50816105e0565b6105e0838361067c565b949350505050565b6001600160a01b0381163b6106555760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610546565b81511561068c5781518083602001fd5b8060405162461bcd60e51b81526004016102f591906107a8565b80356001600160a01b03811681146106bd57600080fd5b919050565b6000602082840312156106d457600080fd5b610253826106a6565b6000806000604084860312156106f257600080fd5b6106fb846106a6565b9250602084013567ffffffffffffffff8082111561071857600080fd5b818601915086601f83011261072c57600080fd5b81358181111561073b57600080fd5b87602082850101111561074d57600080fd5b6020830194508093505050509250925092565b60005b8381101561077b578181015183820152602001610763565b838111156103845750506000910152565b6000825161079e818460208701610760565b9190910192915050565b60208152600082518060208401526107c7816040850160208701610760565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e2b2f80d01b9fee1887f086f33ea33eabe6a896123f3722976ea73e069c365b664736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106c2565b610118565b61005b6100933660046106dd565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106c2565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107dc602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd610456565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b6103688361047e565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a816104be565b6060600080856001600160a01b0316856040516103fb919061078c565b600060405180830381855af49150503d8060008114610436576040519150601f19603f3d011682016040523d82523d6000602084013e61043b565b606091505b509150915061044c86838387610567565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b610487816105e8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105235760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105d65782516000036105cf576001600160a01b0385163b6105cf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102f5565b50816105e0565b6105e0838361067c565b949350505050565b6001600160a01b0381163b6106555760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610546565b81511561068c5781518083602001fd5b8060405162461bcd60e51b81526004016102f591906107a8565b80356001600160a01b03811681146106bd57600080fd5b919050565b6000602082840312156106d457600080fd5b610253826106a6565b6000806000604084860312156106f257600080fd5b6106fb846106a6565b9250602084013567ffffffffffffffff8082111561071857600080fd5b818601915086601f83011261072c57600080fd5b81358181111561073b57600080fd5b87602082850101111561074d57600080fd5b6020830194508093505050509250925092565b60005b8381101561077b578181015183820152602001610763565b838111156103845750506000910152565b6000825161079e818460208701610760565b9190910192915050565b60208152600082518060208401526107c7816040850160208701610760565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e2b2f80d01b9fee1887f086f33ea33eabe6a896123f3722976ea73e069c365b664736f6c634300080e0033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/sandboxPolygon/AvailableRootsRegistry.json b/deployments/mumbaiTestnet/AvailableRootsRegistry.json similarity index 94% rename from deployments/sandboxPolygon/AvailableRootsRegistry.json rename to deployments/mumbaiTestnet/AvailableRootsRegistry.json index 8a49be6..c955ef5 100644 --- a/deployments/sandboxPolygon/AvailableRootsRegistry.json +++ b/deployments/mumbaiTestnet/AvailableRootsRegistry.json @@ -1,5 +1,5 @@ { - "address": "0xb8797eBa1048f6A6AfCbE4F08a582b4Dde69C05d", + "address": "0xe51e46177505c31CE33791066E17E11d9D180305", "abi": [ { "inputs": [ @@ -307,83 +307,83 @@ "type": "function" } ], - "transactionHash": "0xec4dd05d39c34bc5ae07cc921c2c7566d3d2bf77c7f0425c414c8aca9c08282a", + "transactionHash": "0x7eeda21d49a6c7a51050007b3119dbef4504e6324e931efede2680906f8d1077", "receipt": { "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0x2c45760c0902152A5E3f5335C654eFC13Af4daf7", - "transactionIndex": 57, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xe34001905278214a49f7C56923903010d5B0129f", + "transactionIndex": 10, "gasUsed": "508612", - "logsBloom": "0x00000000000000200000000000000000000000000000000010800000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800001000000000000000100000000000000000000020000000000000000000800000000000000000080000000000000408000000000000000000000100000000000000000000080000000000000000000200000000000000000000000000400000000000000000000000480000000004000800000000800000001000000048000000000000000000000100004000020000000020000000000000040000000000000000000000000000000000000100000", - "blockHash": "0x9ac1e25477f9d40623ad3e9c70f36b4e04c105de6b5b1d6133e62713ae678e9a", - "transactionHash": "0xec4dd05d39c34bc5ae07cc921c2c7566d3d2bf77c7f0425c414c8aca9c08282a", + "logsBloom": "0x00000000000000020000000000000000000000000000000000800000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000008000000800001000000000000000100000000000000000080020000000000000000000800000000000000000080000000000000400000000000000000000000000000000000000000000080000000000040000000200000000000000020000000000402000001000000000000000000000000004000008000000000000001000000040000000000000000000000100000000020000800000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x49e5f43f0473514d0f0641131fc6d8ebe5b8530e4e229d3938bfc86fdea90d12", + "transactionHash": "0x7eeda21d49a6c7a51050007b3119dbef4504e6324e931efede2680906f8d1077", "logs": [ { - "transactionIndex": 57, - "blockNumber": 36626428, - "transactionHash": "0xec4dd05d39c34bc5ae07cc921c2c7566d3d2bf77c7f0425c414c8aca9c08282a", - "address": "0x2c45760c0902152A5E3f5335C654eFC13Af4daf7", + "transactionIndex": 10, + "blockNumber": 29771991, + "transactionHash": "0x7eeda21d49a6c7a51050007b3119dbef4504e6324e931efede2680906f8d1077", + "address": "0xe34001905278214a49f7C56923903010d5B0129f", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 228, - "blockHash": "0x9ac1e25477f9d40623ad3e9c70f36b4e04c105de6b5b1d6133e62713ae678e9a" + "logIndex": 26, + "blockHash": "0x49e5f43f0473514d0f0641131fc6d8ebe5b8530e4e229d3938bfc86fdea90d12" }, { - "transactionIndex": 57, - "blockNumber": 36626428, - "transactionHash": "0xec4dd05d39c34bc5ae07cc921c2c7566d3d2bf77c7f0425c414c8aca9c08282a", - "address": "0x2c45760c0902152A5E3f5335C654eFC13Af4daf7", + "transactionIndex": 10, + "blockNumber": 29771991, + "transactionHash": "0x7eeda21d49a6c7a51050007b3119dbef4504e6324e931efede2680906f8d1077", + "address": "0xe34001905278214a49f7C56923903010d5B0129f", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x0000000000000000000000007e2305312099748bbd6a31bff27a8218edd4cbd2" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 229, - "blockHash": "0x9ac1e25477f9d40623ad3e9c70f36b4e04c105de6b5b1d6133e62713ae678e9a" + "logIndex": 27, + "blockHash": "0x49e5f43f0473514d0f0641131fc6d8ebe5b8530e4e229d3938bfc86fdea90d12" }, { - "transactionIndex": 57, - "blockNumber": 36626428, - "transactionHash": "0xec4dd05d39c34bc5ae07cc921c2c7566d3d2bf77c7f0425c414c8aca9c08282a", - "address": "0x2c45760c0902152A5E3f5335C654eFC13Af4daf7", + "transactionIndex": 10, + "blockNumber": 29771991, + "transactionHash": "0x7eeda21d49a6c7a51050007b3119dbef4504e6324e931efede2680906f8d1077", + "address": "0xe34001905278214a49f7C56923903010d5B0129f", "topics": [ "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000002", - "logIndex": 230, - "blockHash": "0x9ac1e25477f9d40623ad3e9c70f36b4e04c105de6b5b1d6133e62713ae678e9a" + "logIndex": 28, + "blockHash": "0x49e5f43f0473514d0f0641131fc6d8ebe5b8530e4e229d3938bfc86fdea90d12" }, { - "transactionIndex": 57, - "blockNumber": 36626428, - "transactionHash": "0xec4dd05d39c34bc5ae07cc921c2c7566d3d2bf77c7f0425c414c8aca9c08282a", + "transactionIndex": 10, + "blockNumber": 29771991, + "transactionHash": "0x7eeda21d49a6c7a51050007b3119dbef4504e6324e931efede2680906f8d1077", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x00000000000000000000000067b94473d81d0cd00849d563c94d0432ac988b49" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" ], - "data": "0x000000000000000000000000000000000000000000000000003a9f20e09a2b84000000000000000000000000000000000000000000000000b4bd91c27da00fbc0000000000000000000000000000000000000000000009e4a14d0a3665122878000000000000000000000000000000000000000000000000b482f2a19d05e4380000000000000000000000000000000000000000000009e4a187a95745ac53fc", - "logIndex": 231, - "blockHash": "0x9ac1e25477f9d40623ad3e9c70f36b4e04c105de6b5b1d6133e62713ae678e9a" + "data": "0x0000000000000000000000000000000000000000000000000002b5deb05276780000000000000000000000000000000000000000000000001b952f1ab6fb40c400000000000000000000000000000000000000000000187b04d44f45e12a57590000000000000000000000000000000000000000000000001b92793c06a8ca4c00000000000000000000000000000000000000000000187b04d70524917ccdd1", + "logIndex": 29, + "blockHash": "0x49e5f43f0473514d0f0641131fc6d8ebe5b8530e4e229d3938bfc86fdea90d12" } ], - "blockNumber": 36626428, - "cumulativeGasUsed": "14431744", + "blockNumber": 29771991, + "cumulativeGasUsed": "4843414", "status": 1, "byzantium": true }, "args": [ - "0x7e2305312099748bbd6a31bff27a8218edd4cbd2" + "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED" ], - "numDeployments": 6, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CannotRegisterForZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotUnregisterForZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"RegisteredRootForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"RegisteredRootForAttester\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"UnregisteredRootForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"UnregisteredRootForAttester\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"_roots\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"isRootAvailableForAttester\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"isRootAvailableForMe\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"registerRootForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"registerRootForAttester\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"unregisterRootForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"unregisterRootForAttester\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"owner\":\"Owner of the contract, can register/ unregister roots\"}},\"initialize(address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"ownerAddress\":\"Owner of the contract, can update public key and address\"}},\"isRootAvailableForAttester(address,uint256)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"attester\":\"Owner of the contract, can update public key and address\",\"root\":\"Owner of the contract, can update public key and address\"}},\"isRootAvailableForMe(uint256)\":{\"details\":\"returns whether a root is available for a caller (msg.sender)\",\"params\":{\"root\":\"root to check whether it is registered for me or not\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"registerRootForAll(uint256)\":{\"details\":\"Registers a root, available for all contracts\",\"params\":{\"root\":\"Root to register\"}},\"registerRootForAttester(address,uint256)\":{\"details\":\"Register a root available for an attester\",\"params\":{\"attester\":\"Attester which will have the root available\",\"root\":\"Root to register\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unregisterRootForAll(uint256)\":{\"details\":\"Unregister a root, available for all contracts\",\"params\":{\"root\":\"Root to unregister\"}},\"unregisterRootForAttester(address,uint256)\":{\"details\":\"Unregister a root for an attester\",\"params\":{\"attester\":\"Attester which will no longer have the root available\",\"root\":\"Root to unregister\"}}},\"title\":\"Attesters Groups Registry\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"This contract stores that data required by attesters to be available so they can verify user claims This contract is deployed behind a proxy and this implementation is focused on storing merkle roots For more information: https://available-roots-registry.docs.sismo.io*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/AvailableRootsRegistry.sol\":\"AvailableRootsRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3467998cbdb82b0c64aa8627efc5893d2b369f73e66e5d1095305e4609593cc5\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5e882d3091e816f1286837eef92ae17737abf66fdeece1282b752f27ba18492b\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b5060405161099538038061099583398101604081905261002f916101be565b61003833610047565b610041816100a2565b506101ee565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600290610100900460ff161580156100c4575060005460ff8083169116105b61012b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff8316176101001781556101576000546201000090046001600160a01b031690565b6001600160a01b0316148061016b5750303b155b156101795761017982610047565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6000602082840312156101d057600080fd5b81516001600160a01b03811681146101e757600080fd5b9392505050565b610798806101fd6000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063be4a605611610071578063be4a605614610170578063c4d66de814610183578063e5e477a014610196578063ebea45cb146101a9578063f2fde38b146101bc578063fe7e7750146101cf57600080fd5b80632f56be56146100b95780634e473f8f146100ce578063715018a6146100f6578063754b377c146100fe57806380b404ce146101185780638da5cb5b14610146575b600080fd5b6100cc6100c7366004610704565b6101e2565b005b6100e16100dc366004610704565b61021f565b60405190151581526020015b60405180910390f35b6100cc610285565b610106600281565b60405160ff90911681526020016100ed565b6100e1610126366004610704565b600160209081526000928352604080842090915290825290205460ff1681565b6000546201000090046001600160a01b03166040516001600160a01b0390911681526020016100ed565b6100cc61017e36600461072e565b610299565b6100cc610191366004610747565b6102af565b6100e16101a436600461072e565b6103ce565b6100cc6101b7366004610704565b61042a565b6100cc6101ca366004610747565b610463565b6100cc6101dd36600461072e565b6104d9565b6101ea6104ec565b6001600160a01b03821661021157604051639e95e88b60e01b815260040160405180910390fd5b61021b828261054d565b5050565b6001600160a01b038216600090815260016020908152604080832084845290915281205460ff168061027e575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b9392505050565b61028d6104ec565b61029760006105ef565b565b6102a16104ec565b6102ac60008261054d565b50565b600054600290610100900460ff161580156102d1575060005460ff8083169116105b6103395760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556103666000546001600160a01b03620100009091041690565b6001600160a01b0316148061037a5750303b155b1561038857610388826105ef565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b33600090815260016020908152604080832084845290915281205460ff1680610424575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b92915050565b6104326104ec565b6001600160a01b03821661045957604051631b25a00160e31b815260040160405180910390fd5b61021b828261064a565b61046b6104ec565b6001600160a01b0381166104d05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610330565b6102ac816105ef565b6104e16104ec565b6102ac60008261064a565b6000546001600160a01b03620100009091041633146102975760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610330565b6001600160a01b0382166000818152600160208181526040808420868552909152909120805460ff191690911790556105b0576040518181527f22f0a171f00eeea3af5276d1f77587471dcc3bde32d62560046549b34bacd38a906020016103c2565b604080516001600160a01b0384168152602081018390527f21cdff046578afe71b78f95ac4891306af3a9b9eb71e2f0ef380b35b487d2f1291016103c2565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6001600160a01b03821660008181526001602090815260408083208584529091529020805460ff191690556106a9576040518181527f7261c2abe5e576aac50024de639315f10783f67935bf118bbb49b33c20ef70ef906020016103c2565b604080516001600160a01b0384168152602081018390527fba8195cc62a4086b7cd93d22db90e43ae42d8b5febd8c66b3453771e455b7a3391016103c2565b80356001600160a01b03811681146106ff57600080fd5b919050565b6000806040838503121561071757600080fd5b610720836106e8565b946020939093013593505050565b60006020828403121561074057600080fd5b5035919050565b60006020828403121561075957600080fd5b61027e826106e856fea264697066735822122096da5c8d33677e6203057d911bba2c609059e50119bb896ec169d0349a48641d64736f6c634300080e0033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063be4a605611610071578063be4a605614610170578063c4d66de814610183578063e5e477a014610196578063ebea45cb146101a9578063f2fde38b146101bc578063fe7e7750146101cf57600080fd5b80632f56be56146100b95780634e473f8f146100ce578063715018a6146100f6578063754b377c146100fe57806380b404ce146101185780638da5cb5b14610146575b600080fd5b6100cc6100c7366004610704565b6101e2565b005b6100e16100dc366004610704565b61021f565b60405190151581526020015b60405180910390f35b6100cc610285565b610106600281565b60405160ff90911681526020016100ed565b6100e1610126366004610704565b600160209081526000928352604080842090915290825290205460ff1681565b6000546201000090046001600160a01b03166040516001600160a01b0390911681526020016100ed565b6100cc61017e36600461072e565b610299565b6100cc610191366004610747565b6102af565b6100e16101a436600461072e565b6103ce565b6100cc6101b7366004610704565b61042a565b6100cc6101ca366004610747565b610463565b6100cc6101dd36600461072e565b6104d9565b6101ea6104ec565b6001600160a01b03821661021157604051639e95e88b60e01b815260040160405180910390fd5b61021b828261054d565b5050565b6001600160a01b038216600090815260016020908152604080832084845290915281205460ff168061027e575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b9392505050565b61028d6104ec565b61029760006105ef565b565b6102a16104ec565b6102ac60008261054d565b50565b600054600290610100900460ff161580156102d1575060005460ff8083169116105b6103395760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556103666000546001600160a01b03620100009091041690565b6001600160a01b0316148061037a5750303b155b1561038857610388826105ef565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b33600090815260016020908152604080832084845290915281205460ff1680610424575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b92915050565b6104326104ec565b6001600160a01b03821661045957604051631b25a00160e31b815260040160405180910390fd5b61021b828261064a565b61046b6104ec565b6001600160a01b0381166104d05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610330565b6102ac816105ef565b6104e16104ec565b6102ac60008261064a565b6000546001600160a01b03620100009091041633146102975760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610330565b6001600160a01b0382166000818152600160208181526040808420868552909152909120805460ff191690911790556105b0576040518181527f22f0a171f00eeea3af5276d1f77587471dcc3bde32d62560046549b34bacd38a906020016103c2565b604080516001600160a01b0384168152602081018390527f21cdff046578afe71b78f95ac4891306af3a9b9eb71e2f0ef380b35b487d2f1291016103c2565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6001600160a01b03821660008181526001602090815260408083208584529091529020805460ff191690556106a9576040518181527f7261c2abe5e576aac50024de639315f10783f67935bf118bbb49b33c20ef70ef906020016103c2565b604080516001600160a01b0384168152602081018390527fba8195cc62a4086b7cd93d22db90e43ae42d8b5febd8c66b3453771e455b7a3391016103c2565b80356001600160a01b03811681146106ff57600080fd5b919050565b6000806040838503121561071757600080fd5b610720836106e8565b946020939093013593505050565b60006020828403121561074057600080fd5b5035919050565b60006020828403121561075957600080fd5b61027e826106e856fea264697066735822122096da5c8d33677e6203057d911bba2c609059e50119bb896ec169d0349a48641d64736f6c634300080e0033", diff --git a/deployments/sandboxPolygon/AvailableRootsRegistryImplem.json b/deployments/mumbaiTestnet/AvailableRootsRegistryImplem.json similarity index 94% rename from deployments/sandboxPolygon/AvailableRootsRegistryImplem.json rename to deployments/mumbaiTestnet/AvailableRootsRegistryImplem.json index b8f1475..b8e336d 100644 --- a/deployments/sandboxPolygon/AvailableRootsRegistryImplem.json +++ b/deployments/mumbaiTestnet/AvailableRootsRegistryImplem.json @@ -1,5 +1,5 @@ { - "address": "0x2c45760c0902152A5E3f5335C654eFC13Af4daf7", + "address": "0xe34001905278214a49f7C56923903010d5B0129f", "abi": [ { "inputs": [ @@ -307,83 +307,83 @@ "type": "function" } ], - "transactionHash": "0xec4dd05d39c34bc5ae07cc921c2c7566d3d2bf77c7f0425c414c8aca9c08282a", + "transactionHash": "0x7eeda21d49a6c7a51050007b3119dbef4504e6324e931efede2680906f8d1077", "receipt": { "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0x2c45760c0902152A5E3f5335C654eFC13Af4daf7", - "transactionIndex": 57, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xe34001905278214a49f7C56923903010d5B0129f", + "transactionIndex": 10, "gasUsed": "508612", - "logsBloom": "0x00000000000000200000000000000000000000000000000010800000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800001000000000000000100000000000000000000020000000000000000000800000000000000000080000000000000408000000000000000000000100000000000000000000080000000000000000000200000000000000000000000000400000000000000000000000480000000004000800000000800000001000000048000000000000000000000100004000020000000020000000000000040000000000000000000000000000000000000100000", - "blockHash": "0x9ac1e25477f9d40623ad3e9c70f36b4e04c105de6b5b1d6133e62713ae678e9a", - "transactionHash": "0xec4dd05d39c34bc5ae07cc921c2c7566d3d2bf77c7f0425c414c8aca9c08282a", + "logsBloom": "0x00000000000000020000000000000000000000000000000000800000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000008000000800001000000000000000100000000000000000080020000000000000000000800000000000000000080000000000000400000000000000000000000000000000000000000000080000000000040000000200000000000000020000000000402000001000000000000000000000000004000008000000000000001000000040000000000000000000000100000000020000800000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x49e5f43f0473514d0f0641131fc6d8ebe5b8530e4e229d3938bfc86fdea90d12", + "transactionHash": "0x7eeda21d49a6c7a51050007b3119dbef4504e6324e931efede2680906f8d1077", "logs": [ { - "transactionIndex": 57, - "blockNumber": 36626428, - "transactionHash": "0xec4dd05d39c34bc5ae07cc921c2c7566d3d2bf77c7f0425c414c8aca9c08282a", - "address": "0x2c45760c0902152A5E3f5335C654eFC13Af4daf7", + "transactionIndex": 10, + "blockNumber": 29771991, + "transactionHash": "0x7eeda21d49a6c7a51050007b3119dbef4504e6324e931efede2680906f8d1077", + "address": "0xe34001905278214a49f7C56923903010d5B0129f", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 228, - "blockHash": "0x9ac1e25477f9d40623ad3e9c70f36b4e04c105de6b5b1d6133e62713ae678e9a" + "logIndex": 26, + "blockHash": "0x49e5f43f0473514d0f0641131fc6d8ebe5b8530e4e229d3938bfc86fdea90d12" }, { - "transactionIndex": 57, - "blockNumber": 36626428, - "transactionHash": "0xec4dd05d39c34bc5ae07cc921c2c7566d3d2bf77c7f0425c414c8aca9c08282a", - "address": "0x2c45760c0902152A5E3f5335C654eFC13Af4daf7", + "transactionIndex": 10, + "blockNumber": 29771991, + "transactionHash": "0x7eeda21d49a6c7a51050007b3119dbef4504e6324e931efede2680906f8d1077", + "address": "0xe34001905278214a49f7C56923903010d5B0129f", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x0000000000000000000000007e2305312099748bbd6a31bff27a8218edd4cbd2" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 229, - "blockHash": "0x9ac1e25477f9d40623ad3e9c70f36b4e04c105de6b5b1d6133e62713ae678e9a" + "logIndex": 27, + "blockHash": "0x49e5f43f0473514d0f0641131fc6d8ebe5b8530e4e229d3938bfc86fdea90d12" }, { - "transactionIndex": 57, - "blockNumber": 36626428, - "transactionHash": "0xec4dd05d39c34bc5ae07cc921c2c7566d3d2bf77c7f0425c414c8aca9c08282a", - "address": "0x2c45760c0902152A5E3f5335C654eFC13Af4daf7", + "transactionIndex": 10, + "blockNumber": 29771991, + "transactionHash": "0x7eeda21d49a6c7a51050007b3119dbef4504e6324e931efede2680906f8d1077", + "address": "0xe34001905278214a49f7C56923903010d5B0129f", "topics": [ "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000002", - "logIndex": 230, - "blockHash": "0x9ac1e25477f9d40623ad3e9c70f36b4e04c105de6b5b1d6133e62713ae678e9a" + "logIndex": 28, + "blockHash": "0x49e5f43f0473514d0f0641131fc6d8ebe5b8530e4e229d3938bfc86fdea90d12" }, { - "transactionIndex": 57, - "blockNumber": 36626428, - "transactionHash": "0xec4dd05d39c34bc5ae07cc921c2c7566d3d2bf77c7f0425c414c8aca9c08282a", + "transactionIndex": 10, + "blockNumber": 29771991, + "transactionHash": "0x7eeda21d49a6c7a51050007b3119dbef4504e6324e931efede2680906f8d1077", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x00000000000000000000000067b94473d81d0cd00849d563c94d0432ac988b49" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" ], - "data": "0x000000000000000000000000000000000000000000000000003a9f20e09a2b84000000000000000000000000000000000000000000000000b4bd91c27da00fbc0000000000000000000000000000000000000000000009e4a14d0a3665122878000000000000000000000000000000000000000000000000b482f2a19d05e4380000000000000000000000000000000000000000000009e4a187a95745ac53fc", - "logIndex": 231, - "blockHash": "0x9ac1e25477f9d40623ad3e9c70f36b4e04c105de6b5b1d6133e62713ae678e9a" + "data": "0x0000000000000000000000000000000000000000000000000002b5deb05276780000000000000000000000000000000000000000000000001b952f1ab6fb40c400000000000000000000000000000000000000000000187b04d44f45e12a57590000000000000000000000000000000000000000000000001b92793c06a8ca4c00000000000000000000000000000000000000000000187b04d70524917ccdd1", + "logIndex": 29, + "blockHash": "0x49e5f43f0473514d0f0641131fc6d8ebe5b8530e4e229d3938bfc86fdea90d12" } ], - "blockNumber": 36626428, - "cumulativeGasUsed": "14431744", + "blockNumber": 29771991, + "cumulativeGasUsed": "4843414", "status": 1, "byzantium": true }, "args": [ - "0x7e2305312099748bbd6a31bff27a8218edd4cbd2" + "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED" ], - "numDeployments": 2, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"CannotRegisterForZeroAddress\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"CannotUnregisterForZeroAddress\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"RegisteredRootForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"RegisteredRootForAttester\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"UnregisteredRootForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"UnregisteredRootForAttester\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"_roots\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"isRootAvailableForAttester\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"isRootAvailableForMe\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"registerRootForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"registerRootForAttester\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"unregisterRootForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"root\",\"type\":\"uint256\"}],\"name\":\"unregisterRootForAttester\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"owner\":\"Owner of the contract, can register/ unregister roots\"}},\"initialize(address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"ownerAddress\":\"Owner of the contract, can update public key and address\"}},\"isRootAvailableForAttester(address,uint256)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"attester\":\"Owner of the contract, can update public key and address\",\"root\":\"Owner of the contract, can update public key and address\"}},\"isRootAvailableForMe(uint256)\":{\"details\":\"returns whether a root is available for a caller (msg.sender)\",\"params\":{\"root\":\"root to check whether it is registered for me or not\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"registerRootForAll(uint256)\":{\"details\":\"Registers a root, available for all contracts\",\"params\":{\"root\":\"Root to register\"}},\"registerRootForAttester(address,uint256)\":{\"details\":\"Register a root available for an attester\",\"params\":{\"attester\":\"Attester which will have the root available\",\"root\":\"Root to register\"}},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"unregisterRootForAll(uint256)\":{\"details\":\"Unregister a root, available for all contracts\",\"params\":{\"root\":\"Root to unregister\"}},\"unregisterRootForAttester(address,uint256)\":{\"details\":\"Unregister a root for an attester\",\"params\":{\"attester\":\"Attester which will no longer have the root available\",\"root\":\"Root to unregister\"}}},\"title\":\"Attesters Groups Registry\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"This contract stores that data required by attesters to be available so they can verify user claims This contract is deployed behind a proxy and this implementation is focused on storing merkle roots For more information: https://available-roots-registry.docs.sismo.io*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/AvailableRootsRegistry.sol\":\"AvailableRootsRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3467998cbdb82b0c64aa8627efc5893d2b369f73e66e5d1095305e4609593cc5\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5e882d3091e816f1286837eef92ae17737abf66fdeece1282b752f27ba18492b\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b5060405161099538038061099583398101604081905261002f916101be565b61003833610047565b610041816100a2565b506101ee565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600290610100900460ff161580156100c4575060005460ff8083169116105b61012b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff8316176101001781556101576000546201000090046001600160a01b031690565b6001600160a01b0316148061016b5750303b155b156101795761017982610047565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b6000602082840312156101d057600080fd5b81516001600160a01b03811681146101e757600080fd5b9392505050565b610798806101fd6000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c8063be4a605611610071578063be4a605614610170578063c4d66de814610183578063e5e477a014610196578063ebea45cb146101a9578063f2fde38b146101bc578063fe7e7750146101cf57600080fd5b80632f56be56146100b95780634e473f8f146100ce578063715018a6146100f6578063754b377c146100fe57806380b404ce146101185780638da5cb5b14610146575b600080fd5b6100cc6100c7366004610704565b6101e2565b005b6100e16100dc366004610704565b61021f565b60405190151581526020015b60405180910390f35b6100cc610285565b610106600281565b60405160ff90911681526020016100ed565b6100e1610126366004610704565b600160209081526000928352604080842090915290825290205460ff1681565b6000546201000090046001600160a01b03166040516001600160a01b0390911681526020016100ed565b6100cc61017e36600461072e565b610299565b6100cc610191366004610747565b6102af565b6100e16101a436600461072e565b6103ce565b6100cc6101b7366004610704565b61042a565b6100cc6101ca366004610747565b610463565b6100cc6101dd36600461072e565b6104d9565b6101ea6104ec565b6001600160a01b03821661021157604051639e95e88b60e01b815260040160405180910390fd5b61021b828261054d565b5050565b6001600160a01b038216600090815260016020908152604080832084845290915281205460ff168061027e575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b9392505050565b61028d6104ec565b61029760006105ef565b565b6102a16104ec565b6102ac60008261054d565b50565b600054600290610100900460ff161580156102d1575060005460ff8083169116105b6103395760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556103666000546001600160a01b03620100009091041690565b6001600160a01b0316148061037a5750303b155b1561038857610388826105ef565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b33600090815260016020908152604080832084845290915281205460ff1680610424575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b92915050565b6104326104ec565b6001600160a01b03821661045957604051631b25a00160e31b815260040160405180910390fd5b61021b828261064a565b61046b6104ec565b6001600160a01b0381166104d05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610330565b6102ac816105ef565b6104e16104ec565b6102ac60008261064a565b6000546001600160a01b03620100009091041633146102975760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610330565b6001600160a01b0382166000818152600160208181526040808420868552909152909120805460ff191690911790556105b0576040518181527f22f0a171f00eeea3af5276d1f77587471dcc3bde32d62560046549b34bacd38a906020016103c2565b604080516001600160a01b0384168152602081018390527f21cdff046578afe71b78f95ac4891306af3a9b9eb71e2f0ef380b35b487d2f1291016103c2565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6001600160a01b03821660008181526001602090815260408083208584529091529020805460ff191690556106a9576040518181527f7261c2abe5e576aac50024de639315f10783f67935bf118bbb49b33c20ef70ef906020016103c2565b604080516001600160a01b0384168152602081018390527fba8195cc62a4086b7cd93d22db90e43ae42d8b5febd8c66b3453771e455b7a3391016103c2565b80356001600160a01b03811681146106ff57600080fd5b919050565b6000806040838503121561071757600080fd5b610720836106e8565b946020939093013593505050565b60006020828403121561074057600080fd5b5035919050565b60006020828403121561075957600080fd5b61027e826106e856fea264697066735822122096da5c8d33677e6203057d911bba2c609059e50119bb896ec169d0349a48641d64736f6c634300080e0033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c8063be4a605611610071578063be4a605614610170578063c4d66de814610183578063e5e477a014610196578063ebea45cb146101a9578063f2fde38b146101bc578063fe7e7750146101cf57600080fd5b80632f56be56146100b95780634e473f8f146100ce578063715018a6146100f6578063754b377c146100fe57806380b404ce146101185780638da5cb5b14610146575b600080fd5b6100cc6100c7366004610704565b6101e2565b005b6100e16100dc366004610704565b61021f565b60405190151581526020015b60405180910390f35b6100cc610285565b610106600281565b60405160ff90911681526020016100ed565b6100e1610126366004610704565b600160209081526000928352604080842090915290825290205460ff1681565b6000546201000090046001600160a01b03166040516001600160a01b0390911681526020016100ed565b6100cc61017e36600461072e565b610299565b6100cc610191366004610747565b6102af565b6100e16101a436600461072e565b6103ce565b6100cc6101b7366004610704565b61042a565b6100cc6101ca366004610747565b610463565b6100cc6101dd36600461072e565b6104d9565b6101ea6104ec565b6001600160a01b03821661021157604051639e95e88b60e01b815260040160405180910390fd5b61021b828261054d565b5050565b6001600160a01b038216600090815260016020908152604080832084845290915281205460ff168061027e575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b9392505050565b61028d6104ec565b61029760006105ef565b565b6102a16104ec565b6102ac60008261054d565b50565b600054600290610100900460ff161580156102d1575060005460ff8083169116105b6103395760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556103666000546001600160a01b03620100009091041690565b6001600160a01b0316148061037a5750303b155b1561038857610388826105ef565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b33600090815260016020908152604080832084845290915281205460ff1680610424575060008281527fa6eef7e35abe7026729641147f7915573c7e97b47efa546f5f6e3230263bcb49602052604090205460ff165b92915050565b6104326104ec565b6001600160a01b03821661045957604051631b25a00160e31b815260040160405180910390fd5b61021b828261064a565b61046b6104ec565b6001600160a01b0381166104d05760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610330565b6102ac816105ef565b6104e16104ec565b6102ac60008261064a565b6000546001600160a01b03620100009091041633146102975760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610330565b6001600160a01b0382166000818152600160208181526040808420868552909152909120805460ff191690911790556105b0576040518181527f22f0a171f00eeea3af5276d1f77587471dcc3bde32d62560046549b34bacd38a906020016103c2565b604080516001600160a01b0384168152602081018390527f21cdff046578afe71b78f95ac4891306af3a9b9eb71e2f0ef380b35b487d2f1291016103c2565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6001600160a01b03821660008181526001602090815260408083208584529091529020805460ff191690556106a9576040518181527f7261c2abe5e576aac50024de639315f10783f67935bf118bbb49b33c20ef70ef906020016103c2565b604080516001600160a01b0384168152602081018390527fba8195cc62a4086b7cd93d22db90e43ae42d8b5febd8c66b3453771e455b7a3391016103c2565b80356001600160a01b03811681146106ff57600080fd5b919050565b6000806040838503121561071757600080fd5b610720836106e8565b946020939093013593505050565b60006020828403121561074057600080fd5b5035919050565b60006020828403121561075957600080fd5b61027e826106e856fea264697066735822122096da5c8d33677e6203057d911bba2c609059e50119bb896ec169d0349a48641d64736f6c634300080e0033", diff --git a/deployments/mumbaiTestnet/AvailableRootsRegistryProxy.json b/deployments/mumbaiTestnet/AvailableRootsRegistryProxy.json new file mode 100644 index 0000000..2e67a46 --- /dev/null +++ b/deployments/mumbaiTestnet/AvailableRootsRegistryProxy.json @@ -0,0 +1,276 @@ +{ + "address": "0xe51e46177505c31CE33791066E17E11d9D180305", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xd9d4751be28292e69908e0fba6a4c602d7996e01effdc62cb8b23092545a35a1", + "receipt": { + "to": null, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xe51e46177505c31CE33791066E17E11d9D180305", + "transactionIndex": 10, + "gasUsed": "612523", + "logsBloom": "0x00000000000000020000000000000000400800000000000000800000000100000000008000000000000000000000000000008000000000000000000000000000000000000000000000000000000002800001000000000000000100200000000000000000020000000000000000000800000000800000000080000002000000400000000000000000000000200000000000000000000080000000000040800000200000000000000020000000000402000001000000000000000000000000004000008020000000000001000000040000000000000400000000100000000020000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x8d7ff333508e4ce450d9f88900d71b15c83b6c4137ac2f05dacb31c1c78f76ba", + "transactionHash": "0xd9d4751be28292e69908e0fba6a4c602d7996e01effdc62cb8b23092545a35a1", + "logs": [ + { + "transactionIndex": 10, + "blockNumber": 29771993, + "transactionHash": "0xd9d4751be28292e69908e0fba6a4c602d7996e01effdc62cb8b23092545a35a1", + "address": "0xe51e46177505c31CE33791066E17E11d9D180305", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000e34001905278214a49f7c56923903010d5b0129f" + ], + "data": "0x", + "logIndex": 42, + "blockHash": "0x8d7ff333508e4ce450d9f88900d71b15c83b6c4137ac2f05dacb31c1c78f76ba" + }, + { + "transactionIndex": 10, + "blockNumber": 29771993, + "transactionHash": "0xd9d4751be28292e69908e0fba6a4c602d7996e01effdc62cb8b23092545a35a1", + "address": "0xe51e46177505c31CE33791066E17E11d9D180305", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" + ], + "data": "0x", + "logIndex": 43, + "blockHash": "0x8d7ff333508e4ce450d9f88900d71b15c83b6c4137ac2f05dacb31c1c78f76ba" + }, + { + "transactionIndex": 10, + "blockNumber": 29771993, + "transactionHash": "0xd9d4751be28292e69908e0fba6a4c602d7996e01effdc62cb8b23092545a35a1", + "address": "0xe51e46177505c31CE33791066E17E11d9D180305", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000002", + "logIndex": 44, + "blockHash": "0x8d7ff333508e4ce450d9f88900d71b15c83b6c4137ac2f05dacb31c1c78f76ba" + }, + { + "transactionIndex": 10, + "blockNumber": 29771993, + "transactionHash": "0xd9d4751be28292e69908e0fba6a4c602d7996e01effdc62cb8b23092545a35a1", + "address": "0xe51e46177505c31CE33791066E17E11d9D180305", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002110475dfbb8d331b300178a867372991ff35fa3", + "logIndex": 45, + "blockHash": "0x8d7ff333508e4ce450d9f88900d71b15c83b6c4137ac2f05dacb31c1c78f76ba" + }, + { + "transactionIndex": 10, + "blockNumber": 29771993, + "transactionHash": "0xd9d4751be28292e69908e0fba6a4c602d7996e01effdc62cb8b23092545a35a1", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" + ], + "data": "0x000000000000000000000000000000000000000000000000000343a12facb3aa0000000000000000000000000000000000000000000000001b92793c0624db4800000000000000000000000000000000000000000000187b052155e9daf7a7d30000000000000000000000000000000000000000000000001b8f359ad678279e00000000000000000000000000000000000000000000187b0524998b0aa45b7d", + "logIndex": 46, + "blockHash": "0x8d7ff333508e4ce450d9f88900d71b15c83b6c4137ac2f05dacb31c1c78f76ba" + } + ], + "blockNumber": 29771993, + "cumulativeGasUsed": "3256389", + "status": 1, + "byzantium": true + }, + "args": [ + "0xe34001905278214a49f7C56923903010d5B0129f", + "0x2110475dfbB8d331b300178A867372991ff35fA3", + "0xc4d66de8000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" + ], + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", + "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(\\n address newImplementation,\\n bytes calldata data\\n ) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x1663761dc98da7a84e6570b428877de7de9859e34f99c7002cad71ccfc9d6283\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405162000eeb38038062000eeb8339810160408190526200002691620004ed565b828162000036828260006200009a565b5062000066905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005cd565b60008051602062000ea483398151915214620000865762000086620005f3565b6200009182620000d7565b5050506200065c565b620000a58362000132565b600082511180620000b35750805b15620000d257620000d083836200017460201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f62000102620001a3565b604080516001600160a01b03928316815291841660208301520160405180910390a16200012f81620001dc565b50565b6200013d8162000291565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606200019c838360405180606001604052806027815260200162000ec46027913962000345565b9392505050565b6000620001cd60008051602062000ea483398151915260001b620003c460201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002475760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b806200027060008051602062000ea483398151915260001b620003c460201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002a781620003c760201b6200025a1760201c565b6200030b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200023e565b80620002707f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b620003c460201b620001ea1760201c565b6060600080856001600160a01b03168560405162000364919062000609565b600060405180830381855af49150503d8060008114620003a1576040519150601f19603f3d011682016040523d82523d6000602084013e620003a6565b606091505b509092509050620003ba86838387620003d6565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200044a57825160000362000442576001600160a01b0385163b620004425760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016200023e565b508162000456565b6200045683836200045e565b949350505050565b8151156200046f5781518083602001fd5b8060405162461bcd60e51b81526004016200023e919062000627565b80516001600160a01b0381168114620004a357600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004db578181015183820152602001620004c1565b83811115620000d05750506000910152565b6000806000606084860312156200050357600080fd5b6200050e846200048b565b92506200051e602085016200048b565b60408501519092506001600160401b03808211156200053c57600080fd5b818601915086601f8301126200055157600080fd5b815181811115620005665762000566620004a8565b604051601f8201601f19908116603f01168101908382118183101715620005915762000591620004a8565b81604052828152896020848701011115620005ab57600080fd5b620005be836020830160208801620004be565b80955050505050509250925092565b600082821015620005ee57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b600082516200061d818460208701620004be565b9190910192915050565b602081526000825180602084015262000648816040850160208701620004be565b601f01601f19169190910160400192915050565b610838806200066c6000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106c2565b610118565b61005b6100933660046106dd565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106c2565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107dc602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd610456565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b6103688361047e565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a816104be565b6060600080856001600160a01b0316856040516103fb919061078c565b600060405180830381855af49150503d8060008114610436576040519150601f19603f3d011682016040523d82523d6000602084013e61043b565b606091505b509150915061044c86838387610567565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b610487816105e8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105235760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105d65782516000036105cf576001600160a01b0385163b6105cf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102f5565b50816105e0565b6105e0838361067c565b949350505050565b6001600160a01b0381163b6106555760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610546565b81511561068c5781518083602001fd5b8060405162461bcd60e51b81526004016102f591906107a8565b80356001600160a01b03811681146106bd57600080fd5b919050565b6000602082840312156106d457600080fd5b610253826106a6565b6000806000604084860312156106f257600080fd5b6106fb846106a6565b9250602084013567ffffffffffffffff8082111561071857600080fd5b818601915086601f83011261072c57600080fd5b81358181111561073b57600080fd5b87602082850101111561074d57600080fd5b6020830194508093505050509250925092565b60005b8381101561077b578181015183820152602001610763565b838111156103845750506000910152565b6000825161079e818460208701610760565b9190910192915050565b60208152600082518060208401526107c7816040850160208701610760565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e2b2f80d01b9fee1887f086f33ea33eabe6a896123f3722976ea73e069c365b664736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106c2565b610118565b61005b6100933660046106dd565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106c2565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107dc602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd610456565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b6103688361047e565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a816104be565b6060600080856001600160a01b0316856040516103fb919061078c565b600060405180830381855af49150503d8060008114610436576040519150601f19603f3d011682016040523d82523d6000602084013e61043b565b606091505b509150915061044c86838387610567565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b610487816105e8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105235760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105d65782516000036105cf576001600160a01b0385163b6105cf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102f5565b50816105e0565b6105e0838361067c565b949350505050565b6001600160a01b0381163b6106555760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610546565b81511561068c5781518083602001fd5b8060405162461bcd60e51b81526004016102f591906107a8565b80356001600160a01b03811681146106bd57600080fd5b919050565b6000602082840312156106d457600080fd5b610253826106a6565b6000806000604084860312156106f257600080fd5b6106fb846106a6565b9250602084013567ffffffffffffffff8082111561071857600080fd5b818601915086601f83011261072c57600080fd5b81358181111561073b57600080fd5b87602082850101111561074d57600080fd5b6020830194508093505050509250925092565b60005b8381101561077b578181015183820152602001610763565b838111156103845750506000910152565b6000825161079e818460208701610760565b9190910192915050565b60208152600082518060208401526107c7816040850160208701610760565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e2b2f80d01b9fee1887f086f33ea33eabe6a896123f3722976ea73e069c365b664736f6c634300080e0033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/mumbai/Badges.json b/deployments/mumbaiTestnet/Badges.json similarity index 98% rename from deployments/mumbai/Badges.json rename to deployments/mumbaiTestnet/Badges.json index f62ba40..45a938e 100644 --- a/deployments/mumbai/Badges.json +++ b/deployments/mumbaiTestnet/Badges.json @@ -1,5 +1,5 @@ { - "address": "0x5722fEa81027533721BA161964622271560da1aC", + "address": "0xc3Ee5Aad6Fb987cF69a2EE7B3B2c92E21E42F34B", "abi": [ { "inputs": [ @@ -769,71 +769,71 @@ "type": "function" } ], - "transactionHash": "0xe6ede11f9bb84c6196c423e8f968bb588de965109953129484ff04390ae68c5e", + "transactionHash": "0x8f5785a7f59fc569dd3f895e5dc77c52dd33008e2c64cbfb53f23dce3e212479", "receipt": { "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x6D102d4FDFFcd6A4eb3E6207a25B2375d453F74A", + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0x818C6d85fFe9DF53d331f6413b0ae07F67CC71C9", "transactionIndex": 14, "gasUsed": "2131254", - "logsBloom": "0x00000004000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000008000002000000000000000000000000000000000000000000000000000800000000000000000040100000000000000000000220000000000000000000800002000000000000080000000000000000000000000000000000000000000000000000010004080000000000000008000200000000000000000000000800400000000000000000000001040000000004000000000000000000001000000050000000000000000000100100000000020000000000000000000000000000000000000000000000000000020000000100000", - "blockHash": "0x3c8ffb75f78b8adfadc03d9a578094358edf94c44b22ac3627ab63dd8fb1ec2e", - "transactionHash": "0xe6ede11f9bb84c6196c423e8f968bb588de965109953129484ff04390ae68c5e", + "logsBloom": "0x00000004200000020000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000010000800000000000000000000100000000000000000000020000000000000000000800000000000000000080000000000000000000000000000000000000000000000000000000000080000000000040000000200000000000000020000000000402000001000000000000001000000000004000008000000000000001000000040000000000000000000100100000000020000000000000000000000000000000000000000000002000000000000000100000", + "blockHash": "0x756baa17d005c1f33aa72ef1be0f49b4d29c66e954e6085bbfb0c2a905554d9a", + "transactionHash": "0x8f5785a7f59fc569dd3f895e5dc77c52dd33008e2c64cbfb53f23dce3e212479", "logs": [ { "transactionIndex": 14, - "blockNumber": 29540671, - "transactionHash": "0xe6ede11f9bb84c6196c423e8f968bb588de965109953129484ff04390ae68c5e", - "address": "0x6D102d4FDFFcd6A4eb3E6207a25B2375d453F74A", + "blockNumber": 29771730, + "transactionHash": "0x8f5785a7f59fc569dd3f895e5dc77c52dd33008e2c64cbfb53f23dce3e212479", + "address": "0x818C6d85fFe9DF53d331f6413b0ae07F67CC71C9", "topics": [ "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 69, - "blockHash": "0x3c8ffb75f78b8adfadc03d9a578094358edf94c44b22ac3627ab63dd8fb1ec2e" + "logIndex": 50, + "blockHash": "0x756baa17d005c1f33aa72ef1be0f49b4d29c66e954e6085bbfb0c2a905554d9a" }, { "transactionIndex": 14, - "blockNumber": 29540671, - "transactionHash": "0xe6ede11f9bb84c6196c423e8f968bb588de965109953129484ff04390ae68c5e", - "address": "0x6D102d4FDFFcd6A4eb3E6207a25B2375d453F74A", + "blockNumber": 29771730, + "transactionHash": "0x8f5785a7f59fc569dd3f895e5dc77c52dd33008e2c64cbfb53f23dce3e212479", + "address": "0x818C6d85fFe9DF53d331f6413b0ae07F67CC71C9", "topics": [ "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 70, - "blockHash": "0x3c8ffb75f78b8adfadc03d9a578094358edf94c44b22ac3627ab63dd8fb1ec2e" + "logIndex": 51, + "blockHash": "0x756baa17d005c1f33aa72ef1be0f49b4d29c66e954e6085bbfb0c2a905554d9a" }, { "transactionIndex": 14, - "blockNumber": 29540671, - "transactionHash": "0xe6ede11f9bb84c6196c423e8f968bb588de965109953129484ff04390ae68c5e", + "blockNumber": 29771730, + "transactionHash": "0x8f5785a7f59fc569dd3f895e5dc77c52dd33008e2c64cbfb53f23dce3e212479", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000c275dc8be39f50d12f66b6a63629c39da5bae5bd" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" ], - "data": "0x0000000000000000000000000000000000000000000000000007ba4e7021eeb40000000000000000000000000000000000000000000000007ce5b243caa744b2000000000000000000000000000000000000000000000b8e71caa1573dbb15c90000000000000000000000000000000000000000000000007cddf7f55a8555fe000000000000000000000000000000000000000000000b8e71d25ba5addd047d", - "logIndex": 71, - "blockHash": "0x3c8ffb75f78b8adfadc03d9a578094358edf94c44b22ac3627ab63dd8fb1ec2e" + "data": "0x000000000000000000000000000000000000000000000000000b5b8bdbc24ff20000000000000000000000000000000000000000000000001bc16d674ec8000000000000000000000000000000000000000000000000187ad4560dfadd1dd30e0000000000000000000000000000000000000000000000001bb611db7305b00e00000000000000000000000000000000000000000000187ad4616986b8e02300", + "logIndex": 52, + "blockHash": "0x756baa17d005c1f33aa72ef1be0f49b4d29c66e954e6085bbfb0c2a905554d9a" } ], - "blockNumber": 29540671, - "cumulativeGasUsed": "4568589", + "blockNumber": 29771730, + "cumulativeGasUsed": "5890047", "status": 1, "byzantium": true }, "args": [ - "https://hub.staging.zikies.io/badges/mumbai/{id}.json", - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954" + "https://hub.testnets.sismo.io/badges/mumbai/{id}.json", + "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED" ], - "numDeployments": 4, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BadgesNonTransferrable\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EVENT_TRIGGERER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationsRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"getAttributeValueForBadge\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getAttributesNamesAndValuesForBadge\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBadgeExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBadgeIssuer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBadgeTimestamp\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistry\",\"type\":\"address\"}],\"name\":\"setAttestationsRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"setUri\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"triggerTransferEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"balanceOf(address,uint256)\":{\"details\":\"Main function of the ERC1155 badge The balance of a user is equal to the value of the underlying attestation. attestationCollectionId == badgeId\",\"params\":{\"account\":\"Address to check badge balance (= value of attestation)\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"balanceOfBatch(address[],uint256[])\":{\"details\":\"See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length.\"},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"owner\":\"Owner of the contract, super admin, can setup roles and update the attestation registry\",\"uri\":\"Uri for the metadata of badges\"}},\"getAttestationsRegistry()\":{\"details\":\"Getter of the attestations registry\"},\"getAttributeValueForBadge(uint256,uint8)\":{\"details\":\"Getter of the value of a specific badge attribute\",\"params\":{\"id\":\"Badge Id to check (= attestationCollectionId)\",\"index\":\"Index of the attribute\"}},\"getAttributesNamesAndValuesForBadge(uint256)\":{\"details\":\"Getter of all badge attributes and their values for a specific badge\",\"params\":{\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getBadgeExtraData(address,uint256)\":{\"details\":\"Getter of the badge extra data (it can store nullifier and burnCount)\",\"params\":{\"account\":\"Address that holds the badge\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getBadgeIssuer(address,uint256)\":{\"details\":\"Getter of the badge issuer\",\"params\":{\"account\":\"Address that holds the badge\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getBadgeTimestamp(address,uint256)\":{\"details\":\"Getter of the badge timestamp\",\"params\":{\"account\":\"Address that holds the badge\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initialize(string,address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"owner\":\"Owner of the contract, super admin, can setup roles and update the attestation registry\",\"uri\":\"Uri for the metadata of badges\"}},\"isApprovedForAll(address,address)\":{\"details\":\"Reverts, this is a non transferable ERC115 contract\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)\":{\"details\":\"See {IERC1155-safeBatchTransferFrom}.\"},\"safeTransferFrom(address,address,uint256,uint256,bytes)\":{\"details\":\"See {IERC1155-safeTransferFrom}.\"},\"setApprovalForAll(address,bool)\":{\"details\":\"Reverts, this is a non transferable ERC115 contract\"},\"setAttestationsRegistry(address)\":{\"details\":\"Set the attestations registry address. Can only be called by owner (default admin)\",\"params\":{\"attestationsRegistry\":\"new attestations registry address\"}},\"setUri(string)\":{\"details\":\"Set the URI. Can only be called by owner (default admin)\",\"params\":{\"uri\":\"new attestations registry address\"}},\"supportsInterface(bytes4)\":{\"details\":\"ERC165\"},\"triggerTransferEvent(address,address,address,uint256,uint256)\":{\"details\":\"Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\",\"params\":{\"from\":\"address(0) if minting, address of the badge holder if burning\",\"id\":\"badgeId for which to trigger the event\",\"operator\":\"who is calling the TransferEvent\",\"to\":\"address of the badge holder is minting, address(0) if burning\",\"value\":\"minted/burned balance\"}},\"uri(uint256)\":{\"details\":\"See {IERC1155MetadataURI-uri}. This implementation returns the same URI for *all* token types. It relies on the token type ID substitution mechanism https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. Clients calling this function must replace the `\\\\{id\\\\}` substring with the actual token type ID.\"}},\"title\":\"Badges contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(string,address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations The associated attestations registry triggers TransferSingle events from this contract It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms For more information: https://badges.docs.sismo.io\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/Badges.sol\":\"Badges\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\nimport \\\"../utils/Context.sol\\\";\\nimport \\\"../utils/Strings.sol\\\";\\nimport \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\\n * Overriding this function changes the behavior of the {onlyRole} modifier.\\n *\\n * Format of the revert message is described in {_checkRole}.\\n *\\n * _Available since v4.6._\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n Strings.toHexString(account),\\n \\\" is missing role \\\",\\n Strings.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * May emit a {RoleGranted} event.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n}\\n\",\"keccak256\":\"0x67e3daf189111d6d5b0464ed09cf9f0605a22c4b965a7fcecd707101faff008a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/security/Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract Pausable is Context {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0x0849d93b16c9940beb286a7864ed02724b248b93e0d80ef6355af5ef15c64773\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/ERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC1155.sol\\\";\\nimport \\\"./IERC1155Receiver.sol\\\";\\nimport \\\"./extensions/IERC1155MetadataURI.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\nimport \\\"../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the basic standard multi-token.\\n * See https://eips.ethereum.org/EIPS/eip-1155\\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\\n *\\n * _Available since v3.1._\\n */\\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\\n using Address for address;\\n\\n // Mapping from token ID to account balances\\n mapping(uint256 => mapping(address => uint256)) private _balances;\\n\\n // Mapping from account to operator approvals\\n mapping(address => mapping(address => bool)) private _operatorApprovals;\\n\\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\\n string private _uri;\\n\\n /**\\n * @dev See {_setURI}.\\n */\\n constructor(string memory uri_) {\\n _setURI(uri_);\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC1155).interfaceId ||\\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC1155MetadataURI-uri}.\\n *\\n * This implementation returns the same URI for *all* token types. It relies\\n * on the token type ID substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * Clients calling this function must replace the `\\\\{id\\\\}` substring with the\\n * actual token type ID.\\n */\\n function uri(uint256) public view virtual override returns (string memory) {\\n return _uri;\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\\n require(account != address(0), \\\"ERC1155: address zero is not a valid owner\\\");\\n return _balances[id][account];\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOfBatch}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\\n public\\n view\\n virtual\\n override\\n returns (uint256[] memory)\\n {\\n require(accounts.length == ids.length, \\\"ERC1155: accounts and ids length mismatch\\\");\\n\\n uint256[] memory batchBalances = new uint256[](accounts.length);\\n\\n for (uint256 i = 0; i < accounts.length; ++i) {\\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\\n }\\n\\n return batchBalances;\\n }\\n\\n /**\\n * @dev See {IERC1155-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC1155-isApprovedForAll}.\\n */\\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\\n return _operatorApprovals[account][operator];\\n }\\n\\n /**\\n * @dev See {IERC1155-safeTransferFrom}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner or approved\\\"\\n );\\n _safeTransferFrom(from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev See {IERC1155-safeBatchTransferFrom}.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner or approved\\\"\\n );\\n _safeBatchTransferFrom(from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n\\n emit TransferSingle(operator, from, to, id, amount);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; ++i) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n }\\n\\n emit TransferBatch(operator, from, to, ids, amounts);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Sets a new URI for all token types, by relying on the token type ID\\n * substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * By this mechanism, any occurrence of the `\\\\{id\\\\}` substring in either the\\n * URI or any of the amounts in the JSON file at said URI will be replaced by\\n * clients with the token type ID.\\n *\\n * For example, the `https://token-cdn-domain/\\\\{id\\\\}.json` URI would be\\n * interpreted by clients as\\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\\n * for token type ID 0x4cce0.\\n *\\n * See {uri}.\\n *\\n * Because these URIs cannot be meaningfully represented by the {URI} event,\\n * this function emits no events.\\n */\\n function _setURI(string memory newuri) internal virtual {\\n _uri = newuri;\\n }\\n\\n /**\\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _mint(\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _balances[id][to] += amount;\\n emit TransferSingle(operator, address(0), to, id, amount);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _mintBatch(\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n _balances[ids[i]][to] += amounts[i];\\n }\\n\\n emit TransferBatch(operator, address(0), to, ids, amounts);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens of token type `id` from `from`\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `from` must have at least `amount` tokens of token type `id`.\\n */\\n function _burn(\\n address from,\\n uint256 id,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n\\n emit TransferSingle(operator, from, address(0), id, amount);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n */\\n function _burnBatch(\\n address from,\\n uint256[] memory ids,\\n uint256[] memory amounts\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n }\\n\\n emit TransferBatch(operator, from, address(0), ids, amounts);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(\\n address owner,\\n address operator,\\n bool approved\\n ) internal virtual {\\n require(owner != operator, \\\"ERC1155: setting approval status for self\\\");\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Hook that is called before any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `ids` and `amounts` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `id` and `amount` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n function _doSafeTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\\n if (response != IERC1155Receiver.onERC1155Received.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non-ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _doSafeBatchTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\\n bytes4 response\\n ) {\\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non-ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\\n uint256[] memory array = new uint256[](1);\\n array[0] = element;\\n\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0xd917747dc87f189c6779b894f367a028f9dca4be930283cccec8f312966af820\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155 is IERC165 {\\n /**\\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\\n */\\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\\n\\n /**\\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\\n * transfers.\\n */\\n event TransferBatch(\\n address indexed operator,\\n address indexed from,\\n address indexed to,\\n uint256[] ids,\\n uint256[] values\\n );\\n\\n /**\\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\\n * `approved`.\\n */\\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\\n\\n /**\\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\\n *\\n * If an {URI} event was emitted for `id`, the standard\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\\n * returned by {IERC1155MetadataURI-uri}.\\n */\\n event URI(string value, uint256 indexed id);\\n\\n /**\\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\\n external\\n view\\n returns (uint256[] memory);\\n\\n /**\\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\\n *\\n * Emits an {ApprovalForAll} event.\\n *\\n * Requirements:\\n *\\n * - `operator` cannot be the caller.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\\n *\\n * See {setApprovalForAll}.\\n */\\n function isApprovedForAll(address account, address operator) external view returns (bool);\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] calldata ids,\\n uint256[] calldata amounts,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x6392f2cfe3a5ee802227fe7a2dfd47096d881aec89bddd214b35c5b46d3cd941\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev _Available since v3.1._\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xeb373f1fdc7b755c6a750123a9b9e3a8a02c1470042fd6505d875000a80bde0b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1155.sol\\\";\\nimport \\\"../../../security/Pausable.sol\\\";\\n\\n/**\\n * @dev ERC1155 token with pausable token transfers, minting and burning.\\n *\\n * Useful for scenarios such as preventing trades until the end of an evaluation\\n * period, or having an emergency switch for freezing all token transfers in the\\n * event of a large bug.\\n *\\n * _Available since v3.1._\\n */\\nabstract contract ERC1155Pausable is ERC1155, Pausable {\\n /**\\n * @dev See {ERC1155-_beforeTokenTransfer}.\\n *\\n * Requirements:\\n *\\n * - the contract must not be paused.\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override {\\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n require(!paused(), \\\"ERC1155Pausable: token transfer while paused\\\");\\n }\\n}\\n\",\"keccak256\":\"0xdad22b949de979bb2ad9001c044b2aeaacf8a25e3de09ed6f022a9469f936d5b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC1155.sol\\\";\\n\\n/**\\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155MetadataURI is IERC1155 {\\n /**\\n * @dev Returns the URI for token type `id`.\\n *\\n * If the `\\\\{id\\\\}` substring is present in the URI, it must be replaced by\\n * clients with the actual token type ID.\\n */\\n function uri(uint256 id) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xa66d18b9a85458d28fc3304717964502ae36f7f8a2ff35bc83f6f85d74b03574\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"},\"contracts/core/Badges.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {IBadges} from './interfaces/IBadges.sol';\\n\\n/**\\n * @title Badges contract\\n * @author Sismo\\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\\n * The associated attestations registry triggers TransferSingle events from this contract\\n * It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms\\n * For more information: https://badges.docs.sismo.io\\n */\\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\\n uint8 public constant IMPLEMENTATION_VERSION = 3;\\n\\n IAttestationsRegistry internal _attestationsRegistry;\\n\\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\\n\\n /**\\n * @dev Constructor\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n */\\n constructor(\\n string memory uri,\\n address owner // This is Sismo Frontend Contract\\n ) ERC1155(uri) {\\n initialize(uri, owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n string memory uri,\\n address owner\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup uri yet or if called by constructor (for implem setup)\\n if (bytes(ERC1155.uri(0)).length == 0 || address(this).code.length == 0) {\\n _setURI(uri);\\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\\n }\\n }\\n\\n /**\\n * @dev Main function of the ERC1155 badge\\n * The balance of a user is equal to the value of the underlying attestation.\\n * attestationCollectionId == badgeId\\n * @param account Address to check badge balance (= value of attestation)\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function balanceOf(\\n address account,\\n uint256 id\\n ) public view virtual override(ERC1155, IBadges) returns (uint256) {\\n return _attestationsRegistry.getAttestationValue(id, account);\\n }\\n\\n /**\\n * @dev Reverts, this is a non transferable ERC115 contract\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n revert BadgesNonTransferrable();\\n }\\n\\n /**\\n * @dev Reverts, this is a non transferable ERC115 contract\\n */\\n function isApprovedForAll(\\n address account,\\n address operator\\n ) public view virtual override returns (bool) {\\n revert BadgesNonTransferrable();\\n }\\n\\n /**\\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\\n * @param operator who is calling the TransferEvent\\n * @param from address(0) if minting, address of the badge holder if burning\\n * @param to address of the badge holder is minting, address(0) if burning\\n * @param id badgeId for which to trigger the event\\n * @param value minted/burned balance\\n */\\n function triggerTransferEvent(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 value\\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\\n emit TransferSingle(operator, from, to, id, value);\\n }\\n\\n /**\\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\\n * @param attestationsRegistry new attestations registry address\\n */\\n function setAttestationsRegistry(\\n address attestationsRegistry\\n ) external override onlyRole(DEFAULT_ADMIN_ROLE) {\\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\\n }\\n\\n /**\\n * @dev Set the URI. Can only be called by owner (default admin)\\n * @param uri new attestations registry address\\n */\\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\\n _setURI(uri);\\n }\\n\\n /**\\n * @dev Getter of the attestations registry\\n */\\n function getAttestationsRegistry() external view override returns (address) {\\n return address(_attestationsRegistry);\\n }\\n\\n /**\\n * @dev Getter of the badge issuer\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeIssuer(address account, uint256 id) external view returns (address) {\\n return _attestationsRegistry.getAttestationIssuer(id, account);\\n }\\n\\n /**\\n * @dev Getter of the badge timestamp\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32) {\\n return _attestationsRegistry.getAttestationTimestamp(id, account);\\n }\\n\\n /**\\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory) {\\n return _attestationsRegistry.getAttestationExtraData(id, account);\\n }\\n\\n /**\\n * @dev Getter of the value of a specific badge attribute\\n * @param id Badge Id to check (= attestationCollectionId)\\n * @param index Index of the attribute\\n */\\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8) {\\n return _attestationsRegistry.getAttributeValueForAttestationsCollection(id, index);\\n }\\n\\n /**\\n * @dev Getter of all badge attributes and their values for a specific badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getAttributesNamesAndValuesForBadge(\\n uint256 id\\n ) external view returns (bytes32[] memory, uint8[] memory) {\\n return _attestationsRegistry.getAttributesNamesAndValuesForAttestationsCollection(id);\\n }\\n\\n /**\\n * @dev ERC165\\n */\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view virtual override(AccessControl, ERC1155) returns (bool) {\\n return super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Reverts, this is a non transferable ERC115 contract\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override {\\n revert BadgesNonTransferrable();\\n }\\n}\\n\",\"keccak256\":\"0x9982b753d43f2a4a9edb5987714b09f518b419339d4bf9cd63b600bee442fd01\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IBadges.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Interface for Badges contract\\n * @author Sismo\\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\\n * The associated attestations registry triggers TransferSingle events from this contract\\n * It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms\\n */\\ninterface IBadges {\\n error BadgesNonTransferrable();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(string memory uri, address owner) external;\\n\\n /**\\n * @dev Main function of the ERC1155 badge\\n * The balance of a user is equal to the value of the underlying attestation.\\n * attestationCollectionId == badgeId\\n * @param account Address to check badge balance (= value of attestation)\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\\n * @param operator who is calling the TransferEvent\\n * @param from address(0) if minting, address of the badge holder if burning\\n * @param to address of the badge holder is minting, address(0) if burning\\n * @param id badgeId for which to trigger the event\\n * @param value minted/burned balance\\n */\\n function triggerTransferEvent(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 value\\n ) external;\\n\\n /**\\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\\n * @param attestationsRegistry new attestations registry address\\n */\\n function setAttestationsRegistry(address attestationsRegistry) external;\\n\\n /**\\n * @dev Set the URI. Can only be called by owner (default admin)\\n * @param uri new attestations registry address\\n */\\n function setUri(string memory uri) external;\\n\\n /**\\n * @dev Getter of the attestations registry\\n */\\n function getAttestationsRegistry() external view returns (address);\\n\\n /**\\n * @dev Getter of the badge issuer\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeIssuer(address account, uint256 id) external view returns (address);\\n\\n /**\\n * @dev Getter of the badge timestamp\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the value of a specific badge attribute\\n * @param id Badge Id to check (= attestationCollectionId)\\n * @param index Index of the attribute\\n */\\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);\\n\\n /**\\n * @dev Getter of all badge attributes and their values for a specific badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getAttributesNamesAndValuesForBadge(\\n uint256 id\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n}\\n\",\"keccak256\":\"0xd6bdfc887ef15ee022eb05d89dbe2e2938ee6c0a55a55f8db527ef650242c6bb\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x60806040523480156200001157600080fd5b50604051620027eb380380620027eb833981016040819052620000349162000395565b81620000408162000055565b506200004d82826200006e565b5050620004c2565b80516200006a906004906020840190620002bc565b5050565b600054600390610100900460ff1615801562000091575060005460ff8083169116105b620000f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff83161761010017815562000127906200051d62000198602090811b91909117901c565b511580620001345750303b155b156200015257620001458362000055565b6200015260008362000234565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b606060048054620001a99062000486565b80601f0160208091040260200160405190810160405280929190818152602001828054620001d79062000486565b8015620002285780601f10620001fc5761010080835404028352916020019162000228565b820191906000526020600020905b8154815290600101906020018083116200020a57829003601f168201915b50505050509050919050565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff166200006a5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b828054620002ca9062000486565b90600052602060002090601f016020900481019282620002ee576000855562000339565b82601f106200030957805160ff191683800117855562000339565b8280016001018555821562000339579182015b82811115620003395782518255916020019190600101906200031c565b50620003479291506200034b565b5090565b5b808211156200034757600081556001016200034c565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200039057600080fd5b919050565b60008060408385031215620003a957600080fd5b82516001600160401b0380821115620003c157600080fd5b818501915085601f830112620003d657600080fd5b815181811115620003eb57620003eb62000362565b604051601f8201601f19908116603f0116810190838211818310171562000416576200041662000362565b816040528281526020935088848487010111156200043357600080fd5b600091505b8282101562000457578482018401518183018501529083019062000438565b82821115620004695760008484830101525b95506200047b91505085820162000378565b925050509250929050565b600181811c908216806200049b57607f821691505b602082108103620004bc57634e487b7160e01b600052602260045260246000fd5b50919050565b61231980620004d26000396000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c8063754b377c116100de578063aed8c6bc11610097578063e37ffe7c11610071578063e37ffe7c146103aa578063e985e9c5146103cb578063f242432a146103de578063ff4468c4146103f157600080fd5b8063aed8c6bc14610371578063b3c1cb2114610384578063d547741f1461039757600080fd5b8063754b377c146103035780637ab4339d1461031d57806391d14854146103305780639b642de114610343578063a217fddf14610356578063a22cb4651461035e57600080fd5b80632f2ff15d1161014b57806344112ed81161012557806344112ed8146102985780634e1273f4146102bf578063710b3096146102df578063730cb7d5146102f257600080fd5b80632f2ff15d1461025f57806336568abe146102725780633e1f3c271461028557600080fd5b8062fdd58e1461019257806301ffc9a7146101b85780630e064366146101db5780630e89341c14610206578063248a9ca3146102265780632eb2c2d61461024a575b600080fd5b6101a56101a0366004611618565b610419565b6040519081526020015b60405180910390f35b6101cb6101c636600461165a565b610496565b60405190151581526020016101af565b6101ee6101e9366004611618565b6104a7565b6040516001600160a01b0390911681526020016101af565b610219610214366004611677565b61051d565b6040516101af91906116ec565b6101a5610234366004611677565b6000908152600160208190526040909120015490565b61025d610258366004611858565b6105b1565b005b61025d61026d366004611905565b610606565b61025d610280366004611905565b610631565b610219610293366004611618565b6106af565b6101a57fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa481565b6102d26102cd366004611935565b610729565b6040516101af9190611a3c565b61025d6102ed366004611a4f565b610852565b6005546001600160a01b03166101ee565b61030b600381565b60405160ff90911681526020016101af565b61025d61032b366004611aaa565b6108e4565b6101cb61033e366004611905565b6109f1565b61025d610351366004611af0565b610a1c565b6101a5600081565b61025d61036c366004611b2c565b610a30565b61030b61037f366004611b6e565b610a49565b61025d610392366004611b93565b610ac0565b61025d6103a5366004611905565b610aee565b6103bd6103b8366004611677565b610b14565b6040516101af929190611bb0565b6101cb6103d9366004611c2e565b610b93565b61025d6103ec366004611c5c565b610bae565b6104046103ff366004611618565b610bf3565b60405163ffffffff90911681526020016101af565b60055460405163461e4f1960e11b8152600481018390526001600160a01b0384811660248301526000921690638c3c9e3290604401602060405180830381865afa15801561046b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cc4565b9392505050565b60006104a182610c69565b92915050565b6005546040516363ed4d5360e11b8152600481018390526001600160a01b038481166024830152600092169063c7da9aa690604401602060405180830381865afa1580156104f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cdd565b60606004805461052c90611cfa565b80601f016020809104026020016040519081016040528092919081815260200182805461055890611cfa565b80156105a55780601f1061057a576101008083540402835291602001916105a5565b820191906000526020600020905b81548152906001019060200180831161058857829003601f168201915b50505050509050919050565b6001600160a01b0385163314806105cd57506105cd8533610b93565b6105f25760405162461bcd60e51b81526004016105e990611d34565b60405180910390fd5b6105ff8585858585610ca9565b5050505050565b6000828152600160208190526040909120015461062281610e97565b61062c8383610ea4565b505050565b6001600160a01b03811633146106a15760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105e9565b6106ab8282610f0f565b5050565b600554604051636d7fbb6760e01b8152600481018390526001600160a01b0384811660248301526060921690636d7fbb6790604401600060405180830381865afa158015610701573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261048f9190810190611d82565b6060815183511461078e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016105e9565b600083516001600160401b038111156107a9576107a96116ff565b6040519080825280602002602001820160405280156107d2578160200160208202803683370190505b50905060005b845181101561084a5761081d8582815181106107f6576107f6611e03565b602002602001015185838151811061081057610810611e03565b6020026020010151610419565b82828151811061082f5761082f611e03565b602090810291909101015261084381611e2f565b90506107d8565b509392505050565b7fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa461087c81610e97565b836001600160a01b0316856001600160a01b0316876001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6286866040516108d4929190918252602082015260400190565b60405180910390a4505050505050565b600054600390610100900460ff16158015610906575060005460ff8083169116105b6109695760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e9565b6000805461ffff191660ff8316176101001781556109869061051d565b5115806109925750303b155b156109ab576109a083610f76565b6109ab600083610ea4565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610a2781610e97565b6106ab82610f76565b6040516309a711b960e31b815260040160405180910390fd5b600554604051630e972f9160e41b81526004810184905260ff831660248201526000916001600160a01b03169063e972f91090604401602060405180830381865afa158015610a9c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611e48565b6000610acb81610e97565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526001602081905260409091200154610b0a81610e97565b61062c8383610f0f565b600554604051632b2bf81b60e11b81526004810183905260609182916001600160a01b0390911690635657f03690602401600060405180830381865afa158015610b62573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b8a9190810190611ed4565b91509150915091565b60006040516309a711b960e31b815260040160405180910390fd5b6001600160a01b038516331480610bca5750610bca8533610b93565b610be65760405162461bcd60e51b81526004016105e990611d34565b6105ff8585858585610f89565b6005546040516314067f8b60e01b8152600481018390526001600160a01b03848116602483015260009216906314067f8b90604401602060405180830381865afa158015610c45573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611f90565b60006001600160e01b03198216636cdb3d1360e11b1480610c9a57506001600160e01b031982166303a24d0760e21b145b806104a157506104a1826110c5565b8151835114610d0b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016105e9565b6001600160a01b038416610d315760405162461bcd60e51b81526004016105e990611fb6565b33610d40818787878787610a30565b60005b8451811015610e29576000858281518110610d6057610d60611e03565b602002602001015190506000858381518110610d7e57610d7e611e03565b60209081029190910181015160008481526002835260408082206001600160a01b038e168352909352919091205490915081811015610dcf5760405162461bcd60e51b81526004016105e990611ffb565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610e0e908490612045565b9250508190555050505080610e2290611e2f565b9050610d43565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610e7992919061205d565b60405180910390a4610e8f8187878787876110fa565b505050505050565b610ea1813361125e565b50565b610eae82826109f1565b6106ab5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b610f1982826109f1565b156106ab5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b80516106ab90600490602084019061156a565b6001600160a01b038416610faf5760405162461bcd60e51b81526004016105e990611fb6565b336000610fbb856112b7565b90506000610fc8856112b7565b9050610fd8838989858589610a30565b60008681526002602090815260408083206001600160a01b038c1684529091529020548581101561101b5760405162461bcd60e51b81526004016105e990611ffb565b60008781526002602090815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061105a908490612045565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46110ba848a8a8a8a8a611302565b505050505050505050565b60006001600160e01b03198216637965db0b60e01b14806104a157506301ffc9a760e01b6001600160e01b03198316146104a1565b6001600160a01b0384163b15610e8f5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061113e908990899088908890889060040161208b565b6020604051808303816000875af1925050508015611179575060408051601f3d908101601f19168201909252611176918101906120e9565b60015b61122557611185612106565b806308c379a0036111be5750611199612122565b806111a457506111c0565b8060405162461bcd60e51b81526004016105e991906116ec565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016105e9565b6001600160e01b0319811663bc197c8160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b50505050505050565b61126882826109f1565b6106ab57611275816113bd565b6112808360206113cf565b6040516020016112919291906121f3565b60408051601f198184030181529082905262461bcd60e51b82526105e9916004016116ec565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106112f1576112f1611e03565b602090810291909101015292915050565b6001600160a01b0384163b15610e8f5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906113469089908990889088908890600401612268565b6020604051808303816000875af1925050508015611381575060408051601f3d908101601f1916820190925261137e918101906120e9565b60015b61138d57611185612106565b6001600160e01b0319811663f23a6e6160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b60606104a16001600160a01b03831660145b606060006113de8360026122ad565b6113e9906002612045565b6001600160401b03811115611400576114006116ff565b6040519080825280601f01601f19166020018201604052801561142a576020820181803683370190505b509050600360fc1b8160008151811061144557611445611e03565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061147457611474611e03565b60200101906001600160f81b031916908160001a90535060006114988460026122ad565b6114a3906001612045565b90505b600181111561151b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106114d7576114d7611e03565b1a60f81b8282815181106114ed576114ed611e03565b60200101906001600160f81b031916908160001a90535060049490941c93611514816122cc565b90506114a6565b50831561048f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105e9565b82805461157690611cfa565b90600052602060002090601f01602090048101928261159857600085556115de565b82601f106115b157805160ff19168380011785556115de565b828001600101855582156115de579182015b828111156115de5782518255916020019190600101906115c3565b506115ea9291506115ee565b5090565b5b808211156115ea57600081556001016115ef565b6001600160a01b0381168114610ea157600080fd5b6000806040838503121561162b57600080fd5b823561163681611603565b946020939093013593505050565b6001600160e01b031981168114610ea157600080fd5b60006020828403121561166c57600080fd5b813561048f81611644565b60006020828403121561168957600080fd5b5035919050565b60005b838110156116ab578181015183820152602001611693565b838111156116ba576000848401525b50505050565b600081518084526116d8816020860160208601611690565b601f01601f19169290920160200192915050565b60208152600061048f60208301846116c0565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561173a5761173a6116ff565b6040525050565b60006001600160401b0382111561175a5761175a6116ff565b5060051b60200190565b600082601f83011261177557600080fd5b8135602061178282611741565b60405161178f8282611715565b83815260059390931b85018201928281019150868411156117af57600080fd5b8286015b848110156117ca57803583529183019183016117b3565b509695505050505050565b60006001600160401b038211156117ee576117ee6116ff565b50601f01601f191660200190565b600082601f83011261180d57600080fd5b8135611818816117d5565b6040516118258282611715565b82815285602084870101111561183a57600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a0868803121561187057600080fd5b853561187b81611603565b9450602086013561188b81611603565b935060408601356001600160401b03808211156118a757600080fd5b6118b389838a01611764565b945060608801359150808211156118c957600080fd5b6118d589838a01611764565b935060808801359150808211156118eb57600080fd5b506118f8888289016117fc565b9150509295509295909350565b6000806040838503121561191857600080fd5b82359150602083013561192a81611603565b809150509250929050565b6000806040838503121561194857600080fd5b82356001600160401b038082111561195f57600080fd5b818501915085601f83011261197357600080fd5b8135602061198082611741565b60405161198d8282611715565b83815260059390931b85018201928281019150898411156119ad57600080fd5b948201945b838610156119d45785356119c581611603565b825294820194908201906119b2565b965050860135925050808211156119ea57600080fd5b506119f785828601611764565b9150509250929050565b600081518084526020808501945080840160005b83811015611a3157815187529582019590820190600101611a15565b509495945050505050565b60208152600061048f6020830184611a01565b600080600080600060a08688031215611a6757600080fd5b8535611a7281611603565b94506020860135611a8281611603565b93506040860135611a9281611603565b94979396509394606081013594506080013592915050565b60008060408385031215611abd57600080fd5b82356001600160401b03811115611ad357600080fd5b611adf858286016117fc565b925050602083013561192a81611603565b600060208284031215611b0257600080fd5b81356001600160401b03811115611b1857600080fd5b611b24848285016117fc565b949350505050565b60008060408385031215611b3f57600080fd5b8235611b4a81611603565b91506020830135801515811461192a57600080fd5b60ff81168114610ea157600080fd5b60008060408385031215611b8157600080fd5b82359150602083013561192a81611b5f565b600060208284031215611ba557600080fd5b813561048f81611603565b604080825283519082018190526000906020906060840190828701845b82811015611be957815184529284019290840190600101611bcd565b5050508381038285015284518082528583019183019060005b81811015611c2157835160ff1683529284019291840191600101611c02565b5090979650505050505050565b60008060408385031215611c4157600080fd5b8235611c4c81611603565b9150602083013561192a81611603565b600080600080600060a08688031215611c7457600080fd5b8535611c7f81611603565b94506020860135611c8f81611603565b9350604086013592506060860135915060808601356001600160401b03811115611cb857600080fd5b6118f8888289016117fc565b600060208284031215611cd657600080fd5b5051919050565b600060208284031215611cef57600080fd5b815161048f81611603565b600181811c90821680611d0e57607f821691505b602082108103611d2e57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b600060208284031215611d9457600080fd5b81516001600160401b03811115611daa57600080fd5b8201601f81018413611dbb57600080fd5b8051611dc6816117d5565b604051611dd38282611715565b828152866020848601011115611de857600080fd5b611df9836020830160208701611690565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e4157611e41611e19565b5060010190565b600060208284031215611e5a57600080fd5b815161048f81611b5f565b600082601f830112611e7657600080fd5b81516020611e8382611741565b604051611e908282611715565b83815260059390931b8501820192828101915086841115611eb057600080fd5b8286015b848110156117ca578051611ec781611b5f565b8352918301918301611eb4565b60008060408385031215611ee757600080fd5b82516001600160401b0380821115611efe57600080fd5b818501915085601f830112611f1257600080fd5b81516020611f1f82611741565b604051611f2c8282611715565b83815260059390931b8501820192828101915089841115611f4c57600080fd5b948201945b83861015611f6a57855182529482019490820190611f51565b91880151919650909350505080821115611f8357600080fd5b506119f785828601611e65565b600060208284031215611fa257600080fd5b815163ffffffff8116811461048f57600080fd5b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6000821982111561205857612058611e19565b500190565b6040815260006120706040830185611a01565b82810360208401526120828185611a01565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906120b790830186611a01565b82810360608401526120c98186611a01565b905082810360808401526120dd81856116c0565b98975050505050505050565b6000602082840312156120fb57600080fd5b815161048f81611644565b600060033d111561211f5760046000803e5060005160e01c5b90565b600060443d10156121305790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561215f57505050505090565b82850191508151818111156121775750505050505090565b843d87010160208285010111156121915750505050505090565b6121a060208286010187611715565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161222b816017850160208801611690565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161225c816028840160208801611690565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906122a2908301846116c0565b979650505050505050565b60008160001904831182151516156122c7576122c7611e19565b500290565b6000816122db576122db611e19565b50600019019056fea26469706673582212209e33646a1ed2d51fcc749870e94aa69546c518fc5bfee43d37014ebc54dd767864736f6c634300080e0033", "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061018d5760003560e01c8063754b377c116100de578063aed8c6bc11610097578063e37ffe7c11610071578063e37ffe7c146103aa578063e985e9c5146103cb578063f242432a146103de578063ff4468c4146103f157600080fd5b8063aed8c6bc14610371578063b3c1cb2114610384578063d547741f1461039757600080fd5b8063754b377c146103035780637ab4339d1461031d57806391d14854146103305780639b642de114610343578063a217fddf14610356578063a22cb4651461035e57600080fd5b80632f2ff15d1161014b57806344112ed81161012557806344112ed8146102985780634e1273f4146102bf578063710b3096146102df578063730cb7d5146102f257600080fd5b80632f2ff15d1461025f57806336568abe146102725780633e1f3c271461028557600080fd5b8062fdd58e1461019257806301ffc9a7146101b85780630e064366146101db5780630e89341c14610206578063248a9ca3146102265780632eb2c2d61461024a575b600080fd5b6101a56101a0366004611618565b610419565b6040519081526020015b60405180910390f35b6101cb6101c636600461165a565b610496565b60405190151581526020016101af565b6101ee6101e9366004611618565b6104a7565b6040516001600160a01b0390911681526020016101af565b610219610214366004611677565b61051d565b6040516101af91906116ec565b6101a5610234366004611677565b6000908152600160208190526040909120015490565b61025d610258366004611858565b6105b1565b005b61025d61026d366004611905565b610606565b61025d610280366004611905565b610631565b610219610293366004611618565b6106af565b6101a57fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa481565b6102d26102cd366004611935565b610729565b6040516101af9190611a3c565b61025d6102ed366004611a4f565b610852565b6005546001600160a01b03166101ee565b61030b600381565b60405160ff90911681526020016101af565b61025d61032b366004611aaa565b6108e4565b6101cb61033e366004611905565b6109f1565b61025d610351366004611af0565b610a1c565b6101a5600081565b61025d61036c366004611b2c565b610a30565b61030b61037f366004611b6e565b610a49565b61025d610392366004611b93565b610ac0565b61025d6103a5366004611905565b610aee565b6103bd6103b8366004611677565b610b14565b6040516101af929190611bb0565b6101cb6103d9366004611c2e565b610b93565b61025d6103ec366004611c5c565b610bae565b6104046103ff366004611618565b610bf3565b60405163ffffffff90911681526020016101af565b60055460405163461e4f1960e11b8152600481018390526001600160a01b0384811660248301526000921690638c3c9e3290604401602060405180830381865afa15801561046b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cc4565b9392505050565b60006104a182610c69565b92915050565b6005546040516363ed4d5360e11b8152600481018390526001600160a01b038481166024830152600092169063c7da9aa690604401602060405180830381865afa1580156104f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cdd565b60606004805461052c90611cfa565b80601f016020809104026020016040519081016040528092919081815260200182805461055890611cfa565b80156105a55780601f1061057a576101008083540402835291602001916105a5565b820191906000526020600020905b81548152906001019060200180831161058857829003601f168201915b50505050509050919050565b6001600160a01b0385163314806105cd57506105cd8533610b93565b6105f25760405162461bcd60e51b81526004016105e990611d34565b60405180910390fd5b6105ff8585858585610ca9565b5050505050565b6000828152600160208190526040909120015461062281610e97565b61062c8383610ea4565b505050565b6001600160a01b03811633146106a15760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105e9565b6106ab8282610f0f565b5050565b600554604051636d7fbb6760e01b8152600481018390526001600160a01b0384811660248301526060921690636d7fbb6790604401600060405180830381865afa158015610701573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261048f9190810190611d82565b6060815183511461078e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016105e9565b600083516001600160401b038111156107a9576107a96116ff565b6040519080825280602002602001820160405280156107d2578160200160208202803683370190505b50905060005b845181101561084a5761081d8582815181106107f6576107f6611e03565b602002602001015185838151811061081057610810611e03565b6020026020010151610419565b82828151811061082f5761082f611e03565b602090810291909101015261084381611e2f565b90506107d8565b509392505050565b7fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa461087c81610e97565b836001600160a01b0316856001600160a01b0316876001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6286866040516108d4929190918252602082015260400190565b60405180910390a4505050505050565b600054600390610100900460ff16158015610906575060005460ff8083169116105b6109695760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e9565b6000805461ffff191660ff8316176101001781556109869061051d565b5115806109925750303b155b156109ab576109a083610f76565b6109ab600083610ea4565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610a2781610e97565b6106ab82610f76565b6040516309a711b960e31b815260040160405180910390fd5b600554604051630e972f9160e41b81526004810184905260ff831660248201526000916001600160a01b03169063e972f91090604401602060405180830381865afa158015610a9c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611e48565b6000610acb81610e97565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526001602081905260409091200154610b0a81610e97565b61062c8383610f0f565b600554604051632b2bf81b60e11b81526004810183905260609182916001600160a01b0390911690635657f03690602401600060405180830381865afa158015610b62573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b8a9190810190611ed4565b91509150915091565b60006040516309a711b960e31b815260040160405180910390fd5b6001600160a01b038516331480610bca5750610bca8533610b93565b610be65760405162461bcd60e51b81526004016105e990611d34565b6105ff8585858585610f89565b6005546040516314067f8b60e01b8152600481018390526001600160a01b03848116602483015260009216906314067f8b90604401602060405180830381865afa158015610c45573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611f90565b60006001600160e01b03198216636cdb3d1360e11b1480610c9a57506001600160e01b031982166303a24d0760e21b145b806104a157506104a1826110c5565b8151835114610d0b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016105e9565b6001600160a01b038416610d315760405162461bcd60e51b81526004016105e990611fb6565b33610d40818787878787610a30565b60005b8451811015610e29576000858281518110610d6057610d60611e03565b602002602001015190506000858381518110610d7e57610d7e611e03565b60209081029190910181015160008481526002835260408082206001600160a01b038e168352909352919091205490915081811015610dcf5760405162461bcd60e51b81526004016105e990611ffb565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610e0e908490612045565b9250508190555050505080610e2290611e2f565b9050610d43565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610e7992919061205d565b60405180910390a4610e8f8187878787876110fa565b505050505050565b610ea1813361125e565b50565b610eae82826109f1565b6106ab5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b610f1982826109f1565b156106ab5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b80516106ab90600490602084019061156a565b6001600160a01b038416610faf5760405162461bcd60e51b81526004016105e990611fb6565b336000610fbb856112b7565b90506000610fc8856112b7565b9050610fd8838989858589610a30565b60008681526002602090815260408083206001600160a01b038c1684529091529020548581101561101b5760405162461bcd60e51b81526004016105e990611ffb565b60008781526002602090815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061105a908490612045565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46110ba848a8a8a8a8a611302565b505050505050505050565b60006001600160e01b03198216637965db0b60e01b14806104a157506301ffc9a760e01b6001600160e01b03198316146104a1565b6001600160a01b0384163b15610e8f5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061113e908990899088908890889060040161208b565b6020604051808303816000875af1925050508015611179575060408051601f3d908101601f19168201909252611176918101906120e9565b60015b61122557611185612106565b806308c379a0036111be5750611199612122565b806111a457506111c0565b8060405162461bcd60e51b81526004016105e991906116ec565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016105e9565b6001600160e01b0319811663bc197c8160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b50505050505050565b61126882826109f1565b6106ab57611275816113bd565b6112808360206113cf565b6040516020016112919291906121f3565b60408051601f198184030181529082905262461bcd60e51b82526105e9916004016116ec565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106112f1576112f1611e03565b602090810291909101015292915050565b6001600160a01b0384163b15610e8f5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906113469089908990889088908890600401612268565b6020604051808303816000875af1925050508015611381575060408051601f3d908101601f1916820190925261137e918101906120e9565b60015b61138d57611185612106565b6001600160e01b0319811663f23a6e6160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b60606104a16001600160a01b03831660145b606060006113de8360026122ad565b6113e9906002612045565b6001600160401b03811115611400576114006116ff565b6040519080825280601f01601f19166020018201604052801561142a576020820181803683370190505b509050600360fc1b8160008151811061144557611445611e03565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061147457611474611e03565b60200101906001600160f81b031916908160001a90535060006114988460026122ad565b6114a3906001612045565b90505b600181111561151b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106114d7576114d7611e03565b1a60f81b8282815181106114ed576114ed611e03565b60200101906001600160f81b031916908160001a90535060049490941c93611514816122cc565b90506114a6565b50831561048f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105e9565b82805461157690611cfa565b90600052602060002090601f01602090048101928261159857600085556115de565b82601f106115b157805160ff19168380011785556115de565b828001600101855582156115de579182015b828111156115de5782518255916020019190600101906115c3565b506115ea9291506115ee565b5090565b5b808211156115ea57600081556001016115ef565b6001600160a01b0381168114610ea157600080fd5b6000806040838503121561162b57600080fd5b823561163681611603565b946020939093013593505050565b6001600160e01b031981168114610ea157600080fd5b60006020828403121561166c57600080fd5b813561048f81611644565b60006020828403121561168957600080fd5b5035919050565b60005b838110156116ab578181015183820152602001611693565b838111156116ba576000848401525b50505050565b600081518084526116d8816020860160208601611690565b601f01601f19169290920160200192915050565b60208152600061048f60208301846116c0565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561173a5761173a6116ff565b6040525050565b60006001600160401b0382111561175a5761175a6116ff565b5060051b60200190565b600082601f83011261177557600080fd5b8135602061178282611741565b60405161178f8282611715565b83815260059390931b85018201928281019150868411156117af57600080fd5b8286015b848110156117ca57803583529183019183016117b3565b509695505050505050565b60006001600160401b038211156117ee576117ee6116ff565b50601f01601f191660200190565b600082601f83011261180d57600080fd5b8135611818816117d5565b6040516118258282611715565b82815285602084870101111561183a57600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a0868803121561187057600080fd5b853561187b81611603565b9450602086013561188b81611603565b935060408601356001600160401b03808211156118a757600080fd5b6118b389838a01611764565b945060608801359150808211156118c957600080fd5b6118d589838a01611764565b935060808801359150808211156118eb57600080fd5b506118f8888289016117fc565b9150509295509295909350565b6000806040838503121561191857600080fd5b82359150602083013561192a81611603565b809150509250929050565b6000806040838503121561194857600080fd5b82356001600160401b038082111561195f57600080fd5b818501915085601f83011261197357600080fd5b8135602061198082611741565b60405161198d8282611715565b83815260059390931b85018201928281019150898411156119ad57600080fd5b948201945b838610156119d45785356119c581611603565b825294820194908201906119b2565b965050860135925050808211156119ea57600080fd5b506119f785828601611764565b9150509250929050565b600081518084526020808501945080840160005b83811015611a3157815187529582019590820190600101611a15565b509495945050505050565b60208152600061048f6020830184611a01565b600080600080600060a08688031215611a6757600080fd5b8535611a7281611603565b94506020860135611a8281611603565b93506040860135611a9281611603565b94979396509394606081013594506080013592915050565b60008060408385031215611abd57600080fd5b82356001600160401b03811115611ad357600080fd5b611adf858286016117fc565b925050602083013561192a81611603565b600060208284031215611b0257600080fd5b81356001600160401b03811115611b1857600080fd5b611b24848285016117fc565b949350505050565b60008060408385031215611b3f57600080fd5b8235611b4a81611603565b91506020830135801515811461192a57600080fd5b60ff81168114610ea157600080fd5b60008060408385031215611b8157600080fd5b82359150602083013561192a81611b5f565b600060208284031215611ba557600080fd5b813561048f81611603565b604080825283519082018190526000906020906060840190828701845b82811015611be957815184529284019290840190600101611bcd565b5050508381038285015284518082528583019183019060005b81811015611c2157835160ff1683529284019291840191600101611c02565b5090979650505050505050565b60008060408385031215611c4157600080fd5b8235611c4c81611603565b9150602083013561192a81611603565b600080600080600060a08688031215611c7457600080fd5b8535611c7f81611603565b94506020860135611c8f81611603565b9350604086013592506060860135915060808601356001600160401b03811115611cb857600080fd5b6118f8888289016117fc565b600060208284031215611cd657600080fd5b5051919050565b600060208284031215611cef57600080fd5b815161048f81611603565b600181811c90821680611d0e57607f821691505b602082108103611d2e57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b600060208284031215611d9457600080fd5b81516001600160401b03811115611daa57600080fd5b8201601f81018413611dbb57600080fd5b8051611dc6816117d5565b604051611dd38282611715565b828152866020848601011115611de857600080fd5b611df9836020830160208701611690565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e4157611e41611e19565b5060010190565b600060208284031215611e5a57600080fd5b815161048f81611b5f565b600082601f830112611e7657600080fd5b81516020611e8382611741565b604051611e908282611715565b83815260059390931b8501820192828101915086841115611eb057600080fd5b8286015b848110156117ca578051611ec781611b5f565b8352918301918301611eb4565b60008060408385031215611ee757600080fd5b82516001600160401b0380821115611efe57600080fd5b818501915085601f830112611f1257600080fd5b81516020611f1f82611741565b604051611f2c8282611715565b83815260059390931b8501820192828101915089841115611f4c57600080fd5b948201945b83861015611f6a57855182529482019490820190611f51565b91880151919650909350505080821115611f8357600080fd5b506119f785828601611e65565b600060208284031215611fa257600080fd5b815163ffffffff8116811461048f57600080fd5b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6000821982111561205857612058611e19565b500190565b6040815260006120706040830185611a01565b82810360208401526120828185611a01565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906120b790830186611a01565b82810360608401526120c98186611a01565b905082810360808401526120dd81856116c0565b98975050505050505050565b6000602082840312156120fb57600080fd5b815161048f81611644565b600060033d111561211f5760046000803e5060005160e01c5b90565b600060443d10156121305790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561215f57505050505090565b82850191508151818111156121775750505050505090565b843d87010160208285010111156121915750505050505090565b6121a060208286010187611715565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161222b816017850160208801611690565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161225c816028840160208801611690565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906122a2908301846116c0565b979650505050505050565b60008160001904831182151516156122c7576122c7611e19565b500290565b6000816122db576122db611e19565b50600019019056fea26469706673582212209e33646a1ed2d51fcc749870e94aa69546c518fc5bfee43d37014ebc54dd767864736f6c634300080e0033", diff --git a/deployments/mumbai/BadgesImplem.json b/deployments/mumbaiTestnet/BadgesImplem.json similarity index 98% rename from deployments/mumbai/BadgesImplem.json rename to deployments/mumbaiTestnet/BadgesImplem.json index 2577f02..9aeff91 100644 --- a/deployments/mumbai/BadgesImplem.json +++ b/deployments/mumbaiTestnet/BadgesImplem.json @@ -1,5 +1,5 @@ { - "address": "0x6D102d4FDFFcd6A4eb3E6207a25B2375d453F74A", + "address": "0x818C6d85fFe9DF53d331f6413b0ae07F67CC71C9", "abi": [ { "inputs": [ @@ -769,71 +769,71 @@ "type": "function" } ], - "transactionHash": "0xe6ede11f9bb84c6196c423e8f968bb588de965109953129484ff04390ae68c5e", + "transactionHash": "0x8f5785a7f59fc569dd3f895e5dc77c52dd33008e2c64cbfb53f23dce3e212479", "receipt": { "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x6D102d4FDFFcd6A4eb3E6207a25B2375d453F74A", + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0x818C6d85fFe9DF53d331f6413b0ae07F67CC71C9", "transactionIndex": 14, "gasUsed": "2131254", - "logsBloom": "0x00000004000000000000000000020000000000000000000000000000000000000000000000000000000000000000000000008000002000000000000000000000000000000000000000000000000000800000000000000000040100000000000000000000220000000000000000000800002000000000000080000000000000000000000000000000000000000000000000000010004080000000000000008000200000000000000000000000800400000000000000000000001040000000004000000000000000000001000000050000000000000000000100100000000020000000000000000000000000000000000000000000000000000020000000100000", - "blockHash": "0x3c8ffb75f78b8adfadc03d9a578094358edf94c44b22ac3627ab63dd8fb1ec2e", - "transactionHash": "0xe6ede11f9bb84c6196c423e8f968bb588de965109953129484ff04390ae68c5e", + "logsBloom": "0x00000004200000020000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000010000800000000000000000000100000000000000000000020000000000000000000800000000000000000080000000000000000000000000000000000000000000000000000000000080000000000040000000200000000000000020000000000402000001000000000000001000000000004000008000000000000001000000040000000000000000000100100000000020000000000000000000000000000000000000000000002000000000000000100000", + "blockHash": "0x756baa17d005c1f33aa72ef1be0f49b4d29c66e954e6085bbfb0c2a905554d9a", + "transactionHash": "0x8f5785a7f59fc569dd3f895e5dc77c52dd33008e2c64cbfb53f23dce3e212479", "logs": [ { "transactionIndex": 14, - "blockNumber": 29540671, - "transactionHash": "0xe6ede11f9bb84c6196c423e8f968bb588de965109953129484ff04390ae68c5e", - "address": "0x6D102d4FDFFcd6A4eb3E6207a25B2375d453F74A", + "blockNumber": 29771730, + "transactionHash": "0x8f5785a7f59fc569dd3f895e5dc77c52dd33008e2c64cbfb53f23dce3e212479", + "address": "0x818C6d85fFe9DF53d331f6413b0ae07F67CC71C9", "topics": [ "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 69, - "blockHash": "0x3c8ffb75f78b8adfadc03d9a578094358edf94c44b22ac3627ab63dd8fb1ec2e" + "logIndex": 50, + "blockHash": "0x756baa17d005c1f33aa72ef1be0f49b4d29c66e954e6085bbfb0c2a905554d9a" }, { "transactionIndex": 14, - "blockNumber": 29540671, - "transactionHash": "0xe6ede11f9bb84c6196c423e8f968bb588de965109953129484ff04390ae68c5e", - "address": "0x6D102d4FDFFcd6A4eb3E6207a25B2375d453F74A", + "blockNumber": 29771730, + "transactionHash": "0x8f5785a7f59fc569dd3f895e5dc77c52dd33008e2c64cbfb53f23dce3e212479", + "address": "0x818C6d85fFe9DF53d331f6413b0ae07F67CC71C9", "topics": [ "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 70, - "blockHash": "0x3c8ffb75f78b8adfadc03d9a578094358edf94c44b22ac3627ab63dd8fb1ec2e" + "logIndex": 51, + "blockHash": "0x756baa17d005c1f33aa72ef1be0f49b4d29c66e954e6085bbfb0c2a905554d9a" }, { "transactionIndex": 14, - "blockNumber": 29540671, - "transactionHash": "0xe6ede11f9bb84c6196c423e8f968bb588de965109953129484ff04390ae68c5e", + "blockNumber": 29771730, + "transactionHash": "0x8f5785a7f59fc569dd3f895e5dc77c52dd33008e2c64cbfb53f23dce3e212479", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000c275dc8be39f50d12f66b6a63629c39da5bae5bd" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" ], - "data": "0x0000000000000000000000000000000000000000000000000007ba4e7021eeb40000000000000000000000000000000000000000000000007ce5b243caa744b2000000000000000000000000000000000000000000000b8e71caa1573dbb15c90000000000000000000000000000000000000000000000007cddf7f55a8555fe000000000000000000000000000000000000000000000b8e71d25ba5addd047d", - "logIndex": 71, - "blockHash": "0x3c8ffb75f78b8adfadc03d9a578094358edf94c44b22ac3627ab63dd8fb1ec2e" + "data": "0x000000000000000000000000000000000000000000000000000b5b8bdbc24ff20000000000000000000000000000000000000000000000001bc16d674ec8000000000000000000000000000000000000000000000000187ad4560dfadd1dd30e0000000000000000000000000000000000000000000000001bb611db7305b00e00000000000000000000000000000000000000000000187ad4616986b8e02300", + "logIndex": 52, + "blockHash": "0x756baa17d005c1f33aa72ef1be0f49b4d29c66e954e6085bbfb0c2a905554d9a" } ], - "blockNumber": 29540671, - "cumulativeGasUsed": "4568589", + "blockNumber": 29771730, + "cumulativeGasUsed": "5890047", "status": 1, "byzantium": true }, "args": [ - "https://hub.staging.zikies.io/badges/mumbai/{id}.json", - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954" + "https://hub.testnets.sismo.io/badges/mumbai/{id}.json", + "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED" ], - "numDeployments": 2, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BadgesNonTransferrable\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EVENT_TRIGGERER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationsRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"getAttributeValueForBadge\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getAttributesNamesAndValuesForBadge\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBadgeExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBadgeIssuer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBadgeTimestamp\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistry\",\"type\":\"address\"}],\"name\":\"setAttestationsRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"setUri\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"triggerTransferEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"balanceOf(address,uint256)\":{\"details\":\"Main function of the ERC1155 badge The balance of a user is equal to the value of the underlying attestation. attestationCollectionId == badgeId\",\"params\":{\"account\":\"Address to check badge balance (= value of attestation)\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"balanceOfBatch(address[],uint256[])\":{\"details\":\"See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length.\"},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"owner\":\"Owner of the contract, super admin, can setup roles and update the attestation registry\",\"uri\":\"Uri for the metadata of badges\"}},\"getAttestationsRegistry()\":{\"details\":\"Getter of the attestations registry\"},\"getAttributeValueForBadge(uint256,uint8)\":{\"details\":\"Getter of the value of a specific badge attribute\",\"params\":{\"id\":\"Badge Id to check (= attestationCollectionId)\",\"index\":\"Index of the attribute\"}},\"getAttributesNamesAndValuesForBadge(uint256)\":{\"details\":\"Getter of all badge attributes and their values for a specific badge\",\"params\":{\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getBadgeExtraData(address,uint256)\":{\"details\":\"Getter of the badge extra data (it can store nullifier and burnCount)\",\"params\":{\"account\":\"Address that holds the badge\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getBadgeIssuer(address,uint256)\":{\"details\":\"Getter of the badge issuer\",\"params\":{\"account\":\"Address that holds the badge\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getBadgeTimestamp(address,uint256)\":{\"details\":\"Getter of the badge timestamp\",\"params\":{\"account\":\"Address that holds the badge\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initialize(string,address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"owner\":\"Owner of the contract, super admin, can setup roles and update the attestation registry\",\"uri\":\"Uri for the metadata of badges\"}},\"isApprovedForAll(address,address)\":{\"details\":\"Reverts, this is a non transferable ERC115 contract\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)\":{\"details\":\"See {IERC1155-safeBatchTransferFrom}.\"},\"safeTransferFrom(address,address,uint256,uint256,bytes)\":{\"details\":\"See {IERC1155-safeTransferFrom}.\"},\"setApprovalForAll(address,bool)\":{\"details\":\"Reverts, this is a non transferable ERC115 contract\"},\"setAttestationsRegistry(address)\":{\"details\":\"Set the attestations registry address. Can only be called by owner (default admin)\",\"params\":{\"attestationsRegistry\":\"new attestations registry address\"}},\"setUri(string)\":{\"details\":\"Set the URI. Can only be called by owner (default admin)\",\"params\":{\"uri\":\"new attestations registry address\"}},\"supportsInterface(bytes4)\":{\"details\":\"ERC165\"},\"triggerTransferEvent(address,address,address,uint256,uint256)\":{\"details\":\"Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\",\"params\":{\"from\":\"address(0) if minting, address of the badge holder if burning\",\"id\":\"badgeId for which to trigger the event\",\"operator\":\"who is calling the TransferEvent\",\"to\":\"address of the badge holder is minting, address(0) if burning\",\"value\":\"minted/burned balance\"}},\"uri(uint256)\":{\"details\":\"See {IERC1155MetadataURI-uri}. This implementation returns the same URI for *all* token types. It relies on the token type ID substitution mechanism https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. Clients calling this function must replace the `\\\\{id\\\\}` substring with the actual token type ID.\"}},\"title\":\"Badges contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(string,address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations The associated attestations registry triggers TransferSingle events from this contract It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms For more information: https://badges.docs.sismo.io\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/Badges.sol\":\"Badges\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\nimport \\\"../utils/Context.sol\\\";\\nimport \\\"../utils/Strings.sol\\\";\\nimport \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\\n * Overriding this function changes the behavior of the {onlyRole} modifier.\\n *\\n * Format of the revert message is described in {_checkRole}.\\n *\\n * _Available since v4.6._\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n Strings.toHexString(account),\\n \\\" is missing role \\\",\\n Strings.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * May emit a {RoleGranted} event.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n}\\n\",\"keccak256\":\"0x67e3daf189111d6d5b0464ed09cf9f0605a22c4b965a7fcecd707101faff008a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/security/Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract Pausable is Context {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0x0849d93b16c9940beb286a7864ed02724b248b93e0d80ef6355af5ef15c64773\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/ERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC1155.sol\\\";\\nimport \\\"./IERC1155Receiver.sol\\\";\\nimport \\\"./extensions/IERC1155MetadataURI.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\nimport \\\"../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the basic standard multi-token.\\n * See https://eips.ethereum.org/EIPS/eip-1155\\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\\n *\\n * _Available since v3.1._\\n */\\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\\n using Address for address;\\n\\n // Mapping from token ID to account balances\\n mapping(uint256 => mapping(address => uint256)) private _balances;\\n\\n // Mapping from account to operator approvals\\n mapping(address => mapping(address => bool)) private _operatorApprovals;\\n\\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\\n string private _uri;\\n\\n /**\\n * @dev See {_setURI}.\\n */\\n constructor(string memory uri_) {\\n _setURI(uri_);\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC1155).interfaceId ||\\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC1155MetadataURI-uri}.\\n *\\n * This implementation returns the same URI for *all* token types. It relies\\n * on the token type ID substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * Clients calling this function must replace the `\\\\{id\\\\}` substring with the\\n * actual token type ID.\\n */\\n function uri(uint256) public view virtual override returns (string memory) {\\n return _uri;\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\\n require(account != address(0), \\\"ERC1155: address zero is not a valid owner\\\");\\n return _balances[id][account];\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOfBatch}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\\n public\\n view\\n virtual\\n override\\n returns (uint256[] memory)\\n {\\n require(accounts.length == ids.length, \\\"ERC1155: accounts and ids length mismatch\\\");\\n\\n uint256[] memory batchBalances = new uint256[](accounts.length);\\n\\n for (uint256 i = 0; i < accounts.length; ++i) {\\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\\n }\\n\\n return batchBalances;\\n }\\n\\n /**\\n * @dev See {IERC1155-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC1155-isApprovedForAll}.\\n */\\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\\n return _operatorApprovals[account][operator];\\n }\\n\\n /**\\n * @dev See {IERC1155-safeTransferFrom}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner or approved\\\"\\n );\\n _safeTransferFrom(from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev See {IERC1155-safeBatchTransferFrom}.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner or approved\\\"\\n );\\n _safeBatchTransferFrom(from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n\\n emit TransferSingle(operator, from, to, id, amount);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; ++i) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n }\\n\\n emit TransferBatch(operator, from, to, ids, amounts);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Sets a new URI for all token types, by relying on the token type ID\\n * substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * By this mechanism, any occurrence of the `\\\\{id\\\\}` substring in either the\\n * URI or any of the amounts in the JSON file at said URI will be replaced by\\n * clients with the token type ID.\\n *\\n * For example, the `https://token-cdn-domain/\\\\{id\\\\}.json` URI would be\\n * interpreted by clients as\\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\\n * for token type ID 0x4cce0.\\n *\\n * See {uri}.\\n *\\n * Because these URIs cannot be meaningfully represented by the {URI} event,\\n * this function emits no events.\\n */\\n function _setURI(string memory newuri) internal virtual {\\n _uri = newuri;\\n }\\n\\n /**\\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _mint(\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _balances[id][to] += amount;\\n emit TransferSingle(operator, address(0), to, id, amount);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _mintBatch(\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n _balances[ids[i]][to] += amounts[i];\\n }\\n\\n emit TransferBatch(operator, address(0), to, ids, amounts);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens of token type `id` from `from`\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `from` must have at least `amount` tokens of token type `id`.\\n */\\n function _burn(\\n address from,\\n uint256 id,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n\\n emit TransferSingle(operator, from, address(0), id, amount);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n */\\n function _burnBatch(\\n address from,\\n uint256[] memory ids,\\n uint256[] memory amounts\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n }\\n\\n emit TransferBatch(operator, from, address(0), ids, amounts);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(\\n address owner,\\n address operator,\\n bool approved\\n ) internal virtual {\\n require(owner != operator, \\\"ERC1155: setting approval status for self\\\");\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Hook that is called before any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `ids` and `amounts` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `id` and `amount` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n function _doSafeTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\\n if (response != IERC1155Receiver.onERC1155Received.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non-ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _doSafeBatchTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\\n bytes4 response\\n ) {\\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non-ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\\n uint256[] memory array = new uint256[](1);\\n array[0] = element;\\n\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0xd917747dc87f189c6779b894f367a028f9dca4be930283cccec8f312966af820\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155 is IERC165 {\\n /**\\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\\n */\\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\\n\\n /**\\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\\n * transfers.\\n */\\n event TransferBatch(\\n address indexed operator,\\n address indexed from,\\n address indexed to,\\n uint256[] ids,\\n uint256[] values\\n );\\n\\n /**\\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\\n * `approved`.\\n */\\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\\n\\n /**\\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\\n *\\n * If an {URI} event was emitted for `id`, the standard\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\\n * returned by {IERC1155MetadataURI-uri}.\\n */\\n event URI(string value, uint256 indexed id);\\n\\n /**\\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\\n external\\n view\\n returns (uint256[] memory);\\n\\n /**\\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\\n *\\n * Emits an {ApprovalForAll} event.\\n *\\n * Requirements:\\n *\\n * - `operator` cannot be the caller.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\\n *\\n * See {setApprovalForAll}.\\n */\\n function isApprovedForAll(address account, address operator) external view returns (bool);\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] calldata ids,\\n uint256[] calldata amounts,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x6392f2cfe3a5ee802227fe7a2dfd47096d881aec89bddd214b35c5b46d3cd941\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev _Available since v3.1._\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xeb373f1fdc7b755c6a750123a9b9e3a8a02c1470042fd6505d875000a80bde0b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1155.sol\\\";\\nimport \\\"../../../security/Pausable.sol\\\";\\n\\n/**\\n * @dev ERC1155 token with pausable token transfers, minting and burning.\\n *\\n * Useful for scenarios such as preventing trades until the end of an evaluation\\n * period, or having an emergency switch for freezing all token transfers in the\\n * event of a large bug.\\n *\\n * _Available since v3.1._\\n */\\nabstract contract ERC1155Pausable is ERC1155, Pausable {\\n /**\\n * @dev See {ERC1155-_beforeTokenTransfer}.\\n *\\n * Requirements:\\n *\\n * - the contract must not be paused.\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override {\\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n require(!paused(), \\\"ERC1155Pausable: token transfer while paused\\\");\\n }\\n}\\n\",\"keccak256\":\"0xdad22b949de979bb2ad9001c044b2aeaacf8a25e3de09ed6f022a9469f936d5b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC1155.sol\\\";\\n\\n/**\\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155MetadataURI is IERC1155 {\\n /**\\n * @dev Returns the URI for token type `id`.\\n *\\n * If the `\\\\{id\\\\}` substring is present in the URI, it must be replaced by\\n * clients with the actual token type ID.\\n */\\n function uri(uint256 id) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xa66d18b9a85458d28fc3304717964502ae36f7f8a2ff35bc83f6f85d74b03574\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"},\"contracts/core/Badges.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {IBadges} from './interfaces/IBadges.sol';\\n\\n/**\\n * @title Badges contract\\n * @author Sismo\\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\\n * The associated attestations registry triggers TransferSingle events from this contract\\n * It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms\\n * For more information: https://badges.docs.sismo.io\\n */\\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\\n uint8 public constant IMPLEMENTATION_VERSION = 3;\\n\\n IAttestationsRegistry internal _attestationsRegistry;\\n\\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\\n\\n /**\\n * @dev Constructor\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n */\\n constructor(\\n string memory uri,\\n address owner // This is Sismo Frontend Contract\\n ) ERC1155(uri) {\\n initialize(uri, owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n string memory uri,\\n address owner\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup uri yet or if called by constructor (for implem setup)\\n if (bytes(ERC1155.uri(0)).length == 0 || address(this).code.length == 0) {\\n _setURI(uri);\\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\\n }\\n }\\n\\n /**\\n * @dev Main function of the ERC1155 badge\\n * The balance of a user is equal to the value of the underlying attestation.\\n * attestationCollectionId == badgeId\\n * @param account Address to check badge balance (= value of attestation)\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function balanceOf(\\n address account,\\n uint256 id\\n ) public view virtual override(ERC1155, IBadges) returns (uint256) {\\n return _attestationsRegistry.getAttestationValue(id, account);\\n }\\n\\n /**\\n * @dev Reverts, this is a non transferable ERC115 contract\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n revert BadgesNonTransferrable();\\n }\\n\\n /**\\n * @dev Reverts, this is a non transferable ERC115 contract\\n */\\n function isApprovedForAll(\\n address account,\\n address operator\\n ) public view virtual override returns (bool) {\\n revert BadgesNonTransferrable();\\n }\\n\\n /**\\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\\n * @param operator who is calling the TransferEvent\\n * @param from address(0) if minting, address of the badge holder if burning\\n * @param to address of the badge holder is minting, address(0) if burning\\n * @param id badgeId for which to trigger the event\\n * @param value minted/burned balance\\n */\\n function triggerTransferEvent(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 value\\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\\n emit TransferSingle(operator, from, to, id, value);\\n }\\n\\n /**\\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\\n * @param attestationsRegistry new attestations registry address\\n */\\n function setAttestationsRegistry(\\n address attestationsRegistry\\n ) external override onlyRole(DEFAULT_ADMIN_ROLE) {\\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\\n }\\n\\n /**\\n * @dev Set the URI. Can only be called by owner (default admin)\\n * @param uri new attestations registry address\\n */\\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\\n _setURI(uri);\\n }\\n\\n /**\\n * @dev Getter of the attestations registry\\n */\\n function getAttestationsRegistry() external view override returns (address) {\\n return address(_attestationsRegistry);\\n }\\n\\n /**\\n * @dev Getter of the badge issuer\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeIssuer(address account, uint256 id) external view returns (address) {\\n return _attestationsRegistry.getAttestationIssuer(id, account);\\n }\\n\\n /**\\n * @dev Getter of the badge timestamp\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32) {\\n return _attestationsRegistry.getAttestationTimestamp(id, account);\\n }\\n\\n /**\\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory) {\\n return _attestationsRegistry.getAttestationExtraData(id, account);\\n }\\n\\n /**\\n * @dev Getter of the value of a specific badge attribute\\n * @param id Badge Id to check (= attestationCollectionId)\\n * @param index Index of the attribute\\n */\\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8) {\\n return _attestationsRegistry.getAttributeValueForAttestationsCollection(id, index);\\n }\\n\\n /**\\n * @dev Getter of all badge attributes and their values for a specific badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getAttributesNamesAndValuesForBadge(\\n uint256 id\\n ) external view returns (bytes32[] memory, uint8[] memory) {\\n return _attestationsRegistry.getAttributesNamesAndValuesForAttestationsCollection(id);\\n }\\n\\n /**\\n * @dev ERC165\\n */\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view virtual override(AccessControl, ERC1155) returns (bool) {\\n return super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Reverts, this is a non transferable ERC115 contract\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override {\\n revert BadgesNonTransferrable();\\n }\\n}\\n\",\"keccak256\":\"0x9982b753d43f2a4a9edb5987714b09f518b419339d4bf9cd63b600bee442fd01\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IBadges.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Interface for Badges contract\\n * @author Sismo\\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\\n * The associated attestations registry triggers TransferSingle events from this contract\\n * It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms\\n */\\ninterface IBadges {\\n error BadgesNonTransferrable();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(string memory uri, address owner) external;\\n\\n /**\\n * @dev Main function of the ERC1155 badge\\n * The balance of a user is equal to the value of the underlying attestation.\\n * attestationCollectionId == badgeId\\n * @param account Address to check badge balance (= value of attestation)\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\\n * @param operator who is calling the TransferEvent\\n * @param from address(0) if minting, address of the badge holder if burning\\n * @param to address of the badge holder is minting, address(0) if burning\\n * @param id badgeId for which to trigger the event\\n * @param value minted/burned balance\\n */\\n function triggerTransferEvent(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 value\\n ) external;\\n\\n /**\\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\\n * @param attestationsRegistry new attestations registry address\\n */\\n function setAttestationsRegistry(address attestationsRegistry) external;\\n\\n /**\\n * @dev Set the URI. Can only be called by owner (default admin)\\n * @param uri new attestations registry address\\n */\\n function setUri(string memory uri) external;\\n\\n /**\\n * @dev Getter of the attestations registry\\n */\\n function getAttestationsRegistry() external view returns (address);\\n\\n /**\\n * @dev Getter of the badge issuer\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeIssuer(address account, uint256 id) external view returns (address);\\n\\n /**\\n * @dev Getter of the badge timestamp\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the value of a specific badge attribute\\n * @param id Badge Id to check (= attestationCollectionId)\\n * @param index Index of the attribute\\n */\\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);\\n\\n /**\\n * @dev Getter of all badge attributes and their values for a specific badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getAttributesNamesAndValuesForBadge(\\n uint256 id\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n}\\n\",\"keccak256\":\"0xd6bdfc887ef15ee022eb05d89dbe2e2938ee6c0a55a55f8db527ef650242c6bb\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x60806040523480156200001157600080fd5b50604051620027eb380380620027eb833981016040819052620000349162000395565b81620000408162000055565b506200004d82826200006e565b5050620004c2565b80516200006a906004906020840190620002bc565b5050565b600054600390610100900460ff1615801562000091575060005460ff8083169116105b620000f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff83161761010017815562000127906200051d62000198602090811b91909117901c565b511580620001345750303b155b156200015257620001458362000055565b6200015260008362000234565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b606060048054620001a99062000486565b80601f0160208091040260200160405190810160405280929190818152602001828054620001d79062000486565b8015620002285780601f10620001fc5761010080835404028352916020019162000228565b820191906000526020600020905b8154815290600101906020018083116200020a57829003601f168201915b50505050509050919050565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff166200006a5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b828054620002ca9062000486565b90600052602060002090601f016020900481019282620002ee576000855562000339565b82601f106200030957805160ff191683800117855562000339565b8280016001018555821562000339579182015b82811115620003395782518255916020019190600101906200031c565b50620003479291506200034b565b5090565b5b808211156200034757600081556001016200034c565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200039057600080fd5b919050565b60008060408385031215620003a957600080fd5b82516001600160401b0380821115620003c157600080fd5b818501915085601f830112620003d657600080fd5b815181811115620003eb57620003eb62000362565b604051601f8201601f19908116603f0116810190838211818310171562000416576200041662000362565b816040528281526020935088848487010111156200043357600080fd5b600091505b8282101562000457578482018401518183018501529083019062000438565b82821115620004695760008484830101525b95506200047b91505085820162000378565b925050509250929050565b600181811c908216806200049b57607f821691505b602082108103620004bc57634e487b7160e01b600052602260045260246000fd5b50919050565b61231980620004d26000396000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c8063754b377c116100de578063aed8c6bc11610097578063e37ffe7c11610071578063e37ffe7c146103aa578063e985e9c5146103cb578063f242432a146103de578063ff4468c4146103f157600080fd5b8063aed8c6bc14610371578063b3c1cb2114610384578063d547741f1461039757600080fd5b8063754b377c146103035780637ab4339d1461031d57806391d14854146103305780639b642de114610343578063a217fddf14610356578063a22cb4651461035e57600080fd5b80632f2ff15d1161014b57806344112ed81161012557806344112ed8146102985780634e1273f4146102bf578063710b3096146102df578063730cb7d5146102f257600080fd5b80632f2ff15d1461025f57806336568abe146102725780633e1f3c271461028557600080fd5b8062fdd58e1461019257806301ffc9a7146101b85780630e064366146101db5780630e89341c14610206578063248a9ca3146102265780632eb2c2d61461024a575b600080fd5b6101a56101a0366004611618565b610419565b6040519081526020015b60405180910390f35b6101cb6101c636600461165a565b610496565b60405190151581526020016101af565b6101ee6101e9366004611618565b6104a7565b6040516001600160a01b0390911681526020016101af565b610219610214366004611677565b61051d565b6040516101af91906116ec565b6101a5610234366004611677565b6000908152600160208190526040909120015490565b61025d610258366004611858565b6105b1565b005b61025d61026d366004611905565b610606565b61025d610280366004611905565b610631565b610219610293366004611618565b6106af565b6101a57fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa481565b6102d26102cd366004611935565b610729565b6040516101af9190611a3c565b61025d6102ed366004611a4f565b610852565b6005546001600160a01b03166101ee565b61030b600381565b60405160ff90911681526020016101af565b61025d61032b366004611aaa565b6108e4565b6101cb61033e366004611905565b6109f1565b61025d610351366004611af0565b610a1c565b6101a5600081565b61025d61036c366004611b2c565b610a30565b61030b61037f366004611b6e565b610a49565b61025d610392366004611b93565b610ac0565b61025d6103a5366004611905565b610aee565b6103bd6103b8366004611677565b610b14565b6040516101af929190611bb0565b6101cb6103d9366004611c2e565b610b93565b61025d6103ec366004611c5c565b610bae565b6104046103ff366004611618565b610bf3565b60405163ffffffff90911681526020016101af565b60055460405163461e4f1960e11b8152600481018390526001600160a01b0384811660248301526000921690638c3c9e3290604401602060405180830381865afa15801561046b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cc4565b9392505050565b60006104a182610c69565b92915050565b6005546040516363ed4d5360e11b8152600481018390526001600160a01b038481166024830152600092169063c7da9aa690604401602060405180830381865afa1580156104f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cdd565b60606004805461052c90611cfa565b80601f016020809104026020016040519081016040528092919081815260200182805461055890611cfa565b80156105a55780601f1061057a576101008083540402835291602001916105a5565b820191906000526020600020905b81548152906001019060200180831161058857829003601f168201915b50505050509050919050565b6001600160a01b0385163314806105cd57506105cd8533610b93565b6105f25760405162461bcd60e51b81526004016105e990611d34565b60405180910390fd5b6105ff8585858585610ca9565b5050505050565b6000828152600160208190526040909120015461062281610e97565b61062c8383610ea4565b505050565b6001600160a01b03811633146106a15760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105e9565b6106ab8282610f0f565b5050565b600554604051636d7fbb6760e01b8152600481018390526001600160a01b0384811660248301526060921690636d7fbb6790604401600060405180830381865afa158015610701573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261048f9190810190611d82565b6060815183511461078e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016105e9565b600083516001600160401b038111156107a9576107a96116ff565b6040519080825280602002602001820160405280156107d2578160200160208202803683370190505b50905060005b845181101561084a5761081d8582815181106107f6576107f6611e03565b602002602001015185838151811061081057610810611e03565b6020026020010151610419565b82828151811061082f5761082f611e03565b602090810291909101015261084381611e2f565b90506107d8565b509392505050565b7fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa461087c81610e97565b836001600160a01b0316856001600160a01b0316876001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6286866040516108d4929190918252602082015260400190565b60405180910390a4505050505050565b600054600390610100900460ff16158015610906575060005460ff8083169116105b6109695760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e9565b6000805461ffff191660ff8316176101001781556109869061051d565b5115806109925750303b155b156109ab576109a083610f76565b6109ab600083610ea4565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610a2781610e97565b6106ab82610f76565b6040516309a711b960e31b815260040160405180910390fd5b600554604051630e972f9160e41b81526004810184905260ff831660248201526000916001600160a01b03169063e972f91090604401602060405180830381865afa158015610a9c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611e48565b6000610acb81610e97565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526001602081905260409091200154610b0a81610e97565b61062c8383610f0f565b600554604051632b2bf81b60e11b81526004810183905260609182916001600160a01b0390911690635657f03690602401600060405180830381865afa158015610b62573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b8a9190810190611ed4565b91509150915091565b60006040516309a711b960e31b815260040160405180910390fd5b6001600160a01b038516331480610bca5750610bca8533610b93565b610be65760405162461bcd60e51b81526004016105e990611d34565b6105ff8585858585610f89565b6005546040516314067f8b60e01b8152600481018390526001600160a01b03848116602483015260009216906314067f8b90604401602060405180830381865afa158015610c45573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611f90565b60006001600160e01b03198216636cdb3d1360e11b1480610c9a57506001600160e01b031982166303a24d0760e21b145b806104a157506104a1826110c5565b8151835114610d0b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016105e9565b6001600160a01b038416610d315760405162461bcd60e51b81526004016105e990611fb6565b33610d40818787878787610a30565b60005b8451811015610e29576000858281518110610d6057610d60611e03565b602002602001015190506000858381518110610d7e57610d7e611e03565b60209081029190910181015160008481526002835260408082206001600160a01b038e168352909352919091205490915081811015610dcf5760405162461bcd60e51b81526004016105e990611ffb565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610e0e908490612045565b9250508190555050505080610e2290611e2f565b9050610d43565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610e7992919061205d565b60405180910390a4610e8f8187878787876110fa565b505050505050565b610ea1813361125e565b50565b610eae82826109f1565b6106ab5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b610f1982826109f1565b156106ab5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b80516106ab90600490602084019061156a565b6001600160a01b038416610faf5760405162461bcd60e51b81526004016105e990611fb6565b336000610fbb856112b7565b90506000610fc8856112b7565b9050610fd8838989858589610a30565b60008681526002602090815260408083206001600160a01b038c1684529091529020548581101561101b5760405162461bcd60e51b81526004016105e990611ffb565b60008781526002602090815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061105a908490612045565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46110ba848a8a8a8a8a611302565b505050505050505050565b60006001600160e01b03198216637965db0b60e01b14806104a157506301ffc9a760e01b6001600160e01b03198316146104a1565b6001600160a01b0384163b15610e8f5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061113e908990899088908890889060040161208b565b6020604051808303816000875af1925050508015611179575060408051601f3d908101601f19168201909252611176918101906120e9565b60015b61122557611185612106565b806308c379a0036111be5750611199612122565b806111a457506111c0565b8060405162461bcd60e51b81526004016105e991906116ec565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016105e9565b6001600160e01b0319811663bc197c8160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b50505050505050565b61126882826109f1565b6106ab57611275816113bd565b6112808360206113cf565b6040516020016112919291906121f3565b60408051601f198184030181529082905262461bcd60e51b82526105e9916004016116ec565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106112f1576112f1611e03565b602090810291909101015292915050565b6001600160a01b0384163b15610e8f5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906113469089908990889088908890600401612268565b6020604051808303816000875af1925050508015611381575060408051601f3d908101601f1916820190925261137e918101906120e9565b60015b61138d57611185612106565b6001600160e01b0319811663f23a6e6160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b60606104a16001600160a01b03831660145b606060006113de8360026122ad565b6113e9906002612045565b6001600160401b03811115611400576114006116ff565b6040519080825280601f01601f19166020018201604052801561142a576020820181803683370190505b509050600360fc1b8160008151811061144557611445611e03565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061147457611474611e03565b60200101906001600160f81b031916908160001a90535060006114988460026122ad565b6114a3906001612045565b90505b600181111561151b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106114d7576114d7611e03565b1a60f81b8282815181106114ed576114ed611e03565b60200101906001600160f81b031916908160001a90535060049490941c93611514816122cc565b90506114a6565b50831561048f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105e9565b82805461157690611cfa565b90600052602060002090601f01602090048101928261159857600085556115de565b82601f106115b157805160ff19168380011785556115de565b828001600101855582156115de579182015b828111156115de5782518255916020019190600101906115c3565b506115ea9291506115ee565b5090565b5b808211156115ea57600081556001016115ef565b6001600160a01b0381168114610ea157600080fd5b6000806040838503121561162b57600080fd5b823561163681611603565b946020939093013593505050565b6001600160e01b031981168114610ea157600080fd5b60006020828403121561166c57600080fd5b813561048f81611644565b60006020828403121561168957600080fd5b5035919050565b60005b838110156116ab578181015183820152602001611693565b838111156116ba576000848401525b50505050565b600081518084526116d8816020860160208601611690565b601f01601f19169290920160200192915050565b60208152600061048f60208301846116c0565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561173a5761173a6116ff565b6040525050565b60006001600160401b0382111561175a5761175a6116ff565b5060051b60200190565b600082601f83011261177557600080fd5b8135602061178282611741565b60405161178f8282611715565b83815260059390931b85018201928281019150868411156117af57600080fd5b8286015b848110156117ca57803583529183019183016117b3565b509695505050505050565b60006001600160401b038211156117ee576117ee6116ff565b50601f01601f191660200190565b600082601f83011261180d57600080fd5b8135611818816117d5565b6040516118258282611715565b82815285602084870101111561183a57600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a0868803121561187057600080fd5b853561187b81611603565b9450602086013561188b81611603565b935060408601356001600160401b03808211156118a757600080fd5b6118b389838a01611764565b945060608801359150808211156118c957600080fd5b6118d589838a01611764565b935060808801359150808211156118eb57600080fd5b506118f8888289016117fc565b9150509295509295909350565b6000806040838503121561191857600080fd5b82359150602083013561192a81611603565b809150509250929050565b6000806040838503121561194857600080fd5b82356001600160401b038082111561195f57600080fd5b818501915085601f83011261197357600080fd5b8135602061198082611741565b60405161198d8282611715565b83815260059390931b85018201928281019150898411156119ad57600080fd5b948201945b838610156119d45785356119c581611603565b825294820194908201906119b2565b965050860135925050808211156119ea57600080fd5b506119f785828601611764565b9150509250929050565b600081518084526020808501945080840160005b83811015611a3157815187529582019590820190600101611a15565b509495945050505050565b60208152600061048f6020830184611a01565b600080600080600060a08688031215611a6757600080fd5b8535611a7281611603565b94506020860135611a8281611603565b93506040860135611a9281611603565b94979396509394606081013594506080013592915050565b60008060408385031215611abd57600080fd5b82356001600160401b03811115611ad357600080fd5b611adf858286016117fc565b925050602083013561192a81611603565b600060208284031215611b0257600080fd5b81356001600160401b03811115611b1857600080fd5b611b24848285016117fc565b949350505050565b60008060408385031215611b3f57600080fd5b8235611b4a81611603565b91506020830135801515811461192a57600080fd5b60ff81168114610ea157600080fd5b60008060408385031215611b8157600080fd5b82359150602083013561192a81611b5f565b600060208284031215611ba557600080fd5b813561048f81611603565b604080825283519082018190526000906020906060840190828701845b82811015611be957815184529284019290840190600101611bcd565b5050508381038285015284518082528583019183019060005b81811015611c2157835160ff1683529284019291840191600101611c02565b5090979650505050505050565b60008060408385031215611c4157600080fd5b8235611c4c81611603565b9150602083013561192a81611603565b600080600080600060a08688031215611c7457600080fd5b8535611c7f81611603565b94506020860135611c8f81611603565b9350604086013592506060860135915060808601356001600160401b03811115611cb857600080fd5b6118f8888289016117fc565b600060208284031215611cd657600080fd5b5051919050565b600060208284031215611cef57600080fd5b815161048f81611603565b600181811c90821680611d0e57607f821691505b602082108103611d2e57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b600060208284031215611d9457600080fd5b81516001600160401b03811115611daa57600080fd5b8201601f81018413611dbb57600080fd5b8051611dc6816117d5565b604051611dd38282611715565b828152866020848601011115611de857600080fd5b611df9836020830160208701611690565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e4157611e41611e19565b5060010190565b600060208284031215611e5a57600080fd5b815161048f81611b5f565b600082601f830112611e7657600080fd5b81516020611e8382611741565b604051611e908282611715565b83815260059390931b8501820192828101915086841115611eb057600080fd5b8286015b848110156117ca578051611ec781611b5f565b8352918301918301611eb4565b60008060408385031215611ee757600080fd5b82516001600160401b0380821115611efe57600080fd5b818501915085601f830112611f1257600080fd5b81516020611f1f82611741565b604051611f2c8282611715565b83815260059390931b8501820192828101915089841115611f4c57600080fd5b948201945b83861015611f6a57855182529482019490820190611f51565b91880151919650909350505080821115611f8357600080fd5b506119f785828601611e65565b600060208284031215611fa257600080fd5b815163ffffffff8116811461048f57600080fd5b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6000821982111561205857612058611e19565b500190565b6040815260006120706040830185611a01565b82810360208401526120828185611a01565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906120b790830186611a01565b82810360608401526120c98186611a01565b905082810360808401526120dd81856116c0565b98975050505050505050565b6000602082840312156120fb57600080fd5b815161048f81611644565b600060033d111561211f5760046000803e5060005160e01c5b90565b600060443d10156121305790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561215f57505050505090565b82850191508151818111156121775750505050505090565b843d87010160208285010111156121915750505050505090565b6121a060208286010187611715565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161222b816017850160208801611690565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161225c816028840160208801611690565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906122a2908301846116c0565b979650505050505050565b60008160001904831182151516156122c7576122c7611e19565b500290565b6000816122db576122db611e19565b50600019019056fea26469706673582212209e33646a1ed2d51fcc749870e94aa69546c518fc5bfee43d37014ebc54dd767864736f6c634300080e0033", "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061018d5760003560e01c8063754b377c116100de578063aed8c6bc11610097578063e37ffe7c11610071578063e37ffe7c146103aa578063e985e9c5146103cb578063f242432a146103de578063ff4468c4146103f157600080fd5b8063aed8c6bc14610371578063b3c1cb2114610384578063d547741f1461039757600080fd5b8063754b377c146103035780637ab4339d1461031d57806391d14854146103305780639b642de114610343578063a217fddf14610356578063a22cb4651461035e57600080fd5b80632f2ff15d1161014b57806344112ed81161012557806344112ed8146102985780634e1273f4146102bf578063710b3096146102df578063730cb7d5146102f257600080fd5b80632f2ff15d1461025f57806336568abe146102725780633e1f3c271461028557600080fd5b8062fdd58e1461019257806301ffc9a7146101b85780630e064366146101db5780630e89341c14610206578063248a9ca3146102265780632eb2c2d61461024a575b600080fd5b6101a56101a0366004611618565b610419565b6040519081526020015b60405180910390f35b6101cb6101c636600461165a565b610496565b60405190151581526020016101af565b6101ee6101e9366004611618565b6104a7565b6040516001600160a01b0390911681526020016101af565b610219610214366004611677565b61051d565b6040516101af91906116ec565b6101a5610234366004611677565b6000908152600160208190526040909120015490565b61025d610258366004611858565b6105b1565b005b61025d61026d366004611905565b610606565b61025d610280366004611905565b610631565b610219610293366004611618565b6106af565b6101a57fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa481565b6102d26102cd366004611935565b610729565b6040516101af9190611a3c565b61025d6102ed366004611a4f565b610852565b6005546001600160a01b03166101ee565b61030b600381565b60405160ff90911681526020016101af565b61025d61032b366004611aaa565b6108e4565b6101cb61033e366004611905565b6109f1565b61025d610351366004611af0565b610a1c565b6101a5600081565b61025d61036c366004611b2c565b610a30565b61030b61037f366004611b6e565b610a49565b61025d610392366004611b93565b610ac0565b61025d6103a5366004611905565b610aee565b6103bd6103b8366004611677565b610b14565b6040516101af929190611bb0565b6101cb6103d9366004611c2e565b610b93565b61025d6103ec366004611c5c565b610bae565b6104046103ff366004611618565b610bf3565b60405163ffffffff90911681526020016101af565b60055460405163461e4f1960e11b8152600481018390526001600160a01b0384811660248301526000921690638c3c9e3290604401602060405180830381865afa15801561046b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cc4565b9392505050565b60006104a182610c69565b92915050565b6005546040516363ed4d5360e11b8152600481018390526001600160a01b038481166024830152600092169063c7da9aa690604401602060405180830381865afa1580156104f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cdd565b60606004805461052c90611cfa565b80601f016020809104026020016040519081016040528092919081815260200182805461055890611cfa565b80156105a55780601f1061057a576101008083540402835291602001916105a5565b820191906000526020600020905b81548152906001019060200180831161058857829003601f168201915b50505050509050919050565b6001600160a01b0385163314806105cd57506105cd8533610b93565b6105f25760405162461bcd60e51b81526004016105e990611d34565b60405180910390fd5b6105ff8585858585610ca9565b5050505050565b6000828152600160208190526040909120015461062281610e97565b61062c8383610ea4565b505050565b6001600160a01b03811633146106a15760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105e9565b6106ab8282610f0f565b5050565b600554604051636d7fbb6760e01b8152600481018390526001600160a01b0384811660248301526060921690636d7fbb6790604401600060405180830381865afa158015610701573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261048f9190810190611d82565b6060815183511461078e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016105e9565b600083516001600160401b038111156107a9576107a96116ff565b6040519080825280602002602001820160405280156107d2578160200160208202803683370190505b50905060005b845181101561084a5761081d8582815181106107f6576107f6611e03565b602002602001015185838151811061081057610810611e03565b6020026020010151610419565b82828151811061082f5761082f611e03565b602090810291909101015261084381611e2f565b90506107d8565b509392505050565b7fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa461087c81610e97565b836001600160a01b0316856001600160a01b0316876001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6286866040516108d4929190918252602082015260400190565b60405180910390a4505050505050565b600054600390610100900460ff16158015610906575060005460ff8083169116105b6109695760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e9565b6000805461ffff191660ff8316176101001781556109869061051d565b5115806109925750303b155b156109ab576109a083610f76565b6109ab600083610ea4565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610a2781610e97565b6106ab82610f76565b6040516309a711b960e31b815260040160405180910390fd5b600554604051630e972f9160e41b81526004810184905260ff831660248201526000916001600160a01b03169063e972f91090604401602060405180830381865afa158015610a9c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611e48565b6000610acb81610e97565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526001602081905260409091200154610b0a81610e97565b61062c8383610f0f565b600554604051632b2bf81b60e11b81526004810183905260609182916001600160a01b0390911690635657f03690602401600060405180830381865afa158015610b62573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b8a9190810190611ed4565b91509150915091565b60006040516309a711b960e31b815260040160405180910390fd5b6001600160a01b038516331480610bca5750610bca8533610b93565b610be65760405162461bcd60e51b81526004016105e990611d34565b6105ff8585858585610f89565b6005546040516314067f8b60e01b8152600481018390526001600160a01b03848116602483015260009216906314067f8b90604401602060405180830381865afa158015610c45573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611f90565b60006001600160e01b03198216636cdb3d1360e11b1480610c9a57506001600160e01b031982166303a24d0760e21b145b806104a157506104a1826110c5565b8151835114610d0b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016105e9565b6001600160a01b038416610d315760405162461bcd60e51b81526004016105e990611fb6565b33610d40818787878787610a30565b60005b8451811015610e29576000858281518110610d6057610d60611e03565b602002602001015190506000858381518110610d7e57610d7e611e03565b60209081029190910181015160008481526002835260408082206001600160a01b038e168352909352919091205490915081811015610dcf5760405162461bcd60e51b81526004016105e990611ffb565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610e0e908490612045565b9250508190555050505080610e2290611e2f565b9050610d43565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610e7992919061205d565b60405180910390a4610e8f8187878787876110fa565b505050505050565b610ea1813361125e565b50565b610eae82826109f1565b6106ab5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b610f1982826109f1565b156106ab5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b80516106ab90600490602084019061156a565b6001600160a01b038416610faf5760405162461bcd60e51b81526004016105e990611fb6565b336000610fbb856112b7565b90506000610fc8856112b7565b9050610fd8838989858589610a30565b60008681526002602090815260408083206001600160a01b038c1684529091529020548581101561101b5760405162461bcd60e51b81526004016105e990611ffb565b60008781526002602090815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061105a908490612045565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46110ba848a8a8a8a8a611302565b505050505050505050565b60006001600160e01b03198216637965db0b60e01b14806104a157506301ffc9a760e01b6001600160e01b03198316146104a1565b6001600160a01b0384163b15610e8f5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061113e908990899088908890889060040161208b565b6020604051808303816000875af1925050508015611179575060408051601f3d908101601f19168201909252611176918101906120e9565b60015b61122557611185612106565b806308c379a0036111be5750611199612122565b806111a457506111c0565b8060405162461bcd60e51b81526004016105e991906116ec565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016105e9565b6001600160e01b0319811663bc197c8160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b50505050505050565b61126882826109f1565b6106ab57611275816113bd565b6112808360206113cf565b6040516020016112919291906121f3565b60408051601f198184030181529082905262461bcd60e51b82526105e9916004016116ec565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106112f1576112f1611e03565b602090810291909101015292915050565b6001600160a01b0384163b15610e8f5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906113469089908990889088908890600401612268565b6020604051808303816000875af1925050508015611381575060408051601f3d908101601f1916820190925261137e918101906120e9565b60015b61138d57611185612106565b6001600160e01b0319811663f23a6e6160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b60606104a16001600160a01b03831660145b606060006113de8360026122ad565b6113e9906002612045565b6001600160401b03811115611400576114006116ff565b6040519080825280601f01601f19166020018201604052801561142a576020820181803683370190505b509050600360fc1b8160008151811061144557611445611e03565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061147457611474611e03565b60200101906001600160f81b031916908160001a90535060006114988460026122ad565b6114a3906001612045565b90505b600181111561151b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106114d7576114d7611e03565b1a60f81b8282815181106114ed576114ed611e03565b60200101906001600160f81b031916908160001a90535060049490941c93611514816122cc565b90506114a6565b50831561048f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105e9565b82805461157690611cfa565b90600052602060002090601f01602090048101928261159857600085556115de565b82601f106115b157805160ff19168380011785556115de565b828001600101855582156115de579182015b828111156115de5782518255916020019190600101906115c3565b506115ea9291506115ee565b5090565b5b808211156115ea57600081556001016115ef565b6001600160a01b0381168114610ea157600080fd5b6000806040838503121561162b57600080fd5b823561163681611603565b946020939093013593505050565b6001600160e01b031981168114610ea157600080fd5b60006020828403121561166c57600080fd5b813561048f81611644565b60006020828403121561168957600080fd5b5035919050565b60005b838110156116ab578181015183820152602001611693565b838111156116ba576000848401525b50505050565b600081518084526116d8816020860160208601611690565b601f01601f19169290920160200192915050565b60208152600061048f60208301846116c0565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561173a5761173a6116ff565b6040525050565b60006001600160401b0382111561175a5761175a6116ff565b5060051b60200190565b600082601f83011261177557600080fd5b8135602061178282611741565b60405161178f8282611715565b83815260059390931b85018201928281019150868411156117af57600080fd5b8286015b848110156117ca57803583529183019183016117b3565b509695505050505050565b60006001600160401b038211156117ee576117ee6116ff565b50601f01601f191660200190565b600082601f83011261180d57600080fd5b8135611818816117d5565b6040516118258282611715565b82815285602084870101111561183a57600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a0868803121561187057600080fd5b853561187b81611603565b9450602086013561188b81611603565b935060408601356001600160401b03808211156118a757600080fd5b6118b389838a01611764565b945060608801359150808211156118c957600080fd5b6118d589838a01611764565b935060808801359150808211156118eb57600080fd5b506118f8888289016117fc565b9150509295509295909350565b6000806040838503121561191857600080fd5b82359150602083013561192a81611603565b809150509250929050565b6000806040838503121561194857600080fd5b82356001600160401b038082111561195f57600080fd5b818501915085601f83011261197357600080fd5b8135602061198082611741565b60405161198d8282611715565b83815260059390931b85018201928281019150898411156119ad57600080fd5b948201945b838610156119d45785356119c581611603565b825294820194908201906119b2565b965050860135925050808211156119ea57600080fd5b506119f785828601611764565b9150509250929050565b600081518084526020808501945080840160005b83811015611a3157815187529582019590820190600101611a15565b509495945050505050565b60208152600061048f6020830184611a01565b600080600080600060a08688031215611a6757600080fd5b8535611a7281611603565b94506020860135611a8281611603565b93506040860135611a9281611603565b94979396509394606081013594506080013592915050565b60008060408385031215611abd57600080fd5b82356001600160401b03811115611ad357600080fd5b611adf858286016117fc565b925050602083013561192a81611603565b600060208284031215611b0257600080fd5b81356001600160401b03811115611b1857600080fd5b611b24848285016117fc565b949350505050565b60008060408385031215611b3f57600080fd5b8235611b4a81611603565b91506020830135801515811461192a57600080fd5b60ff81168114610ea157600080fd5b60008060408385031215611b8157600080fd5b82359150602083013561192a81611b5f565b600060208284031215611ba557600080fd5b813561048f81611603565b604080825283519082018190526000906020906060840190828701845b82811015611be957815184529284019290840190600101611bcd565b5050508381038285015284518082528583019183019060005b81811015611c2157835160ff1683529284019291840191600101611c02565b5090979650505050505050565b60008060408385031215611c4157600080fd5b8235611c4c81611603565b9150602083013561192a81611603565b600080600080600060a08688031215611c7457600080fd5b8535611c7f81611603565b94506020860135611c8f81611603565b9350604086013592506060860135915060808601356001600160401b03811115611cb857600080fd5b6118f8888289016117fc565b600060208284031215611cd657600080fd5b5051919050565b600060208284031215611cef57600080fd5b815161048f81611603565b600181811c90821680611d0e57607f821691505b602082108103611d2e57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b600060208284031215611d9457600080fd5b81516001600160401b03811115611daa57600080fd5b8201601f81018413611dbb57600080fd5b8051611dc6816117d5565b604051611dd38282611715565b828152866020848601011115611de857600080fd5b611df9836020830160208701611690565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e4157611e41611e19565b5060010190565b600060208284031215611e5a57600080fd5b815161048f81611b5f565b600082601f830112611e7657600080fd5b81516020611e8382611741565b604051611e908282611715565b83815260059390931b8501820192828101915086841115611eb057600080fd5b8286015b848110156117ca578051611ec781611b5f565b8352918301918301611eb4565b60008060408385031215611ee757600080fd5b82516001600160401b0380821115611efe57600080fd5b818501915085601f830112611f1257600080fd5b81516020611f1f82611741565b604051611f2c8282611715565b83815260059390931b8501820192828101915089841115611f4c57600080fd5b948201945b83861015611f6a57855182529482019490820190611f51565b91880151919650909350505080821115611f8357600080fd5b506119f785828601611e65565b600060208284031215611fa257600080fd5b815163ffffffff8116811461048f57600080fd5b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6000821982111561205857612058611e19565b500190565b6040815260006120706040830185611a01565b82810360208401526120828185611a01565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906120b790830186611a01565b82810360608401526120c98186611a01565b905082810360808401526120dd81856116c0565b98975050505050505050565b6000602082840312156120fb57600080fd5b815161048f81611644565b600060033d111561211f5760046000803e5060005160e01c5b90565b600060443d10156121305790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561215f57505050505090565b82850191508151818111156121775750505050505090565b843d87010160208285010111156121915750505050505090565b6121a060208286010187611715565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161222b816017850160208801611690565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161225c816028840160208801611690565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906122a2908301846116c0565b979650505050505050565b60008160001904831182151516156122c7576122c7611e19565b500290565b6000816122db576122db611e19565b50600019019056fea26469706673582212209e33646a1ed2d51fcc749870e94aa69546c518fc5bfee43d37014ebc54dd767864736f6c634300080e0033", diff --git a/deployments/mumbaiTestnet/BadgesProxy.json b/deployments/mumbaiTestnet/BadgesProxy.json new file mode 100644 index 0000000..25fe32a --- /dev/null +++ b/deployments/mumbaiTestnet/BadgesProxy.json @@ -0,0 +1,277 @@ +{ + "address": "0xc3Ee5Aad6Fb987cF69a2EE7B3B2c92E21E42F34B", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xc26894b4d16d2fa82e446adc6229356bc6e32ec2a45fa3b0939a5301e2414189", + "receipt": { + "to": null, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xc3Ee5Aad6Fb987cF69a2EE7B3B2c92E21E42F34B", + "transactionIndex": 8, + "gasUsed": "704790", + "logsBloom": "0x00000004000000020000000000000000400000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000022800000002000000000000100000000000000000000020000000000000000000800000000800000000080000000800000000000000000000000000000000000000000000000000080000000000040800000200000000000000020000000000402010001000000000000001000000000004000008020000000000001000000040000000000000400000100100000000020000000000000000000000200000000000000000000000000000000000000100000", + "blockHash": "0x7eb48a59ca1ee9d4a5caedd82fed042443aaa9a0fb90ad366e2b33c084b880d7", + "transactionHash": "0xc26894b4d16d2fa82e446adc6229356bc6e32ec2a45fa3b0939a5301e2414189", + "logs": [ + { + "transactionIndex": 8, + "blockNumber": 29771733, + "transactionHash": "0xc26894b4d16d2fa82e446adc6229356bc6e32ec2a45fa3b0939a5301e2414189", + "address": "0xc3Ee5Aad6Fb987cF69a2EE7B3B2c92E21E42F34B", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000818c6d85ffe9df53d331f6413b0ae07f67cc71c9" + ], + "data": "0x", + "logIndex": 35, + "blockHash": "0x7eb48a59ca1ee9d4a5caedd82fed042443aaa9a0fb90ad366e2b33c084b880d7" + }, + { + "transactionIndex": 8, + "blockNumber": 29771733, + "transactionHash": "0xc26894b4d16d2fa82e446adc6229356bc6e32ec2a45fa3b0939a5301e2414189", + "address": "0xc3Ee5Aad6Fb987cF69a2EE7B3B2c92E21E42F34B", + "topics": [ + "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" + ], + "data": "0x", + "logIndex": 36, + "blockHash": "0x7eb48a59ca1ee9d4a5caedd82fed042443aaa9a0fb90ad366e2b33c084b880d7" + }, + { + "transactionIndex": 8, + "blockNumber": 29771733, + "transactionHash": "0xc26894b4d16d2fa82e446adc6229356bc6e32ec2a45fa3b0939a5301e2414189", + "address": "0xc3Ee5Aad6Fb987cF69a2EE7B3B2c92E21E42F34B", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000003", + "logIndex": 37, + "blockHash": "0x7eb48a59ca1ee9d4a5caedd82fed042443aaa9a0fb90ad366e2b33c084b880d7" + }, + { + "transactionIndex": 8, + "blockNumber": 29771733, + "transactionHash": "0xc26894b4d16d2fa82e446adc6229356bc6e32ec2a45fa3b0939a5301e2414189", + "address": "0xc3Ee5Aad6Fb987cF69a2EE7B3B2c92E21E42F34B", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002110475dfbb8d331b300178a867372991ff35fa3", + "logIndex": 38, + "blockHash": "0x7eb48a59ca1ee9d4a5caedd82fed042443aaa9a0fb90ad366e2b33c084b880d7" + }, + { + "transactionIndex": 8, + "blockNumber": 29771733, + "transactionHash": "0xc26894b4d16d2fa82e446adc6229356bc6e32ec2a45fa3b0939a5301e2414189", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" + ], + "data": "0x0000000000000000000000000000000000000000000000000003c181103805a80000000000000000000000000000000000000000000000001bb611db6ff932fe00000000000000000000000000000000000000000000187ad50a8542c38376a20000000000000000000000000000000000000000000000001bb2505a5fc12d5600000000000000000000000000000000000000000000187ad50e46c3d3bb7c4a", + "logIndex": 39, + "blockHash": "0x7eb48a59ca1ee9d4a5caedd82fed042443aaa9a0fb90ad366e2b33c084b880d7" + } + ], + "blockNumber": 29771733, + "cumulativeGasUsed": "3283520", + "status": 1, + "byzantium": true + }, + "args": [ + "0x818C6d85fFe9DF53d331f6413b0ae07F67CC71C9", + "0x2110475dfbB8d331b300178A867372991ff35fA3", + "0x7ab4339d0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed000000000000000000000000000000000000000000000000000000000000003568747470733a2f2f6875622e746573746e6574732e7369736d6f2e696f2f6261646765732f6d756d6261692f7b69647d2e6a736f6e0000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", + "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(\\n address newImplementation,\\n bytes calldata data\\n ) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x1663761dc98da7a84e6570b428877de7de9859e34f99c7002cad71ccfc9d6283\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405162000eeb38038062000eeb8339810160408190526200002691620004ed565b828162000036828260006200009a565b5062000066905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005cd565b60008051602062000ea483398151915214620000865762000086620005f3565b6200009182620000d7565b5050506200065c565b620000a58362000132565b600082511180620000b35750805b15620000d257620000d083836200017460201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f62000102620001a3565b604080516001600160a01b03928316815291841660208301520160405180910390a16200012f81620001dc565b50565b6200013d8162000291565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606200019c838360405180606001604052806027815260200162000ec46027913962000345565b9392505050565b6000620001cd60008051602062000ea483398151915260001b620003c460201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002475760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b806200027060008051602062000ea483398151915260001b620003c460201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002a781620003c760201b6200025a1760201c565b6200030b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200023e565b80620002707f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b620003c460201b620001ea1760201c565b6060600080856001600160a01b03168560405162000364919062000609565b600060405180830381855af49150503d8060008114620003a1576040519150601f19603f3d011682016040523d82523d6000602084013e620003a6565b606091505b509092509050620003ba86838387620003d6565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200044a57825160000362000442576001600160a01b0385163b620004425760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016200023e565b508162000456565b6200045683836200045e565b949350505050565b8151156200046f5781518083602001fd5b8060405162461bcd60e51b81526004016200023e919062000627565b80516001600160a01b0381168114620004a357600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004db578181015183820152602001620004c1565b83811115620000d05750506000910152565b6000806000606084860312156200050357600080fd5b6200050e846200048b565b92506200051e602085016200048b565b60408501519092506001600160401b03808211156200053c57600080fd5b818601915086601f8301126200055157600080fd5b815181811115620005665762000566620004a8565b604051601f8201601f19908116603f01168101908382118183101715620005915762000591620004a8565b81604052828152896020848701011115620005ab57600080fd5b620005be836020830160208801620004be565b80955050505050509250925092565b600082821015620005ee57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b600082516200061d818460208701620004be565b9190910192915050565b602081526000825180602084015262000648816040850160208701620004be565b601f01601f19169190910160400192915050565b610838806200066c6000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106c2565b610118565b61005b6100933660046106dd565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106c2565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107dc602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd610456565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b6103688361047e565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a816104be565b6060600080856001600160a01b0316856040516103fb919061078c565b600060405180830381855af49150503d8060008114610436576040519150601f19603f3d011682016040523d82523d6000602084013e61043b565b606091505b509150915061044c86838387610567565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b610487816105e8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105235760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105d65782516000036105cf576001600160a01b0385163b6105cf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102f5565b50816105e0565b6105e0838361067c565b949350505050565b6001600160a01b0381163b6106555760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610546565b81511561068c5781518083602001fd5b8060405162461bcd60e51b81526004016102f591906107a8565b80356001600160a01b03811681146106bd57600080fd5b919050565b6000602082840312156106d457600080fd5b610253826106a6565b6000806000604084860312156106f257600080fd5b6106fb846106a6565b9250602084013567ffffffffffffffff8082111561071857600080fd5b818601915086601f83011261072c57600080fd5b81358181111561073b57600080fd5b87602082850101111561074d57600080fd5b6020830194508093505050509250925092565b60005b8381101561077b578181015183820152602001610763565b838111156103845750506000910152565b6000825161079e818460208701610760565b9190910192915050565b60208152600082518060208401526107c7816040850160208701610760565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e2b2f80d01b9fee1887f086f33ea33eabe6a896123f3722976ea73e069c365b664736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106c2565b610118565b61005b6100933660046106dd565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106c2565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107dc602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd610456565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b6103688361047e565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a816104be565b6060600080856001600160a01b0316856040516103fb919061078c565b600060405180830381855af49150503d8060008114610436576040519150601f19603f3d011682016040523d82523d6000602084013e61043b565b606091505b509150915061044c86838387610567565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b610487816105e8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105235760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105d65782516000036105cf576001600160a01b0385163b6105cf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102f5565b50816105e0565b6105e0838361067c565b949350505050565b6001600160a01b0381163b6106555760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610546565b81511561068c5781518083602001fd5b8060405162461bcd60e51b81526004016102f591906107a8565b80356001600160a01b03811681146106bd57600080fd5b919050565b6000602082840312156106d457600080fd5b610253826106a6565b6000806000604084860312156106f257600080fd5b6106fb846106a6565b9250602084013567ffffffffffffffff8082111561071857600080fd5b818601915086601f83011261072c57600080fd5b81358181111561073b57600080fd5b87602082850101111561074d57600080fd5b6020830194508093505050509250925092565b60005b8381101561077b578181015183820152602001610763565b838111156103845750506000910152565b6000825161079e818460208701610760565b9190910192915050565b60208152600082518060208401526107c7816040850160208701610760565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e2b2f80d01b9fee1887f086f33ea33eabe6a896123f3722976ea73e069c365b664736f6c634300080e0033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/sandboxPolygon/CommitmentMapperRegistry.json b/deployments/mumbaiTestnet/CommitmentMapperRegistry.json similarity index 93% rename from deployments/sandboxPolygon/CommitmentMapperRegistry.json rename to deployments/mumbaiTestnet/CommitmentMapperRegistry.json index c9ef1dd..594d28c 100644 --- a/deployments/sandboxPolygon/CommitmentMapperRegistry.json +++ b/deployments/mumbaiTestnet/CommitmentMapperRegistry.json @@ -1,5 +1,5 @@ { - "address": "0xC44F46A31B752b773685be6B5ce8616fFeb97C8D", + "address": "0xE6C1f01C71A184A44A21B10A7FBEb3b1604B4f2a", "abi": [ { "inputs": [ @@ -213,112 +213,112 @@ "type": "function" } ], - "transactionHash": "0x3b19d54c9fb944fd66faf0dacddd1a72b32ac6cd073a2d128530ddace942e432", + "transactionHash": "0x9bd9a08e4af1643ed1ea5e63f49cebb6b9bf8394a728c58cd07dfed7a83faee7", "receipt": { "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0x74CA5D99034F41f70F5870D7759FeA1D92A358b7", - "transactionIndex": 63, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xbC457e93b213d7879e23E30C8873875Ed0668088", + "transactionIndex": 17, "gasUsed": "520404", - "logsBloom": "0x00000000000000200000000000000008002000000000000000800000000000000000000000000000000000000000000000008000000020000000000004000000000000000000008000000000000400800001000000000000000100000000000000000000020000000000000000000800000000010000000084000000000800400000000000010000000000100000000000000000000080000000000000000000200001000000000000000000000400000000001000000000000000000000004000000004000000000001000000040000000000000000800000100004000020000000100000000000000000000000000000000000000000000000000000100000", - "blockHash": "0x3a331ff61624d9d9430fe6bfb35c1431d8bb31a57ef50a816667b33ac5b0befc", - "transactionHash": "0x3b19d54c9fb944fd66faf0dacddd1a72b32ac6cd073a2d128530ddace942e432", + "logsBloom": "0x00000000000000020000000000000000000000400000000000800000000000000000000000000000000000000000000000008000000000000000000004000000000000000000008000000000000400800001000000000000000100000000000000000000020000000000000000000800000000000000000884000000000000400000000000000000000000000000000000000000000080000000000040000000200000000000000020000000000402000001000000000000000000000000004000008004000000000001000000040000000000000000000000100000000020000000100000000020000000000000000000000000000000000000000000100000", + "blockHash": "0x225e98dab37cca45de88d005472ff63f978916450abc1faf4c8bf801f40e5f4c", + "transactionHash": "0x9bd9a08e4af1643ed1ea5e63f49cebb6b9bf8394a728c58cd07dfed7a83faee7", "logs": [ { - "transactionIndex": 63, - "blockNumber": 36626447, - "transactionHash": "0x3b19d54c9fb944fd66faf0dacddd1a72b32ac6cd073a2d128530ddace942e432", - "address": "0x74CA5D99034F41f70F5870D7759FeA1D92A358b7", + "transactionIndex": 17, + "blockNumber": 29772017, + "transactionHash": "0x9bd9a08e4af1643ed1ea5e63f49cebb6b9bf8394a728c58cd07dfed7a83faee7", + "address": "0xbC457e93b213d7879e23E30C8873875Ed0668088", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 302, - "blockHash": "0x3a331ff61624d9d9430fe6bfb35c1431d8bb31a57ef50a816667b33ac5b0befc" + "logIndex": 61, + "blockHash": "0x225e98dab37cca45de88d005472ff63f978916450abc1faf4c8bf801f40e5f4c" }, { - "transactionIndex": 63, - "blockNumber": 36626447, - "transactionHash": "0x3b19d54c9fb944fd66faf0dacddd1a72b32ac6cd073a2d128530ddace942e432", - "address": "0x74CA5D99034F41f70F5870D7759FeA1D92A358b7", + "transactionIndex": 17, + "blockNumber": 29772017, + "transactionHash": "0x9bd9a08e4af1643ed1ea5e63f49cebb6b9bf8394a728c58cd07dfed7a83faee7", + "address": "0xbC457e93b213d7879e23E30C8873875Ed0668088", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x000000000000000000000000aee4acd5c4bf516330ca8fe11b07206fc6709294" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 303, - "blockHash": "0x3a331ff61624d9d9430fe6bfb35c1431d8bb31a57ef50a816667b33ac5b0befc" + "logIndex": 62, + "blockHash": "0x225e98dab37cca45de88d005472ff63f978916450abc1faf4c8bf801f40e5f4c" }, { - "transactionIndex": 63, - "blockNumber": 36626447, - "transactionHash": "0x3b19d54c9fb944fd66faf0dacddd1a72b32ac6cd073a2d128530ddace942e432", - "address": "0x74CA5D99034F41f70F5870D7759FeA1D92A358b7", + "transactionIndex": 17, + "blockNumber": 29772017, + "transactionHash": "0x9bd9a08e4af1643ed1ea5e63f49cebb6b9bf8394a728c58cd07dfed7a83faee7", + "address": "0xbC457e93b213d7879e23E30C8873875Ed0668088", "topics": [ "0x9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab15" ], "data": "0x0c6c16efc72c198f4549bd069f1e57f091885234b9c140286d80ef431151d64412c54731563d974ead25d469d2263fdf0e230d5a09f6cd40a06e60210610d642", - "logIndex": 304, - "blockHash": "0x3a331ff61624d9d9430fe6bfb35c1431d8bb31a57ef50a816667b33ac5b0befc" + "logIndex": 63, + "blockHash": "0x225e98dab37cca45de88d005472ff63f978916450abc1faf4c8bf801f40e5f4c" }, { - "transactionIndex": 63, - "blockNumber": 36626447, - "transactionHash": "0x3b19d54c9fb944fd66faf0dacddd1a72b32ac6cd073a2d128530ddace942e432", - "address": "0x74CA5D99034F41f70F5870D7759FeA1D92A358b7", + "transactionIndex": 17, + "blockNumber": 29772017, + "transactionHash": "0x9bd9a08e4af1643ed1ea5e63f49cebb6b9bf8394a728c58cd07dfed7a83faee7", + "address": "0xbC457e93b213d7879e23E30C8873875Ed0668088", "topics": [ "0xa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f4" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "logIndex": 305, - "blockHash": "0x3a331ff61624d9d9430fe6bfb35c1431d8bb31a57ef50a816667b33ac5b0befc" + "logIndex": 64, + "blockHash": "0x225e98dab37cca45de88d005472ff63f978916450abc1faf4c8bf801f40e5f4c" }, { - "transactionIndex": 63, - "blockNumber": 36626447, - "transactionHash": "0x3b19d54c9fb944fd66faf0dacddd1a72b32ac6cd073a2d128530ddace942e432", - "address": "0x74CA5D99034F41f70F5870D7759FeA1D92A358b7", + "transactionIndex": 17, + "blockNumber": 29772017, + "transactionHash": "0x9bd9a08e4af1643ed1ea5e63f49cebb6b9bf8394a728c58cd07dfed7a83faee7", + "address": "0xbC457e93b213d7879e23E30C8873875Ed0668088", "topics": [ "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000002", - "logIndex": 306, - "blockHash": "0x3a331ff61624d9d9430fe6bfb35c1431d8bb31a57ef50a816667b33ac5b0befc" + "logIndex": 65, + "blockHash": "0x225e98dab37cca45de88d005472ff63f978916450abc1faf4c8bf801f40e5f4c" }, { - "transactionIndex": 63, - "blockNumber": 36626447, - "transactionHash": "0x3b19d54c9fb944fd66faf0dacddd1a72b32ac6cd073a2d128530ddace942e432", + "transactionIndex": 17, + "blockNumber": 29772017, + "transactionHash": "0x9bd9a08e4af1643ed1ea5e63f49cebb6b9bf8394a728c58cd07dfed7a83faee7", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x00000000000000000000000072f93a2740e00112d5f2cef404c0aa16fae21fa4" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" ], - "data": "0x00000000000000000000000000000000000000000000000000396de976530804000000000000000000000000000000000000000000000000b459f165559b4e340000000000000000000000000000000000000000000017e57a16a108d61aacbd000000000000000000000000000000000000000000000000b420837bdf4846300000000000000000000000000000000000000000000017e57a500ef24c6db4c1", - "logIndex": 307, - "blockHash": "0x3a331ff61624d9d9430fe6bfb35c1431d8bb31a57ef50a816667b33ac5b0befc" + "data": "0x0000000000000000000000000000000000000000000000000002c5f4ff470a580000000000000000000000000000000000000000000000001b8f359ad5d9444300000000000000000000000000000000000000000000187b061e992745670c730000000000000000000000000000000000000000000000001b8c6fa5d69239eb00000000000000000000000000000000000000000000187b06215f1c44ae16cb", + "logIndex": 66, + "blockHash": "0x225e98dab37cca45de88d005472ff63f978916450abc1faf4c8bf801f40e5f4c" } ], - "blockNumber": 36626447, - "cumulativeGasUsed": "11990954", + "blockNumber": 29772017, + "cumulativeGasUsed": "5726895", "status": 1, "byzantium": true }, "args": [ - "0xaee4acd5c4Bf516330ca8fe11B07206fC6709294", + "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", [ "0x0c6c16efc72c198f4549bd069f1e57f091885234b9c140286d80ef431151d644", "0x12c54731563d974ead25d469d2263fdf0e230d5a09f6cd40a06e60210610d642" ], "0x0000000000000000000000000000000000000000" ], - "numDeployments": 5, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentMapperEdDSAPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"pubKey\",\"type\":\"uint256[2]\"}],\"name\":\"PubKeyNotValid\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"UpdatedCommitmentMapperAddress\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256[2]\",\"name\":\"newEdDSAPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"UpdatedCommitmentMapperEdDSAPubKey\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEdDSAPubKey\",\"outputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"\",\"type\":\"uint256[2]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentMapperEdDSAPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"updateCommitmentMapperAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"newEdDSAPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"updateCommitmentMapperEdDSAPubKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"commitmentMapperAddress\":\"Address of the commitment mapper\",\"commitmentMapperEdDSAPubKey\":\"EdDSA public key of the commitment mapper\",\"owner\":\"Owner of the contract, can update public key and address\"}},\"getAddress()\":{\"details\":\"Getter of the address of the commitment mapper\"},\"getEdDSAPubKey()\":{\"details\":\"Getter of the EdDSA public key of the commitment mapper\"},\"initialize(address,uint256[2],address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"commitmentMapperAddress\":\"Address of the commitment mapper\",\"commitmentMapperEdDSAPubKey\":\"EdDSA public key of the commitment mapper\",\"ownerAddress\":\"Owner of the contract, can update public key and address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"updateCommitmentMapperAddress(address)\":{\"details\":\"Updates the address\",\"params\":{\"newAddress\":\"new address\"}},\"updateCommitmentMapperEdDSAPubKey(uint256[2])\":{\"details\":\"Updates the EdDSA public key\",\"params\":{\"newEdDSAPubKey\":\"new EdDSA pubic key\"}}},\"title\":\"Commitment Mapper Registry Contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address,uint256[2],address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"This contract stores information about the commitment mapper. Its ethereum address and its EdDSA public key For more information: https://commitment-mapper.docs.sismo.io*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":\"CommitmentMapperRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address ownerAddress,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0x1b6ab7a4ba266f3da2c7f6ba3de93e3ab89f389dbd6db14514b43cbdcbe9fe09\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0xcb419cf389baad6f38de28625718f64f551d2669339c1b4e1887e11d62484469\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x60806040523480156200001157600080fd5b5060405162000abe38038062000abe833981016040819052620000349162000313565b6200003f3362000055565b6200004c838383620000b0565b505050620003ef565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600290610100900460ff16158015620000d3575060005460ff8083169116105b6200013b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff831617610100178155620001686000546201000090046001600160a01b031690565b6001600160a01b031614806200017d5750303b155b15620001a4576200018e8462000055565b6200019983620001eb565b620001a48262000237565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b620001fa600182600262000286565b507f9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab15816040516200022c9190620003bc565b60405180910390a150565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f4906020016200022c565b8260028101928215620002b7579160200282015b82811115620002b75782518255916020019190600101906200029a565b50620002c5929150620002c9565b5090565b5b80821115620002c55760008155600101620002ca565b80516001600160a01b0381168114620002f857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b6000806000608084860312156200032957600080fd5b6200033484620002e0565b9250602085603f8601126200034857600080fd5b604080519081016001600160401b03811182821017156200036d576200036d620002fd565b6040528060608701888111156200038357600080fd5b8388015b81811015620003a0578051835291840191840162000387565b50829550620003af81620002e0565b9450505050509250925092565b60408101818360005b6002811015620003e6578151835260209283019290910190600101620003c5565b50505092915050565b6106bf80620003ff6000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063727b2d5c11610066578063727b2d5c146100f4578063754b377c1461010757806378cf75d7146101215780638da5cb5b14610134578063f2fde38b1461014b57600080fd5b806338cc48311461009857806359a80d0d146100c25780637098a5f4146100d7578063715018a6146100ec575b600080fd5b6003546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100ca61015e565b6040516100b9919061053c565b6100ea6100e53660046105eb565b610198565b005b6100ea6101ac565b6100ea61010236600461062a565b6101c0565b61010f600281565b60405160ff90911681526020016100b9565b6100ea61012f366004610645565b6101d1565b6000546201000090046001600160a01b03166100a5565b6100ea61015936600461062a565b610303565b6101666104cb565b60408051808201918290529060019060029082845b81548152602001906001019080831161017b575050505050905090565b6101a0610379565b6101a9816103da565b50565b6101b4610379565b6101be6000610422565b565b6101c8610379565b6101a98161047d565b600054600290610100900460ff161580156101f3575060005460ff8083169116105b61025b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556102886000546001600160a01b03620100009091041690565b6001600160a01b0316148061029c5750303b155b156102bc576102aa84610422565b6102b3836103da565b6102bc8261047d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b61030b610379565b6001600160a01b0381166103705760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610252565b6101a981610422565b6000546001600160a01b03620100009091041633146101be5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610252565b6103e760018260026104e9565b507f9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab1581604051610417919061053c565b60405180910390a150565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f490602001610417565b60405180604001604052806002906020820280368337509192915050565b8260028101928215610517579160200282015b828111156105175782518255916020019190600101906104fc565b50610523929150610527565b5090565b5b808211156105235760008155600101610528565b60408101818360005b6002811015610564578151835260209283019290910190600101610545565b50505092915050565b600082601f83011261057e57600080fd5b6040516040810181811067ffffffffffffffff821117156105af57634e487b7160e01b600052604160045260246000fd5b80604052508060408401858111156105c657600080fd5b845b818110156105e05780358352602092830192016105c8565b509195945050505050565b6000604082840312156105fd57600080fd5b610607838361056d565b9392505050565b80356001600160a01b038116811461062557600080fd5b919050565b60006020828403121561063c57600080fd5b6106078261060e565b60008060006080848603121561065a57600080fd5b6106638461060e565b9250610672856020860161056d565b91506106806060850161060e565b9050925092509256fea2646970667358221220d4b69e1f79868deff972c669c62c01ccfa63a6b030214293debea10ed567f04f64736f6c634300080e0033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063727b2d5c11610066578063727b2d5c146100f4578063754b377c1461010757806378cf75d7146101215780638da5cb5b14610134578063f2fde38b1461014b57600080fd5b806338cc48311461009857806359a80d0d146100c25780637098a5f4146100d7578063715018a6146100ec575b600080fd5b6003546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100ca61015e565b6040516100b9919061053c565b6100ea6100e53660046105eb565b610198565b005b6100ea6101ac565b6100ea61010236600461062a565b6101c0565b61010f600281565b60405160ff90911681526020016100b9565b6100ea61012f366004610645565b6101d1565b6000546201000090046001600160a01b03166100a5565b6100ea61015936600461062a565b610303565b6101666104cb565b60408051808201918290529060019060029082845b81548152602001906001019080831161017b575050505050905090565b6101a0610379565b6101a9816103da565b50565b6101b4610379565b6101be6000610422565b565b6101c8610379565b6101a98161047d565b600054600290610100900460ff161580156101f3575060005460ff8083169116105b61025b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556102886000546001600160a01b03620100009091041690565b6001600160a01b0316148061029c5750303b155b156102bc576102aa84610422565b6102b3836103da565b6102bc8261047d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b61030b610379565b6001600160a01b0381166103705760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610252565b6101a981610422565b6000546001600160a01b03620100009091041633146101be5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610252565b6103e760018260026104e9565b507f9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab1581604051610417919061053c565b60405180910390a150565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f490602001610417565b60405180604001604052806002906020820280368337509192915050565b8260028101928215610517579160200282015b828111156105175782518255916020019190600101906104fc565b50610523929150610527565b5090565b5b808211156105235760008155600101610528565b60408101818360005b6002811015610564578151835260209283019290910190600101610545565b50505092915050565b600082601f83011261057e57600080fd5b6040516040810181811067ffffffffffffffff821117156105af57634e487b7160e01b600052604160045260246000fd5b80604052508060408401858111156105c657600080fd5b845b818110156105e05780358352602092830192016105c8565b509195945050505050565b6000604082840312156105fd57600080fd5b610607838361056d565b9392505050565b80356001600160a01b038116811461062557600080fd5b919050565b60006020828403121561063c57600080fd5b6106078261060e565b60008060006080848603121561065a57600080fd5b6106638461060e565b9250610672856020860161056d565b91506106806060850161060e565b9050925092509256fea2646970667358221220d4b69e1f79868deff972c669c62c01ccfa63a6b030214293debea10ed567f04f64736f6c634300080e0033", diff --git a/deployments/sandboxPolygon/CommitmentMapperRegistryImplem.json b/deployments/mumbaiTestnet/CommitmentMapperRegistryImplem.json similarity index 93% rename from deployments/sandboxPolygon/CommitmentMapperRegistryImplem.json rename to deployments/mumbaiTestnet/CommitmentMapperRegistryImplem.json index 16be142..51400a7 100644 --- a/deployments/sandboxPolygon/CommitmentMapperRegistryImplem.json +++ b/deployments/mumbaiTestnet/CommitmentMapperRegistryImplem.json @@ -1,5 +1,5 @@ { - "address": "0x74CA5D99034F41f70F5870D7759FeA1D92A358b7", + "address": "0xbC457e93b213d7879e23E30C8873875Ed0668088", "abi": [ { "inputs": [ @@ -213,112 +213,112 @@ "type": "function" } ], - "transactionHash": "0x3b19d54c9fb944fd66faf0dacddd1a72b32ac6cd073a2d128530ddace942e432", + "transactionHash": "0x9bd9a08e4af1643ed1ea5e63f49cebb6b9bf8394a728c58cd07dfed7a83faee7", "receipt": { "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0x74CA5D99034F41f70F5870D7759FeA1D92A358b7", - "transactionIndex": 63, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xbC457e93b213d7879e23E30C8873875Ed0668088", + "transactionIndex": 17, "gasUsed": "520404", - "logsBloom": "0x00000000000000200000000000000008002000000000000000800000000000000000000000000000000000000000000000008000000020000000000004000000000000000000008000000000000400800001000000000000000100000000000000000000020000000000000000000800000000010000000084000000000800400000000000010000000000100000000000000000000080000000000000000000200001000000000000000000000400000000001000000000000000000000004000000004000000000001000000040000000000000000800000100004000020000000100000000000000000000000000000000000000000000000000000100000", - "blockHash": "0x3a331ff61624d9d9430fe6bfb35c1431d8bb31a57ef50a816667b33ac5b0befc", - "transactionHash": "0x3b19d54c9fb944fd66faf0dacddd1a72b32ac6cd073a2d128530ddace942e432", + "logsBloom": "0x00000000000000020000000000000000000000400000000000800000000000000000000000000000000000000000000000008000000000000000000004000000000000000000008000000000000400800001000000000000000100000000000000000000020000000000000000000800000000000000000884000000000000400000000000000000000000000000000000000000000080000000000040000000200000000000000020000000000402000001000000000000000000000000004000008004000000000001000000040000000000000000000000100000000020000000100000000020000000000000000000000000000000000000000000100000", + "blockHash": "0x225e98dab37cca45de88d005472ff63f978916450abc1faf4c8bf801f40e5f4c", + "transactionHash": "0x9bd9a08e4af1643ed1ea5e63f49cebb6b9bf8394a728c58cd07dfed7a83faee7", "logs": [ { - "transactionIndex": 63, - "blockNumber": 36626447, - "transactionHash": "0x3b19d54c9fb944fd66faf0dacddd1a72b32ac6cd073a2d128530ddace942e432", - "address": "0x74CA5D99034F41f70F5870D7759FeA1D92A358b7", + "transactionIndex": 17, + "blockNumber": 29772017, + "transactionHash": "0x9bd9a08e4af1643ed1ea5e63f49cebb6b9bf8394a728c58cd07dfed7a83faee7", + "address": "0xbC457e93b213d7879e23E30C8873875Ed0668088", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 302, - "blockHash": "0x3a331ff61624d9d9430fe6bfb35c1431d8bb31a57ef50a816667b33ac5b0befc" + "logIndex": 61, + "blockHash": "0x225e98dab37cca45de88d005472ff63f978916450abc1faf4c8bf801f40e5f4c" }, { - "transactionIndex": 63, - "blockNumber": 36626447, - "transactionHash": "0x3b19d54c9fb944fd66faf0dacddd1a72b32ac6cd073a2d128530ddace942e432", - "address": "0x74CA5D99034F41f70F5870D7759FeA1D92A358b7", + "transactionIndex": 17, + "blockNumber": 29772017, + "transactionHash": "0x9bd9a08e4af1643ed1ea5e63f49cebb6b9bf8394a728c58cd07dfed7a83faee7", + "address": "0xbC457e93b213d7879e23E30C8873875Ed0668088", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x000000000000000000000000aee4acd5c4bf516330ca8fe11b07206fc6709294" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 303, - "blockHash": "0x3a331ff61624d9d9430fe6bfb35c1431d8bb31a57ef50a816667b33ac5b0befc" + "logIndex": 62, + "blockHash": "0x225e98dab37cca45de88d005472ff63f978916450abc1faf4c8bf801f40e5f4c" }, { - "transactionIndex": 63, - "blockNumber": 36626447, - "transactionHash": "0x3b19d54c9fb944fd66faf0dacddd1a72b32ac6cd073a2d128530ddace942e432", - "address": "0x74CA5D99034F41f70F5870D7759FeA1D92A358b7", + "transactionIndex": 17, + "blockNumber": 29772017, + "transactionHash": "0x9bd9a08e4af1643ed1ea5e63f49cebb6b9bf8394a728c58cd07dfed7a83faee7", + "address": "0xbC457e93b213d7879e23E30C8873875Ed0668088", "topics": [ "0x9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab15" ], "data": "0x0c6c16efc72c198f4549bd069f1e57f091885234b9c140286d80ef431151d64412c54731563d974ead25d469d2263fdf0e230d5a09f6cd40a06e60210610d642", - "logIndex": 304, - "blockHash": "0x3a331ff61624d9d9430fe6bfb35c1431d8bb31a57ef50a816667b33ac5b0befc" + "logIndex": 63, + "blockHash": "0x225e98dab37cca45de88d005472ff63f978916450abc1faf4c8bf801f40e5f4c" }, { - "transactionIndex": 63, - "blockNumber": 36626447, - "transactionHash": "0x3b19d54c9fb944fd66faf0dacddd1a72b32ac6cd073a2d128530ddace942e432", - "address": "0x74CA5D99034F41f70F5870D7759FeA1D92A358b7", + "transactionIndex": 17, + "blockNumber": 29772017, + "transactionHash": "0x9bd9a08e4af1643ed1ea5e63f49cebb6b9bf8394a728c58cd07dfed7a83faee7", + "address": "0xbC457e93b213d7879e23E30C8873875Ed0668088", "topics": [ "0xa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f4" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "logIndex": 305, - "blockHash": "0x3a331ff61624d9d9430fe6bfb35c1431d8bb31a57ef50a816667b33ac5b0befc" + "logIndex": 64, + "blockHash": "0x225e98dab37cca45de88d005472ff63f978916450abc1faf4c8bf801f40e5f4c" }, { - "transactionIndex": 63, - "blockNumber": 36626447, - "transactionHash": "0x3b19d54c9fb944fd66faf0dacddd1a72b32ac6cd073a2d128530ddace942e432", - "address": "0x74CA5D99034F41f70F5870D7759FeA1D92A358b7", + "transactionIndex": 17, + "blockNumber": 29772017, + "transactionHash": "0x9bd9a08e4af1643ed1ea5e63f49cebb6b9bf8394a728c58cd07dfed7a83faee7", + "address": "0xbC457e93b213d7879e23E30C8873875Ed0668088", "topics": [ "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000002", - "logIndex": 306, - "blockHash": "0x3a331ff61624d9d9430fe6bfb35c1431d8bb31a57ef50a816667b33ac5b0befc" + "logIndex": 65, + "blockHash": "0x225e98dab37cca45de88d005472ff63f978916450abc1faf4c8bf801f40e5f4c" }, { - "transactionIndex": 63, - "blockNumber": 36626447, - "transactionHash": "0x3b19d54c9fb944fd66faf0dacddd1a72b32ac6cd073a2d128530ddace942e432", + "transactionIndex": 17, + "blockNumber": 29772017, + "transactionHash": "0x9bd9a08e4af1643ed1ea5e63f49cebb6b9bf8394a728c58cd07dfed7a83faee7", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x00000000000000000000000072f93a2740e00112d5f2cef404c0aa16fae21fa4" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" ], - "data": "0x00000000000000000000000000000000000000000000000000396de976530804000000000000000000000000000000000000000000000000b459f165559b4e340000000000000000000000000000000000000000000017e57a16a108d61aacbd000000000000000000000000000000000000000000000000b420837bdf4846300000000000000000000000000000000000000000000017e57a500ef24c6db4c1", - "logIndex": 307, - "blockHash": "0x3a331ff61624d9d9430fe6bfb35c1431d8bb31a57ef50a816667b33ac5b0befc" + "data": "0x0000000000000000000000000000000000000000000000000002c5f4ff470a580000000000000000000000000000000000000000000000001b8f359ad5d9444300000000000000000000000000000000000000000000187b061e992745670c730000000000000000000000000000000000000000000000001b8c6fa5d69239eb00000000000000000000000000000000000000000000187b06215f1c44ae16cb", + "logIndex": 66, + "blockHash": "0x225e98dab37cca45de88d005472ff63f978916450abc1faf4c8bf801f40e5f4c" } ], - "blockNumber": 36626447, - "cumulativeGasUsed": "11990954", + "blockNumber": 29772017, + "cumulativeGasUsed": "5726895", "status": 1, "byzantium": true }, "args": [ - "0xaee4acd5c4Bf516330ca8fe11B07206fC6709294", + "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", [ "0x0c6c16efc72c198f4549bd069f1e57f091885234b9c140286d80ef431151d644", "0x12c54731563d974ead25d469d2263fdf0e230d5a09f6cd40a06e60210610d642" ], "0x0000000000000000000000000000000000000000" ], - "numDeployments": 2, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentMapperEdDSAPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"pubKey\",\"type\":\"uint256[2]\"}],\"name\":\"PubKeyNotValid\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"UpdatedCommitmentMapperAddress\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256[2]\",\"name\":\"newEdDSAPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"UpdatedCommitmentMapperEdDSAPubKey\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAddress\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getEdDSAPubKey\",\"outputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"\",\"type\":\"uint256[2]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentMapperEdDSAPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAddress\",\"type\":\"address\"}],\"name\":\"updateCommitmentMapperAddress\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"newEdDSAPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"updateCommitmentMapperEdDSAPubKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"constructor\":{\"details\":\"Constructor\",\"params\":{\"commitmentMapperAddress\":\"Address of the commitment mapper\",\"commitmentMapperEdDSAPubKey\":\"EdDSA public key of the commitment mapper\",\"owner\":\"Owner of the contract, can update public key and address\"}},\"getAddress()\":{\"details\":\"Getter of the address of the commitment mapper\"},\"getEdDSAPubKey()\":{\"details\":\"Getter of the EdDSA public key of the commitment mapper\"},\"initialize(address,uint256[2],address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"commitmentMapperAddress\":\"Address of the commitment mapper\",\"commitmentMapperEdDSAPubKey\":\"EdDSA public key of the commitment mapper\",\"ownerAddress\":\"Owner of the contract, can update public key and address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"},\"updateCommitmentMapperAddress(address)\":{\"details\":\"Updates the address\",\"params\":{\"newAddress\":\"new address\"}},\"updateCommitmentMapperEdDSAPubKey(uint256[2])\":{\"details\":\"Updates the EdDSA public key\",\"params\":{\"newEdDSAPubKey\":\"new EdDSA pubic key\"}}},\"title\":\"Commitment Mapper Registry Contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(address,uint256[2],address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"This contract stores information about the commitment mapper. Its ethereum address and its EdDSA public key For more information: https://commitment-mapper.docs.sismo.io*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":\"CommitmentMapperRegistry\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address ownerAddress,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0x1b6ab7a4ba266f3da2c7f6ba3de93e3ab89f389dbd6db14514b43cbdcbe9fe09\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0xcb419cf389baad6f38de28625718f64f551d2669339c1b4e1887e11d62484469\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x60806040523480156200001157600080fd5b5060405162000abe38038062000abe833981016040819052620000349162000313565b6200003f3362000055565b6200004c838383620000b0565b505050620003ef565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600290610100900460ff16158015620000d3575060005460ff8083169116105b6200013b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff831617610100178155620001686000546201000090046001600160a01b031690565b6001600160a01b031614806200017d5750303b155b15620001a4576200018e8462000055565b6200019983620001eb565b620001a48262000237565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b620001fa600182600262000286565b507f9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab15816040516200022c9190620003bc565b60405180910390a150565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f4906020016200022c565b8260028101928215620002b7579160200282015b82811115620002b75782518255916020019190600101906200029a565b50620002c5929150620002c9565b5090565b5b80821115620002c55760008155600101620002ca565b80516001600160a01b0381168114620002f857600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b6000806000608084860312156200032957600080fd5b6200033484620002e0565b9250602085603f8601126200034857600080fd5b604080519081016001600160401b03811182821017156200036d576200036d620002fd565b6040528060608701888111156200038357600080fd5b8388015b81811015620003a0578051835291840191840162000387565b50829550620003af81620002e0565b9450505050509250925092565b60408101818360005b6002811015620003e6578151835260209283019290910190600101620003c5565b50505092915050565b6106bf80620003ff6000396000f3fe608060405234801561001057600080fd5b50600436106100935760003560e01c8063727b2d5c11610066578063727b2d5c146100f4578063754b377c1461010757806378cf75d7146101215780638da5cb5b14610134578063f2fde38b1461014b57600080fd5b806338cc48311461009857806359a80d0d146100c25780637098a5f4146100d7578063715018a6146100ec575b600080fd5b6003546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100ca61015e565b6040516100b9919061053c565b6100ea6100e53660046105eb565b610198565b005b6100ea6101ac565b6100ea61010236600461062a565b6101c0565b61010f600281565b60405160ff90911681526020016100b9565b6100ea61012f366004610645565b6101d1565b6000546201000090046001600160a01b03166100a5565b6100ea61015936600461062a565b610303565b6101666104cb565b60408051808201918290529060019060029082845b81548152602001906001019080831161017b575050505050905090565b6101a0610379565b6101a9816103da565b50565b6101b4610379565b6101be6000610422565b565b6101c8610379565b6101a98161047d565b600054600290610100900460ff161580156101f3575060005460ff8083169116105b61025b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556102886000546001600160a01b03620100009091041690565b6001600160a01b0316148061029c5750303b155b156102bc576102aa84610422565b6102b3836103da565b6102bc8261047d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b61030b610379565b6001600160a01b0381166103705760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610252565b6101a981610422565b6000546001600160a01b03620100009091041633146101be5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610252565b6103e760018260026104e9565b507f9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab1581604051610417919061053c565b60405180910390a150565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f490602001610417565b60405180604001604052806002906020820280368337509192915050565b8260028101928215610517579160200282015b828111156105175782518255916020019190600101906104fc565b50610523929150610527565b5090565b5b808211156105235760008155600101610528565b60408101818360005b6002811015610564578151835260209283019290910190600101610545565b50505092915050565b600082601f83011261057e57600080fd5b6040516040810181811067ffffffffffffffff821117156105af57634e487b7160e01b600052604160045260246000fd5b80604052508060408401858111156105c657600080fd5b845b818110156105e05780358352602092830192016105c8565b509195945050505050565b6000604082840312156105fd57600080fd5b610607838361056d565b9392505050565b80356001600160a01b038116811461062557600080fd5b919050565b60006020828403121561063c57600080fd5b6106078261060e565b60008060006080848603121561065a57600080fd5b6106638461060e565b9250610672856020860161056d565b91506106806060850161060e565b9050925092509256fea2646970667358221220d4b69e1f79868deff972c669c62c01ccfa63a6b030214293debea10ed567f04f64736f6c634300080e0033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100935760003560e01c8063727b2d5c11610066578063727b2d5c146100f4578063754b377c1461010757806378cf75d7146101215780638da5cb5b14610134578063f2fde38b1461014b57600080fd5b806338cc48311461009857806359a80d0d146100c25780637098a5f4146100d7578063715018a6146100ec575b600080fd5b6003546001600160a01b03165b6040516001600160a01b0390911681526020015b60405180910390f35b6100ca61015e565b6040516100b9919061053c565b6100ea6100e53660046105eb565b610198565b005b6100ea6101ac565b6100ea61010236600461062a565b6101c0565b61010f600281565b60405160ff90911681526020016100b9565b6100ea61012f366004610645565b6101d1565b6000546201000090046001600160a01b03166100a5565b6100ea61015936600461062a565b610303565b6101666104cb565b60408051808201918290529060019060029082845b81548152602001906001019080831161017b575050505050905090565b6101a0610379565b6101a9816103da565b50565b6101b4610379565b6101be6000610422565b565b6101c8610379565b6101a98161047d565b600054600290610100900460ff161580156101f3575060005460ff8083169116105b61025b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556102886000546001600160a01b03620100009091041690565b6001600160a01b0316148061029c5750303b155b156102bc576102aa84610422565b6102b3836103da565b6102bc8261047d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a150505050565b61030b610379565b6001600160a01b0381166103705760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610252565b6101a981610422565b6000546001600160a01b03620100009091041633146101be5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610252565b6103e760018260026104e9565b507f9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab1581604051610417919061053c565b60405180910390a150565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600380546001600160a01b0319166001600160a01b0383169081179091556040519081527fa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f490602001610417565b60405180604001604052806002906020820280368337509192915050565b8260028101928215610517579160200282015b828111156105175782518255916020019190600101906104fc565b50610523929150610527565b5090565b5b808211156105235760008155600101610528565b60408101818360005b6002811015610564578151835260209283019290910190600101610545565b50505092915050565b600082601f83011261057e57600080fd5b6040516040810181811067ffffffffffffffff821117156105af57634e487b7160e01b600052604160045260246000fd5b80604052508060408401858111156105c657600080fd5b845b818110156105e05780358352602092830192016105c8565b509195945050505050565b6000604082840312156105fd57600080fd5b610607838361056d565b9392505050565b80356001600160a01b038116811461062557600080fd5b919050565b60006020828403121561063c57600080fd5b6106078261060e565b60008060006080848603121561065a57600080fd5b6106638461060e565b9250610672856020860161056d565b91506106806060850161060e565b9050925092509256fea2646970667358221220d4b69e1f79868deff972c669c62c01ccfa63a6b030214293debea10ed567f04f64736f6c634300080e0033", diff --git a/deployments/mumbaiTestnet/CommitmentMapperRegistryProxy.json b/deployments/mumbaiTestnet/CommitmentMapperRegistryProxy.json new file mode 100644 index 0000000..3182733 --- /dev/null +++ b/deployments/mumbaiTestnet/CommitmentMapperRegistryProxy.json @@ -0,0 +1,300 @@ +{ + "address": "0xE6C1f01C71A184A44A21B10A7FBEb3b1604B4f2a", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x93935e55e0a649a5bc481eb9f16d8d3586d8fafdbcc0c1211f4aaf534609abbd", + "receipt": { + "to": null, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xE6C1f01C71A184A44A21B10A7FBEb3b1604B4f2a", + "transactionIndex": 8, + "gasUsed": "664040", + "logsBloom": "0x0000000000000002000000000000000040000000000000000080000000000000000000000000000000000000000000000000800000000000000000000400000000000000000000800000000000040280010100000000000000010000000000000000000002000000000000000020080000000080000000008400000000000040000000000000000000000000000000000000000000008000000000004080000020000000000000002000000000040200000100000000000000000040000000400000c024000000000001000000040000000000000400000000100000000020000000100800000000000000000000000000000000000000000000000000180000", + "blockHash": "0x60120e4cca69cd652de0fa9872744b30ce2f21e248b6ac3d216b17f919e2563d", + "transactionHash": "0x93935e55e0a649a5bc481eb9f16d8d3586d8fafdbcc0c1211f4aaf534609abbd", + "logs": [ + { + "transactionIndex": 8, + "blockNumber": 29772021, + "transactionHash": "0x93935e55e0a649a5bc481eb9f16d8d3586d8fafdbcc0c1211f4aaf534609abbd", + "address": "0xE6C1f01C71A184A44A21B10A7FBEb3b1604B4f2a", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000bc457e93b213d7879e23e30c8873875ed0668088" + ], + "data": "0x", + "logIndex": 44, + "blockHash": "0x60120e4cca69cd652de0fa9872744b30ce2f21e248b6ac3d216b17f919e2563d" + }, + { + "transactionIndex": 8, + "blockNumber": 29772021, + "transactionHash": "0x93935e55e0a649a5bc481eb9f16d8d3586d8fafdbcc0c1211f4aaf534609abbd", + "address": "0xE6C1f01C71A184A44A21B10A7FBEb3b1604B4f2a", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" + ], + "data": "0x", + "logIndex": 45, + "blockHash": "0x60120e4cca69cd652de0fa9872744b30ce2f21e248b6ac3d216b17f919e2563d" + }, + { + "transactionIndex": 8, + "blockNumber": 29772021, + "transactionHash": "0x93935e55e0a649a5bc481eb9f16d8d3586d8fafdbcc0c1211f4aaf534609abbd", + "address": "0xE6C1f01C71A184A44A21B10A7FBEb3b1604B4f2a", + "topics": [ + "0x9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab15" + ], + "data": "0x0c6c16efc72c198f4549bd069f1e57f091885234b9c140286d80ef431151d64412c54731563d974ead25d469d2263fdf0e230d5a09f6cd40a06e60210610d642", + "logIndex": 46, + "blockHash": "0x60120e4cca69cd652de0fa9872744b30ce2f21e248b6ac3d216b17f919e2563d" + }, + { + "transactionIndex": 8, + "blockNumber": 29772021, + "transactionHash": "0x93935e55e0a649a5bc481eb9f16d8d3586d8fafdbcc0c1211f4aaf534609abbd", + "address": "0xE6C1f01C71A184A44A21B10A7FBEb3b1604B4f2a", + "topics": [ + "0xa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f4" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000000", + "logIndex": 47, + "blockHash": "0x60120e4cca69cd652de0fa9872744b30ce2f21e248b6ac3d216b17f919e2563d" + }, + { + "transactionIndex": 8, + "blockNumber": 29772021, + "transactionHash": "0x93935e55e0a649a5bc481eb9f16d8d3586d8fafdbcc0c1211f4aaf534609abbd", + "address": "0xE6C1f01C71A184A44A21B10A7FBEb3b1604B4f2a", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000002", + "logIndex": 48, + "blockHash": "0x60120e4cca69cd652de0fa9872744b30ce2f21e248b6ac3d216b17f919e2563d" + }, + { + "transactionIndex": 8, + "blockNumber": 29772021, + "transactionHash": "0x93935e55e0a649a5bc481eb9f16d8d3586d8fafdbcc0c1211f4aaf534609abbd", + "address": "0xE6C1f01C71A184A44A21B10A7FBEb3b1604B4f2a", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002110475dfbb8d331b300178a867372991ff35fa3", + "logIndex": 49, + "blockHash": "0x60120e4cca69cd652de0fa9872744b30ce2f21e248b6ac3d216b17f919e2563d" + }, + { + "transactionIndex": 8, + "blockNumber": 29772021, + "transactionHash": "0x93935e55e0a649a5bc481eb9f16d8d3586d8fafdbcc0c1211f4aaf534609abbd", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" + ], + "data": "0x000000000000000000000000000000000000000000000000000389e94a6f76180000000000000000000000000000000000000000000000001b8c6fa5d60b3bd700000000000000000000000000000000000000000000187b065275df5bc472820000000000000000000000000000000000000000000000001b88e5bc8b9bc5bf00000000000000000000000000000000000000000000187b0655ffc8a633e89a", + "logIndex": 50, + "blockHash": "0x60120e4cca69cd652de0fa9872744b30ce2f21e248b6ac3d216b17f919e2563d" + } + ], + "blockNumber": 29772021, + "cumulativeGasUsed": "2558845", + "status": 1, + "byzantium": true + }, + "args": [ + "0xbC457e93b213d7879e23E30C8873875Ed0668088", + "0x2110475dfbB8d331b300178A867372991ff35fA3", + "0x78cf75d7000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed0c6c16efc72c198f4549bd069f1e57f091885234b9c140286d80ef431151d64412c54731563d974ead25d469d2263fdf0e230d5a09f6cd40a06e60210610d6420000000000000000000000000000000000000000000000000000000000000000" + ], + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", + "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(\\n address newImplementation,\\n bytes calldata data\\n ) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x1663761dc98da7a84e6570b428877de7de9859e34f99c7002cad71ccfc9d6283\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405162000eeb38038062000eeb8339810160408190526200002691620004ed565b828162000036828260006200009a565b5062000066905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005cd565b60008051602062000ea483398151915214620000865762000086620005f3565b6200009182620000d7565b5050506200065c565b620000a58362000132565b600082511180620000b35750805b15620000d257620000d083836200017460201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f62000102620001a3565b604080516001600160a01b03928316815291841660208301520160405180910390a16200012f81620001dc565b50565b6200013d8162000291565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606200019c838360405180606001604052806027815260200162000ec46027913962000345565b9392505050565b6000620001cd60008051602062000ea483398151915260001b620003c460201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002475760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b806200027060008051602062000ea483398151915260001b620003c460201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002a781620003c760201b6200025a1760201c565b6200030b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200023e565b80620002707f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b620003c460201b620001ea1760201c565b6060600080856001600160a01b03168560405162000364919062000609565b600060405180830381855af49150503d8060008114620003a1576040519150601f19603f3d011682016040523d82523d6000602084013e620003a6565b606091505b509092509050620003ba86838387620003d6565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200044a57825160000362000442576001600160a01b0385163b620004425760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016200023e565b508162000456565b6200045683836200045e565b949350505050565b8151156200046f5781518083602001fd5b8060405162461bcd60e51b81526004016200023e919062000627565b80516001600160a01b0381168114620004a357600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004db578181015183820152602001620004c1565b83811115620000d05750506000910152565b6000806000606084860312156200050357600080fd5b6200050e846200048b565b92506200051e602085016200048b565b60408501519092506001600160401b03808211156200053c57600080fd5b818601915086601f8301126200055157600080fd5b815181811115620005665762000566620004a8565b604051601f8201601f19908116603f01168101908382118183101715620005915762000591620004a8565b81604052828152896020848701011115620005ab57600080fd5b620005be836020830160208801620004be565b80955050505050509250925092565b600082821015620005ee57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b600082516200061d818460208701620004be565b9190910192915050565b602081526000825180602084015262000648816040850160208701620004be565b601f01601f19169190910160400192915050565b610838806200066c6000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106c2565b610118565b61005b6100933660046106dd565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106c2565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107dc602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd610456565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b6103688361047e565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a816104be565b6060600080856001600160a01b0316856040516103fb919061078c565b600060405180830381855af49150503d8060008114610436576040519150601f19603f3d011682016040523d82523d6000602084013e61043b565b606091505b509150915061044c86838387610567565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b610487816105e8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105235760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105d65782516000036105cf576001600160a01b0385163b6105cf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102f5565b50816105e0565b6105e0838361067c565b949350505050565b6001600160a01b0381163b6106555760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610546565b81511561068c5781518083602001fd5b8060405162461bcd60e51b81526004016102f591906107a8565b80356001600160a01b03811681146106bd57600080fd5b919050565b6000602082840312156106d457600080fd5b610253826106a6565b6000806000604084860312156106f257600080fd5b6106fb846106a6565b9250602084013567ffffffffffffffff8082111561071857600080fd5b818601915086601f83011261072c57600080fd5b81358181111561073b57600080fd5b87602082850101111561074d57600080fd5b6020830194508093505050509250925092565b60005b8381101561077b578181015183820152602001610763565b838111156103845750506000910152565b6000825161079e818460208701610760565b9190910192915050565b60208152600082518060208401526107c7816040850160208701610760565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e2b2f80d01b9fee1887f086f33ea33eabe6a896123f3722976ea73e069c365b664736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106c2565b610118565b61005b6100933660046106dd565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106c2565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107dc602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd610456565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b6103688361047e565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a816104be565b6060600080856001600160a01b0316856040516103fb919061078c565b600060405180830381855af49150503d8060008114610436576040519150601f19603f3d011682016040523d82523d6000602084013e61043b565b606091505b509150915061044c86838387610567565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b610487816105e8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105235760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105d65782516000036105cf576001600160a01b0385163b6105cf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102f5565b50816105e0565b6105e0838361067c565b949350505050565b6001600160a01b0381163b6106555760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610546565b81511561068c5781518083602001fd5b8060405162461bcd60e51b81526004016102f591906107a8565b80356001600160a01b03811681146106bd57600080fd5b919050565b6000602082840312156106d457600080fd5b610253826106a6565b6000806000604084860312156106f257600080fd5b6106fb846106a6565b9250602084013567ffffffffffffffff8082111561071857600080fd5b818601915086601f83011261072c57600080fd5b81358181111561073b57600080fd5b87602082850101111561074d57600080fd5b6020830194508093505050509250925092565b60005b8381101561077b578181015183820152602001610763565b838111156103845750506000910152565b6000825161079e818460208701610760565b9190910192915050565b60208152600082518060208401526107c7816040850160208701610760565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e2b2f80d01b9fee1887f086f33ea33eabe6a896123f3722976ea73e069c365b664736f6c634300080e0033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/sandboxPolygon/Front.json b/deployments/mumbaiTestnet/Front.json similarity index 67% rename from deployments/sandboxPolygon/Front.json rename to deployments/mumbaiTestnet/Front.json index cb5b5e2..f04b5f1 100644 --- a/deployments/sandboxPolygon/Front.json +++ b/deployments/mumbaiTestnet/Front.json @@ -1,5 +1,5 @@ { - "address": "0xfC6f6b50B9Ee651B73B481E2cd221aFffc26a5E4", + "address": "0xcAf720C39bcdF47476aDc0618e6d7B57B7533213", "abi": [ { "inputs": [ @@ -430,46 +430,46 @@ "type": "function" } ], - "transactionHash": "0xfc0d4a8674abc716a6b42e21b3b0cc239542fe95dedc0d4f0ede26a710955db5", + "transactionHash": "0xf263a9f036cf3381681ef07acd8d101533649b6d5206468724d2821f3a783156", "receipt": { "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0xbC356247570B2584E567F7eF7a54e09Ec668400B", - "transactionIndex": 22, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0x401A6641AC660678C1c0d8b5D03a9e90F5f70D81", + "transactionIndex": 24, "gasUsed": "954922", - "logsBloom": "0x00000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000200000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000100000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000004000000100000000000001000000000000000000000000000000100004000000002000000000000000000000000000000000000000000000000000000000100000", - "blockHash": "0x7482f2e8f148bc6b333a0ec8f80a4c42fc0c167281e2aa4611225afbbc4a9aa5", - "transactionHash": "0xfc0d4a8674abc716a6b42e21b3b0cc239542fe95dedc0d4f0ede26a710955db5", + "logsBloom": "0x00000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000040000000200000000000000020000000000002000001000000000000000000000000004000008000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x2df3420c8b41e6814227d597d2cfc54d2855b1968cfdc5bb29f4f3a2102c6cb5", + "transactionHash": "0xf263a9f036cf3381681ef07acd8d101533649b6d5206468724d2821f3a783156", "logs": [ { - "transactionIndex": 22, - "blockNumber": 32513060, - "transactionHash": "0xfc0d4a8674abc716a6b42e21b3b0cc239542fe95dedc0d4f0ede26a710955db5", + "transactionIndex": 24, + "blockNumber": 29771761, + "transactionHash": "0xf263a9f036cf3381681ef07acd8d101533649b6d5206468724d2821f3a783156", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x0000000000000000000000001efecb61a2f80aa34d3b9218b564a64d05946290" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" ], - "data": "0x0000000000000000000000000000000000000000000000000133d73b80fc63440000000000000000000000000000000000000000000000002b5dd4217636d9a60000000000000000000000000000000000000000000008b0ebc0f6cc993110eb0000000000000000000000000000000000000000000000002a29fce5f53a76620000000000000000000000000000000000000000000008b0ecf4ce081a2d742f", - "logIndex": 70, - "blockHash": "0x7482f2e8f148bc6b333a0ec8f80a4c42fc0c167281e2aa4611225afbbc4a9aa5" + "data": "0x000000000000000000000000000000000000000000000000000516bea7ab6d580000000000000000000000000000000000000000000000001b9e20e188449f8d00000000000000000000000000000000000000000000187ae4e0c455b3f59d7a0000000000000000000000000000000000000000000000001b990a22e099323500000000000000000000000000000000000000000000187ae4e5db145ba10ad2", + "logIndex": 79, + "blockHash": "0x2df3420c8b41e6814227d597d2cfc54d2855b1968cfdc5bb29f4f3a2102c6cb5" } ], - "blockNumber": 32513060, - "cumulativeGasUsed": "3779507", + "blockNumber": 29771761, + "cumulativeGasUsed": "7780109", "status": 1, "byzantium": true }, "args": [ - "0xC999390A856e0633f945dD851DeeCE15b533ccA3" + "0xc24F86a8D9f82401b693d4FFaa1DCf3109d88524" ], - "numDeployments": 5, - "solcInputHash": "c872f238f220b3571ef309821a459203", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"DifferentRequestsDestinations\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"EarlyUserAttestationGenerated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ATTESTATIONS_REGISTRY\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EARLY_USER_BADGE_END_DATE\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EARLY_USER_COLLECTION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"attesters\",\"type\":\"address[]\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request[]\",\"name\":\"requests\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"proofDataArray\",\"type\":\"bytes[]\"}],\"name\":\"batchBuildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[][]\",\"name\":\"\",\"type\":\"tuple[][]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"attesters\",\"type\":\"address[]\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request[]\",\"name\":\"requests\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"proofDataArray\",\"type\":\"bytes[]\"}],\"name\":\"batchGenerateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[][]\",\"name\":\"\",\"type\":\"tuple[][]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"batchBuildAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])\":{\"details\":\"build the attestations from multiple user requests. Forwards to the build function of targeted attester\",\"params\":{\"attesters\":\"Targeted attesters\",\"proofDataArray\":\"Data sent along the request to prove its validity\",\"requests\":\"User requests\"},\"returns\":{\"_0\":\"attestations Attestations that will be recorded\"}},\"batchGenerateAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])\":{\"details\":\"generate multiple attestations at once, to the same destination, generates an early user attestation\",\"params\":{\"attesters\":\"Attesters targeted by the attesters\",\"proofDataArray\":\"Data sent with each request\",\"requests\":\"Requests sent to attester\"}},\"buildAttestations(address,((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"build the attestations from a user request targeting a specific attester. Forwards to the build function of targeted attester\",\"params\":{\"attester\":\"Targeted attester\",\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that will be recorded\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"attestationsRegistryAddress\":\"Attestations registry contract address\"}},\"generateAttestations(address,((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Forward a request to an attester and generates an early user attestation\",\"params\":{\"attester\":\"Attester targeted by the request\",\"proofData\":\"Data provided to the attester to back the request\",\"request\":\"Request sent to the attester\"}}},\"title\":\"Front\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This is the Front contract of the Sismo protocol Behind a proxy, it routes attestations request to the targeted attester and can perform some actions This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference For more information: https://front.docs.sismo.io\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/Front.sol\":\"Front\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/core/Front.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {IFront} from './interfaces/IFront.sol';\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation} from './libs/Structs.sol';\\n\\n/**\\n * @title Front\\n * @author Sismo\\n * @notice This is the Front contract of the Sismo protocol\\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\\n\\n * For more information: https://front.docs.sismo.io\\n */\\ncontract Front is IFront {\\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\\n uint256 public constant EARLY_USER_COLLECTION = 0;\\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress Attestations registry contract address\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Forward a request to an attester and generates an early user attestation\\n * @param attester Attester targeted by the request\\n * @param request Request sent to the attester\\n * @param proofData Data provided to the attester to back the request\\n */\\n function generateAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n Attestation[] memory attestations = _forwardAttestationsGeneration(\\n attester,\\n request,\\n proofData\\n );\\n _generateEarlyUserAttestation(request.destination);\\n return attestations;\\n }\\n\\n /**\\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\\n * @param attesters Attesters targeted by the attesters\\n * @param requests Requests sent to attester\\n * @param proofDataArray Data sent with each request\\n */\\n function batchGenerateAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external override returns (Attestation[][] memory) {\\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\\n address destination = requests[0].destination;\\n for (uint256 i = 0; i < attesters.length; i++) {\\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\\n attestations[i] = _forwardAttestationsGeneration(\\n attesters[i],\\n requests[i],\\n proofDataArray[i]\\n );\\n }\\n _generateEarlyUserAttestation(destination);\\n return attestations;\\n }\\n\\n /**\\n * @dev build the attestations from a user request targeting a specific attester.\\n * Forwards to the build function of targeted attester\\n * @param attester Targeted attester\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external view override returns (Attestation[] memory) {\\n return _forwardAttestationsBuild(attester, request, proofData);\\n }\\n\\n /**\\n * @dev build the attestations from multiple user requests.\\n * Forwards to the build function of targeted attester\\n * @param attesters Targeted attesters\\n * @param requests User requests\\n * @param proofDataArray Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function batchBuildAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external view override returns (Attestation[][] memory) {\\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\\n\\n for (uint256 i = 0; i < attesters.length; i++) {\\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\\n }\\n return attestations;\\n }\\n\\n function _forwardAttestationsBuild(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) internal view returns (Attestation[] memory) {\\n return IAttester(attester).buildAttestations(request, proofData);\\n }\\n\\n function _forwardAttestationsGeneration(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) internal returns (Attestation[] memory) {\\n return IAttester(attester).generateAttestations(request, proofData);\\n }\\n\\n function _generateEarlyUserAttestation(address destination) internal {\\n uint32 currentTimestamp = uint32(block.timestamp);\\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\\n EARLY_USER_COLLECTION,\\n destination\\n );\\n\\n if (!alreadyHasAttestation) {\\n Attestation[] memory attestations = new Attestation[](1);\\n attestations[0] = Attestation(\\n EARLY_USER_COLLECTION,\\n destination,\\n address(this),\\n 1,\\n currentTimestamp,\\n 'With strong love from Sismo'\\n );\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n emit EarlyUserAttestationGenerated(destination);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3ea2112c22a36ff318873f1f015fa9e3b447e93d33464ae81b9bcd7d0f917621\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param attestations Attestations to be deleted\\n */\\n function deleteAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xb5e25bd7e0372c9973e582fb7fe96318c145831a5452d8c79eb848a7464b0297\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/interfaces/IFront.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\n\\n/**\\n * @title IFront\\n * @author Sismo\\n * @notice This is the interface of the Front Contract\\n */\\ninterface IFront {\\n error DifferentRequestsDestinations();\\n event EarlyUserAttestationGenerated(address destination);\\n\\n /**\\n * @dev Forward a request to an attester and generates an early user attestation\\n * @param attester Attester targeted by the request\\n * @param request Request sent to the attester\\n * @param proofData Data provided to the attester to back the request\\n */\\n function generateAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev generate multiple attestations at once, to the same destination\\n * @param attesters Attesters targeted by the attesters\\n * @param requests Requests sent to attester\\n * @param proofDataArray Data sent with each request\\n */\\n function batchGenerateAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external returns (Attestation[][] memory);\\n\\n /**\\n * @dev build the attestations from a user request targeting a specific attester.\\n * Forwards to the build function of targeted attester\\n * @param attester Targeted attester\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev build the attestations from multiple user requests.\\n * Forwards to the build function(s) of targeted attester(s)\\n * @param attesters Targeted attesters\\n * @param requests User requests\\n * @param proofDataArray Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function batchBuildAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external view returns (Attestation[][] memory);\\n}\\n\",\"keccak256\":\"0xfeab84e36830c432f91d0cbe1beb430331529829ce667a6371fbad47baa12191\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b506040516110e43803806110e483398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161104b610099600039600081816101020152818161051901526106bd015261104b6000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806389a504771161005b57806389a50477146100e7578063ac9d6541146100fd578063aebddc691461013c578063c0a92c911461014f57600080fd5b80630a60387d14610082578063369b88be146100a75780633ee490ce146100c7575b600080fd5b61008d6363226b0081565b60405163ffffffff90911681526020015b60405180910390f35b6100ba6100b5366004610805565b610162565b60405161009e91906108cf565b6100da6100d5366004610a0d565b61031d565b60405161009e9190610ab9565b6100ef600081565b60405190815260200161009e565b6101247f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161009e565b6100da61014a366004610a0d565b610350565b6100ba61015d366004610805565b61035e565b606060008667ffffffffffffffff81111561017f5761017f610b84565b6040519080825280602002602001820160405280156101b257816020015b606081526020019060019003908161019d5790505b5090506000868660008181106101ca576101ca610b9a565b90506020028101906101dc9190610bb0565b6101ed906040810190602001610bd0565b905060005b8881101561030757816001600160a01b031688888381811061021657610216610b9a565b90506020028101906102289190610bb0565b610239906040810190602001610bd0565b6001600160a01b0316146102605760405163f1b973df60e01b815260040160405180910390fd5b6102d78a8a8381811061027557610275610b9a565b905060200201602081019061028a9190610bd0565b89898481811061029c5761029c610b9a565b90506020028101906102ae9190610bb0565b8888858181106102c0576102c0610b9a565b90506020028101906102d29190610bf4565b610463565b8382815181106102e9576102e9610b9a565b602002602001018190525080806102ff90610c3b565b9150506101f2565b50610311816104dd565b50979650505050505050565b6060600061032d86868686610463565b90506103476103426040870160208801610bd0565b6104dd565b95945050505050565b606061034785858585610769565b606060008667ffffffffffffffff81111561037b5761037b610b84565b6040519080825280602002602001820160405280156103ae57816020015b60608152602001906001900390816103995790505b50905060005b87811015610311576104338989838181106103d1576103d1610b9a565b90506020020160208101906103e69190610bd0565b8888848181106103f8576103f8610b9a565b905060200281019061040a9190610bb0565b87878581811061041c5761041c610b9a565b905060200281019061042e9190610bf4565b610769565b82828151811061044557610445610b9a565b6020026020010181905250808061045b90610c3b565b9150506103b4565b60405163e60f999f60e01b81526060906001600160a01b0386169063e60f999f9061049690879087908790600401610c8b565b6000604051808303816000875af11580156104b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103479190810190610e9d565b426363226b0063ffffffff82161015610765576040516211023960e41b81526000600482018190526001600160a01b03848116602484015290917f0000000000000000000000000000000000000000000000000000000000000000909116906301102390906044016020604051808303816000875af1158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190610ff3565b90508061076357604080516001808252818301909252600091816020015b6105f76040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816105a65790505090506040518060c0016040528060008152602001856001600160a01b03168152602001306001600160a01b03168152602001600181526020018463ffffffff1681526020016040518060400160405280601b81526020017f57697468207374726f6e67206c6f76652066726f6d205369736d6f00000000008152508152508160008151811061069b5761069b610b9a565b602090810291909101015260405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106f2908490600401610ab9565b600060405180830381600087803b15801561070c57600080fd5b505af1158015610720573d6000803e3d6000fd5b50506040516001600160a01b03871681527f65566f56ce57729c92989973ff6ac5bdd213f57bf75d7248c4190d6d3634738e9250602001905060405180910390a1505b505b5050565b604051630af411a360e41b81526060906001600160a01b0386169063af411a309061079c90879087908790600401610c8b565b600060405180830381865afa1580156104b5573d6000803e3d6000fd5b60008083601f8401126107cb57600080fd5b50813567ffffffffffffffff8111156107e357600080fd5b6020830191508360208260051b85010111156107fe57600080fd5b9250929050565b6000806000806000806060878903121561081e57600080fd5b863567ffffffffffffffff8082111561083657600080fd5b6108428a838b016107b9565b9098509650602089013591508082111561085b57600080fd5b6108678a838b016107b9565b9096509450604089013591508082111561088057600080fd5b5061088d89828a016107b9565b979a9699509497509295939492505050565b60005b838110156108ba5781810151838201526020016108a2565b838111156108c9576000848401525b50505050565b60208152600060208201835180825260408401915060408160051b8501016020860160005b838110156109d957868303603f19018552815180518085526020918201918086019190600582901b87010160005b828110156109bf57601f1980898403018552855180518452602081015160018060a01b03808216602087015280604084015116604087015250506060810151606085015263ffffffff608082015116608085015260a0810151905060c060a085015280518060c086015261099d8160e087016020850161089f565b6020978801979690960195601f019091169290920160e0019150600101610922565b5060209889019890965094909401935050506001016108f4565b50909695505050505050565b6001600160a01b03811681146109fa57600080fd5b50565b8035610a08816109e5565b919050565b60008060008060608587031215610a2357600080fd5b8435610a2e816109e5565b9350602085013567ffffffffffffffff80821115610a4b57600080fd5b9086019060408289031215610a5f57600080fd5b90935060408601359080821115610a7557600080fd5b818701915087601f830112610a8957600080fd5b813581811115610a9857600080fd5b886020828501011115610aaa57600080fd5b95989497505060200194505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610b7657888303603f19018552815180518452878101516001600160a01b03908116898601528782015116878501526060808201519085015260808082015163ffffffff169085015260a09081015160c091850182905280519185018290529060e090610b5681838801858d0161089f565b96890196601f01601f191694909401909301925090860190600101610ae0565b509098975050505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008235603e19833603018112610bc657600080fd5b9190910192915050565b600060208284031215610be257600080fd5b8135610bed816109e5565b9392505050565b6000808335601e19843603018112610c0b57600080fd5b83018035915067ffffffffffffffff821115610c2657600080fd5b6020019150368190038213156107fe57600080fd5b600060018201610c5b57634e487b7160e01b600052601160045260246000fd5b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006040808352608083018635601e19883603018112610caa57600080fd5b87018035602080830167ffffffffffffffff80841115610cc957600080fd5b8360051b803603831315610cdc57600080fd5b878a018890529584905260a09589018601956000908a01607e1936889003015b86831015610d96578b8903609f190182528435818112610d1b57600080fd5b8801868101358a528a8101358a88015260608082013536839003603e19018112610d4457600080fd5b9091018b8101919088013586811115610d5c57600080fd5b803603831315610d6b57600080fd5b818d8d0152610d7d828d018285610c62565b9b50505094860194506001929092019190850190610cfc565b5050505050610da6818b016109fd565b6001600160a01b0381166060890152945086840381880152505050610dcc818688610c62565b979650505050505050565b60405160c0810167ffffffffffffffff81118282101715610dfa57610dfa610b84565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e2957610e29610b84565b604052919050565b600082601f830112610e4257600080fd5b815167ffffffffffffffff811115610e5c57610e5c610b84565b610e6f601f8201601f1916602001610e00565b818152846020838601011115610e8457600080fd5b610e9582602083016020870161089f565b949350505050565b60006020808385031215610eb057600080fd5b825167ffffffffffffffff80821115610ec857600080fd5b818501915085601f830112610edc57600080fd5b815181811115610eee57610eee610b84565b8060051b610efd858201610e00565b9182528381018501918581019089841115610f1757600080fd5b86860192505b83831015610fe657825185811115610f355760008081fd5b860160c0818c03601f1901811315610f4d5760008081fd5b610f55610dd7565b898301518152604080840151610f6a816109e5565b828c0152606084810151610f7d816109e5565b8083850152506080915081850151818401525060a08085015163ffffffff81168114610fa95760008081fd5b83830152928401519289841115610fc257600091508182fd5b610fd08f8d86880101610e31565b9083015250845250509186019190860190610f1d565b9998505050505050505050565b60006020828403121561100557600080fd5b81518015158114610bed57600080fdfea26469706673582212206eab9b350687ecccafd79868df619e95a4ffb1f38b3590296e186abb24b904f864736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806389a504771161005b57806389a50477146100e7578063ac9d6541146100fd578063aebddc691461013c578063c0a92c911461014f57600080fd5b80630a60387d14610082578063369b88be146100a75780633ee490ce146100c7575b600080fd5b61008d6363226b0081565b60405163ffffffff90911681526020015b60405180910390f35b6100ba6100b5366004610805565b610162565b60405161009e91906108cf565b6100da6100d5366004610a0d565b61031d565b60405161009e9190610ab9565b6100ef600081565b60405190815260200161009e565b6101247f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161009e565b6100da61014a366004610a0d565b610350565b6100ba61015d366004610805565b61035e565b606060008667ffffffffffffffff81111561017f5761017f610b84565b6040519080825280602002602001820160405280156101b257816020015b606081526020019060019003908161019d5790505b5090506000868660008181106101ca576101ca610b9a565b90506020028101906101dc9190610bb0565b6101ed906040810190602001610bd0565b905060005b8881101561030757816001600160a01b031688888381811061021657610216610b9a565b90506020028101906102289190610bb0565b610239906040810190602001610bd0565b6001600160a01b0316146102605760405163f1b973df60e01b815260040160405180910390fd5b6102d78a8a8381811061027557610275610b9a565b905060200201602081019061028a9190610bd0565b89898481811061029c5761029c610b9a565b90506020028101906102ae9190610bb0565b8888858181106102c0576102c0610b9a565b90506020028101906102d29190610bf4565b610463565b8382815181106102e9576102e9610b9a565b602002602001018190525080806102ff90610c3b565b9150506101f2565b50610311816104dd565b50979650505050505050565b6060600061032d86868686610463565b90506103476103426040870160208801610bd0565b6104dd565b95945050505050565b606061034785858585610769565b606060008667ffffffffffffffff81111561037b5761037b610b84565b6040519080825280602002602001820160405280156103ae57816020015b60608152602001906001900390816103995790505b50905060005b87811015610311576104338989838181106103d1576103d1610b9a565b90506020020160208101906103e69190610bd0565b8888848181106103f8576103f8610b9a565b905060200281019061040a9190610bb0565b87878581811061041c5761041c610b9a565b905060200281019061042e9190610bf4565b610769565b82828151811061044557610445610b9a565b6020026020010181905250808061045b90610c3b565b9150506103b4565b60405163e60f999f60e01b81526060906001600160a01b0386169063e60f999f9061049690879087908790600401610c8b565b6000604051808303816000875af11580156104b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103479190810190610e9d565b426363226b0063ffffffff82161015610765576040516211023960e41b81526000600482018190526001600160a01b03848116602484015290917f0000000000000000000000000000000000000000000000000000000000000000909116906301102390906044016020604051808303816000875af1158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190610ff3565b90508061076357604080516001808252818301909252600091816020015b6105f76040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816105a65790505090506040518060c0016040528060008152602001856001600160a01b03168152602001306001600160a01b03168152602001600181526020018463ffffffff1681526020016040518060400160405280601b81526020017f57697468207374726f6e67206c6f76652066726f6d205369736d6f00000000008152508152508160008151811061069b5761069b610b9a565b602090810291909101015260405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106f2908490600401610ab9565b600060405180830381600087803b15801561070c57600080fd5b505af1158015610720573d6000803e3d6000fd5b50506040516001600160a01b03871681527f65566f56ce57729c92989973ff6ac5bdd213f57bf75d7248c4190d6d3634738e9250602001905060405180910390a1505b505b5050565b604051630af411a360e41b81526060906001600160a01b0386169063af411a309061079c90879087908790600401610c8b565b600060405180830381865afa1580156104b5573d6000803e3d6000fd5b60008083601f8401126107cb57600080fd5b50813567ffffffffffffffff8111156107e357600080fd5b6020830191508360208260051b85010111156107fe57600080fd5b9250929050565b6000806000806000806060878903121561081e57600080fd5b863567ffffffffffffffff8082111561083657600080fd5b6108428a838b016107b9565b9098509650602089013591508082111561085b57600080fd5b6108678a838b016107b9565b9096509450604089013591508082111561088057600080fd5b5061088d89828a016107b9565b979a9699509497509295939492505050565b60005b838110156108ba5781810151838201526020016108a2565b838111156108c9576000848401525b50505050565b60208152600060208201835180825260408401915060408160051b8501016020860160005b838110156109d957868303603f19018552815180518085526020918201918086019190600582901b87010160005b828110156109bf57601f1980898403018552855180518452602081015160018060a01b03808216602087015280604084015116604087015250506060810151606085015263ffffffff608082015116608085015260a0810151905060c060a085015280518060c086015261099d8160e087016020850161089f565b6020978801979690960195601f019091169290920160e0019150600101610922565b5060209889019890965094909401935050506001016108f4565b50909695505050505050565b6001600160a01b03811681146109fa57600080fd5b50565b8035610a08816109e5565b919050565b60008060008060608587031215610a2357600080fd5b8435610a2e816109e5565b9350602085013567ffffffffffffffff80821115610a4b57600080fd5b9086019060408289031215610a5f57600080fd5b90935060408601359080821115610a7557600080fd5b818701915087601f830112610a8957600080fd5b813581811115610a9857600080fd5b886020828501011115610aaa57600080fd5b95989497505060200194505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610b7657888303603f19018552815180518452878101516001600160a01b03908116898601528782015116878501526060808201519085015260808082015163ffffffff169085015260a09081015160c091850182905280519185018290529060e090610b5681838801858d0161089f565b96890196601f01601f191694909401909301925090860190600101610ae0565b509098975050505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008235603e19833603018112610bc657600080fd5b9190910192915050565b600060208284031215610be257600080fd5b8135610bed816109e5565b9392505050565b6000808335601e19843603018112610c0b57600080fd5b83018035915067ffffffffffffffff821115610c2657600080fd5b6020019150368190038213156107fe57600080fd5b600060018201610c5b57634e487b7160e01b600052601160045260246000fd5b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006040808352608083018635601e19883603018112610caa57600080fd5b87018035602080830167ffffffffffffffff80841115610cc957600080fd5b8360051b803603831315610cdc57600080fd5b878a018890529584905260a09589018601956000908a01607e1936889003015b86831015610d96578b8903609f190182528435818112610d1b57600080fd5b8801868101358a528a8101358a88015260608082013536839003603e19018112610d4457600080fd5b9091018b8101919088013586811115610d5c57600080fd5b803603831315610d6b57600080fd5b818d8d0152610d7d828d018285610c62565b9b50505094860194506001929092019190850190610cfc565b5050505050610da6818b016109fd565b6001600160a01b0381166060890152945086840381880152505050610dcc818688610c62565b979650505050505050565b60405160c0810167ffffffffffffffff81118282101715610dfa57610dfa610b84565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e2957610e29610b84565b604052919050565b600082601f830112610e4257600080fd5b815167ffffffffffffffff811115610e5c57610e5c610b84565b610e6f601f8201601f1916602001610e00565b818152846020838601011115610e8457600080fd5b610e9582602083016020870161089f565b949350505050565b60006020808385031215610eb057600080fd5b825167ffffffffffffffff80821115610ec857600080fd5b818501915085601f830112610edc57600080fd5b815181811115610eee57610eee610b84565b8060051b610efd858201610e00565b9182528381018501918581019089841115610f1757600080fd5b86860192505b83831015610fe657825185811115610f355760008081fd5b860160c0818c03601f1901811315610f4d5760008081fd5b610f55610dd7565b898301518152604080840151610f6a816109e5565b828c0152606084810151610f7d816109e5565b8083850152506080915081850151818401525060a08085015163ffffffff81168114610fa95760008081fd5b83830152928401519289841115610fc257600091508182fd5b610fd08f8d86880101610e31565b9083015250845250509186019190860190610f1d565b9998505050505050505050565b60006020828403121561100557600080fd5b81518015158114610bed57600080fdfea26469706673582212206eab9b350687ecccafd79868df619e95a4ffb1f38b3590296e186abb24b904f864736f6c634300080e0033", + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", + "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"DifferentRequestsDestinations\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"EarlyUserAttestationGenerated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ATTESTATIONS_REGISTRY\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EARLY_USER_BADGE_END_DATE\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EARLY_USER_COLLECTION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"attesters\",\"type\":\"address[]\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request[]\",\"name\":\"requests\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"proofDataArray\",\"type\":\"bytes[]\"}],\"name\":\"batchBuildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[][]\",\"name\":\"\",\"type\":\"tuple[][]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"attesters\",\"type\":\"address[]\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request[]\",\"name\":\"requests\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"proofDataArray\",\"type\":\"bytes[]\"}],\"name\":\"batchGenerateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[][]\",\"name\":\"\",\"type\":\"tuple[][]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"batchBuildAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])\":{\"details\":\"build the attestations from multiple user requests. Forwards to the build function of targeted attester\",\"params\":{\"attesters\":\"Targeted attesters\",\"proofDataArray\":\"Data sent along the request to prove its validity\",\"requests\":\"User requests\"},\"returns\":{\"_0\":\"attestations Attestations that will be recorded\"}},\"batchGenerateAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])\":{\"details\":\"generate multiple attestations at once, to the same destination, generates an early user attestation\",\"params\":{\"attesters\":\"Attesters targeted by the attesters\",\"proofDataArray\":\"Data sent with each request\",\"requests\":\"Requests sent to attester\"}},\"buildAttestations(address,((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"build the attestations from a user request targeting a specific attester. Forwards to the build function of targeted attester\",\"params\":{\"attester\":\"Targeted attester\",\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that will be recorded\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"attestationsRegistryAddress\":\"Attestations registry contract address\"}},\"generateAttestations(address,((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Forward a request to an attester and generates an early user attestation\",\"params\":{\"attester\":\"Attester targeted by the request\",\"proofData\":\"Data provided to the attester to back the request\",\"request\":\"Request sent to the attester\"}}},\"title\":\"Front\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This is the Front contract of the Sismo protocol Behind a proxy, it routes attestations request to the targeted attester and can perform some actions This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference For more information: https://front.docs.sismo.io\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/Front.sol\":\"Front\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/core/Front.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {IFront} from './interfaces/IFront.sol';\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation} from './libs/Structs.sol';\\n\\n/**\\n * @title Front\\n * @author Sismo\\n * @notice This is the Front contract of the Sismo protocol\\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\\n\\n * For more information: https://front.docs.sismo.io\\n */\\ncontract Front is IFront {\\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\\n uint256 public constant EARLY_USER_COLLECTION = 0;\\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress Attestations registry contract address\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Forward a request to an attester and generates an early user attestation\\n * @param attester Attester targeted by the request\\n * @param request Request sent to the attester\\n * @param proofData Data provided to the attester to back the request\\n */\\n function generateAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n Attestation[] memory attestations = _forwardAttestationsGeneration(\\n attester,\\n request,\\n proofData\\n );\\n _generateEarlyUserAttestation(request.destination);\\n return attestations;\\n }\\n\\n /**\\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\\n * @param attesters Attesters targeted by the attesters\\n * @param requests Requests sent to attester\\n * @param proofDataArray Data sent with each request\\n */\\n function batchGenerateAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external override returns (Attestation[][] memory) {\\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\\n address destination = requests[0].destination;\\n for (uint256 i = 0; i < attesters.length; i++) {\\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\\n attestations[i] = _forwardAttestationsGeneration(\\n attesters[i],\\n requests[i],\\n proofDataArray[i]\\n );\\n }\\n _generateEarlyUserAttestation(destination);\\n return attestations;\\n }\\n\\n /**\\n * @dev build the attestations from a user request targeting a specific attester.\\n * Forwards to the build function of targeted attester\\n * @param attester Targeted attester\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external view override returns (Attestation[] memory) {\\n return _forwardAttestationsBuild(attester, request, proofData);\\n }\\n\\n /**\\n * @dev build the attestations from multiple user requests.\\n * Forwards to the build function of targeted attester\\n * @param attesters Targeted attesters\\n * @param requests User requests\\n * @param proofDataArray Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function batchBuildAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external view override returns (Attestation[][] memory) {\\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\\n\\n for (uint256 i = 0; i < attesters.length; i++) {\\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\\n }\\n return attestations;\\n }\\n\\n function _forwardAttestationsBuild(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) internal view returns (Attestation[] memory) {\\n return IAttester(attester).buildAttestations(request, proofData);\\n }\\n\\n function _forwardAttestationsGeneration(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) internal returns (Attestation[] memory) {\\n return IAttester(attester).generateAttestations(request, proofData);\\n }\\n\\n function _generateEarlyUserAttestation(address destination) internal {\\n uint32 currentTimestamp = uint32(block.timestamp);\\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\\n EARLY_USER_COLLECTION,\\n destination\\n );\\n\\n if (!alreadyHasAttestation) {\\n Attestation[] memory attestations = new Attestation[](1);\\n attestations[0] = Attestation(\\n EARLY_USER_COLLECTION,\\n destination,\\n address(this),\\n 1,\\n currentTimestamp,\\n 'With strong love from Sismo'\\n );\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n emit EarlyUserAttestationGenerated(destination);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3ea2112c22a36ff318873f1f015fa9e3b447e93d33464ae81b9bcd7d0f917621\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0x2d5faf5df56dfe1294202e89180846a1d4a5f938699619ee73b60c7314a97dfe\",\"license\":\"MIT\"},\"contracts/core/interfaces/IFront.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\n\\n/**\\n * @title IFront\\n * @author Sismo\\n * @notice This is the interface of the Front Contract\\n */\\ninterface IFront {\\n error DifferentRequestsDestinations();\\n event EarlyUserAttestationGenerated(address destination);\\n\\n /**\\n * @dev Forward a request to an attester and generates an early user attestation\\n * @param attester Attester targeted by the request\\n * @param request Request sent to the attester\\n * @param proofData Data provided to the attester to back the request\\n */\\n function generateAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev generate multiple attestations at once, to the same destination\\n * @param attesters Attesters targeted by the attesters\\n * @param requests Requests sent to attester\\n * @param proofDataArray Data sent with each request\\n */\\n function batchGenerateAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external returns (Attestation[][] memory);\\n\\n /**\\n * @dev build the attestations from a user request targeting a specific attester.\\n * Forwards to the build function of targeted attester\\n * @param attester Targeted attester\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev build the attestations from multiple user requests.\\n * Forwards to the build function(s) of targeted attester(s)\\n * @param attesters Targeted attesters\\n * @param requests User requests\\n * @param proofDataArray Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function batchBuildAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external view returns (Attestation[][] memory);\\n}\\n\",\"keccak256\":\"0xfeab84e36830c432f91d0cbe1beb430331529829ce667a6371fbad47baa12191\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a060405234801561001057600080fd5b506040516110e43803806110e483398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161104b610099600039600081816101020152818161051901526106bd015261104b6000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806389a504771161005b57806389a50477146100e7578063ac9d6541146100fd578063aebddc691461013c578063c0a92c911461014f57600080fd5b80630a60387d14610082578063369b88be146100a75780633ee490ce146100c7575b600080fd5b61008d6363226b0081565b60405163ffffffff90911681526020015b60405180910390f35b6100ba6100b5366004610805565b610162565b60405161009e91906108cf565b6100da6100d5366004610a0d565b61031d565b60405161009e9190610ab9565b6100ef600081565b60405190815260200161009e565b6101247f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161009e565b6100da61014a366004610a0d565b610350565b6100ba61015d366004610805565b61035e565b606060008667ffffffffffffffff81111561017f5761017f610b84565b6040519080825280602002602001820160405280156101b257816020015b606081526020019060019003908161019d5790505b5090506000868660008181106101ca576101ca610b9a565b90506020028101906101dc9190610bb0565b6101ed906040810190602001610bd0565b905060005b8881101561030757816001600160a01b031688888381811061021657610216610b9a565b90506020028101906102289190610bb0565b610239906040810190602001610bd0565b6001600160a01b0316146102605760405163f1b973df60e01b815260040160405180910390fd5b6102d78a8a8381811061027557610275610b9a565b905060200201602081019061028a9190610bd0565b89898481811061029c5761029c610b9a565b90506020028101906102ae9190610bb0565b8888858181106102c0576102c0610b9a565b90506020028101906102d29190610bf4565b610463565b8382815181106102e9576102e9610b9a565b602002602001018190525080806102ff90610c3b565b9150506101f2565b50610311816104dd565b50979650505050505050565b6060600061032d86868686610463565b90506103476103426040870160208801610bd0565b6104dd565b95945050505050565b606061034785858585610769565b606060008667ffffffffffffffff81111561037b5761037b610b84565b6040519080825280602002602001820160405280156103ae57816020015b60608152602001906001900390816103995790505b50905060005b87811015610311576104338989838181106103d1576103d1610b9a565b90506020020160208101906103e69190610bd0565b8888848181106103f8576103f8610b9a565b905060200281019061040a9190610bb0565b87878581811061041c5761041c610b9a565b905060200281019061042e9190610bf4565b610769565b82828151811061044557610445610b9a565b6020026020010181905250808061045b90610c3b565b9150506103b4565b60405163e60f999f60e01b81526060906001600160a01b0386169063e60f999f9061049690879087908790600401610c8b565b6000604051808303816000875af11580156104b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103479190810190610e9d565b426363226b0063ffffffff82161015610765576040516211023960e41b81526000600482018190526001600160a01b03848116602484015290917f0000000000000000000000000000000000000000000000000000000000000000909116906301102390906044016020604051808303816000875af1158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190610ff3565b90508061076357604080516001808252818301909252600091816020015b6105f76040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816105a65790505090506040518060c0016040528060008152602001856001600160a01b03168152602001306001600160a01b03168152602001600181526020018463ffffffff1681526020016040518060400160405280601b81526020017f57697468207374726f6e67206c6f76652066726f6d205369736d6f00000000008152508152508160008151811061069b5761069b610b9a565b602090810291909101015260405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106f2908490600401610ab9565b600060405180830381600087803b15801561070c57600080fd5b505af1158015610720573d6000803e3d6000fd5b50506040516001600160a01b03871681527f65566f56ce57729c92989973ff6ac5bdd213f57bf75d7248c4190d6d3634738e9250602001905060405180910390a1505b505b5050565b604051630af411a360e41b81526060906001600160a01b0386169063af411a309061079c90879087908790600401610c8b565b600060405180830381865afa1580156104b5573d6000803e3d6000fd5b60008083601f8401126107cb57600080fd5b50813567ffffffffffffffff8111156107e357600080fd5b6020830191508360208260051b85010111156107fe57600080fd5b9250929050565b6000806000806000806060878903121561081e57600080fd5b863567ffffffffffffffff8082111561083657600080fd5b6108428a838b016107b9565b9098509650602089013591508082111561085b57600080fd5b6108678a838b016107b9565b9096509450604089013591508082111561088057600080fd5b5061088d89828a016107b9565b979a9699509497509295939492505050565b60005b838110156108ba5781810151838201526020016108a2565b838111156108c9576000848401525b50505050565b60208152600060208201835180825260408401915060408160051b8501016020860160005b838110156109d957868303603f19018552815180518085526020918201918086019190600582901b87010160005b828110156109bf57601f1980898403018552855180518452602081015160018060a01b03808216602087015280604084015116604087015250506060810151606085015263ffffffff608082015116608085015260a0810151905060c060a085015280518060c086015261099d8160e087016020850161089f565b6020978801979690960195601f019091169290920160e0019150600101610922565b5060209889019890965094909401935050506001016108f4565b50909695505050505050565b6001600160a01b03811681146109fa57600080fd5b50565b8035610a08816109e5565b919050565b60008060008060608587031215610a2357600080fd5b8435610a2e816109e5565b9350602085013567ffffffffffffffff80821115610a4b57600080fd5b9086019060408289031215610a5f57600080fd5b90935060408601359080821115610a7557600080fd5b818701915087601f830112610a8957600080fd5b813581811115610a9857600080fd5b886020828501011115610aaa57600080fd5b95989497505060200194505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610b7657888303603f19018552815180518452878101516001600160a01b03908116898601528782015116878501526060808201519085015260808082015163ffffffff169085015260a09081015160c091850182905280519185018290529060e090610b5681838801858d0161089f565b96890196601f01601f191694909401909301925090860190600101610ae0565b509098975050505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008235603e19833603018112610bc657600080fd5b9190910192915050565b600060208284031215610be257600080fd5b8135610bed816109e5565b9392505050565b6000808335601e19843603018112610c0b57600080fd5b83018035915067ffffffffffffffff821115610c2657600080fd5b6020019150368190038213156107fe57600080fd5b600060018201610c5b57634e487b7160e01b600052601160045260246000fd5b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006040808352608083018635601e19883603018112610caa57600080fd5b87018035602080830167ffffffffffffffff80841115610cc957600080fd5b8360051b803603831315610cdc57600080fd5b878a018890529584905260a09589018601956000908a01607e1936889003015b86831015610d96578b8903609f190182528435818112610d1b57600080fd5b8801868101358a528a8101358a88015260608082013536839003603e19018112610d4457600080fd5b9091018b8101919088013586811115610d5c57600080fd5b803603831315610d6b57600080fd5b818d8d0152610d7d828d018285610c62565b9b50505094860194506001929092019190850190610cfc565b5050505050610da6818b016109fd565b6001600160a01b0381166060890152945086840381880152505050610dcc818688610c62565b979650505050505050565b60405160c0810167ffffffffffffffff81118282101715610dfa57610dfa610b84565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e2957610e29610b84565b604052919050565b600082601f830112610e4257600080fd5b815167ffffffffffffffff811115610e5c57610e5c610b84565b610e6f601f8201601f1916602001610e00565b818152846020838601011115610e8457600080fd5b610e9582602083016020870161089f565b949350505050565b60006020808385031215610eb057600080fd5b825167ffffffffffffffff80821115610ec857600080fd5b818501915085601f830112610edc57600080fd5b815181811115610eee57610eee610b84565b8060051b610efd858201610e00565b9182528381018501918581019089841115610f1757600080fd5b86860192505b83831015610fe657825185811115610f355760008081fd5b860160c0818c03601f1901811315610f4d5760008081fd5b610f55610dd7565b898301518152604080840151610f6a816109e5565b828c0152606084810151610f7d816109e5565b8083850152506080915081850151818401525060a08085015163ffffffff81168114610fa95760008081fd5b83830152928401519289841115610fc257600091508182fd5b610fd08f8d86880101610e31565b9083015250845250509186019190860190610f1d565b9998505050505050505050565b60006020828403121561100557600080fd5b81518015158114610bed57600080fdfea2646970667358221220d94f10ac944b32abaa7aeaaf9016c7bb0e7cf17318303adce9da2bdcd5cbb14a64736f6c634300080e0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806389a504771161005b57806389a50477146100e7578063ac9d6541146100fd578063aebddc691461013c578063c0a92c911461014f57600080fd5b80630a60387d14610082578063369b88be146100a75780633ee490ce146100c7575b600080fd5b61008d6363226b0081565b60405163ffffffff90911681526020015b60405180910390f35b6100ba6100b5366004610805565b610162565b60405161009e91906108cf565b6100da6100d5366004610a0d565b61031d565b60405161009e9190610ab9565b6100ef600081565b60405190815260200161009e565b6101247f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161009e565b6100da61014a366004610a0d565b610350565b6100ba61015d366004610805565b61035e565b606060008667ffffffffffffffff81111561017f5761017f610b84565b6040519080825280602002602001820160405280156101b257816020015b606081526020019060019003908161019d5790505b5090506000868660008181106101ca576101ca610b9a565b90506020028101906101dc9190610bb0565b6101ed906040810190602001610bd0565b905060005b8881101561030757816001600160a01b031688888381811061021657610216610b9a565b90506020028101906102289190610bb0565b610239906040810190602001610bd0565b6001600160a01b0316146102605760405163f1b973df60e01b815260040160405180910390fd5b6102d78a8a8381811061027557610275610b9a565b905060200201602081019061028a9190610bd0565b89898481811061029c5761029c610b9a565b90506020028101906102ae9190610bb0565b8888858181106102c0576102c0610b9a565b90506020028101906102d29190610bf4565b610463565b8382815181106102e9576102e9610b9a565b602002602001018190525080806102ff90610c3b565b9150506101f2565b50610311816104dd565b50979650505050505050565b6060600061032d86868686610463565b90506103476103426040870160208801610bd0565b6104dd565b95945050505050565b606061034785858585610769565b606060008667ffffffffffffffff81111561037b5761037b610b84565b6040519080825280602002602001820160405280156103ae57816020015b60608152602001906001900390816103995790505b50905060005b87811015610311576104338989838181106103d1576103d1610b9a565b90506020020160208101906103e69190610bd0565b8888848181106103f8576103f8610b9a565b905060200281019061040a9190610bb0565b87878581811061041c5761041c610b9a565b905060200281019061042e9190610bf4565b610769565b82828151811061044557610445610b9a565b6020026020010181905250808061045b90610c3b565b9150506103b4565b60405163e60f999f60e01b81526060906001600160a01b0386169063e60f999f9061049690879087908790600401610c8b565b6000604051808303816000875af11580156104b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103479190810190610e9d565b426363226b0063ffffffff82161015610765576040516211023960e41b81526000600482018190526001600160a01b03848116602484015290917f0000000000000000000000000000000000000000000000000000000000000000909116906301102390906044016020604051808303816000875af1158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190610ff3565b90508061076357604080516001808252818301909252600091816020015b6105f76040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816105a65790505090506040518060c0016040528060008152602001856001600160a01b03168152602001306001600160a01b03168152602001600181526020018463ffffffff1681526020016040518060400160405280601b81526020017f57697468207374726f6e67206c6f76652066726f6d205369736d6f00000000008152508152508160008151811061069b5761069b610b9a565b602090810291909101015260405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106f2908490600401610ab9565b600060405180830381600087803b15801561070c57600080fd5b505af1158015610720573d6000803e3d6000fd5b50506040516001600160a01b03871681527f65566f56ce57729c92989973ff6ac5bdd213f57bf75d7248c4190d6d3634738e9250602001905060405180910390a1505b505b5050565b604051630af411a360e41b81526060906001600160a01b0386169063af411a309061079c90879087908790600401610c8b565b600060405180830381865afa1580156104b5573d6000803e3d6000fd5b60008083601f8401126107cb57600080fd5b50813567ffffffffffffffff8111156107e357600080fd5b6020830191508360208260051b85010111156107fe57600080fd5b9250929050565b6000806000806000806060878903121561081e57600080fd5b863567ffffffffffffffff8082111561083657600080fd5b6108428a838b016107b9565b9098509650602089013591508082111561085b57600080fd5b6108678a838b016107b9565b9096509450604089013591508082111561088057600080fd5b5061088d89828a016107b9565b979a9699509497509295939492505050565b60005b838110156108ba5781810151838201526020016108a2565b838111156108c9576000848401525b50505050565b60208152600060208201835180825260408401915060408160051b8501016020860160005b838110156109d957868303603f19018552815180518085526020918201918086019190600582901b87010160005b828110156109bf57601f1980898403018552855180518452602081015160018060a01b03808216602087015280604084015116604087015250506060810151606085015263ffffffff608082015116608085015260a0810151905060c060a085015280518060c086015261099d8160e087016020850161089f565b6020978801979690960195601f019091169290920160e0019150600101610922565b5060209889019890965094909401935050506001016108f4565b50909695505050505050565b6001600160a01b03811681146109fa57600080fd5b50565b8035610a08816109e5565b919050565b60008060008060608587031215610a2357600080fd5b8435610a2e816109e5565b9350602085013567ffffffffffffffff80821115610a4b57600080fd5b9086019060408289031215610a5f57600080fd5b90935060408601359080821115610a7557600080fd5b818701915087601f830112610a8957600080fd5b813581811115610a9857600080fd5b886020828501011115610aaa57600080fd5b95989497505060200194505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610b7657888303603f19018552815180518452878101516001600160a01b03908116898601528782015116878501526060808201519085015260808082015163ffffffff169085015260a09081015160c091850182905280519185018290529060e090610b5681838801858d0161089f565b96890196601f01601f191694909401909301925090860190600101610ae0565b509098975050505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008235603e19833603018112610bc657600080fd5b9190910192915050565b600060208284031215610be257600080fd5b8135610bed816109e5565b9392505050565b6000808335601e19843603018112610c0b57600080fd5b83018035915067ffffffffffffffff821115610c2657600080fd5b6020019150368190038213156107fe57600080fd5b600060018201610c5b57634e487b7160e01b600052601160045260246000fd5b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006040808352608083018635601e19883603018112610caa57600080fd5b87018035602080830167ffffffffffffffff80841115610cc957600080fd5b8360051b803603831315610cdc57600080fd5b878a018890529584905260a09589018601956000908a01607e1936889003015b86831015610d96578b8903609f190182528435818112610d1b57600080fd5b8801868101358a528a8101358a88015260608082013536839003603e19018112610d4457600080fd5b9091018b8101919088013586811115610d5c57600080fd5b803603831315610d6b57600080fd5b818d8d0152610d7d828d018285610c62565b9b50505094860194506001929092019190850190610cfc565b5050505050610da6818b016109fd565b6001600160a01b0381166060890152945086840381880152505050610dcc818688610c62565b979650505050505050565b60405160c0810167ffffffffffffffff81118282101715610dfa57610dfa610b84565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e2957610e29610b84565b604052919050565b600082601f830112610e4257600080fd5b815167ffffffffffffffff811115610e5c57610e5c610b84565b610e6f601f8201601f1916602001610e00565b818152846020838601011115610e8457600080fd5b610e9582602083016020870161089f565b949350505050565b60006020808385031215610eb057600080fd5b825167ffffffffffffffff80821115610ec857600080fd5b818501915085601f830112610edc57600080fd5b815181811115610eee57610eee610b84565b8060051b610efd858201610e00565b9182528381018501918581019089841115610f1757600080fd5b86860192505b83831015610fe657825185811115610f355760008081fd5b860160c0818c03601f1901811315610f4d5760008081fd5b610f55610dd7565b898301518152604080840151610f6a816109e5565b828c0152606084810151610f7d816109e5565b8083850152506080915081850151818401525060a08085015163ffffffff81168114610fa95760008081fd5b83830152928401519289841115610fc257600091508182fd5b610fd08f8d86880101610e31565b9083015250845250509186019190860190610f1d565b9998505050505050505050565b60006020828403121561100557600080fd5b81518015158114610bed57600080fdfea2646970667358221220d94f10ac944b32abaa7aeaaf9016c7bb0e7cf17318303adce9da2bdcd5cbb14a64736f6c634300080e0033", "devdoc": { "author": "Sismo", "kind": "dev", diff --git a/deployments/sandboxPolygon/FrontImplem.json b/deployments/mumbaiTestnet/FrontImplem.json similarity index 67% rename from deployments/sandboxPolygon/FrontImplem.json rename to deployments/mumbaiTestnet/FrontImplem.json index b3f7ac7..a0c122c 100644 --- a/deployments/sandboxPolygon/FrontImplem.json +++ b/deployments/mumbaiTestnet/FrontImplem.json @@ -1,5 +1,5 @@ { - "address": "0xbC356247570B2584E567F7eF7a54e09Ec668400B", + "address": "0x401A6641AC660678C1c0d8b5D03a9e90F5f70D81", "abi": [ { "inputs": [ @@ -430,46 +430,46 @@ "type": "function" } ], - "transactionHash": "0xfc0d4a8674abc716a6b42e21b3b0cc239542fe95dedc0d4f0ede26a710955db5", + "transactionHash": "0xf263a9f036cf3381681ef07acd8d101533649b6d5206468724d2821f3a783156", "receipt": { "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0xbC356247570B2584E567F7eF7a54e09Ec668400B", - "transactionIndex": 22, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0x401A6641AC660678C1c0d8b5D03a9e90F5f70D81", + "transactionIndex": 24, "gasUsed": "954922", - "logsBloom": "0x00000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000200000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000100000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000004000000100000000000001000000000000000000000000000000100004000000002000000000000000000000000000000000000000000000000000000000100000", - "blockHash": "0x7482f2e8f148bc6b333a0ec8f80a4c42fc0c167281e2aa4611225afbbc4a9aa5", - "transactionHash": "0xfc0d4a8674abc716a6b42e21b3b0cc239542fe95dedc0d4f0ede26a710955db5", + "logsBloom": "0x00000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000040000000200000000000000020000000000002000001000000000000000000000000004000008000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x2df3420c8b41e6814227d597d2cfc54d2855b1968cfdc5bb29f4f3a2102c6cb5", + "transactionHash": "0xf263a9f036cf3381681ef07acd8d101533649b6d5206468724d2821f3a783156", "logs": [ { - "transactionIndex": 22, - "blockNumber": 32513060, - "transactionHash": "0xfc0d4a8674abc716a6b42e21b3b0cc239542fe95dedc0d4f0ede26a710955db5", + "transactionIndex": 24, + "blockNumber": 29771761, + "transactionHash": "0xf263a9f036cf3381681ef07acd8d101533649b6d5206468724d2821f3a783156", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x0000000000000000000000001efecb61a2f80aa34d3b9218b564a64d05946290" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" ], - "data": "0x0000000000000000000000000000000000000000000000000133d73b80fc63440000000000000000000000000000000000000000000000002b5dd4217636d9a60000000000000000000000000000000000000000000008b0ebc0f6cc993110eb0000000000000000000000000000000000000000000000002a29fce5f53a76620000000000000000000000000000000000000000000008b0ecf4ce081a2d742f", - "logIndex": 70, - "blockHash": "0x7482f2e8f148bc6b333a0ec8f80a4c42fc0c167281e2aa4611225afbbc4a9aa5" + "data": "0x000000000000000000000000000000000000000000000000000516bea7ab6d580000000000000000000000000000000000000000000000001b9e20e188449f8d00000000000000000000000000000000000000000000187ae4e0c455b3f59d7a0000000000000000000000000000000000000000000000001b990a22e099323500000000000000000000000000000000000000000000187ae4e5db145ba10ad2", + "logIndex": 79, + "blockHash": "0x2df3420c8b41e6814227d597d2cfc54d2855b1968cfdc5bb29f4f3a2102c6cb5" } ], - "blockNumber": 32513060, - "cumulativeGasUsed": "3779507", + "blockNumber": 29771761, + "cumulativeGasUsed": "7780109", "status": 1, "byzantium": true }, "args": [ - "0xC999390A856e0633f945dD851DeeCE15b533ccA3" + "0xc24F86a8D9f82401b693d4FFaa1DCf3109d88524" ], "numDeployments": 1, - "solcInputHash": "c872f238f220b3571ef309821a459203", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"DifferentRequestsDestinations\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"EarlyUserAttestationGenerated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ATTESTATIONS_REGISTRY\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EARLY_USER_BADGE_END_DATE\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EARLY_USER_COLLECTION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"attesters\",\"type\":\"address[]\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request[]\",\"name\":\"requests\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"proofDataArray\",\"type\":\"bytes[]\"}],\"name\":\"batchBuildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[][]\",\"name\":\"\",\"type\":\"tuple[][]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"attesters\",\"type\":\"address[]\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request[]\",\"name\":\"requests\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"proofDataArray\",\"type\":\"bytes[]\"}],\"name\":\"batchGenerateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[][]\",\"name\":\"\",\"type\":\"tuple[][]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"batchBuildAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])\":{\"details\":\"build the attestations from multiple user requests. Forwards to the build function of targeted attester\",\"params\":{\"attesters\":\"Targeted attesters\",\"proofDataArray\":\"Data sent along the request to prove its validity\",\"requests\":\"User requests\"},\"returns\":{\"_0\":\"attestations Attestations that will be recorded\"}},\"batchGenerateAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])\":{\"details\":\"generate multiple attestations at once, to the same destination, generates an early user attestation\",\"params\":{\"attesters\":\"Attesters targeted by the attesters\",\"proofDataArray\":\"Data sent with each request\",\"requests\":\"Requests sent to attester\"}},\"buildAttestations(address,((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"build the attestations from a user request targeting a specific attester. Forwards to the build function of targeted attester\",\"params\":{\"attester\":\"Targeted attester\",\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that will be recorded\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"attestationsRegistryAddress\":\"Attestations registry contract address\"}},\"generateAttestations(address,((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Forward a request to an attester and generates an early user attestation\",\"params\":{\"attester\":\"Attester targeted by the request\",\"proofData\":\"Data provided to the attester to back the request\",\"request\":\"Request sent to the attester\"}}},\"title\":\"Front\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This is the Front contract of the Sismo protocol Behind a proxy, it routes attestations request to the targeted attester and can perform some actions This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference For more information: https://front.docs.sismo.io\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/Front.sol\":\"Front\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/core/Front.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {IFront} from './interfaces/IFront.sol';\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation} from './libs/Structs.sol';\\n\\n/**\\n * @title Front\\n * @author Sismo\\n * @notice This is the Front contract of the Sismo protocol\\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\\n\\n * For more information: https://front.docs.sismo.io\\n */\\ncontract Front is IFront {\\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\\n uint256 public constant EARLY_USER_COLLECTION = 0;\\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress Attestations registry contract address\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Forward a request to an attester and generates an early user attestation\\n * @param attester Attester targeted by the request\\n * @param request Request sent to the attester\\n * @param proofData Data provided to the attester to back the request\\n */\\n function generateAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n Attestation[] memory attestations = _forwardAttestationsGeneration(\\n attester,\\n request,\\n proofData\\n );\\n _generateEarlyUserAttestation(request.destination);\\n return attestations;\\n }\\n\\n /**\\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\\n * @param attesters Attesters targeted by the attesters\\n * @param requests Requests sent to attester\\n * @param proofDataArray Data sent with each request\\n */\\n function batchGenerateAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external override returns (Attestation[][] memory) {\\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\\n address destination = requests[0].destination;\\n for (uint256 i = 0; i < attesters.length; i++) {\\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\\n attestations[i] = _forwardAttestationsGeneration(\\n attesters[i],\\n requests[i],\\n proofDataArray[i]\\n );\\n }\\n _generateEarlyUserAttestation(destination);\\n return attestations;\\n }\\n\\n /**\\n * @dev build the attestations from a user request targeting a specific attester.\\n * Forwards to the build function of targeted attester\\n * @param attester Targeted attester\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external view override returns (Attestation[] memory) {\\n return _forwardAttestationsBuild(attester, request, proofData);\\n }\\n\\n /**\\n * @dev build the attestations from multiple user requests.\\n * Forwards to the build function of targeted attester\\n * @param attesters Targeted attesters\\n * @param requests User requests\\n * @param proofDataArray Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function batchBuildAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external view override returns (Attestation[][] memory) {\\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\\n\\n for (uint256 i = 0; i < attesters.length; i++) {\\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\\n }\\n return attestations;\\n }\\n\\n function _forwardAttestationsBuild(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) internal view returns (Attestation[] memory) {\\n return IAttester(attester).buildAttestations(request, proofData);\\n }\\n\\n function _forwardAttestationsGeneration(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) internal returns (Attestation[] memory) {\\n return IAttester(attester).generateAttestations(request, proofData);\\n }\\n\\n function _generateEarlyUserAttestation(address destination) internal {\\n uint32 currentTimestamp = uint32(block.timestamp);\\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\\n EARLY_USER_COLLECTION,\\n destination\\n );\\n\\n if (!alreadyHasAttestation) {\\n Attestation[] memory attestations = new Attestation[](1);\\n attestations[0] = Attestation(\\n EARLY_USER_COLLECTION,\\n destination,\\n address(this),\\n 1,\\n currentTimestamp,\\n 'With strong love from Sismo'\\n );\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n emit EarlyUserAttestationGenerated(destination);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3ea2112c22a36ff318873f1f015fa9e3b447e93d33464ae81b9bcd7d0f917621\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param attestations Attestations to be deleted\\n */\\n function deleteAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xb5e25bd7e0372c9973e582fb7fe96318c145831a5452d8c79eb848a7464b0297\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/interfaces/IFront.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\n\\n/**\\n * @title IFront\\n * @author Sismo\\n * @notice This is the interface of the Front Contract\\n */\\ninterface IFront {\\n error DifferentRequestsDestinations();\\n event EarlyUserAttestationGenerated(address destination);\\n\\n /**\\n * @dev Forward a request to an attester and generates an early user attestation\\n * @param attester Attester targeted by the request\\n * @param request Request sent to the attester\\n * @param proofData Data provided to the attester to back the request\\n */\\n function generateAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev generate multiple attestations at once, to the same destination\\n * @param attesters Attesters targeted by the attesters\\n * @param requests Requests sent to attester\\n * @param proofDataArray Data sent with each request\\n */\\n function batchGenerateAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external returns (Attestation[][] memory);\\n\\n /**\\n * @dev build the attestations from a user request targeting a specific attester.\\n * Forwards to the build function of targeted attester\\n * @param attester Targeted attester\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev build the attestations from multiple user requests.\\n * Forwards to the build function(s) of targeted attester(s)\\n * @param attesters Targeted attesters\\n * @param requests User requests\\n * @param proofDataArray Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function batchBuildAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external view returns (Attestation[][] memory);\\n}\\n\",\"keccak256\":\"0xfeab84e36830c432f91d0cbe1beb430331529829ce667a6371fbad47baa12191\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60a060405234801561001057600080fd5b506040516110e43803806110e483398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161104b610099600039600081816101020152818161051901526106bd015261104b6000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806389a504771161005b57806389a50477146100e7578063ac9d6541146100fd578063aebddc691461013c578063c0a92c911461014f57600080fd5b80630a60387d14610082578063369b88be146100a75780633ee490ce146100c7575b600080fd5b61008d6363226b0081565b60405163ffffffff90911681526020015b60405180910390f35b6100ba6100b5366004610805565b610162565b60405161009e91906108cf565b6100da6100d5366004610a0d565b61031d565b60405161009e9190610ab9565b6100ef600081565b60405190815260200161009e565b6101247f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161009e565b6100da61014a366004610a0d565b610350565b6100ba61015d366004610805565b61035e565b606060008667ffffffffffffffff81111561017f5761017f610b84565b6040519080825280602002602001820160405280156101b257816020015b606081526020019060019003908161019d5790505b5090506000868660008181106101ca576101ca610b9a565b90506020028101906101dc9190610bb0565b6101ed906040810190602001610bd0565b905060005b8881101561030757816001600160a01b031688888381811061021657610216610b9a565b90506020028101906102289190610bb0565b610239906040810190602001610bd0565b6001600160a01b0316146102605760405163f1b973df60e01b815260040160405180910390fd5b6102d78a8a8381811061027557610275610b9a565b905060200201602081019061028a9190610bd0565b89898481811061029c5761029c610b9a565b90506020028101906102ae9190610bb0565b8888858181106102c0576102c0610b9a565b90506020028101906102d29190610bf4565b610463565b8382815181106102e9576102e9610b9a565b602002602001018190525080806102ff90610c3b565b9150506101f2565b50610311816104dd565b50979650505050505050565b6060600061032d86868686610463565b90506103476103426040870160208801610bd0565b6104dd565b95945050505050565b606061034785858585610769565b606060008667ffffffffffffffff81111561037b5761037b610b84565b6040519080825280602002602001820160405280156103ae57816020015b60608152602001906001900390816103995790505b50905060005b87811015610311576104338989838181106103d1576103d1610b9a565b90506020020160208101906103e69190610bd0565b8888848181106103f8576103f8610b9a565b905060200281019061040a9190610bb0565b87878581811061041c5761041c610b9a565b905060200281019061042e9190610bf4565b610769565b82828151811061044557610445610b9a565b6020026020010181905250808061045b90610c3b565b9150506103b4565b60405163e60f999f60e01b81526060906001600160a01b0386169063e60f999f9061049690879087908790600401610c8b565b6000604051808303816000875af11580156104b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103479190810190610e9d565b426363226b0063ffffffff82161015610765576040516211023960e41b81526000600482018190526001600160a01b03848116602484015290917f0000000000000000000000000000000000000000000000000000000000000000909116906301102390906044016020604051808303816000875af1158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190610ff3565b90508061076357604080516001808252818301909252600091816020015b6105f76040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816105a65790505090506040518060c0016040528060008152602001856001600160a01b03168152602001306001600160a01b03168152602001600181526020018463ffffffff1681526020016040518060400160405280601b81526020017f57697468207374726f6e67206c6f76652066726f6d205369736d6f00000000008152508152508160008151811061069b5761069b610b9a565b602090810291909101015260405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106f2908490600401610ab9565b600060405180830381600087803b15801561070c57600080fd5b505af1158015610720573d6000803e3d6000fd5b50506040516001600160a01b03871681527f65566f56ce57729c92989973ff6ac5bdd213f57bf75d7248c4190d6d3634738e9250602001905060405180910390a1505b505b5050565b604051630af411a360e41b81526060906001600160a01b0386169063af411a309061079c90879087908790600401610c8b565b600060405180830381865afa1580156104b5573d6000803e3d6000fd5b60008083601f8401126107cb57600080fd5b50813567ffffffffffffffff8111156107e357600080fd5b6020830191508360208260051b85010111156107fe57600080fd5b9250929050565b6000806000806000806060878903121561081e57600080fd5b863567ffffffffffffffff8082111561083657600080fd5b6108428a838b016107b9565b9098509650602089013591508082111561085b57600080fd5b6108678a838b016107b9565b9096509450604089013591508082111561088057600080fd5b5061088d89828a016107b9565b979a9699509497509295939492505050565b60005b838110156108ba5781810151838201526020016108a2565b838111156108c9576000848401525b50505050565b60208152600060208201835180825260408401915060408160051b8501016020860160005b838110156109d957868303603f19018552815180518085526020918201918086019190600582901b87010160005b828110156109bf57601f1980898403018552855180518452602081015160018060a01b03808216602087015280604084015116604087015250506060810151606085015263ffffffff608082015116608085015260a0810151905060c060a085015280518060c086015261099d8160e087016020850161089f565b6020978801979690960195601f019091169290920160e0019150600101610922565b5060209889019890965094909401935050506001016108f4565b50909695505050505050565b6001600160a01b03811681146109fa57600080fd5b50565b8035610a08816109e5565b919050565b60008060008060608587031215610a2357600080fd5b8435610a2e816109e5565b9350602085013567ffffffffffffffff80821115610a4b57600080fd5b9086019060408289031215610a5f57600080fd5b90935060408601359080821115610a7557600080fd5b818701915087601f830112610a8957600080fd5b813581811115610a9857600080fd5b886020828501011115610aaa57600080fd5b95989497505060200194505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610b7657888303603f19018552815180518452878101516001600160a01b03908116898601528782015116878501526060808201519085015260808082015163ffffffff169085015260a09081015160c091850182905280519185018290529060e090610b5681838801858d0161089f565b96890196601f01601f191694909401909301925090860190600101610ae0565b509098975050505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008235603e19833603018112610bc657600080fd5b9190910192915050565b600060208284031215610be257600080fd5b8135610bed816109e5565b9392505050565b6000808335601e19843603018112610c0b57600080fd5b83018035915067ffffffffffffffff821115610c2657600080fd5b6020019150368190038213156107fe57600080fd5b600060018201610c5b57634e487b7160e01b600052601160045260246000fd5b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006040808352608083018635601e19883603018112610caa57600080fd5b87018035602080830167ffffffffffffffff80841115610cc957600080fd5b8360051b803603831315610cdc57600080fd5b878a018890529584905260a09589018601956000908a01607e1936889003015b86831015610d96578b8903609f190182528435818112610d1b57600080fd5b8801868101358a528a8101358a88015260608082013536839003603e19018112610d4457600080fd5b9091018b8101919088013586811115610d5c57600080fd5b803603831315610d6b57600080fd5b818d8d0152610d7d828d018285610c62565b9b50505094860194506001929092019190850190610cfc565b5050505050610da6818b016109fd565b6001600160a01b0381166060890152945086840381880152505050610dcc818688610c62565b979650505050505050565b60405160c0810167ffffffffffffffff81118282101715610dfa57610dfa610b84565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e2957610e29610b84565b604052919050565b600082601f830112610e4257600080fd5b815167ffffffffffffffff811115610e5c57610e5c610b84565b610e6f601f8201601f1916602001610e00565b818152846020838601011115610e8457600080fd5b610e9582602083016020870161089f565b949350505050565b60006020808385031215610eb057600080fd5b825167ffffffffffffffff80821115610ec857600080fd5b818501915085601f830112610edc57600080fd5b815181811115610eee57610eee610b84565b8060051b610efd858201610e00565b9182528381018501918581019089841115610f1757600080fd5b86860192505b83831015610fe657825185811115610f355760008081fd5b860160c0818c03601f1901811315610f4d5760008081fd5b610f55610dd7565b898301518152604080840151610f6a816109e5565b828c0152606084810151610f7d816109e5565b8083850152506080915081850151818401525060a08085015163ffffffff81168114610fa95760008081fd5b83830152928401519289841115610fc257600091508182fd5b610fd08f8d86880101610e31565b9083015250845250509186019190860190610f1d565b9998505050505050505050565b60006020828403121561100557600080fd5b81518015158114610bed57600080fdfea26469706673582212206eab9b350687ecccafd79868df619e95a4ffb1f38b3590296e186abb24b904f864736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806389a504771161005b57806389a50477146100e7578063ac9d6541146100fd578063aebddc691461013c578063c0a92c911461014f57600080fd5b80630a60387d14610082578063369b88be146100a75780633ee490ce146100c7575b600080fd5b61008d6363226b0081565b60405163ffffffff90911681526020015b60405180910390f35b6100ba6100b5366004610805565b610162565b60405161009e91906108cf565b6100da6100d5366004610a0d565b61031d565b60405161009e9190610ab9565b6100ef600081565b60405190815260200161009e565b6101247f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161009e565b6100da61014a366004610a0d565b610350565b6100ba61015d366004610805565b61035e565b606060008667ffffffffffffffff81111561017f5761017f610b84565b6040519080825280602002602001820160405280156101b257816020015b606081526020019060019003908161019d5790505b5090506000868660008181106101ca576101ca610b9a565b90506020028101906101dc9190610bb0565b6101ed906040810190602001610bd0565b905060005b8881101561030757816001600160a01b031688888381811061021657610216610b9a565b90506020028101906102289190610bb0565b610239906040810190602001610bd0565b6001600160a01b0316146102605760405163f1b973df60e01b815260040160405180910390fd5b6102d78a8a8381811061027557610275610b9a565b905060200201602081019061028a9190610bd0565b89898481811061029c5761029c610b9a565b90506020028101906102ae9190610bb0565b8888858181106102c0576102c0610b9a565b90506020028101906102d29190610bf4565b610463565b8382815181106102e9576102e9610b9a565b602002602001018190525080806102ff90610c3b565b9150506101f2565b50610311816104dd565b50979650505050505050565b6060600061032d86868686610463565b90506103476103426040870160208801610bd0565b6104dd565b95945050505050565b606061034785858585610769565b606060008667ffffffffffffffff81111561037b5761037b610b84565b6040519080825280602002602001820160405280156103ae57816020015b60608152602001906001900390816103995790505b50905060005b87811015610311576104338989838181106103d1576103d1610b9a565b90506020020160208101906103e69190610bd0565b8888848181106103f8576103f8610b9a565b905060200281019061040a9190610bb0565b87878581811061041c5761041c610b9a565b905060200281019061042e9190610bf4565b610769565b82828151811061044557610445610b9a565b6020026020010181905250808061045b90610c3b565b9150506103b4565b60405163e60f999f60e01b81526060906001600160a01b0386169063e60f999f9061049690879087908790600401610c8b565b6000604051808303816000875af11580156104b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103479190810190610e9d565b426363226b0063ffffffff82161015610765576040516211023960e41b81526000600482018190526001600160a01b03848116602484015290917f0000000000000000000000000000000000000000000000000000000000000000909116906301102390906044016020604051808303816000875af1158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190610ff3565b90508061076357604080516001808252818301909252600091816020015b6105f76040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816105a65790505090506040518060c0016040528060008152602001856001600160a01b03168152602001306001600160a01b03168152602001600181526020018463ffffffff1681526020016040518060400160405280601b81526020017f57697468207374726f6e67206c6f76652066726f6d205369736d6f00000000008152508152508160008151811061069b5761069b610b9a565b602090810291909101015260405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106f2908490600401610ab9565b600060405180830381600087803b15801561070c57600080fd5b505af1158015610720573d6000803e3d6000fd5b50506040516001600160a01b03871681527f65566f56ce57729c92989973ff6ac5bdd213f57bf75d7248c4190d6d3634738e9250602001905060405180910390a1505b505b5050565b604051630af411a360e41b81526060906001600160a01b0386169063af411a309061079c90879087908790600401610c8b565b600060405180830381865afa1580156104b5573d6000803e3d6000fd5b60008083601f8401126107cb57600080fd5b50813567ffffffffffffffff8111156107e357600080fd5b6020830191508360208260051b85010111156107fe57600080fd5b9250929050565b6000806000806000806060878903121561081e57600080fd5b863567ffffffffffffffff8082111561083657600080fd5b6108428a838b016107b9565b9098509650602089013591508082111561085b57600080fd5b6108678a838b016107b9565b9096509450604089013591508082111561088057600080fd5b5061088d89828a016107b9565b979a9699509497509295939492505050565b60005b838110156108ba5781810151838201526020016108a2565b838111156108c9576000848401525b50505050565b60208152600060208201835180825260408401915060408160051b8501016020860160005b838110156109d957868303603f19018552815180518085526020918201918086019190600582901b87010160005b828110156109bf57601f1980898403018552855180518452602081015160018060a01b03808216602087015280604084015116604087015250506060810151606085015263ffffffff608082015116608085015260a0810151905060c060a085015280518060c086015261099d8160e087016020850161089f565b6020978801979690960195601f019091169290920160e0019150600101610922565b5060209889019890965094909401935050506001016108f4565b50909695505050505050565b6001600160a01b03811681146109fa57600080fd5b50565b8035610a08816109e5565b919050565b60008060008060608587031215610a2357600080fd5b8435610a2e816109e5565b9350602085013567ffffffffffffffff80821115610a4b57600080fd5b9086019060408289031215610a5f57600080fd5b90935060408601359080821115610a7557600080fd5b818701915087601f830112610a8957600080fd5b813581811115610a9857600080fd5b886020828501011115610aaa57600080fd5b95989497505060200194505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610b7657888303603f19018552815180518452878101516001600160a01b03908116898601528782015116878501526060808201519085015260808082015163ffffffff169085015260a09081015160c091850182905280519185018290529060e090610b5681838801858d0161089f565b96890196601f01601f191694909401909301925090860190600101610ae0565b509098975050505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008235603e19833603018112610bc657600080fd5b9190910192915050565b600060208284031215610be257600080fd5b8135610bed816109e5565b9392505050565b6000808335601e19843603018112610c0b57600080fd5b83018035915067ffffffffffffffff821115610c2657600080fd5b6020019150368190038213156107fe57600080fd5b600060018201610c5b57634e487b7160e01b600052601160045260246000fd5b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006040808352608083018635601e19883603018112610caa57600080fd5b87018035602080830167ffffffffffffffff80841115610cc957600080fd5b8360051b803603831315610cdc57600080fd5b878a018890529584905260a09589018601956000908a01607e1936889003015b86831015610d96578b8903609f190182528435818112610d1b57600080fd5b8801868101358a528a8101358a88015260608082013536839003603e19018112610d4457600080fd5b9091018b8101919088013586811115610d5c57600080fd5b803603831315610d6b57600080fd5b818d8d0152610d7d828d018285610c62565b9b50505094860194506001929092019190850190610cfc565b5050505050610da6818b016109fd565b6001600160a01b0381166060890152945086840381880152505050610dcc818688610c62565b979650505050505050565b60405160c0810167ffffffffffffffff81118282101715610dfa57610dfa610b84565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e2957610e29610b84565b604052919050565b600082601f830112610e4257600080fd5b815167ffffffffffffffff811115610e5c57610e5c610b84565b610e6f601f8201601f1916602001610e00565b818152846020838601011115610e8457600080fd5b610e9582602083016020870161089f565b949350505050565b60006020808385031215610eb057600080fd5b825167ffffffffffffffff80821115610ec857600080fd5b818501915085601f830112610edc57600080fd5b815181811115610eee57610eee610b84565b8060051b610efd858201610e00565b9182528381018501918581019089841115610f1757600080fd5b86860192505b83831015610fe657825185811115610f355760008081fd5b860160c0818c03601f1901811315610f4d5760008081fd5b610f55610dd7565b898301518152604080840151610f6a816109e5565b828c0152606084810151610f7d816109e5565b8083850152506080915081850151818401525060a08085015163ffffffff81168114610fa95760008081fd5b83830152928401519289841115610fc257600091508182fd5b610fd08f8d86880101610e31565b9083015250845250509186019190860190610f1d565b9998505050505050505050565b60006020828403121561100557600080fd5b81518015158114610bed57600080fdfea26469706673582212206eab9b350687ecccafd79868df619e95a4ffb1f38b3590296e186abb24b904f864736f6c634300080e0033", + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", + "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"DifferentRequestsDestinations\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"name\":\"EarlyUserAttestationGenerated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"ATTESTATIONS_REGISTRY\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EARLY_USER_BADGE_END_DATE\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EARLY_USER_COLLECTION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"attesters\",\"type\":\"address[]\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request[]\",\"name\":\"requests\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"proofDataArray\",\"type\":\"bytes[]\"}],\"name\":\"batchBuildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[][]\",\"name\":\"\",\"type\":\"tuple[][]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"attesters\",\"type\":\"address[]\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request[]\",\"name\":\"requests\",\"type\":\"tuple[]\"},{\"internalType\":\"bytes[]\",\"name\":\"proofDataArray\",\"type\":\"bytes[]\"}],\"name\":\"batchGenerateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[][]\",\"name\":\"\",\"type\":\"tuple[][]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attester\",\"type\":\"address\"},{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"batchBuildAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])\":{\"details\":\"build the attestations from multiple user requests. Forwards to the build function of targeted attester\",\"params\":{\"attesters\":\"Targeted attesters\",\"proofDataArray\":\"Data sent along the request to prove its validity\",\"requests\":\"User requests\"},\"returns\":{\"_0\":\"attestations Attestations that will be recorded\"}},\"batchGenerateAttestations(address[],((uint256,uint256,bytes)[],address)[],bytes[])\":{\"details\":\"generate multiple attestations at once, to the same destination, generates an early user attestation\",\"params\":{\"attesters\":\"Attesters targeted by the attesters\",\"proofDataArray\":\"Data sent with each request\",\"requests\":\"Requests sent to attester\"}},\"buildAttestations(address,((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"build the attestations from a user request targeting a specific attester. Forwards to the build function of targeted attester\",\"params\":{\"attester\":\"Targeted attester\",\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that will be recorded\"}},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"attestationsRegistryAddress\":\"Attestations registry contract address\"}},\"generateAttestations(address,((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Forward a request to an attester and generates an early user attestation\",\"params\":{\"attester\":\"Attester targeted by the request\",\"proofData\":\"Data provided to the attester to back the request\",\"request\":\"Request sent to the attester\"}}},\"title\":\"Front\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This is the Front contract of the Sismo protocol Behind a proxy, it routes attestations request to the targeted attester and can perform some actions This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference For more information: https://front.docs.sismo.io\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/Front.sol\":\"Front\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"contracts/core/Front.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {IFront} from './interfaces/IFront.sol';\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation} from './libs/Structs.sol';\\n\\n/**\\n * @title Front\\n * @author Sismo\\n * @notice This is the Front contract of the Sismo protocol\\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\\n\\n * For more information: https://front.docs.sismo.io\\n */\\ncontract Front is IFront {\\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\\n uint256 public constant EARLY_USER_COLLECTION = 0;\\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress Attestations registry contract address\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Forward a request to an attester and generates an early user attestation\\n * @param attester Attester targeted by the request\\n * @param request Request sent to the attester\\n * @param proofData Data provided to the attester to back the request\\n */\\n function generateAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n Attestation[] memory attestations = _forwardAttestationsGeneration(\\n attester,\\n request,\\n proofData\\n );\\n _generateEarlyUserAttestation(request.destination);\\n return attestations;\\n }\\n\\n /**\\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\\n * @param attesters Attesters targeted by the attesters\\n * @param requests Requests sent to attester\\n * @param proofDataArray Data sent with each request\\n */\\n function batchGenerateAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external override returns (Attestation[][] memory) {\\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\\n address destination = requests[0].destination;\\n for (uint256 i = 0; i < attesters.length; i++) {\\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\\n attestations[i] = _forwardAttestationsGeneration(\\n attesters[i],\\n requests[i],\\n proofDataArray[i]\\n );\\n }\\n _generateEarlyUserAttestation(destination);\\n return attestations;\\n }\\n\\n /**\\n * @dev build the attestations from a user request targeting a specific attester.\\n * Forwards to the build function of targeted attester\\n * @param attester Targeted attester\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external view override returns (Attestation[] memory) {\\n return _forwardAttestationsBuild(attester, request, proofData);\\n }\\n\\n /**\\n * @dev build the attestations from multiple user requests.\\n * Forwards to the build function of targeted attester\\n * @param attesters Targeted attesters\\n * @param requests User requests\\n * @param proofDataArray Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function batchBuildAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external view override returns (Attestation[][] memory) {\\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\\n\\n for (uint256 i = 0; i < attesters.length; i++) {\\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\\n }\\n return attestations;\\n }\\n\\n function _forwardAttestationsBuild(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) internal view returns (Attestation[] memory) {\\n return IAttester(attester).buildAttestations(request, proofData);\\n }\\n\\n function _forwardAttestationsGeneration(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) internal returns (Attestation[] memory) {\\n return IAttester(attester).generateAttestations(request, proofData);\\n }\\n\\n function _generateEarlyUserAttestation(address destination) internal {\\n uint32 currentTimestamp = uint32(block.timestamp);\\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\\n EARLY_USER_COLLECTION,\\n destination\\n );\\n\\n if (!alreadyHasAttestation) {\\n Attestation[] memory attestations = new Attestation[](1);\\n attestations[0] = Attestation(\\n EARLY_USER_COLLECTION,\\n destination,\\n address(this),\\n 1,\\n currentTimestamp,\\n 'With strong love from Sismo'\\n );\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n emit EarlyUserAttestationGenerated(destination);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3ea2112c22a36ff318873f1f015fa9e3b447e93d33464ae81b9bcd7d0f917621\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0x2d5faf5df56dfe1294202e89180846a1d4a5f938699619ee73b60c7314a97dfe\",\"license\":\"MIT\"},\"contracts/core/interfaces/IFront.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\n\\n/**\\n * @title IFront\\n * @author Sismo\\n * @notice This is the interface of the Front Contract\\n */\\ninterface IFront {\\n error DifferentRequestsDestinations();\\n event EarlyUserAttestationGenerated(address destination);\\n\\n /**\\n * @dev Forward a request to an attester and generates an early user attestation\\n * @param attester Attester targeted by the request\\n * @param request Request sent to the attester\\n * @param proofData Data provided to the attester to back the request\\n */\\n function generateAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev generate multiple attestations at once, to the same destination\\n * @param attesters Attesters targeted by the attesters\\n * @param requests Requests sent to attester\\n * @param proofDataArray Data sent with each request\\n */\\n function batchGenerateAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external returns (Attestation[][] memory);\\n\\n /**\\n * @dev build the attestations from a user request targeting a specific attester.\\n * Forwards to the build function of targeted attester\\n * @param attester Targeted attester\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n address attester,\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev build the attestations from multiple user requests.\\n * Forwards to the build function(s) of targeted attester(s)\\n * @param attesters Targeted attesters\\n * @param requests User requests\\n * @param proofDataArray Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function batchBuildAttestations(\\n address[] calldata attesters,\\n Request[] calldata requests,\\n bytes[] calldata proofDataArray\\n ) external view returns (Attestation[][] memory);\\n}\\n\",\"keccak256\":\"0xfeab84e36830c432f91d0cbe1beb430331529829ce667a6371fbad47baa12191\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x60a060405234801561001057600080fd5b506040516110e43803806110e483398101604081905261002f91610040565b6001600160a01b0316608052610070565b60006020828403121561005257600080fd5b81516001600160a01b038116811461006957600080fd5b9392505050565b60805161104b610099600039600081816101020152818161051901526106bd015261104b6000f3fe608060405234801561001057600080fd5b506004361061007d5760003560e01c806389a504771161005b57806389a50477146100e7578063ac9d6541146100fd578063aebddc691461013c578063c0a92c911461014f57600080fd5b80630a60387d14610082578063369b88be146100a75780633ee490ce146100c7575b600080fd5b61008d6363226b0081565b60405163ffffffff90911681526020015b60405180910390f35b6100ba6100b5366004610805565b610162565b60405161009e91906108cf565b6100da6100d5366004610a0d565b61031d565b60405161009e9190610ab9565b6100ef600081565b60405190815260200161009e565b6101247f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161009e565b6100da61014a366004610a0d565b610350565b6100ba61015d366004610805565b61035e565b606060008667ffffffffffffffff81111561017f5761017f610b84565b6040519080825280602002602001820160405280156101b257816020015b606081526020019060019003908161019d5790505b5090506000868660008181106101ca576101ca610b9a565b90506020028101906101dc9190610bb0565b6101ed906040810190602001610bd0565b905060005b8881101561030757816001600160a01b031688888381811061021657610216610b9a565b90506020028101906102289190610bb0565b610239906040810190602001610bd0565b6001600160a01b0316146102605760405163f1b973df60e01b815260040160405180910390fd5b6102d78a8a8381811061027557610275610b9a565b905060200201602081019061028a9190610bd0565b89898481811061029c5761029c610b9a565b90506020028101906102ae9190610bb0565b8888858181106102c0576102c0610b9a565b90506020028101906102d29190610bf4565b610463565b8382815181106102e9576102e9610b9a565b602002602001018190525080806102ff90610c3b565b9150506101f2565b50610311816104dd565b50979650505050505050565b6060600061032d86868686610463565b90506103476103426040870160208801610bd0565b6104dd565b95945050505050565b606061034785858585610769565b606060008667ffffffffffffffff81111561037b5761037b610b84565b6040519080825280602002602001820160405280156103ae57816020015b60608152602001906001900390816103995790505b50905060005b87811015610311576104338989838181106103d1576103d1610b9a565b90506020020160208101906103e69190610bd0565b8888848181106103f8576103f8610b9a565b905060200281019061040a9190610bb0565b87878581811061041c5761041c610b9a565b905060200281019061042e9190610bf4565b610769565b82828151811061044557610445610b9a565b6020026020010181905250808061045b90610c3b565b9150506103b4565b60405163e60f999f60e01b81526060906001600160a01b0386169063e60f999f9061049690879087908790600401610c8b565b6000604051808303816000875af11580156104b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103479190810190610e9d565b426363226b0063ffffffff82161015610765576040516211023960e41b81526000600482018190526001600160a01b03848116602484015290917f0000000000000000000000000000000000000000000000000000000000000000909116906301102390906044016020604051808303816000875af1158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190610ff3565b90508061076357604080516001808252818301909252600091816020015b6105f76040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816105a65790505090506040518060c0016040528060008152602001856001600160a01b03168152602001306001600160a01b03168152602001600181526020018463ffffffff1681526020016040518060400160405280601b81526020017f57697468207374726f6e67206c6f76652066726f6d205369736d6f00000000008152508152508160008151811061069b5761069b610b9a565b602090810291909101015260405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106f2908490600401610ab9565b600060405180830381600087803b15801561070c57600080fd5b505af1158015610720573d6000803e3d6000fd5b50506040516001600160a01b03871681527f65566f56ce57729c92989973ff6ac5bdd213f57bf75d7248c4190d6d3634738e9250602001905060405180910390a1505b505b5050565b604051630af411a360e41b81526060906001600160a01b0386169063af411a309061079c90879087908790600401610c8b565b600060405180830381865afa1580156104b5573d6000803e3d6000fd5b60008083601f8401126107cb57600080fd5b50813567ffffffffffffffff8111156107e357600080fd5b6020830191508360208260051b85010111156107fe57600080fd5b9250929050565b6000806000806000806060878903121561081e57600080fd5b863567ffffffffffffffff8082111561083657600080fd5b6108428a838b016107b9565b9098509650602089013591508082111561085b57600080fd5b6108678a838b016107b9565b9096509450604089013591508082111561088057600080fd5b5061088d89828a016107b9565b979a9699509497509295939492505050565b60005b838110156108ba5781810151838201526020016108a2565b838111156108c9576000848401525b50505050565b60208152600060208201835180825260408401915060408160051b8501016020860160005b838110156109d957868303603f19018552815180518085526020918201918086019190600582901b87010160005b828110156109bf57601f1980898403018552855180518452602081015160018060a01b03808216602087015280604084015116604087015250506060810151606085015263ffffffff608082015116608085015260a0810151905060c060a085015280518060c086015261099d8160e087016020850161089f565b6020978801979690960195601f019091169290920160e0019150600101610922565b5060209889019890965094909401935050506001016108f4565b50909695505050505050565b6001600160a01b03811681146109fa57600080fd5b50565b8035610a08816109e5565b919050565b60008060008060608587031215610a2357600080fd5b8435610a2e816109e5565b9350602085013567ffffffffffffffff80821115610a4b57600080fd5b9086019060408289031215610a5f57600080fd5b90935060408601359080821115610a7557600080fd5b818701915087601f830112610a8957600080fd5b813581811115610a9857600080fd5b886020828501011115610aaa57600080fd5b95989497505060200194505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610b7657888303603f19018552815180518452878101516001600160a01b03908116898601528782015116878501526060808201519085015260808082015163ffffffff169085015260a09081015160c091850182905280519185018290529060e090610b5681838801858d0161089f565b96890196601f01601f191694909401909301925090860190600101610ae0565b509098975050505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008235603e19833603018112610bc657600080fd5b9190910192915050565b600060208284031215610be257600080fd5b8135610bed816109e5565b9392505050565b6000808335601e19843603018112610c0b57600080fd5b83018035915067ffffffffffffffff821115610c2657600080fd5b6020019150368190038213156107fe57600080fd5b600060018201610c5b57634e487b7160e01b600052601160045260246000fd5b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006040808352608083018635601e19883603018112610caa57600080fd5b87018035602080830167ffffffffffffffff80841115610cc957600080fd5b8360051b803603831315610cdc57600080fd5b878a018890529584905260a09589018601956000908a01607e1936889003015b86831015610d96578b8903609f190182528435818112610d1b57600080fd5b8801868101358a528a8101358a88015260608082013536839003603e19018112610d4457600080fd5b9091018b8101919088013586811115610d5c57600080fd5b803603831315610d6b57600080fd5b818d8d0152610d7d828d018285610c62565b9b50505094860194506001929092019190850190610cfc565b5050505050610da6818b016109fd565b6001600160a01b0381166060890152945086840381880152505050610dcc818688610c62565b979650505050505050565b60405160c0810167ffffffffffffffff81118282101715610dfa57610dfa610b84565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e2957610e29610b84565b604052919050565b600082601f830112610e4257600080fd5b815167ffffffffffffffff811115610e5c57610e5c610b84565b610e6f601f8201601f1916602001610e00565b818152846020838601011115610e8457600080fd5b610e9582602083016020870161089f565b949350505050565b60006020808385031215610eb057600080fd5b825167ffffffffffffffff80821115610ec857600080fd5b818501915085601f830112610edc57600080fd5b815181811115610eee57610eee610b84565b8060051b610efd858201610e00565b9182528381018501918581019089841115610f1757600080fd5b86860192505b83831015610fe657825185811115610f355760008081fd5b860160c0818c03601f1901811315610f4d5760008081fd5b610f55610dd7565b898301518152604080840151610f6a816109e5565b828c0152606084810151610f7d816109e5565b8083850152506080915081850151818401525060a08085015163ffffffff81168114610fa95760008081fd5b83830152928401519289841115610fc257600091508182fd5b610fd08f8d86880101610e31565b9083015250845250509186019190860190610f1d565b9998505050505050505050565b60006020828403121561100557600080fd5b81518015158114610bed57600080fdfea2646970667358221220d94f10ac944b32abaa7aeaaf9016c7bb0e7cf17318303adce9da2bdcd5cbb14a64736f6c634300080e0033", + "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061007d5760003560e01c806389a504771161005b57806389a50477146100e7578063ac9d6541146100fd578063aebddc691461013c578063c0a92c911461014f57600080fd5b80630a60387d14610082578063369b88be146100a75780633ee490ce146100c7575b600080fd5b61008d6363226b0081565b60405163ffffffff90911681526020015b60405180910390f35b6100ba6100b5366004610805565b610162565b60405161009e91906108cf565b6100da6100d5366004610a0d565b61031d565b60405161009e9190610ab9565b6100ef600081565b60405190815260200161009e565b6101247f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161009e565b6100da61014a366004610a0d565b610350565b6100ba61015d366004610805565b61035e565b606060008667ffffffffffffffff81111561017f5761017f610b84565b6040519080825280602002602001820160405280156101b257816020015b606081526020019060019003908161019d5790505b5090506000868660008181106101ca576101ca610b9a565b90506020028101906101dc9190610bb0565b6101ed906040810190602001610bd0565b905060005b8881101561030757816001600160a01b031688888381811061021657610216610b9a565b90506020028101906102289190610bb0565b610239906040810190602001610bd0565b6001600160a01b0316146102605760405163f1b973df60e01b815260040160405180910390fd5b6102d78a8a8381811061027557610275610b9a565b905060200201602081019061028a9190610bd0565b89898481811061029c5761029c610b9a565b90506020028101906102ae9190610bb0565b8888858181106102c0576102c0610b9a565b90506020028101906102d29190610bf4565b610463565b8382815181106102e9576102e9610b9a565b602002602001018190525080806102ff90610c3b565b9150506101f2565b50610311816104dd565b50979650505050505050565b6060600061032d86868686610463565b90506103476103426040870160208801610bd0565b6104dd565b95945050505050565b606061034785858585610769565b606060008667ffffffffffffffff81111561037b5761037b610b84565b6040519080825280602002602001820160405280156103ae57816020015b60608152602001906001900390816103995790505b50905060005b87811015610311576104338989838181106103d1576103d1610b9a565b90506020020160208101906103e69190610bd0565b8888848181106103f8576103f8610b9a565b905060200281019061040a9190610bb0565b87878581811061041c5761041c610b9a565b905060200281019061042e9190610bf4565b610769565b82828151811061044557610445610b9a565b6020026020010181905250808061045b90610c3b565b9150506103b4565b60405163e60f999f60e01b81526060906001600160a01b0386169063e60f999f9061049690879087908790600401610c8b565b6000604051808303816000875af11580156104b5573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526103479190810190610e9d565b426363226b0063ffffffff82161015610765576040516211023960e41b81526000600482018190526001600160a01b03848116602484015290917f0000000000000000000000000000000000000000000000000000000000000000909116906301102390906044016020604051808303816000875af1158015610564573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105889190610ff3565b90508061076357604080516001808252818301909252600091816020015b6105f76040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816105a65790505090506040518060c0016040528060008152602001856001600160a01b03168152602001306001600160a01b03168152602001600181526020018463ffffffff1681526020016040518060400160405280601b81526020017f57697468207374726f6e67206c6f76652066726f6d205369736d6f00000000008152508152508160008151811061069b5761069b610b9a565b602090810291909101015260405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106f2908490600401610ab9565b600060405180830381600087803b15801561070c57600080fd5b505af1158015610720573d6000803e3d6000fd5b50506040516001600160a01b03871681527f65566f56ce57729c92989973ff6ac5bdd213f57bf75d7248c4190d6d3634738e9250602001905060405180910390a1505b505b5050565b604051630af411a360e41b81526060906001600160a01b0386169063af411a309061079c90879087908790600401610c8b565b600060405180830381865afa1580156104b5573d6000803e3d6000fd5b60008083601f8401126107cb57600080fd5b50813567ffffffffffffffff8111156107e357600080fd5b6020830191508360208260051b85010111156107fe57600080fd5b9250929050565b6000806000806000806060878903121561081e57600080fd5b863567ffffffffffffffff8082111561083657600080fd5b6108428a838b016107b9565b9098509650602089013591508082111561085b57600080fd5b6108678a838b016107b9565b9096509450604089013591508082111561088057600080fd5b5061088d89828a016107b9565b979a9699509497509295939492505050565b60005b838110156108ba5781810151838201526020016108a2565b838111156108c9576000848401525b50505050565b60208152600060208201835180825260408401915060408160051b8501016020860160005b838110156109d957868303603f19018552815180518085526020918201918086019190600582901b87010160005b828110156109bf57601f1980898403018552855180518452602081015160018060a01b03808216602087015280604084015116604087015250506060810151606085015263ffffffff608082015116608085015260a0810151905060c060a085015280518060c086015261099d8160e087016020850161089f565b6020978801979690960195601f019091169290920160e0019150600101610922565b5060209889019890965094909401935050506001016108f4565b50909695505050505050565b6001600160a01b03811681146109fa57600080fd5b50565b8035610a08816109e5565b919050565b60008060008060608587031215610a2357600080fd5b8435610a2e816109e5565b9350602085013567ffffffffffffffff80821115610a4b57600080fd5b9086019060408289031215610a5f57600080fd5b90935060408601359080821115610a7557600080fd5b818701915087601f830112610a8957600080fd5b813581811115610a9857600080fd5b886020828501011115610aaa57600080fd5b95989497505060200194505050565b60006020808301818452808551808352604092508286019150828160051b87010184880160005b83811015610b7657888303603f19018552815180518452878101516001600160a01b03908116898601528782015116878501526060808201519085015260808082015163ffffffff169085015260a09081015160c091850182905280519185018290529060e090610b5681838801858d0161089f565b96890196601f01601f191694909401909301925090860190600101610ae0565b509098975050505050505050565b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b60008235603e19833603018112610bc657600080fd5b9190910192915050565b600060208284031215610be257600080fd5b8135610bed816109e5565b9392505050565b6000808335601e19843603018112610c0b57600080fd5b83018035915067ffffffffffffffff821115610c2657600080fd5b6020019150368190038213156107fe57600080fd5b600060018201610c5b57634e487b7160e01b600052601160045260246000fd5b5060010190565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60006040808352608083018635601e19883603018112610caa57600080fd5b87018035602080830167ffffffffffffffff80841115610cc957600080fd5b8360051b803603831315610cdc57600080fd5b878a018890529584905260a09589018601956000908a01607e1936889003015b86831015610d96578b8903609f190182528435818112610d1b57600080fd5b8801868101358a528a8101358a88015260608082013536839003603e19018112610d4457600080fd5b9091018b8101919088013586811115610d5c57600080fd5b803603831315610d6b57600080fd5b818d8d0152610d7d828d018285610c62565b9b50505094860194506001929092019190850190610cfc565b5050505050610da6818b016109fd565b6001600160a01b0381166060890152945086840381880152505050610dcc818688610c62565b979650505050505050565b60405160c0810167ffffffffffffffff81118282101715610dfa57610dfa610b84565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610e2957610e29610b84565b604052919050565b600082601f830112610e4257600080fd5b815167ffffffffffffffff811115610e5c57610e5c610b84565b610e6f601f8201601f1916602001610e00565b818152846020838601011115610e8457600080fd5b610e9582602083016020870161089f565b949350505050565b60006020808385031215610eb057600080fd5b825167ffffffffffffffff80821115610ec857600080fd5b818501915085601f830112610edc57600080fd5b815181811115610eee57610eee610b84565b8060051b610efd858201610e00565b9182528381018501918581019089841115610f1757600080fd5b86860192505b83831015610fe657825185811115610f355760008081fd5b860160c0818c03601f1901811315610f4d5760008081fd5b610f55610dd7565b898301518152604080840151610f6a816109e5565b828c0152606084810151610f7d816109e5565b8083850152506080915081850151818401525060a08085015163ffffffff81168114610fa95760008081fd5b83830152928401519289841115610fc257600091508182fd5b610fd08f8d86880101610e31565b9083015250845250509186019190860190610f1d565b9998505050505050505050565b60006020828403121561100557600080fd5b81518015158114610bed57600080fdfea2646970667358221220d94f10ac944b32abaa7aeaaf9016c7bb0e7cf17318303adce9da2bdcd5cbb14a64736f6c634300080e0033", "devdoc": { "author": "Sismo", "kind": "dev", diff --git a/deployments/mumbaiTestnet/FrontProxy.json b/deployments/mumbaiTestnet/FrontProxy.json new file mode 100644 index 0000000..40ea543 --- /dev/null +++ b/deployments/mumbaiTestnet/FrontProxy.json @@ -0,0 +1,250 @@ +{ + "address": "0xcAf720C39bcdF47476aDc0618e6d7B57B7533213", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xa9798da3d7eef1b74337638a4af6d4a646b8cb8988d1b7b0c8f3fa111e1d75b3", + "receipt": { + "to": null, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xcAf720C39bcdF47476aDc0618e6d7B57B7533213", + "transactionIndex": 13, + "gasUsed": "584787", + "logsBloom": "0x00000000000000020000000000000000402000000000000000000000000000000000000000000000000000000000000000008000400000000000000000000000000000000000000000000000000002800000000000000000000100000000000000000000000000000000000000000000000000800000000080000000000000200000000000000000000000000000001000000000000000000000000040800000200000000000000020000000000002000001000000000000000000000000004000008020000000000001002000000000000000000400000000100000000000000000000000000000000000000000000000000800000000000000000000100000", + "blockHash": "0xe8648e6431782583969ae1514158f2d9287a7370d445cca0a6b5fb569a18f480", + "transactionHash": "0xa9798da3d7eef1b74337638a4af6d4a646b8cb8988d1b7b0c8f3fa111e1d75b3", + "logs": [ + { + "transactionIndex": 13, + "blockNumber": 29771765, + "transactionHash": "0xa9798da3d7eef1b74337638a4af6d4a646b8cb8988d1b7b0c8f3fa111e1d75b3", + "address": "0xcAf720C39bcdF47476aDc0618e6d7B57B7533213", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000401a6641ac660678c1c0d8b5d03a9e90f5f70d81" + ], + "data": "0x", + "logIndex": 61, + "blockHash": "0xe8648e6431782583969ae1514158f2d9287a7370d445cca0a6b5fb569a18f480" + }, + { + "transactionIndex": 13, + "blockNumber": 29771765, + "transactionHash": "0xa9798da3d7eef1b74337638a4af6d4a646b8cb8988d1b7b0c8f3fa111e1d75b3", + "address": "0xcAf720C39bcdF47476aDc0618e6d7B57B7533213", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002110475dfbb8d331b300178a867372991ff35fa3", + "logIndex": 62, + "blockHash": "0xe8648e6431782583969ae1514158f2d9287a7370d445cca0a6b5fb569a18f480" + }, + { + "transactionIndex": 13, + "blockNumber": 29771765, + "transactionHash": "0xa9798da3d7eef1b74337638a4af6d4a646b8cb8988d1b7b0c8f3fa111e1d75b3", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" + ], + "data": "0x00000000000000000000000000000000000000000000000000031dca7ff78bb40000000000000000000000000000000000000000000000001b990a22df4a106f00000000000000000000000000000000000000000000187ae5f6ca030889ab610000000000000000000000000000000000000000000000001b95ec585f5284bb00000000000000000000000000000000000000000000187ae5f9e7cd88813715", + "logIndex": 63, + "blockHash": "0xe8648e6431782583969ae1514158f2d9287a7370d445cca0a6b5fb569a18f480" + } + ], + "blockNumber": 29771765, + "cumulativeGasUsed": "6595135", + "status": 1, + "byzantium": true + }, + "args": [ + "0x401A6641AC660678C1c0d8b5D03a9e90F5f70D81", + "0x2110475dfbB8d331b300178A867372991ff35fA3", + "0x" + ], + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", + "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(\\n address newImplementation,\\n bytes calldata data\\n ) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x1663761dc98da7a84e6570b428877de7de9859e34f99c7002cad71ccfc9d6283\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405162000eeb38038062000eeb8339810160408190526200002691620004ed565b828162000036828260006200009a565b5062000066905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005cd565b60008051602062000ea483398151915214620000865762000086620005f3565b6200009182620000d7565b5050506200065c565b620000a58362000132565b600082511180620000b35750805b15620000d257620000d083836200017460201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f62000102620001a3565b604080516001600160a01b03928316815291841660208301520160405180910390a16200012f81620001dc565b50565b6200013d8162000291565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606200019c838360405180606001604052806027815260200162000ec46027913962000345565b9392505050565b6000620001cd60008051602062000ea483398151915260001b620003c460201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002475760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b806200027060008051602062000ea483398151915260001b620003c460201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002a781620003c760201b6200025a1760201c565b6200030b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200023e565b80620002707f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b620003c460201b620001ea1760201c565b6060600080856001600160a01b03168560405162000364919062000609565b600060405180830381855af49150503d8060008114620003a1576040519150601f19603f3d011682016040523d82523d6000602084013e620003a6565b606091505b509092509050620003ba86838387620003d6565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200044a57825160000362000442576001600160a01b0385163b620004425760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016200023e565b508162000456565b6200045683836200045e565b949350505050565b8151156200046f5781518083602001fd5b8060405162461bcd60e51b81526004016200023e919062000627565b80516001600160a01b0381168114620004a357600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004db578181015183820152602001620004c1565b83811115620000d05750506000910152565b6000806000606084860312156200050357600080fd5b6200050e846200048b565b92506200051e602085016200048b565b60408501519092506001600160401b03808211156200053c57600080fd5b818601915086601f8301126200055157600080fd5b815181811115620005665762000566620004a8565b604051601f8201601f19908116603f01168101908382118183101715620005915762000591620004a8565b81604052828152896020848701011115620005ab57600080fd5b620005be836020830160208801620004be565b80955050505050509250925092565b600082821015620005ee57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b600082516200061d818460208701620004be565b9190910192915050565b602081526000825180602084015262000648816040850160208701620004be565b601f01601f19169190910160400192915050565b610838806200066c6000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106c2565b610118565b61005b6100933660046106dd565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106c2565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107dc602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd610456565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b6103688361047e565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a816104be565b6060600080856001600160a01b0316856040516103fb919061078c565b600060405180830381855af49150503d8060008114610436576040519150601f19603f3d011682016040523d82523d6000602084013e61043b565b606091505b509150915061044c86838387610567565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b610487816105e8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105235760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105d65782516000036105cf576001600160a01b0385163b6105cf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102f5565b50816105e0565b6105e0838361067c565b949350505050565b6001600160a01b0381163b6106555760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610546565b81511561068c5781518083602001fd5b8060405162461bcd60e51b81526004016102f591906107a8565b80356001600160a01b03811681146106bd57600080fd5b919050565b6000602082840312156106d457600080fd5b610253826106a6565b6000806000604084860312156106f257600080fd5b6106fb846106a6565b9250602084013567ffffffffffffffff8082111561071857600080fd5b818601915086601f83011261072c57600080fd5b81358181111561073b57600080fd5b87602082850101111561074d57600080fd5b6020830194508093505050509250925092565b60005b8381101561077b578181015183820152602001610763565b838111156103845750506000910152565b6000825161079e818460208701610760565b9190910192915050565b60208152600082518060208401526107c7816040850160208701610760565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e2b2f80d01b9fee1887f086f33ea33eabe6a896123f3722976ea73e069c365b664736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106c2565b610118565b61005b6100933660046106dd565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106c2565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107dc602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd610456565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b6103688361047e565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a816104be565b6060600080856001600160a01b0316856040516103fb919061078c565b600060405180830381855af49150503d8060008114610436576040519150601f19603f3d011682016040523d82523d6000602084013e61043b565b606091505b509150915061044c86838387610567565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b610487816105e8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105235760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105d65782516000036105cf576001600160a01b0385163b6105cf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102f5565b50816105e0565b6105e0838361067c565b949350505050565b6001600160a01b0381163b6106555760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610546565b81511561068c5781518083602001fd5b8060405162461bcd60e51b81526004016102f591906107a8565b80356001600160a01b03811681146106bd57600080fd5b919050565b6000602082840312156106d457600080fd5b610253826106a6565b6000806000604084860312156106f257600080fd5b6106fb846106a6565b9250602084013567ffffffffffffffff8082111561071857600080fd5b818601915086601f83011261072c57600080fd5b81358181111561073b57600080fd5b87602082850101111561074d57600080fd5b6020830194508093505050509250925092565b60005b8381101561077b578181015183820152602001610763565b838111156103845750506000910152565b6000825161079e818460208701610760565b9190910192915050565b60208152600082518060208401526107c7816040850160208701610760565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e2b2f80d01b9fee1887f086f33ea33eabe6a896123f3722976ea73e069c365b664736f6c634300080e0033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/mumbai/FrontendLib.json b/deployments/mumbaiTestnet/FrontendLib.json similarity index 98% rename from deployments/mumbai/FrontendLib.json rename to deployments/mumbaiTestnet/FrontendLib.json index b37ed6d..5f0611b 100644 --- a/deployments/mumbai/FrontendLib.json +++ b/deployments/mumbaiTestnet/FrontendLib.json @@ -1,5 +1,5 @@ { - "address": "0x299DDFdE5f62Abb56D2f3Dd8b42E525494e5455B", + "address": "0xBcEd04c8ecBB47250Ca8193bb7fAe0F1A9A0391F", "abi": [ { "inputs": [ @@ -32,40 +32,40 @@ "type": "function" } ], - "transactionHash": "0x0363be8297be0b83416a50ef8b0123540051dbe2d00f2acaf0c690a26e0bb73c", + "transactionHash": "0x1fbdecef09967106bbd56efa308b2a3ffb649ff9b6ffbfb719d69049de973568", "receipt": { "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x299DDFdE5f62Abb56D2f3Dd8b42E525494e5455B", - "transactionIndex": 44, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xBcEd04c8ecBB47250Ca8193bb7fAe0F1A9A0391F", + "transactionIndex": 8, "gasUsed": "224972", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000008000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000010000000000000000000008000200000000000000000080000000000000000000000000000000000000000004000000000000000000001000000000100000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000100000", - "blockHash": "0xbd76fccb7ec73ca45ed359f498b1f4d768d5b46401bf1236319c4d28a58838e9", - "transactionHash": "0x0363be8297be0b83416a50ef8b0123540051dbe2d00f2acaf0c690a26e0bb73c", + "logsBloom": "0x00000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000040000000200000000000000020000000000002000001000000000000000000000000004000008000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x2052cc42021f4250fed001e8ef51bd64ae6b3fe9336f91b28d300ce3b062198b", + "transactionHash": "0x1fbdecef09967106bbd56efa308b2a3ffb649ff9b6ffbfb719d69049de973568", "logs": [ { - "transactionIndex": 44, - "blockNumber": 29624968, - "transactionHash": "0x0363be8297be0b83416a50ef8b0123540051dbe2d00f2acaf0c690a26e0bb73c", + "transactionIndex": 8, + "blockNumber": 29772205, + "transactionHash": "0x1fbdecef09967106bbd56efa308b2a3ffb649ff9b6ffbfb719d69049de973568", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x0000000000000000000000003a22c8bc68e98b0faf40f349dd2b2890fae01484" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" ], - "data": "0x0000000000000000000000000000000000000000000000000000eed4e962cca00000000000000000000000000000000000000000000000007c898cb4dfeccdee0000000000000000000000000000000000000000000000c8b79ed760334ea17f0000000000000000000000000000000000000000000000007c889ddff68a014e0000000000000000000000000000000000000000000000c8b79fc6351cb16e1f", - "logIndex": 163, - "blockHash": "0xbd76fccb7ec73ca45ed359f498b1f4d768d5b46401bf1236319c4d28a58838e9" + "data": "0x000000000000000000000000000000000000000000000000000132ea903096680000000000000000000000000000000000000000000000001b5e17e8807543e500000000000000000000000000000000000000000000187b2dcdbcf7234316260000000000000000000000000000000000000000000000001b5ce4fdf044ad7d00000000000000000000000000000000000000000000187b2dceefe1b373ac8e", + "logIndex": 33, + "blockHash": "0x2052cc42021f4250fed001e8ef51bd64ae6b3fe9336f91b28d300ce3b062198b" } ], - "blockNumber": 29624968, - "cumulativeGasUsed": "16187392", + "blockNumber": 29772205, + "cumulativeGasUsed": "2088779", "status": 1, "byzantium": true }, "args": [ - "0x069e6B99f4DA543156f66274FC6673442803C587" + "0xEe6c299A09d352caf53C81621f6D757c7C0B4d7c" ], "numDeployments": 1, "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", diff --git a/deployments/mumbai/HydraS1AccountboundAttester.json b/deployments/mumbaiTestnet/HydraS1AccountboundAttester.json similarity index 98% rename from deployments/mumbai/HydraS1AccountboundAttester.json rename to deployments/mumbaiTestnet/HydraS1AccountboundAttester.json index a63d770..382a6ec 100644 --- a/deployments/mumbai/HydraS1AccountboundAttester.json +++ b/deployments/mumbaiTestnet/HydraS1AccountboundAttester.json @@ -1,5 +1,5 @@ { - "address": "0x069e6B99f4DA543156f66274FC6673442803C587", + "address": "0xEe6c299A09d352caf53C81621f6D757c7C0B4d7c", "abi": [ { "inputs": [ @@ -981,89 +981,89 @@ "type": "function" } ], - "transactionHash": "0x1367c8d1f64f3987113f6cafe1e0929b836f4ee62ef2fb65fdd6b2833394d238", + "transactionHash": "0xeb1debcc341f8a8d53f61b4ad5dc32643d2bf028f53c38f677361a8669071634", "receipt": { "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0xa723D0b8D0e816BE0f4BbE839163655BD85E14FC", - "transactionIndex": 31, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xE822EcA41Be81D15ffe3daEaF9f9F91E8bB5D959", + "transactionIndex": 16, "gasUsed": "2322582", - "logsBloom": "0x00000000000000000000000000020000000000000000000000800000000000000000000000000000020000000000000000008000102000000000000000000000000000000000000000000000000000800001000000000000040100000000000000000000020000000000000000000800002000000000000080000000000000400000000000000000000000002000000000000010000080000000000000008000200000000000000000000000800400000000000000000000000040000000004000000000000000000001000000040000000000000000000000100000000020000000000000000000000000000000000000000000000000000020000000100000", - "blockHash": "0x2b4a8cf2d29028afa58dd99b710997cc288b1d5d7c951447f5d5886bc45606fa", - "transactionHash": "0x1367c8d1f64f3987113f6cafe1e0929b836f4ee62ef2fb65fdd6b2833394d238", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000008000000000000000000000008000000000000100000000000000000000800001000000000000000100000000000000000000020000000000000000000800000000000000000080000000000000400000000000000000000000000000000000000000000080000000000040000000200000000000000000080000000402002000000000000000002000000000004000008000000000000001000000040100000000000000000000100000000020000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x3ab0c3fb14a9bee8100e023bededd0a8d7d4a2d7f9369643ec65a6dfa669e10b", + "transactionHash": "0xeb1debcc341f8a8d53f61b4ad5dc32643d2bf028f53c38f677361a8669071634", "logs": [ { - "transactionIndex": 31, - "blockNumber": 29540611, - "transactionHash": "0x1367c8d1f64f3987113f6cafe1e0929b836f4ee62ef2fb65fdd6b2833394d238", - "address": "0xa723D0b8D0e816BE0f4BbE839163655BD85E14FC", + "transactionIndex": 16, + "blockNumber": 29772149, + "transactionHash": "0xeb1debcc341f8a8d53f61b4ad5dc32643d2bf028f53c38f677361a8669071634", + "address": "0xE822EcA41Be81D15ffe3daEaF9f9F91E8bB5D959", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 95, - "blockHash": "0x2b4a8cf2d29028afa58dd99b710997cc288b1d5d7c951447f5d5886bc45606fa" + "logIndex": 60, + "blockHash": "0x3ab0c3fb14a9bee8100e023bededd0a8d7d4a2d7f9369643ec65a6dfa669e10b" }, { - "transactionIndex": 31, - "blockNumber": 29540611, - "transactionHash": "0x1367c8d1f64f3987113f6cafe1e0929b836f4ee62ef2fb65fdd6b2833394d238", - "address": "0xa723D0b8D0e816BE0f4BbE839163655BD85E14FC", + "transactionIndex": 16, + "blockNumber": 29772149, + "transactionHash": "0xeb1debcc341f8a8d53f61b4ad5dc32643d2bf028f53c38f677361a8669071634", + "address": "0xE822EcA41Be81D15ffe3daEaF9f9F91E8bB5D959", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 96, - "blockHash": "0x2b4a8cf2d29028afa58dd99b710997cc288b1d5d7c951447f5d5886bc45606fa" + "logIndex": 61, + "blockHash": "0x3ab0c3fb14a9bee8100e023bededd0a8d7d4a2d7f9369643ec65a6dfa669e10b" }, { - "transactionIndex": 31, - "blockNumber": 29540611, - "transactionHash": "0x1367c8d1f64f3987113f6cafe1e0929b836f4ee62ef2fb65fdd6b2833394d238", - "address": "0xa723D0b8D0e816BE0f4BbE839163655BD85E14FC", + "transactionIndex": 16, + "blockNumber": 29772149, + "transactionHash": "0xeb1debcc341f8a8d53f61b4ad5dc32643d2bf028f53c38f677361a8669071634", + "address": "0xE822EcA41Be81D15ffe3daEaF9f9F91E8bB5D959", "topics": [ "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000004", - "logIndex": 97, - "blockHash": "0x2b4a8cf2d29028afa58dd99b710997cc288b1d5d7c951447f5d5886bc45606fa" + "logIndex": 62, + "blockHash": "0x3ab0c3fb14a9bee8100e023bededd0a8d7d4a2d7f9369643ec65a6dfa669e10b" }, { - "transactionIndex": 31, - "blockNumber": 29540611, - "transactionHash": "0x1367c8d1f64f3987113f6cafe1e0929b836f4ee62ef2fb65fdd6b2833394d238", + "transactionIndex": 16, + "blockNumber": 29772149, + "transactionHash": "0xeb1debcc341f8a8d53f61b4ad5dc32643d2bf028f53c38f677361a8669071634", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000c275dc8be39f50d12f66b6a63629c39da5bae5bd" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x0000000000000000000000003a22c8bc68e98b0faf40f349dd2b2890fae01484" ], - "data": "0x000000000000000000000000000000000000000000000000000fe87ffbf4efa40000000000000000000000000000000000000000000000007d5a488854524ff8000000000000000000000000000000000000000000000b8e591ef8f4fa5d33c70000000000000000000000000000000000000000000000007d4a6008585d6054000000000000000000000000000000000000000000000b8e592ee174f652236b", - "logIndex": 98, - "blockHash": "0x2b4a8cf2d29028afa58dd99b710997cc288b1d5d7c951447f5d5886bc45606fa" + "data": "0x000000000000000000000000000000000000000000000000000c60906454a8d40000000000000000000000000000000000000000000000001b823feee5d9e725000000000000000000000000000000000000000000000108f4a1f5a010efc33f0000000000000000000000000000000000000000000000001b75df5e81853e51000000000000000000000000000000000000000000000108f4ae563075446c13", + "logIndex": 63, + "blockHash": "0x3ab0c3fb14a9bee8100e023bededd0a8d7d4a2d7f9369643ec65a6dfa669e10b" } ], - "blockNumber": 29540611, - "cumulativeGasUsed": "11747422", + "blockNumber": 29772149, + "cumulativeGasUsed": "6591936", "status": 1, "byzantium": true }, "args": [ - "0xf576E42E5b2682B8f606B1840c3A982610C29a3f", - "0xCBB1032416EB875D94Da8a447D73471E4C51998E", - "0x2c17e335d131dfd21238475Dd545B9B29Fb5A27D", - "0x82B54988e4E3a2850501F91AC06CEA82bdb014D3", + "0xc24F86a8D9f82401b693d4FFaa1DCf3109d88524", + "0x09f35a46C6863F5C8Cd887F690974DCaaDe0A2a5", + "0xe51e46177505c31CE33791066E17E11d9D180305", + "0xE6C1f01C71A184A44A21B10A7FBEb3b1604B4f2a", "10000001", "20000000", - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954" + "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED" ], - "numDeployments": 2, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"hydraS1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"availableRootsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"AccountsTreeValueMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimLength\",\"type\":\"uint256\"}],\"name\":\"ClaimsLengthDifferentThanOne\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentMapperPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"}],\"name\":\"CooldownDurationNotSetForGroupIndex\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedExternalNullifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"externalNullifier\",\"type\":\"uint256\"}],\"name\":\"ExternalNullifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"burnCount\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"cooldownStart\",\"type\":\"uint32\"}],\"name\":\"NullifierOnCooldown\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"NullifierUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inputRoot\",\"type\":\"uint256\"}],\"name\":\"RegistryRootMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"cooldownDuration\",\"type\":\"uint32\"}],\"name\":\"CooldownDurationSetForGroupIndex\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"NullifierDestinationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"burnCount\",\"type\":\"uint16\"}],\"name\":\"NullifierSetOnCooldown\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"claimDestination\",\"type\":\"address\"}],\"name\":\"_getNextBurnCount\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAvailableRootsRegistry\",\"outputs\":[{\"internalType\":\"contract IAvailableRootsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"getBurnCountFromExtraData\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentMapperRegistry\",\"outputs\":[{\"internalType\":\"contract ICommitmentMapperRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"}],\"name\":\"getCooldownDurationForGroupIndex\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfNullifier\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"getNullifierBurnCount\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"getNullifierCooldownStart\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"getNullifierFromExtraData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract HydraS1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"cooldownDuration\",\"type\":\"uint32\"}],\"name\":\"setCooldownDurationForGroupIndex\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"errors\":{\"CollectionIdOutOfBound(uint256)\":[{\"details\":\"Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST*\"}],\"CooldownDurationNotSetForGroupIndex(uint256)\":[{\"details\":\"Error when the cooldown duration for a given groupIndex is equal to zero. The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.*\"}],\"NullifierOnCooldown(uint256,address,uint16,uint32)\":[{\"details\":\"Error when the nullifier is on cooldown. The user have to wait the cooldownDuration before being able to change again the destination address.*\"}],\"NullifierUsed(uint256)\":[{\"details\":\"Error when the nullifier is already used for a destination address*\"}]},\"kind\":\"dev\",\"methods\":{\"_getNextBurnCount(uint256,address)\":{\"details\":\"returns burn count or burn count + 1 if new burn will happen\",\"params\":{\"claimDestination\":\"destination referenced in the user claim\",\"nullifier\":\"user nullifier\"}},\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns the actual attestations constructed from the user request\",\"params\":{\"proofData\":\"snark public input as well as snark proof\",\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"availableRootsRegistryAddress\":\"Registry storing the available groups for this attester (e.g roots of registry merkle trees)\",\"collectionIdFirst\":\"Id of the first attestation collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last attestation collection in which the attester is supposed to record\",\"commitmentMapperAddress\":\"commitment mapper's public key registry\",\"hydraS1VerifierAddress\":\"ZK Snark Hydra-S1 Verifier contract\",\"owner\":\"Address of attester's owner\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getAvailableRootsRegistry()\":{\"details\":\"Getter of Roots Registry Contract\"},\"getBurnCountFromExtraData(bytes)\":{\"details\":\"Returns the burn count for a given extraData\",\"params\":{\"extraData\":\"bytes where the burnCount is encoded\"}},\"getCommitmentMapperRegistry()\":{\"details\":\"Getter of Commitment Mapper Registry contract\"},\"getCooldownDurationForGroupIndex(uint256)\":{\"details\":\"Getter, get the cooldown duration of a groupIndex\",\"params\":{\"groupIndex\":\"internal collection id*\"}},\"getDestinationOfNullifier(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a nullifier\",\"params\":{\"nullifier\":\"nullifier used*\"}},\"getNullifierBurnCount(uint256)\":{\"details\":\"Getter, returns the burnCount of a nullifier\",\"params\":{\"nullifier\":\"nullifier used*\"}},\"getNullifierCooldownStart(uint256)\":{\"details\":\"Getter, returns the cooldown start of a nullifier\",\"params\":{\"nullifier\":\"nullifier used*\"}},\"getNullifierFromExtraData(bytes)\":{\"details\":\"returns the nullifier for a given extraData\",\"params\":{\"extraData\":\"bytes where the nullifier is encoded\"}},\"getVerifier()\":{\"details\":\"Getter of Hydra-S1 Verifier contract\"},\"initialize(address)\":{\"details\":\"Initialize function, to be called by the proxy delegating calls to this implementation\",\"params\":{\"ownerAddress\":\"Owner of the contract, has the right to authorize/unauthorize attestations issuers\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setCooldownDurationForGroupIndex(uint256,uint32)\":{\"details\":\"Setter, sets the cooldown duration of a groupIndex\",\"params\":{\"cooldownDuration\":\"cooldown duration we want to set for the groupIndex*\",\"groupIndex\":\"internal collection id\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Hydra-S1 Accountbound Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getCooldownDurationForGroupIndex(uint256)\":{\"notice\":\"returns 0 when the accountbound feature is deactivated for this group\"},\"initialize(address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"},\"setCooldownDurationForGroupIndex(uint256,uint32)\":{\"notice\":\"set to 0 to deactivate the accountbound feature for this group\"}},\"notice\":\"This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic. Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic. However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation. The _beforeRecordAttestations is also overriden to fit the Accountbound logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Nullified Each source account gets one nullifier per claim (i.e only one attestation per source account per claim) While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier) We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation. We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation. Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier) - Accountbound (opt-in, with cooldown period) The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group. Users can update their attestation's destination by providing a new Hydra-S1 ZK proof It means the attestation is bound to the source account, stored on an updatable destination account. When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional. A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations. - Renewable A nullifier can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol\":\"HydraS1AccountboundAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [8609986746108439658545470593166889256314951959466775818870246174320018498804,\\n 6848251127850009101372611262053374737897586140140607384018397707035108265914],\\n [21367916863936594568281095443965096905143705300114190558130516981138584550504,\\n 13327705762185115653848159709412003423932761899188342359583872691135383932883]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 19965766170734310004645394427613286415565755728797065894668054116047682895204,\\n 6952067612339183672227137101423582097916038093373585908267153974352032944482\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 13987716160490730015463796942940452666334097189904948795214986996497499925899,\\n 5336810094802209074340875836312868429276540870324469349093948627126061524544\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 14931593253473978964215343699995811275378324235306358485461293343370969283966,\\n 564306919152089917957316877787764763278299990971316475606280877961553231205\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11591267743733991434114686002448165336885445656808796470854638278338319268343,\\n 11495219763417990955889652410266075210402006084183208750635660647824890013350\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 8183184532870222270700473518157259944911700429689031755853536692005688965081,\\n 9121077094104828462137861111631978599019724423614716723152060153405564278301\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 4314095526093128699362232919686741372014146055311239687202926853002748112330,\\n 11665330391505820654128458332883010598817535082070674418723503440883598640597\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 18925967077785550270509493111690046951994174908254476036944536825999614778001,\\n 4990629719417206796668074534812314525340851981015724652256935997545282642849\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x120f0b311a61cabc9d42ef740c19e5f20b4c8ba400d9a6378e33c76dd54f5c42\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\n\\nimport {IHydraS1AccountboundAttester} from './interfaces/IHydraS1AccountboundAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from '../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra-S1\\nimport {HydraS1SimpleAttester, IAttester, HydraS1Lib, HydraS1ProofData, HydraS1Claim} from './HydraS1SimpleAttester.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic.\\n * Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic.\\n * However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation.\\n * The _beforeRecordAttestations is also overriden to fit the Accountbound logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Nullified\\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\\n * While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier)\\n * We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation.\\n * We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation.\\n * Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier)\\n\\n * - Accountbound (opt-in, with cooldown period)\\n * The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group.\\n * Users can update their attestation's destination by providing a new Hydra-S1 ZK proof \\n * It means the attestation is bound to the source account, stored on an updatable destination account.\\n * When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional.\\n * A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred\\n * One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations.\\n \\n * - Renewable\\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew or update their attestations\\n **/\\n\\ncontract HydraS1AccountboundAttester is\\n IHydraS1AccountboundAttester,\\n HydraS1SimpleAttester,\\n Ownable\\n{\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n uint8 public constant IMPLEMENTATION_VERSION = 4;\\n\\n /*******************************************************\\n Storage layout:\\n 20 slots between HydraS1SimpleAttester and HydraS1AccountboundAttester\\n 1 currently used by Ownable\\n 19 place holders\\n 2O for config\\n 1 currently used\\n 19 place holders\\n 20 for logic\\n 2 currently used\\n 18 place holders\\n *******************************************************/\\n\\n // keeping some space for future config logics\\n uint256[19] private _placeHolderBeforeHydraS1Accountbound;\\n\\n // cooldown durations for each groupIndex\\n mapping(uint256 => uint32) internal _cooldownDurations;\\n\\n // keeping some space for future config logics\\n uint256[19] private _placeHoldersHydraS1AccountboundConfig;\\n\\n mapping(uint256 => uint32) internal _nullifiersCooldownStart;\\n mapping(uint256 => uint16) internal _nullifiersBurnCount;\\n\\n // keeping some space for future config logics\\n uint256[18] private _placeHoldersHydraS1AccountboundLogic;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first attestation collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last attestation collection in which the attester is supposed to record\\n * @param owner Address of attester's owner\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n address owner\\n )\\n HydraS1SimpleAttester(\\n attestationsRegistryAddress,\\n hydraS1VerifierAddress,\\n availableRootsRegistryAddress,\\n commitmentMapperAddress,\\n collectionIdFirst,\\n collectionIdLast\\n )\\n {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Returns the actual attestations constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark public input as well as snark proof\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual override(IAttester, HydraS1SimpleAttester) returns (Attestation[] memory) {\\n Attestation[] memory attestations = super.buildAttestations(request, proofData);\\n\\n uint256 nullifier = proofData._getNullifier();\\n attestations[0].extraData = abi.encode(\\n attestations[0].extraData, // nullifier, from HydraS1 Simple\\n _getNextBurnCount(nullifier, attestations[0].owner) // BurnCount\\n );\\n\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if nullifier already used, not a renewal, and nullifier on cooldown.\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n uint256 nullifier = proofData._getNullifier();\\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\\n\\n HydraS1Claim memory claim = request._claim();\\n\\n // check if the nullifier has already been used previously, if so it may be on cooldown\\n if (\\n previousNullifierDestination != address(0) &&\\n previousNullifierDestination != claim.destination\\n ) {\\n uint32 cooldownDuration = _getCooldownDurationForGroupIndex(claim.groupProperties.groupIndex);\\n if (cooldownDuration == 0) {\\n revert CooldownDurationNotSetForGroupIndex(claim.groupProperties.groupIndex);\\n }\\n if (_isOnCooldown(nullifier, cooldownDuration)) {\\n uint16 burnCount = _getNullifierBurnCount(nullifier);\\n revert NullifierOnCooldown(\\n nullifier,\\n previousNullifierDestination,\\n burnCount,\\n cooldownDuration\\n );\\n }\\n\\n // Delete the old Attestation linked to the nullifier before recording the new one (accountbound feature)\\n _deletePreviousAttestation(claim, previousNullifierDestination);\\n\\n _setNullifierOnCooldownAndIncrementBurnCount(nullifier);\\n }\\n _setDestinationForNullifier(nullifier, request.destination);\\n }\\n\\n /*******************************************************\\n LOGIC FUNCTIONS RELATED TO ACCOUNTBOUND FEATURE\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the burnCount of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16) {\\n return _getNullifierBurnCount(nullifier);\\n }\\n\\n /**\\n * @dev Getter, returns the cooldown start of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32) {\\n return _getNullifierCooldownStart(nullifier);\\n }\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external pure override(HydraS1SimpleAttester, IHydraS1AccountboundAttester) returns (uint256) {\\n (uint256 nullifier, ) = abi.decode(extraData, (uint256, uint16));\\n\\n return nullifier;\\n }\\n\\n /**\\n * @dev Returns the burn count for a given extraData\\n * @param extraData bytes where the burnCount is encoded\\n */\\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16) {\\n (, uint16 burnCount) = abi.decode(extraData, (uint256, uint16));\\n\\n return burnCount;\\n }\\n\\n /**\\n * @dev Checks if a nullifier is on cooldown\\n * @param nullifier user nullifier\\n * @param cooldownDuration waiting time before the user can change its badge destination\\n */\\n function _isOnCooldown(uint256 nullifier, uint32 cooldownDuration) internal view returns (bool) {\\n return _getNullifierCooldownStart(nullifier) + cooldownDuration > block.timestamp;\\n }\\n\\n /**\\n * @dev Delete the previous attestation created with this nullifier\\n * @param claim user claim\\n * @param previousNullifierDestination previous destination chosen for this user nullifier\\n */\\n function _deletePreviousAttestation(\\n HydraS1Claim memory claim,\\n address previousNullifierDestination\\n ) internal {\\n address[] memory attestationOwners = new address[](1);\\n uint256[] memory attestationCollectionIds = new uint256[](1);\\n\\n attestationOwners[0] = previousNullifierDestination;\\n attestationCollectionIds[0] = AUTHORIZED_COLLECTION_ID_FIRST + claim.groupProperties.groupIndex;\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n }\\n\\n function _setNullifierOnCooldownAndIncrementBurnCount(uint256 nullifier) internal {\\n _nullifiersCooldownStart[nullifier] = uint32(block.timestamp);\\n _nullifiersBurnCount[nullifier] += 1;\\n emit NullifierSetOnCooldown(nullifier, _nullifiersBurnCount[nullifier]);\\n }\\n\\n function _getNullifierCooldownStart(uint256 nullifier) internal view returns (uint32) {\\n return _nullifiersCooldownStart[nullifier];\\n }\\n\\n function _getNullifierBurnCount(uint256 nullifier) internal view returns (uint16) {\\n return _nullifiersBurnCount[nullifier];\\n }\\n\\n /**\\n * @dev returns burn count or burn count + 1 if new burn will happen\\n * @param nullifier user nullifier\\n * @param claimDestination destination referenced in the user claim\\n */\\n function _getNextBurnCount(\\n uint256 nullifier,\\n address claimDestination\\n ) public view virtual returns (uint16) {\\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\\n uint16 burnCount = _getNullifierBurnCount(nullifier);\\n // If the attestation is minted on a new destination address\\n // the burnCount that will be encoded in the extraData of the Attestation should be incremented\\n if (\\n previousNullifierDestination != address(0) && previousNullifierDestination != claimDestination\\n ) {\\n burnCount += 1;\\n }\\n return burnCount;\\n }\\n\\n /*******************************************************\\n GROUP CONFIGURATION LOGIC\\n *******************************************************/\\n\\n /**\\n * @dev Setter, sets the cooldown duration of a groupIndex\\n * @notice set to 0 to deactivate the accountbound feature for this group\\n * @param groupIndex internal collection id\\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\\n **/\\n function setCooldownDurationForGroupIndex(\\n uint256 groupIndex,\\n uint32 cooldownDuration\\n ) external onlyOwner {\\n _cooldownDurations[groupIndex] = cooldownDuration;\\n emit CooldownDurationSetForGroupIndex(groupIndex, cooldownDuration);\\n }\\n\\n /**\\n * @dev Getter, get the cooldown duration of a groupIndex\\n * @notice returns 0 when the accountbound feature is deactivated for this group\\n * @param groupIndex internal collection id\\n **/\\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32) {\\n return _getCooldownDurationForGroupIndex(groupIndex);\\n }\\n\\n // = 0 means that the accountbound feature is deactivated for this group\\n function _getCooldownDurationForGroupIndex(uint256 groupIndex) internal view returns (uint32) {\\n return _cooldownDurations[groupIndex];\\n }\\n}\\n\",\"keccak256\":\"0x4c391f4bbfdd1b22039fdc7b43f12d7933deca89cc6ae9e5a2b5afa8c427762c\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\\nimport {IHydraS1Base} from './base/IHydraS1Base.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Nullified\\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * nullifier = hash(sourceSecret, externalNullifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - Renewable\\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew their attestations\\n **/\\n\\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n /*******************************************************\\n Storage layout:\\n 20 slots for HydraS1\\n 1 slot used\\n 19 place holders\\n *******************************************************/\\n\\n mapping(uint256 => address) internal _nullifiersDestinations;\\n\\n // keeping some space for future\\n uint256[19] private _placeHoldersHydraS1Simple;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n uint256 nullifier = proofData._getNullifier();\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n abi.encode(nullifier)\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if nullifier already used and not a renewal (e.g destination different that last)\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n // we get the nullifier used from the snark input in the data provided\\n uint256 nullifier = proofData._getNullifier();\\n address currentDestination = _getDestinationOfNullifier(nullifier);\\n\\n if (currentDestination != address(0) && currentDestination != request.destination) {\\n revert NullifierUsed(nullifier);\\n }\\n\\n _setDestinationForNullifier(nullifier, request.destination);\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the external nullifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose externalNullifier = hash(attesterAddress, claim.GroupId)\\n * Creates one nullifier per group, per user and makes sure no collision with other attester's nullifiers\\n **/\\n function _getExternalNullifierOfClaim(\\n HydraS1Claim memory claim\\n ) internal view override returns (uint256) {\\n uint256 externalNullifier = _encodeInSnarkField(\\n address(this),\\n claim.groupProperties.groupIndex\\n );\\n return externalNullifier;\\n }\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external pure virtual override(IHydraS1Base, HydraS1Base) returns (uint256) {\\n return abi.decode(extraData, (uint256));\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getDestinationOfNullifier(uint256 nullifier) external view override returns (address) {\\n return _getDestinationOfNullifier(nullifier);\\n }\\n\\n function _setDestinationForNullifier(uint256 nullifier, address destination) internal virtual {\\n _nullifiersDestinations[nullifier] = destination;\\n emit NullifierDestinationUpdated(nullifier, destination);\\n }\\n\\n function _getDestinationOfNullifier(uint256 nullifier) internal view returns (address) {\\n return _nullifiersDestinations[nullifier];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x7bb2f154f8b33d4c536ebe7828baeb25853d9c288d85b75f0f9d4c3a8e01e735\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Attester} from '../../../core/Attester.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n *\\n */\\nabstract contract HydraS1Base is IHydraS1Base, Attester, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the nullifier from an attestation extraData\\n * @dev Getter of a nullifier encoded in extraData\\n * @notice Must be implemented by the inheriting contracts\\n * @param extraData extraData where nullifier can be encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external view virtual returns (uint256);\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the external nullifier from a user request\\n * so it can be checked against snark input\\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n *\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of external nullifiers\\n *\\n * Do they get one external nullifier per claim?\\n * Do they get 2 external nullifiers per claim?\\n * Do they get 1 external nullifier per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getExternalNullifierOfClaim(\\n HydraS1Claim memory claim\\n ) internal view virtual returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(\\n HydraS1Claim memory claim,\\n HydraS1ProofInput memory input\\n ) internal view virtual {\\n if (input.accountsTreeValue != claim.groupId) {\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n }\\n\\n if (input.isStrict == claim.groupProperties.isScore) {\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n }\\n\\n if (input.destination != claim.destination) {\\n revert DestinationMismatch(claim.destination, input.destination);\\n }\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot)) {\\n revert RegistryRootMismatch(input.registryRoot);\\n }\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n ) {\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n }\\n\\n uint256 externalNullifier = _getExternalNullifierOfClaim(claim);\\n\\n if (input.externalNullifier != externalNullifier) {\\n revert ExternalNullifierMismatch(externalNullifier, input.externalNullifier);\\n }\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(uint256 /*errorCode*/) {\\n revert InvalidGroth16Proof('');\\n } catch (bytes memory /*lowLevelData*/) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0x8614a04a2a58649b4434fab39ca30e3ff0d94d09998355dbd9fa5bf762b3c845\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Interface\\n * @author Sismo\\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n **/\\ninterface IHydraS1Base is IAttester {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error ExternalNullifierMismatch(uint256 expectedExternalNullifier, uint256 externalNullifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n function getNullifierFromExtraData(bytes memory extraData) external view returns (uint256);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x65b9966e5cf43975edb64c742057153058ee31bea1beadf4456577e9d5dbc76d\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1AccountboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from '././IHydraS1SimpleAttester.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Interface\\n * @author Sismo\\n * @notice Interface of the HydraS1AccountboundAttester contract which inherits from the errors, events and methods specific to the HydraS1SimpleAttester interface.\\n **/\\ninterface IHydraS1AccountboundAttester is IHydraS1SimpleAttester {\\n /**\\n * @dev Event emitted when the duration of the cooldown duration for a group index (internal collection id) has been set\\n * @param groupIndex internal collection id\\n * @param cooldownDuration the duration of the cooldown period\\n **/\\n event CooldownDurationSetForGroupIndex(uint256 indexed groupIndex, uint32 cooldownDuration);\\n\\n /**\\n * @dev Event emitted when the nullifier has been set on cooldown. This happens when the\\n * attestation destination of a nullifier has been changed\\n * @param nullifier user nullifier\\n * @param burnCount the number of times the attestation destination of a nullifier has been changed\\n **/\\n event NullifierSetOnCooldown(uint256 indexed nullifier, uint16 burnCount);\\n\\n /**\\n * @dev Error when the nullifier is on cooldown. The user have to wait the cooldownDuration\\n * before being able to change again the destination address.\\n **/\\n error NullifierOnCooldown(\\n uint256 nullifier,\\n address destination,\\n uint16 burnCount,\\n uint32 cooldownStart\\n );\\n\\n /**\\n * @dev Error when the cooldown duration for a given groupIndex is equal to zero.\\n * The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.\\n **/\\n error CooldownDurationNotSetForGroupIndex(uint256 groupIndex);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(bytes memory extraData) external pure returns (uint256);\\n\\n /**\\n * @dev Returns the burn count for a given extraData\\n * @param extraData bytes where the burnCount is encoded\\n */\\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16);\\n\\n /**\\n * @dev Getter, returns the cooldown start of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32);\\n\\n /**\\n * @dev Getter, returns the burnCount of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16);\\n\\n /**\\n * @dev Setter, sets the cooldown duration of a groupIndex\\n * @param groupIndex internal collection id\\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\\n **/\\n function setCooldownDurationForGroupIndex(uint256 groupIndex, uint32 cooldownDuration) external;\\n\\n /*/**\\n * @dev Getter, get the cooldown duration of a groupIndex\\n * @notice returns 0 when the accountbound feature is deactivated for this group\\n * @param groupIndex internal collection id\\n **/\\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32);\\n}\\n\",\"keccak256\":\"0x69293ce8ee200e3ce8b34478b5dde62d934e32c4f82d173314a4ed72731b3663\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Interface\\n * @author Sismo\\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\\n **/\\ninterface IHydraS1SimpleAttester is IHydraS1Base {\\n /**\\n * @dev Error when the nullifier is already used for a destination address\\n **/\\n error NullifierUsed(uint256 nullifier);\\n\\n /**\\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\\n **/\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n /**\\n * @dev Event emitted when the nullifier is associated to a destination address.\\n **/\\n event NullifierDestinationUpdated(uint256 nullifier, address newOwner);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getDestinationOfNullifier(uint256 nullifier) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x8222c187e8314c931121c7632965316f079322b076501a5443d3102a0891a8d5\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // externalNullifier\\n // nullifier\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 externalNullifier;\\n uint256 nullifier;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getNullifier(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(\\n HydraS1ProofData memory self\\n )\\n internal\\n pure\\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[10] memory)\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(\\n HydraS1ProofData memory self\\n ) internal pure returns (uint256[2] memory) {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(\\n HydraS1ProofData memory self\\n ) internal pure returns (uint256) {\\n return self.input[5];\\n }\\n\\n function _getNullifier(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getNullifier(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 nullifier = uint256(_getNullifier(snarkProofData));\\n return nullifier;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(\\n bytes memory encodedProperties\\n ) internal pure returns (uint256) {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0xa484f046e44f6c77177ba6f165573dc3ee90680a057dff7d3de46d67a29c462a\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n address[] memory attestationOwners = new address[](collectionIds.length);\\n\\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\\n\\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n // fetch attestations from the registry\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationOwners[i] = attestationsOwner;\\n attestationCollectionIds[i] = collectionIds[i];\\n\\n attestations[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestations, proofData);\\n\\n _beforeDeleteAttestations(attestations, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n\\n _afterDeleteAttestations(attestations, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestations[i]);\\n }\\n return attestations;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x7743f02ed07e1b40a2ff45f5a45b5fe87d765326cce3528676cbd36c3d08ba37\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0x2d5faf5df56dfe1294202e89180846a1d4a5f938699619ee73b60c7314a97dfe\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3467998cbdb82b0c64aa8627efc5893d2b369f73e66e5d1095305e4609593cc5\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address ownerAddress,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0x1b6ab7a4ba266f3da2c7f6ba3de93e3ab89f389dbd6db14514b43cbdcbe9fe09\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5e882d3091e816f1286837eef92ae17737abf66fdeece1282b752f27ba18492b\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0xcb419cf389baad6f38de28625718f64f551d2669339c1b4e1887e11d62484469\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x6101406040523480156200001257600080fd5b5060405162002b2738038062002b2783398101604081905262000035916200020f565b6001600160a01b0387811660805286811660a05285811660e052841660c0526101008390526101208290526200006b3362000083565b6200007681620000d5565b5050505050505062000292565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054600490610100900460ff16158015620000f8575060005460ff8083169116105b620001605760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff831617610100178155620001876015546001600160a01b031690565b6001600160a01b031614806200019c5750303b155b15620001ad57620001ad8262000083565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b80516001600160a01b03811681146200020a57600080fd5b919050565b600080600080600080600060e0888a0312156200022b57600080fd5b6200023688620001f2565b96506200024660208901620001f2565b95506200025660408901620001f2565b94506200026660608901620001f2565b93506080880151925060a088015191506200028460c08901620001f2565b905092959891949750929550565b60805160a05160c05160e05161010051610120516127ff620003286000396000818161025e0152610d9201526000818161023701528181610d6a01526117200152600081816102dd01526112fa01526000818161017901526113960152600081816101f901526114f7015260008181610323015281816107820152818161096301528181610ae8015261177901526127ff6000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c80638b159099116100b8578063c4d66de81161007c578063c4d66de814610347578063c776adde1461035a578063ca1cc6461461036d578063e60f999f14610380578063f2fde38b14610393578063f7e420b3146103a657600080fd5b80638b159099146102a25780638da5cb5b146102ca578063918447af146102db578063af411a3014610301578063bfa665851461032157600080fd5b806346657fe91161010a57806346657fe9146101f7578063524a32481461021d57806354846d7a146102325780637000b05114610259578063715018a614610280578063754b377c1461028857600080fd5b8063063599db146101475780632254f98e14610177578063345dd9891461019d5780633800a4b9146101be5780633c4a9854146101e4575b600080fd5b61015a610155366004611bbf565b6103b9565b6040516001600160a01b0390911681526020015b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000061015a565b6101b06101ab366004611ce1565b6103d8565b60405190815260200161016e565b6101d16101cc366004611bbf565b6103f7565b60405161ffff909116815260200161016e565b6101d16101f2366004611ce1565b61040f565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61023061022b366004611d27565b61042e565b005b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b610230610494565b610290600481565b60405160ff909116815260200161016e565b6102b56102b0366004611bbf565b6104a8565b60405163ffffffff909116815260200161016e565b6015546001600160a01b031661015a565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61031461030f366004611d9f565b6104c2565b60405161016e9190611ec2565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b610230610355366004611f49565b610573565b610314610368366004611f66565b61068b565b6101d161037b366004612017565b610a46565b61031461038e366004611d9f565b610aaa565b6102306103a1366004611f49565b610bc6565b6102b56103b4366004611bbf565b610c3f565b6000818152600160205260408120546001600160a01b03165b92915050565b600080828060200190518101906103ef919061203c565b509392505050565b6000818152603e602052604081205461ffff166103d2565b60008082806020019051810190610426919061203c565b949350505050565b610436610c59565b600082815260296020908152604091829020805463ffffffff191663ffffffff8516908117909155915191825283917f893e2a4c394b497c1a2b041d18acc02d05deb2cc7ae3ea0f85d001aa93dff48b910160405180910390a25050565b61049c610c59565b6104a66000610cb3565b565b60008181526029602052604081205463ffffffff166103d2565b606060006104d1858585610d05565b905060006104df8585610e84565b9050816000815181106104f4576104f4612068565b602002602001015160a00151610528828460008151811061051757610517612068565b602002602001015160200151610a46565b60405160200161053992919061207e565b6040516020818303038152906040528260008151811061055b5761055b612068565b602090810291909101015160a0015250949350505050565b600054600490610100900460ff16158015610595575060005460ff8083169116105b6105fd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556106236015546001600160a01b031690565b6001600160a01b031614806106375750303b155b156106455761064582610cb3565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60606000856001600160401b038111156106a7576106a7611bd8565b6040519080825280602002602001820160405280156106d0578160200160208202803683370190505b5090506000866001600160401b038111156106ed576106ed611bd8565b604051908082528060200260200182016040528015610716578160200160208202803683370190505b5090506000876001600160401b0381111561073357610733611bd8565b60405190808252806020026020018201604052801561076c57816020015b610759611a9d565b8152602001906001900390816107515790505b50905060005b88811015610940576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106107c1576107c1612068565b905060200201358e6040518363ffffffff1660e01b81526004016107f89291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610815573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261083d91908101906120a4565b93509350935093508b88868151811061085857610858612068565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061088a5761088a612068565b905060200201358786815181106108a3576108a3612068565b6020026020010181815250506040518060c001604052808f8f888181106108cc576108cc612068565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061091e5761091e612068565b60200260200101819052505050505080806109389061216c565b915050610772565b5061094c818787610ea0565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061099a9086908690600401612185565b600060405180830381600087803b1580156109b457600080fd5b505af11580156109c8573d6000803e3d6000fd5b5050505060005b88811015610a39577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b828281518110610a0a57610a0a612068565b6020026020010151604051610a1f9190612209565b60405180910390a180610a318161216c565b9150506109cf565b5098975050505050505050565b600082815260016020908152604080832054603e9092528220546001600160a01b039091169061ffff168115801590610a915750836001600160a01b0316826001600160a01b031614155b1561042657610aa160018261221c565b95945050505050565b6060610ab7848484610eb9565b6000610ac48585856104c2565b9050610ad1858585610f01565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c09390610b1d908490600401611ec2565b600060405180830381600087803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b5050505060005b8151811015610bbd577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610b8e57610b8e612068565b6020026020010151604051610ba39190612209565b60405180910390a180610bb58161216c565b915050610b52565b50949350505050565b610bce610c59565b6001600160a01b038116610c335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b610c3c81610cb3565b50565b6000818152603d602052604081205463ffffffff166103d2565b6015546001600160a01b031633146104a65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105f4565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606000610d1a610d1586612242565b611057565b60408051600180825281830190925291925060009190816020015b610d3d611a9d565b815260200190600190039081610d35575050606083015151909150600090610d8e906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b90507f0000000000000000000000000000000000000000000000000000000000000000811115610dd457604051637bbf29e360e01b8152600481018290526024016105f4565b306000610de18888610e84565b90506040518060c0016040528084815260200186604001516001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff16815260200182604051602001610e4791815260200190565b60405160208183030381529060405281525084600081518110610e6c57610e6c612068565b60209081029190910101525091979650505050505050565b600080610e9383850185612439565b90506000610aa1826110dc565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ec782840184612439565b90506000610ed4826110f2565b90506000610ee4610d1587612242565b9050610ef0818361119c565b610ef9836114cd565b505050505050565b6000610f0d8383610e84565b6000818152600160205260408120549192506001600160a01b0390911690610f37610d1587612242565b90506001600160a01b03821615801590610f67575080604001516001600160a01b0316826001600160a01b031614155b1561103e576060810151516001600160801b031660009081526029602052604081205463ffffffff1690819003610fc35760608201515160405163065ef5f360e01b81526001600160801b0390911660048201526024016105f4565b610fcd848261166a565b15611029576000848152603e602052604081205461ffff16604051630d16862d60e11b8152600481018790526001600160a01b038616602482015261ffff8216604482015263ffffffff841660648201529091506084016105f4565b611033828461169a565b61103c846117e8565b505b610ef9836110526040890160208a01611f49565b61188f565b61105f611aeb565b6000826000015160008151811061107857611078612068565b6020026020010151905061108b816118ee565b600081604001518060200190518101906110a5919061251a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b602081015160009060065b602002015192915050565b6110fa611b4e565b60405180610120016040528061110f8461192e565b6001600160a01b031681526020016111268461193c565b81526020016111348461194b565b81526020016111428461195a565b8152602001611150846110dc565b815260200161115e84611969565b815260200161116c84611978565b81526020016111848460200151610120015160011490565b1515815260200161119484611987565b905292915050565b815160c0820151146111d157815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016105f4565b81606001516040015115158160e0015115150361121c57606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016105f4565b81604001516001600160a01b031681600001516001600160a01b03161461127057604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016105f4565b468160200151146112a3576020810151604051630432cec160e31b815246600482015260248101919091526044016105f4565b81602001518160a00151146112de57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016105f4565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015611349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136d9190612595565b61139257806040015160405163cbfe7bc360e01b81526004016105f491815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa1580156113f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141591906125b0565b80516101008401515191925014158061143c57506020808201516101008401519091015114155b15611486578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016105f4565b6000611491846119df565b9050808360600151146114c7576060830151604051630e6efbdd60e21b81526105f4918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946115309490939290919060040161262c565b602060405180830381865afa925050508015611569575060408051601f3d908101601f1916820190925261156691810190612595565b60015b61163f576115756126b0565b806308c379a0036115ae57506115896126cc565b8061159457506115ed565b8060405162dd577760e81b81526004016105f49190612755565b634e487b71036115ed576115c0612768565b906115cb57506115ed565b60405162dd577760e81b815260206004820152600060248201526044016105f4565b3d808015611617576040519150601f19603f3d011682016040523d82523d6000602084013e61161c565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016105f4565b806116665760405162dd577760e81b815260206004820152600060248201526044016105f4565b5050565b6000828152603d6020526040812054429061168c90849063ffffffff16612788565b63ffffffff16119392505050565b60408051600180825281830190925260009160208083019080368337505060408051600180825281830190925292935060009291506020808301908036833701905050905082826000815181106116f3576116f3612068565b6001600160a01b0390921660209283029190910190910152606084015151611744906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b8160008151811061175757611757612068565b602090810291909101015260405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af7906117b09085908590600401612185565b600060405180830381600087803b1580156117ca57600080fd5b505af11580156117de573d6000803e3d6000fd5b5050505050505050565b6000818152603d60209081526040808320805463ffffffff19164263ffffffff16179055603e909152812080546001929061182890849061ffff1661221c565b82546101009290920a61ffff8181021990931691831602179091556000838152603e60209081526040918290205491519190921681528392507f85183f8abad8891335fb845d2e6b4f84a9c7f7409f242f4e5ec138a84abffacf910160405180910390a250565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f0c5a122814a29e22d1363dacdd6f7c95345b70890f97e65eacb5565da28116ac910161067f565b60006118fd8260400151611a04565b825190915081146116665781516040516337e3d1ab60e01b81526105f4918391600401918252602082015260400190565b6020810151600090816110e7565b602081015160009060016110e7565b602081015160009060046110e7565b602081015160009060056110e7565b602081015160009060076110e7565b602081015160009060086110e7565b61198f611ba1565b604051806040016040528083602001516002600a81106119b1576119b1612068565b6020020151815260200183602001516003600a81106119d2576119d2612068565b6020020151905292915050565b6000806119fd308460600151600001516001600160801b0316611a39565b9392505050565b805160208201206000906103d2907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906127a7565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6119fd91906127a7565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b03168152602001611b49604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001611b495b60405180604001604052806002906020820280368337509192915050565b600060208284031215611bd157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b0382111715611c0d57611c0d611bd8565b60405250565b606081018181106001600160401b0382111715611c0d57611c0d611bd8565b601f8201601f191681016001600160401b0381118282101715611c5757611c57611bd8565b6040525050565b60006001600160401b03821115611c7757611c77611bd8565b50601f01601f191660200190565b600082601f830112611c9657600080fd5b8135611ca181611c5e565b604051611cae8282611c32565b828152856020848701011115611cc357600080fd5b82602086016020830137600092810160200192909252509392505050565b600060208284031215611cf357600080fd5b81356001600160401b03811115611d0957600080fd5b61042684828501611c85565b63ffffffff81168114610c3c57600080fd5b60008060408385031215611d3a57600080fd5b823591506020830135611d4c81611d15565b809150509250929050565b60008083601f840112611d6957600080fd5b5081356001600160401b03811115611d8057600080fd5b602083019150836020828501011115611d9857600080fd5b9250929050565b600080600060408486031215611db457600080fd5b83356001600160401b0380821115611dcb57600080fd5b9085019060408288031215611ddf57600080fd5b90935060208501359080821115611df557600080fd5b50611e0286828701611d57565b9497909650939450505050565b60005b83811015611e2a578181015183820152602001611e12565b838111156114c75750506000910152565b60008151808452611e53816020860160208601611e0f565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261042660c0850182611e3b565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611f1757603f19888603018452611f05858351611e67565b94509285019290850190600101611ee9565b5092979650505050505050565b6001600160a01b0381168114610c3c57600080fd5b8035611f4481611f24565b919050565b600060208284031215611f5b57600080fd5b81356119fd81611f24565b600080600080600060608688031215611f7e57600080fd5b85356001600160401b0380821115611f9557600080fd5b818801915088601f830112611fa957600080fd5b813581811115611fb857600080fd5b8960208260051b8501011115611fcd57600080fd5b60208301975080965050611fe360208901611f39565b94506040880135915080821115611ff957600080fd5b5061200688828901611d57565b969995985093965092949392505050565b6000806040838503121561202a57600080fd5b823591506020830135611d4c81611f24565b6000806040838503121561204f57600080fd5b82519150602083015161ffff81168114611d4c57600080fd5b634e487b7160e01b600052603260045260246000fd5b6040815260006120916040830185611e3b565b905061ffff831660208301529392505050565b600080600080608085870312156120ba57600080fd5b84516120c581611f24565b6020860151604087015191955093506120dd81611d15565b60608601519092506001600160401b038111156120f957600080fd5b8501601f8101871361210a57600080fd5b805161211581611c5e565b6040516121228282611c32565b82815289602084860101111561213757600080fd5b612148836020830160208701611e0f565b969995985093965050505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161217e5761217e612156565b5060010190565b604080825283519082018190526000906020906060840190828701845b828110156121c75781516001600160a01b0316845292840192908401906001016121a2565b5050508381038285015284518082528583019183019060005b818110156121fc578351835292840192918401916001016121e0565b5090979650505050505050565b6020815260006119fd6020830184611e67565b600061ffff80831681851680830382111561223957612239612156565b01949350505050565b6000604080833603121561225557600080fd5b805161226081611bee565b83356001600160401b038082111561227757600080fd5b9085019036601f83011261228a57600080fd5b813560208282111561229e5761229e611bd8565b8160051b86516122b083830182611c32565b928352848101820192828101368511156122c957600080fd5b83870192505b8483101561234d578235868111156122e75760008081fd5b8701606036829003601f19018113156123005760008081fd5b8a5161230b81611c13565b8287013581528b8301358188015290820135908882111561232c5760008081fd5b61233a368884860101611c85565b818d0152835250509183019183016122cf565b5086525061235c888201611f39565b90850152509195945050505050565b6000821982111561237e5761237e612156565b500190565b600082601f83011261239457600080fd5b6040516123a081611bee565b8060408401858111156123b257600080fd5b845b818110156123cc5780358352602092830192016123b4565b509195945050505050565b600082601f8301126123e857600080fd5b6040516101408082018281106001600160401b038211171561240c5761240c611bd8565b6040528301818582111561241f57600080fd5b845b828110156123cc578035825260209182019101612421565b600081830361024081121561244d57600080fd5b6040805161245a81611bee565b6101008084121561246a57600080fd5b8251935061247784611c13565b6124818787612383565b845286605f87011261249257600080fd5b825161249d81611bee565b8060c08801898111156124af57600080fd5b8589015b818110156124d4576124c58b82612383565b835260209092019186016124b3565b508260208801526124e58a82612383565b868801525050508382526124fb878288016123d7565b60208301525095945050505050565b80518015158114611f4457600080fd5b60006060828403121561252c57600080fd5b604051606081018181106001600160401b038211171561254e5761254e611bd8565b60405282516001600160801b038116811461256857600080fd5b8152602083015161257881611d15565b60208201526125896040840161250a565b60408201529392505050565b6000602082840312156125a757600080fd5b6119fd8261250a565b6000604082840312156125c257600080fd5b82601f8301126125d157600080fd5b6040516125dd81611bee565b8060408401858111156125ef57600080fd5b845b818110156123cc5780518352602092830192016125f1565b8060005b60028110156114c757815184526020938401939091019060010161260d565b610240810161263b8287612609565b60408083018660005b600281101561266b57612658838351612609565b9183019160209190910190600101612644565b5050505061267c60c0830185612609565b61010082018360005b600a8110156126a4578151835260209283019290910190600101612685565b50505095945050505050565b600060033d11156126c95760046000803e5060005160e01c5b90565b600060443d10156126da5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561270957505050505090565b82850191508151818111156127215750505050505090565b843d870101602082850101111561273b5750505050505090565b61274a60208286010187611c32565b509095945050505050565b6020815260006119fd6020830184611e3b565b60008060233d1115612784576020600460003e50506000516001905b9091565b600063ffffffff80831681851680830382111561223957612239612156565b6000826127c457634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220202a9a70b259c56940b27ba667618cafc46cd9a9f1eb7ea03e8803b68fee4b3964736f6c634300080e0033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101425760003560e01c80638b159099116100b8578063c4d66de81161007c578063c4d66de814610347578063c776adde1461035a578063ca1cc6461461036d578063e60f999f14610380578063f2fde38b14610393578063f7e420b3146103a657600080fd5b80638b159099146102a25780638da5cb5b146102ca578063918447af146102db578063af411a3014610301578063bfa665851461032157600080fd5b806346657fe91161010a57806346657fe9146101f7578063524a32481461021d57806354846d7a146102325780637000b05114610259578063715018a614610280578063754b377c1461028857600080fd5b8063063599db146101475780632254f98e14610177578063345dd9891461019d5780633800a4b9146101be5780633c4a9854146101e4575b600080fd5b61015a610155366004611bbf565b6103b9565b6040516001600160a01b0390911681526020015b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000061015a565b6101b06101ab366004611ce1565b6103d8565b60405190815260200161016e565b6101d16101cc366004611bbf565b6103f7565b60405161ffff909116815260200161016e565b6101d16101f2366004611ce1565b61040f565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61023061022b366004611d27565b61042e565b005b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b610230610494565b610290600481565b60405160ff909116815260200161016e565b6102b56102b0366004611bbf565b6104a8565b60405163ffffffff909116815260200161016e565b6015546001600160a01b031661015a565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61031461030f366004611d9f565b6104c2565b60405161016e9190611ec2565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b610230610355366004611f49565b610573565b610314610368366004611f66565b61068b565b6101d161037b366004612017565b610a46565b61031461038e366004611d9f565b610aaa565b6102306103a1366004611f49565b610bc6565b6102b56103b4366004611bbf565b610c3f565b6000818152600160205260408120546001600160a01b03165b92915050565b600080828060200190518101906103ef919061203c565b509392505050565b6000818152603e602052604081205461ffff166103d2565b60008082806020019051810190610426919061203c565b949350505050565b610436610c59565b600082815260296020908152604091829020805463ffffffff191663ffffffff8516908117909155915191825283917f893e2a4c394b497c1a2b041d18acc02d05deb2cc7ae3ea0f85d001aa93dff48b910160405180910390a25050565b61049c610c59565b6104a66000610cb3565b565b60008181526029602052604081205463ffffffff166103d2565b606060006104d1858585610d05565b905060006104df8585610e84565b9050816000815181106104f4576104f4612068565b602002602001015160a00151610528828460008151811061051757610517612068565b602002602001015160200151610a46565b60405160200161053992919061207e565b6040516020818303038152906040528260008151811061055b5761055b612068565b602090810291909101015160a0015250949350505050565b600054600490610100900460ff16158015610595575060005460ff8083169116105b6105fd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556106236015546001600160a01b031690565b6001600160a01b031614806106375750303b155b156106455761064582610cb3565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60606000856001600160401b038111156106a7576106a7611bd8565b6040519080825280602002602001820160405280156106d0578160200160208202803683370190505b5090506000866001600160401b038111156106ed576106ed611bd8565b604051908082528060200260200182016040528015610716578160200160208202803683370190505b5090506000876001600160401b0381111561073357610733611bd8565b60405190808252806020026020018201604052801561076c57816020015b610759611a9d565b8152602001906001900390816107515790505b50905060005b88811015610940576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106107c1576107c1612068565b905060200201358e6040518363ffffffff1660e01b81526004016107f89291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610815573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261083d91908101906120a4565b93509350935093508b88868151811061085857610858612068565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061088a5761088a612068565b905060200201358786815181106108a3576108a3612068565b6020026020010181815250506040518060c001604052808f8f888181106108cc576108cc612068565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061091e5761091e612068565b60200260200101819052505050505080806109389061216c565b915050610772565b5061094c818787610ea0565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061099a9086908690600401612185565b600060405180830381600087803b1580156109b457600080fd5b505af11580156109c8573d6000803e3d6000fd5b5050505060005b88811015610a39577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b828281518110610a0a57610a0a612068565b6020026020010151604051610a1f9190612209565b60405180910390a180610a318161216c565b9150506109cf565b5098975050505050505050565b600082815260016020908152604080832054603e9092528220546001600160a01b039091169061ffff168115801590610a915750836001600160a01b0316826001600160a01b031614155b1561042657610aa160018261221c565b95945050505050565b6060610ab7848484610eb9565b6000610ac48585856104c2565b9050610ad1858585610f01565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c09390610b1d908490600401611ec2565b600060405180830381600087803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b5050505060005b8151811015610bbd577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610b8e57610b8e612068565b6020026020010151604051610ba39190612209565b60405180910390a180610bb58161216c565b915050610b52565b50949350505050565b610bce610c59565b6001600160a01b038116610c335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b610c3c81610cb3565b50565b6000818152603d602052604081205463ffffffff166103d2565b6015546001600160a01b031633146104a65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105f4565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606000610d1a610d1586612242565b611057565b60408051600180825281830190925291925060009190816020015b610d3d611a9d565b815260200190600190039081610d35575050606083015151909150600090610d8e906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b90507f0000000000000000000000000000000000000000000000000000000000000000811115610dd457604051637bbf29e360e01b8152600481018290526024016105f4565b306000610de18888610e84565b90506040518060c0016040528084815260200186604001516001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff16815260200182604051602001610e4791815260200190565b60405160208183030381529060405281525084600081518110610e6c57610e6c612068565b60209081029190910101525091979650505050505050565b600080610e9383850185612439565b90506000610aa1826110dc565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ec782840184612439565b90506000610ed4826110f2565b90506000610ee4610d1587612242565b9050610ef0818361119c565b610ef9836114cd565b505050505050565b6000610f0d8383610e84565b6000818152600160205260408120549192506001600160a01b0390911690610f37610d1587612242565b90506001600160a01b03821615801590610f67575080604001516001600160a01b0316826001600160a01b031614155b1561103e576060810151516001600160801b031660009081526029602052604081205463ffffffff1690819003610fc35760608201515160405163065ef5f360e01b81526001600160801b0390911660048201526024016105f4565b610fcd848261166a565b15611029576000848152603e602052604081205461ffff16604051630d16862d60e11b8152600481018790526001600160a01b038616602482015261ffff8216604482015263ffffffff841660648201529091506084016105f4565b611033828461169a565b61103c846117e8565b505b610ef9836110526040890160208a01611f49565b61188f565b61105f611aeb565b6000826000015160008151811061107857611078612068565b6020026020010151905061108b816118ee565b600081604001518060200190518101906110a5919061251a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b602081015160009060065b602002015192915050565b6110fa611b4e565b60405180610120016040528061110f8461192e565b6001600160a01b031681526020016111268461193c565b81526020016111348461194b565b81526020016111428461195a565b8152602001611150846110dc565b815260200161115e84611969565b815260200161116c84611978565b81526020016111848460200151610120015160011490565b1515815260200161119484611987565b905292915050565b815160c0820151146111d157815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016105f4565b81606001516040015115158160e0015115150361121c57606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016105f4565b81604001516001600160a01b031681600001516001600160a01b03161461127057604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016105f4565b468160200151146112a3576020810151604051630432cec160e31b815246600482015260248101919091526044016105f4565b81602001518160a00151146112de57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016105f4565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015611349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136d9190612595565b61139257806040015160405163cbfe7bc360e01b81526004016105f491815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa1580156113f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141591906125b0565b80516101008401515191925014158061143c57506020808201516101008401519091015114155b15611486578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016105f4565b6000611491846119df565b9050808360600151146114c7576060830151604051630e6efbdd60e21b81526105f4918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946115309490939290919060040161262c565b602060405180830381865afa925050508015611569575060408051601f3d908101601f1916820190925261156691810190612595565b60015b61163f576115756126b0565b806308c379a0036115ae57506115896126cc565b8061159457506115ed565b8060405162dd577760e81b81526004016105f49190612755565b634e487b71036115ed576115c0612768565b906115cb57506115ed565b60405162dd577760e81b815260206004820152600060248201526044016105f4565b3d808015611617576040519150601f19603f3d011682016040523d82523d6000602084013e61161c565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016105f4565b806116665760405162dd577760e81b815260206004820152600060248201526044016105f4565b5050565b6000828152603d6020526040812054429061168c90849063ffffffff16612788565b63ffffffff16119392505050565b60408051600180825281830190925260009160208083019080368337505060408051600180825281830190925292935060009291506020808301908036833701905050905082826000815181106116f3576116f3612068565b6001600160a01b0390921660209283029190910190910152606084015151611744906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b8160008151811061175757611757612068565b602090810291909101015260405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af7906117b09085908590600401612185565b600060405180830381600087803b1580156117ca57600080fd5b505af11580156117de573d6000803e3d6000fd5b5050505050505050565b6000818152603d60209081526040808320805463ffffffff19164263ffffffff16179055603e909152812080546001929061182890849061ffff1661221c565b82546101009290920a61ffff8181021990931691831602179091556000838152603e60209081526040918290205491519190921681528392507f85183f8abad8891335fb845d2e6b4f84a9c7f7409f242f4e5ec138a84abffacf910160405180910390a250565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f0c5a122814a29e22d1363dacdd6f7c95345b70890f97e65eacb5565da28116ac910161067f565b60006118fd8260400151611a04565b825190915081146116665781516040516337e3d1ab60e01b81526105f4918391600401918252602082015260400190565b6020810151600090816110e7565b602081015160009060016110e7565b602081015160009060046110e7565b602081015160009060056110e7565b602081015160009060076110e7565b602081015160009060086110e7565b61198f611ba1565b604051806040016040528083602001516002600a81106119b1576119b1612068565b6020020151815260200183602001516003600a81106119d2576119d2612068565b6020020151905292915050565b6000806119fd308460600151600001516001600160801b0316611a39565b9392505050565b805160208201206000906103d2907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906127a7565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6119fd91906127a7565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b03168152602001611b49604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001611b495b60405180604001604052806002906020820280368337509192915050565b600060208284031215611bd157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b0382111715611c0d57611c0d611bd8565b60405250565b606081018181106001600160401b0382111715611c0d57611c0d611bd8565b601f8201601f191681016001600160401b0381118282101715611c5757611c57611bd8565b6040525050565b60006001600160401b03821115611c7757611c77611bd8565b50601f01601f191660200190565b600082601f830112611c9657600080fd5b8135611ca181611c5e565b604051611cae8282611c32565b828152856020848701011115611cc357600080fd5b82602086016020830137600092810160200192909252509392505050565b600060208284031215611cf357600080fd5b81356001600160401b03811115611d0957600080fd5b61042684828501611c85565b63ffffffff81168114610c3c57600080fd5b60008060408385031215611d3a57600080fd5b823591506020830135611d4c81611d15565b809150509250929050565b60008083601f840112611d6957600080fd5b5081356001600160401b03811115611d8057600080fd5b602083019150836020828501011115611d9857600080fd5b9250929050565b600080600060408486031215611db457600080fd5b83356001600160401b0380821115611dcb57600080fd5b9085019060408288031215611ddf57600080fd5b90935060208501359080821115611df557600080fd5b50611e0286828701611d57565b9497909650939450505050565b60005b83811015611e2a578181015183820152602001611e12565b838111156114c75750506000910152565b60008151808452611e53816020860160208601611e0f565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261042660c0850182611e3b565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611f1757603f19888603018452611f05858351611e67565b94509285019290850190600101611ee9565b5092979650505050505050565b6001600160a01b0381168114610c3c57600080fd5b8035611f4481611f24565b919050565b600060208284031215611f5b57600080fd5b81356119fd81611f24565b600080600080600060608688031215611f7e57600080fd5b85356001600160401b0380821115611f9557600080fd5b818801915088601f830112611fa957600080fd5b813581811115611fb857600080fd5b8960208260051b8501011115611fcd57600080fd5b60208301975080965050611fe360208901611f39565b94506040880135915080821115611ff957600080fd5b5061200688828901611d57565b969995985093965092949392505050565b6000806040838503121561202a57600080fd5b823591506020830135611d4c81611f24565b6000806040838503121561204f57600080fd5b82519150602083015161ffff81168114611d4c57600080fd5b634e487b7160e01b600052603260045260246000fd5b6040815260006120916040830185611e3b565b905061ffff831660208301529392505050565b600080600080608085870312156120ba57600080fd5b84516120c581611f24565b6020860151604087015191955093506120dd81611d15565b60608601519092506001600160401b038111156120f957600080fd5b8501601f8101871361210a57600080fd5b805161211581611c5e565b6040516121228282611c32565b82815289602084860101111561213757600080fd5b612148836020830160208701611e0f565b969995985093965050505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161217e5761217e612156565b5060010190565b604080825283519082018190526000906020906060840190828701845b828110156121c75781516001600160a01b0316845292840192908401906001016121a2565b5050508381038285015284518082528583019183019060005b818110156121fc578351835292840192918401916001016121e0565b5090979650505050505050565b6020815260006119fd6020830184611e67565b600061ffff80831681851680830382111561223957612239612156565b01949350505050565b6000604080833603121561225557600080fd5b805161226081611bee565b83356001600160401b038082111561227757600080fd5b9085019036601f83011261228a57600080fd5b813560208282111561229e5761229e611bd8565b8160051b86516122b083830182611c32565b928352848101820192828101368511156122c957600080fd5b83870192505b8483101561234d578235868111156122e75760008081fd5b8701606036829003601f19018113156123005760008081fd5b8a5161230b81611c13565b8287013581528b8301358188015290820135908882111561232c5760008081fd5b61233a368884860101611c85565b818d0152835250509183019183016122cf565b5086525061235c888201611f39565b90850152509195945050505050565b6000821982111561237e5761237e612156565b500190565b600082601f83011261239457600080fd5b6040516123a081611bee565b8060408401858111156123b257600080fd5b845b818110156123cc5780358352602092830192016123b4565b509195945050505050565b600082601f8301126123e857600080fd5b6040516101408082018281106001600160401b038211171561240c5761240c611bd8565b6040528301818582111561241f57600080fd5b845b828110156123cc578035825260209182019101612421565b600081830361024081121561244d57600080fd5b6040805161245a81611bee565b6101008084121561246a57600080fd5b8251935061247784611c13565b6124818787612383565b845286605f87011261249257600080fd5b825161249d81611bee565b8060c08801898111156124af57600080fd5b8589015b818110156124d4576124c58b82612383565b835260209092019186016124b3565b508260208801526124e58a82612383565b868801525050508382526124fb878288016123d7565b60208301525095945050505050565b80518015158114611f4457600080fd5b60006060828403121561252c57600080fd5b604051606081018181106001600160401b038211171561254e5761254e611bd8565b60405282516001600160801b038116811461256857600080fd5b8152602083015161257881611d15565b60208201526125896040840161250a565b60408201529392505050565b6000602082840312156125a757600080fd5b6119fd8261250a565b6000604082840312156125c257600080fd5b82601f8301126125d157600080fd5b6040516125dd81611bee565b8060408401858111156125ef57600080fd5b845b818110156123cc5780518352602092830192016125f1565b8060005b60028110156114c757815184526020938401939091019060010161260d565b610240810161263b8287612609565b60408083018660005b600281101561266b57612658838351612609565b9183019160209190910190600101612644565b5050505061267c60c0830185612609565b61010082018360005b600a8110156126a4578151835260209283019290910190600101612685565b50505095945050505050565b600060033d11156126c95760046000803e5060005160e01c5b90565b600060443d10156126da5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561270957505050505090565b82850191508151818111156127215750505050505090565b843d870101602082850101111561273b5750505050505090565b61274a60208286010187611c32565b509095945050505050565b6020815260006119fd6020830184611e3b565b60008060233d1115612784576020600460003e50506000516001905b9091565b600063ffffffff80831681851680830382111561223957612239612156565b6000826127c457634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220202a9a70b259c56940b27ba667618cafc46cd9a9f1eb7ea03e8803b68fee4b3964736f6c634300080e0033", diff --git a/deployments/mumbai/HydraS1AccountboundAttesterImplem.json b/deployments/mumbaiTestnet/HydraS1AccountboundAttesterImplem.json similarity index 98% rename from deployments/mumbai/HydraS1AccountboundAttesterImplem.json rename to deployments/mumbaiTestnet/HydraS1AccountboundAttesterImplem.json index f49b0bd..282ba0b 100644 --- a/deployments/mumbai/HydraS1AccountboundAttesterImplem.json +++ b/deployments/mumbaiTestnet/HydraS1AccountboundAttesterImplem.json @@ -1,5 +1,5 @@ { - "address": "0xa723D0b8D0e816BE0f4BbE839163655BD85E14FC", + "address": "0xE822EcA41Be81D15ffe3daEaF9f9F91E8bB5D959", "abi": [ { "inputs": [ @@ -981,89 +981,89 @@ "type": "function" } ], - "transactionHash": "0x1367c8d1f64f3987113f6cafe1e0929b836f4ee62ef2fb65fdd6b2833394d238", + "transactionHash": "0xeb1debcc341f8a8d53f61b4ad5dc32643d2bf028f53c38f677361a8669071634", "receipt": { "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0xa723D0b8D0e816BE0f4BbE839163655BD85E14FC", - "transactionIndex": 31, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xE822EcA41Be81D15ffe3daEaF9f9F91E8bB5D959", + "transactionIndex": 16, "gasUsed": "2322582", - "logsBloom": "0x00000000000000000000000000020000000000000000000000800000000000000000000000000000020000000000000000008000102000000000000000000000000000000000000000000000000000800001000000000000040100000000000000000000020000000000000000000800002000000000000080000000000000400000000000000000000000002000000000000010000080000000000000008000200000000000000000000000800400000000000000000000000040000000004000000000000000000001000000040000000000000000000000100000000020000000000000000000000000000000000000000000000000000020000000100000", - "blockHash": "0x2b4a8cf2d29028afa58dd99b710997cc288b1d5d7c951447f5d5886bc45606fa", - "transactionHash": "0x1367c8d1f64f3987113f6cafe1e0929b836f4ee62ef2fb65fdd6b2833394d238", + "logsBloom": "0x00000000000000000000000000000000000000000000000000800000000000000000000000000000000000000000000000008000000000000000000000008000000000000100000000000000000000800001000000000000000100000000000000000000020000000000000000000800000000000000000080000000000000400000000000000000000000000000000000000000000080000000000040000000200000000000000000080000000402002000000000000000002000000000004000008000000000000001000000040100000000000000000000100000000020000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x3ab0c3fb14a9bee8100e023bededd0a8d7d4a2d7f9369643ec65a6dfa669e10b", + "transactionHash": "0xeb1debcc341f8a8d53f61b4ad5dc32643d2bf028f53c38f677361a8669071634", "logs": [ { - "transactionIndex": 31, - "blockNumber": 29540611, - "transactionHash": "0x1367c8d1f64f3987113f6cafe1e0929b836f4ee62ef2fb65fdd6b2833394d238", - "address": "0xa723D0b8D0e816BE0f4BbE839163655BD85E14FC", + "transactionIndex": 16, + "blockNumber": 29772149, + "transactionHash": "0xeb1debcc341f8a8d53f61b4ad5dc32643d2bf028f53c38f677361a8669071634", + "address": "0xE822EcA41Be81D15ffe3daEaF9f9F91E8bB5D959", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 95, - "blockHash": "0x2b4a8cf2d29028afa58dd99b710997cc288b1d5d7c951447f5d5886bc45606fa" + "logIndex": 60, + "blockHash": "0x3ab0c3fb14a9bee8100e023bededd0a8d7d4a2d7f9369643ec65a6dfa669e10b" }, { - "transactionIndex": 31, - "blockNumber": 29540611, - "transactionHash": "0x1367c8d1f64f3987113f6cafe1e0929b836f4ee62ef2fb65fdd6b2833394d238", - "address": "0xa723D0b8D0e816BE0f4BbE839163655BD85E14FC", + "transactionIndex": 16, + "blockNumber": 29772149, + "transactionHash": "0xeb1debcc341f8a8d53f61b4ad5dc32643d2bf028f53c38f677361a8669071634", + "address": "0xE822EcA41Be81D15ffe3daEaF9f9F91E8bB5D959", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x0000000000000000000000004e070e9b85a659f0b7b47cde33152ad6c2f63954" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 96, - "blockHash": "0x2b4a8cf2d29028afa58dd99b710997cc288b1d5d7c951447f5d5886bc45606fa" + "logIndex": 61, + "blockHash": "0x3ab0c3fb14a9bee8100e023bededd0a8d7d4a2d7f9369643ec65a6dfa669e10b" }, { - "transactionIndex": 31, - "blockNumber": 29540611, - "transactionHash": "0x1367c8d1f64f3987113f6cafe1e0929b836f4ee62ef2fb65fdd6b2833394d238", - "address": "0xa723D0b8D0e816BE0f4BbE839163655BD85E14FC", + "transactionIndex": 16, + "blockNumber": 29772149, + "transactionHash": "0xeb1debcc341f8a8d53f61b4ad5dc32643d2bf028f53c38f677361a8669071634", + "address": "0xE822EcA41Be81D15ffe3daEaF9f9F91E8bB5D959", "topics": [ "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000004", - "logIndex": 97, - "blockHash": "0x2b4a8cf2d29028afa58dd99b710997cc288b1d5d7c951447f5d5886bc45606fa" + "logIndex": 62, + "blockHash": "0x3ab0c3fb14a9bee8100e023bededd0a8d7d4a2d7f9369643ec65a6dfa669e10b" }, { - "transactionIndex": 31, - "blockNumber": 29540611, - "transactionHash": "0x1367c8d1f64f3987113f6cafe1e0929b836f4ee62ef2fb65fdd6b2833394d238", + "transactionIndex": 16, + "blockNumber": 29772149, + "transactionHash": "0xeb1debcc341f8a8d53f61b4ad5dc32643d2bf028f53c38f677361a8669071634", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000c275dc8be39f50d12f66b6a63629c39da5bae5bd" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x0000000000000000000000003a22c8bc68e98b0faf40f349dd2b2890fae01484" ], - "data": "0x000000000000000000000000000000000000000000000000000fe87ffbf4efa40000000000000000000000000000000000000000000000007d5a488854524ff8000000000000000000000000000000000000000000000b8e591ef8f4fa5d33c70000000000000000000000000000000000000000000000007d4a6008585d6054000000000000000000000000000000000000000000000b8e592ee174f652236b", - "logIndex": 98, - "blockHash": "0x2b4a8cf2d29028afa58dd99b710997cc288b1d5d7c951447f5d5886bc45606fa" + "data": "0x000000000000000000000000000000000000000000000000000c60906454a8d40000000000000000000000000000000000000000000000001b823feee5d9e725000000000000000000000000000000000000000000000108f4a1f5a010efc33f0000000000000000000000000000000000000000000000001b75df5e81853e51000000000000000000000000000000000000000000000108f4ae563075446c13", + "logIndex": 63, + "blockHash": "0x3ab0c3fb14a9bee8100e023bededd0a8d7d4a2d7f9369643ec65a6dfa669e10b" } ], - "blockNumber": 29540611, - "cumulativeGasUsed": "11747422", + "blockNumber": 29772149, + "cumulativeGasUsed": "6591936", "status": 1, "byzantium": true }, "args": [ - "0xf576E42E5b2682B8f606B1840c3A982610C29a3f", - "0xCBB1032416EB875D94Da8a447D73471E4C51998E", - "0x2c17e335d131dfd21238475Dd545B9B29Fb5A27D", - "0x82B54988e4E3a2850501F91AC06CEA82bdb014D3", + "0xc24F86a8D9f82401b693d4FFaa1DCf3109d88524", + "0x09f35a46C6863F5C8Cd887F690974DCaaDe0A2a5", + "0xe51e46177505c31CE33791066E17E11d9D180305", + "0xE6C1f01C71A184A44A21B10A7FBEb3b1604B4f2a", "10000001", "20000000", - "0x4e070E9b85a659F0B7B47cde33152ad6c2F63954" + "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED" ], - "numDeployments": 2, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"hydraS1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"availableRootsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"AccountsTreeValueMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimLength\",\"type\":\"uint256\"}],\"name\":\"ClaimsLengthDifferentThanOne\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentMapperPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"}],\"name\":\"CooldownDurationNotSetForGroupIndex\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedExternalNullifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"externalNullifier\",\"type\":\"uint256\"}],\"name\":\"ExternalNullifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"burnCount\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"cooldownStart\",\"type\":\"uint32\"}],\"name\":\"NullifierOnCooldown\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"NullifierUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inputRoot\",\"type\":\"uint256\"}],\"name\":\"RegistryRootMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"cooldownDuration\",\"type\":\"uint32\"}],\"name\":\"CooldownDurationSetForGroupIndex\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"NullifierDestinationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"burnCount\",\"type\":\"uint16\"}],\"name\":\"NullifierSetOnCooldown\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"claimDestination\",\"type\":\"address\"}],\"name\":\"_getNextBurnCount\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAvailableRootsRegistry\",\"outputs\":[{\"internalType\":\"contract IAvailableRootsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"getBurnCountFromExtraData\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentMapperRegistry\",\"outputs\":[{\"internalType\":\"contract ICommitmentMapperRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"}],\"name\":\"getCooldownDurationForGroupIndex\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfNullifier\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"getNullifierBurnCount\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"getNullifierCooldownStart\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"getNullifierFromExtraData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract HydraS1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"cooldownDuration\",\"type\":\"uint32\"}],\"name\":\"setCooldownDurationForGroupIndex\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"errors\":{\"CollectionIdOutOfBound(uint256)\":[{\"details\":\"Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST*\"}],\"CooldownDurationNotSetForGroupIndex(uint256)\":[{\"details\":\"Error when the cooldown duration for a given groupIndex is equal to zero. The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.*\"}],\"NullifierOnCooldown(uint256,address,uint16,uint32)\":[{\"details\":\"Error when the nullifier is on cooldown. The user have to wait the cooldownDuration before being able to change again the destination address.*\"}],\"NullifierUsed(uint256)\":[{\"details\":\"Error when the nullifier is already used for a destination address*\"}]},\"kind\":\"dev\",\"methods\":{\"_getNextBurnCount(uint256,address)\":{\"details\":\"returns burn count or burn count + 1 if new burn will happen\",\"params\":{\"claimDestination\":\"destination referenced in the user claim\",\"nullifier\":\"user nullifier\"}},\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns the actual attestations constructed from the user request\",\"params\":{\"proofData\":\"snark public input as well as snark proof\",\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"availableRootsRegistryAddress\":\"Registry storing the available groups for this attester (e.g roots of registry merkle trees)\",\"collectionIdFirst\":\"Id of the first attestation collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last attestation collection in which the attester is supposed to record\",\"commitmentMapperAddress\":\"commitment mapper's public key registry\",\"hydraS1VerifierAddress\":\"ZK Snark Hydra-S1 Verifier contract\",\"owner\":\"Address of attester's owner\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getAvailableRootsRegistry()\":{\"details\":\"Getter of Roots Registry Contract\"},\"getBurnCountFromExtraData(bytes)\":{\"details\":\"Returns the burn count for a given extraData\",\"params\":{\"extraData\":\"bytes where the burnCount is encoded\"}},\"getCommitmentMapperRegistry()\":{\"details\":\"Getter of Commitment Mapper Registry contract\"},\"getCooldownDurationForGroupIndex(uint256)\":{\"details\":\"Getter, get the cooldown duration of a groupIndex\",\"params\":{\"groupIndex\":\"internal collection id*\"}},\"getDestinationOfNullifier(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a nullifier\",\"params\":{\"nullifier\":\"nullifier used*\"}},\"getNullifierBurnCount(uint256)\":{\"details\":\"Getter, returns the burnCount of a nullifier\",\"params\":{\"nullifier\":\"nullifier used*\"}},\"getNullifierCooldownStart(uint256)\":{\"details\":\"Getter, returns the cooldown start of a nullifier\",\"params\":{\"nullifier\":\"nullifier used*\"}},\"getNullifierFromExtraData(bytes)\":{\"details\":\"returns the nullifier for a given extraData\",\"params\":{\"extraData\":\"bytes where the nullifier is encoded\"}},\"getVerifier()\":{\"details\":\"Getter of Hydra-S1 Verifier contract\"},\"initialize(address)\":{\"details\":\"Initialize function, to be called by the proxy delegating calls to this implementation\",\"params\":{\"ownerAddress\":\"Owner of the contract, has the right to authorize/unauthorize attestations issuers\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setCooldownDurationForGroupIndex(uint256,uint32)\":{\"details\":\"Setter, sets the cooldown duration of a groupIndex\",\"params\":{\"cooldownDuration\":\"cooldown duration we want to set for the groupIndex*\",\"groupIndex\":\"internal collection id\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Hydra-S1 Accountbound Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getCooldownDurationForGroupIndex(uint256)\":{\"notice\":\"returns 0 when the accountbound feature is deactivated for this group\"},\"initialize(address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"},\"setCooldownDurationForGroupIndex(uint256,uint32)\":{\"notice\":\"set to 0 to deactivate the accountbound feature for this group\"}},\"notice\":\"This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic. Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic. However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation. The _beforeRecordAttestations is also overriden to fit the Accountbound logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Nullified Each source account gets one nullifier per claim (i.e only one attestation per source account per claim) While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier) We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation. We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation. Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier) - Accountbound (opt-in, with cooldown period) The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group. Users can update their attestation's destination by providing a new Hydra-S1 ZK proof It means the attestation is bound to the source account, stored on an updatable destination account. When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional. A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations. - Renewable A nullifier can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol\":\"HydraS1AccountboundAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [8609986746108439658545470593166889256314951959466775818870246174320018498804,\\n 6848251127850009101372611262053374737897586140140607384018397707035108265914],\\n [21367916863936594568281095443965096905143705300114190558130516981138584550504,\\n 13327705762185115653848159709412003423932761899188342359583872691135383932883]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 19965766170734310004645394427613286415565755728797065894668054116047682895204,\\n 6952067612339183672227137101423582097916038093373585908267153974352032944482\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 13987716160490730015463796942940452666334097189904948795214986996497499925899,\\n 5336810094802209074340875836312868429276540870324469349093948627126061524544\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 14931593253473978964215343699995811275378324235306358485461293343370969283966,\\n 564306919152089917957316877787764763278299990971316475606280877961553231205\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11591267743733991434114686002448165336885445656808796470854638278338319268343,\\n 11495219763417990955889652410266075210402006084183208750635660647824890013350\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 8183184532870222270700473518157259944911700429689031755853536692005688965081,\\n 9121077094104828462137861111631978599019724423614716723152060153405564278301\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 4314095526093128699362232919686741372014146055311239687202926853002748112330,\\n 11665330391505820654128458332883010598817535082070674418723503440883598640597\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 18925967077785550270509493111690046951994174908254476036944536825999614778001,\\n 4990629719417206796668074534812314525340851981015724652256935997545282642849\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x120f0b311a61cabc9d42ef740c19e5f20b4c8ba400d9a6378e33c76dd54f5c42\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\n\\nimport {IHydraS1AccountboundAttester} from './interfaces/IHydraS1AccountboundAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from '../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra-S1\\nimport {HydraS1SimpleAttester, IAttester, HydraS1Lib, HydraS1ProofData, HydraS1Claim} from './HydraS1SimpleAttester.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic.\\n * Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic.\\n * However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation.\\n * The _beforeRecordAttestations is also overriden to fit the Accountbound logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Nullified\\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\\n * While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier)\\n * We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation.\\n * We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation.\\n * Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier)\\n\\n * - Accountbound (opt-in, with cooldown period)\\n * The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group.\\n * Users can update their attestation's destination by providing a new Hydra-S1 ZK proof \\n * It means the attestation is bound to the source account, stored on an updatable destination account.\\n * When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional.\\n * A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred\\n * One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations.\\n \\n * - Renewable\\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew or update their attestations\\n **/\\n\\ncontract HydraS1AccountboundAttester is\\n IHydraS1AccountboundAttester,\\n HydraS1SimpleAttester,\\n Ownable\\n{\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n uint8 public constant IMPLEMENTATION_VERSION = 4;\\n\\n /*******************************************************\\n Storage layout:\\n 20 slots between HydraS1SimpleAttester and HydraS1AccountboundAttester\\n 1 currently used by Ownable\\n 19 place holders\\n 2O for config\\n 1 currently used\\n 19 place holders\\n 20 for logic\\n 2 currently used\\n 18 place holders\\n *******************************************************/\\n\\n // keeping some space for future config logics\\n uint256[19] private _placeHolderBeforeHydraS1Accountbound;\\n\\n // cooldown durations for each groupIndex\\n mapping(uint256 => uint32) internal _cooldownDurations;\\n\\n // keeping some space for future config logics\\n uint256[19] private _placeHoldersHydraS1AccountboundConfig;\\n\\n mapping(uint256 => uint32) internal _nullifiersCooldownStart;\\n mapping(uint256 => uint16) internal _nullifiersBurnCount;\\n\\n // keeping some space for future config logics\\n uint256[18] private _placeHoldersHydraS1AccountboundLogic;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first attestation collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last attestation collection in which the attester is supposed to record\\n * @param owner Address of attester's owner\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n address owner\\n )\\n HydraS1SimpleAttester(\\n attestationsRegistryAddress,\\n hydraS1VerifierAddress,\\n availableRootsRegistryAddress,\\n commitmentMapperAddress,\\n collectionIdFirst,\\n collectionIdLast\\n )\\n {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Returns the actual attestations constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark public input as well as snark proof\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual override(IAttester, HydraS1SimpleAttester) returns (Attestation[] memory) {\\n Attestation[] memory attestations = super.buildAttestations(request, proofData);\\n\\n uint256 nullifier = proofData._getNullifier();\\n attestations[0].extraData = abi.encode(\\n attestations[0].extraData, // nullifier, from HydraS1 Simple\\n _getNextBurnCount(nullifier, attestations[0].owner) // BurnCount\\n );\\n\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if nullifier already used, not a renewal, and nullifier on cooldown.\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n uint256 nullifier = proofData._getNullifier();\\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\\n\\n HydraS1Claim memory claim = request._claim();\\n\\n // check if the nullifier has already been used previously, if so it may be on cooldown\\n if (\\n previousNullifierDestination != address(0) &&\\n previousNullifierDestination != claim.destination\\n ) {\\n uint32 cooldownDuration = _getCooldownDurationForGroupIndex(claim.groupProperties.groupIndex);\\n if (cooldownDuration == 0) {\\n revert CooldownDurationNotSetForGroupIndex(claim.groupProperties.groupIndex);\\n }\\n if (_isOnCooldown(nullifier, cooldownDuration)) {\\n uint16 burnCount = _getNullifierBurnCount(nullifier);\\n revert NullifierOnCooldown(\\n nullifier,\\n previousNullifierDestination,\\n burnCount,\\n cooldownDuration\\n );\\n }\\n\\n // Delete the old Attestation linked to the nullifier before recording the new one (accountbound feature)\\n _deletePreviousAttestation(claim, previousNullifierDestination);\\n\\n _setNullifierOnCooldownAndIncrementBurnCount(nullifier);\\n }\\n _setDestinationForNullifier(nullifier, request.destination);\\n }\\n\\n /*******************************************************\\n LOGIC FUNCTIONS RELATED TO ACCOUNTBOUND FEATURE\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the burnCount of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16) {\\n return _getNullifierBurnCount(nullifier);\\n }\\n\\n /**\\n * @dev Getter, returns the cooldown start of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32) {\\n return _getNullifierCooldownStart(nullifier);\\n }\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external pure override(HydraS1SimpleAttester, IHydraS1AccountboundAttester) returns (uint256) {\\n (uint256 nullifier, ) = abi.decode(extraData, (uint256, uint16));\\n\\n return nullifier;\\n }\\n\\n /**\\n * @dev Returns the burn count for a given extraData\\n * @param extraData bytes where the burnCount is encoded\\n */\\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16) {\\n (, uint16 burnCount) = abi.decode(extraData, (uint256, uint16));\\n\\n return burnCount;\\n }\\n\\n /**\\n * @dev Checks if a nullifier is on cooldown\\n * @param nullifier user nullifier\\n * @param cooldownDuration waiting time before the user can change its badge destination\\n */\\n function _isOnCooldown(uint256 nullifier, uint32 cooldownDuration) internal view returns (bool) {\\n return _getNullifierCooldownStart(nullifier) + cooldownDuration > block.timestamp;\\n }\\n\\n /**\\n * @dev Delete the previous attestation created with this nullifier\\n * @param claim user claim\\n * @param previousNullifierDestination previous destination chosen for this user nullifier\\n */\\n function _deletePreviousAttestation(\\n HydraS1Claim memory claim,\\n address previousNullifierDestination\\n ) internal {\\n address[] memory attestationOwners = new address[](1);\\n uint256[] memory attestationCollectionIds = new uint256[](1);\\n\\n attestationOwners[0] = previousNullifierDestination;\\n attestationCollectionIds[0] = AUTHORIZED_COLLECTION_ID_FIRST + claim.groupProperties.groupIndex;\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n }\\n\\n function _setNullifierOnCooldownAndIncrementBurnCount(uint256 nullifier) internal {\\n _nullifiersCooldownStart[nullifier] = uint32(block.timestamp);\\n _nullifiersBurnCount[nullifier] += 1;\\n emit NullifierSetOnCooldown(nullifier, _nullifiersBurnCount[nullifier]);\\n }\\n\\n function _getNullifierCooldownStart(uint256 nullifier) internal view returns (uint32) {\\n return _nullifiersCooldownStart[nullifier];\\n }\\n\\n function _getNullifierBurnCount(uint256 nullifier) internal view returns (uint16) {\\n return _nullifiersBurnCount[nullifier];\\n }\\n\\n /**\\n * @dev returns burn count or burn count + 1 if new burn will happen\\n * @param nullifier user nullifier\\n * @param claimDestination destination referenced in the user claim\\n */\\n function _getNextBurnCount(\\n uint256 nullifier,\\n address claimDestination\\n ) public view virtual returns (uint16) {\\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\\n uint16 burnCount = _getNullifierBurnCount(nullifier);\\n // If the attestation is minted on a new destination address\\n // the burnCount that will be encoded in the extraData of the Attestation should be incremented\\n if (\\n previousNullifierDestination != address(0) && previousNullifierDestination != claimDestination\\n ) {\\n burnCount += 1;\\n }\\n return burnCount;\\n }\\n\\n /*******************************************************\\n GROUP CONFIGURATION LOGIC\\n *******************************************************/\\n\\n /**\\n * @dev Setter, sets the cooldown duration of a groupIndex\\n * @notice set to 0 to deactivate the accountbound feature for this group\\n * @param groupIndex internal collection id\\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\\n **/\\n function setCooldownDurationForGroupIndex(\\n uint256 groupIndex,\\n uint32 cooldownDuration\\n ) external onlyOwner {\\n _cooldownDurations[groupIndex] = cooldownDuration;\\n emit CooldownDurationSetForGroupIndex(groupIndex, cooldownDuration);\\n }\\n\\n /**\\n * @dev Getter, get the cooldown duration of a groupIndex\\n * @notice returns 0 when the accountbound feature is deactivated for this group\\n * @param groupIndex internal collection id\\n **/\\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32) {\\n return _getCooldownDurationForGroupIndex(groupIndex);\\n }\\n\\n // = 0 means that the accountbound feature is deactivated for this group\\n function _getCooldownDurationForGroupIndex(uint256 groupIndex) internal view returns (uint32) {\\n return _cooldownDurations[groupIndex];\\n }\\n}\\n\",\"keccak256\":\"0x4c391f4bbfdd1b22039fdc7b43f12d7933deca89cc6ae9e5a2b5afa8c427762c\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\\nimport {IHydraS1Base} from './base/IHydraS1Base.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Nullified\\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * nullifier = hash(sourceSecret, externalNullifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - Renewable\\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew their attestations\\n **/\\n\\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n /*******************************************************\\n Storage layout:\\n 20 slots for HydraS1\\n 1 slot used\\n 19 place holders\\n *******************************************************/\\n\\n mapping(uint256 => address) internal _nullifiersDestinations;\\n\\n // keeping some space for future\\n uint256[19] private _placeHoldersHydraS1Simple;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n uint256 nullifier = proofData._getNullifier();\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n abi.encode(nullifier)\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if nullifier already used and not a renewal (e.g destination different that last)\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n // we get the nullifier used from the snark input in the data provided\\n uint256 nullifier = proofData._getNullifier();\\n address currentDestination = _getDestinationOfNullifier(nullifier);\\n\\n if (currentDestination != address(0) && currentDestination != request.destination) {\\n revert NullifierUsed(nullifier);\\n }\\n\\n _setDestinationForNullifier(nullifier, request.destination);\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the external nullifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose externalNullifier = hash(attesterAddress, claim.GroupId)\\n * Creates one nullifier per group, per user and makes sure no collision with other attester's nullifiers\\n **/\\n function _getExternalNullifierOfClaim(\\n HydraS1Claim memory claim\\n ) internal view override returns (uint256) {\\n uint256 externalNullifier = _encodeInSnarkField(\\n address(this),\\n claim.groupProperties.groupIndex\\n );\\n return externalNullifier;\\n }\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external pure virtual override(IHydraS1Base, HydraS1Base) returns (uint256) {\\n return abi.decode(extraData, (uint256));\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getDestinationOfNullifier(uint256 nullifier) external view override returns (address) {\\n return _getDestinationOfNullifier(nullifier);\\n }\\n\\n function _setDestinationForNullifier(uint256 nullifier, address destination) internal virtual {\\n _nullifiersDestinations[nullifier] = destination;\\n emit NullifierDestinationUpdated(nullifier, destination);\\n }\\n\\n function _getDestinationOfNullifier(uint256 nullifier) internal view returns (address) {\\n return _nullifiersDestinations[nullifier];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x7bb2f154f8b33d4c536ebe7828baeb25853d9c288d85b75f0f9d4c3a8e01e735\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Attester} from '../../../core/Attester.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n *\\n */\\nabstract contract HydraS1Base is IHydraS1Base, Attester, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the nullifier from an attestation extraData\\n * @dev Getter of a nullifier encoded in extraData\\n * @notice Must be implemented by the inheriting contracts\\n * @param extraData extraData where nullifier can be encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external view virtual returns (uint256);\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the external nullifier from a user request\\n * so it can be checked against snark input\\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n *\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of external nullifiers\\n *\\n * Do they get one external nullifier per claim?\\n * Do they get 2 external nullifiers per claim?\\n * Do they get 1 external nullifier per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getExternalNullifierOfClaim(\\n HydraS1Claim memory claim\\n ) internal view virtual returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(\\n HydraS1Claim memory claim,\\n HydraS1ProofInput memory input\\n ) internal view virtual {\\n if (input.accountsTreeValue != claim.groupId) {\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n }\\n\\n if (input.isStrict == claim.groupProperties.isScore) {\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n }\\n\\n if (input.destination != claim.destination) {\\n revert DestinationMismatch(claim.destination, input.destination);\\n }\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot)) {\\n revert RegistryRootMismatch(input.registryRoot);\\n }\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n ) {\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n }\\n\\n uint256 externalNullifier = _getExternalNullifierOfClaim(claim);\\n\\n if (input.externalNullifier != externalNullifier) {\\n revert ExternalNullifierMismatch(externalNullifier, input.externalNullifier);\\n }\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(uint256 /*errorCode*/) {\\n revert InvalidGroth16Proof('');\\n } catch (bytes memory /*lowLevelData*/) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0x8614a04a2a58649b4434fab39ca30e3ff0d94d09998355dbd9fa5bf762b3c845\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Interface\\n * @author Sismo\\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n **/\\ninterface IHydraS1Base is IAttester {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error ExternalNullifierMismatch(uint256 expectedExternalNullifier, uint256 externalNullifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n function getNullifierFromExtraData(bytes memory extraData) external view returns (uint256);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x65b9966e5cf43975edb64c742057153058ee31bea1beadf4456577e9d5dbc76d\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1AccountboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from '././IHydraS1SimpleAttester.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Interface\\n * @author Sismo\\n * @notice Interface of the HydraS1AccountboundAttester contract which inherits from the errors, events and methods specific to the HydraS1SimpleAttester interface.\\n **/\\ninterface IHydraS1AccountboundAttester is IHydraS1SimpleAttester {\\n /**\\n * @dev Event emitted when the duration of the cooldown duration for a group index (internal collection id) has been set\\n * @param groupIndex internal collection id\\n * @param cooldownDuration the duration of the cooldown period\\n **/\\n event CooldownDurationSetForGroupIndex(uint256 indexed groupIndex, uint32 cooldownDuration);\\n\\n /**\\n * @dev Event emitted when the nullifier has been set on cooldown. This happens when the\\n * attestation destination of a nullifier has been changed\\n * @param nullifier user nullifier\\n * @param burnCount the number of times the attestation destination of a nullifier has been changed\\n **/\\n event NullifierSetOnCooldown(uint256 indexed nullifier, uint16 burnCount);\\n\\n /**\\n * @dev Error when the nullifier is on cooldown. The user have to wait the cooldownDuration\\n * before being able to change again the destination address.\\n **/\\n error NullifierOnCooldown(\\n uint256 nullifier,\\n address destination,\\n uint16 burnCount,\\n uint32 cooldownStart\\n );\\n\\n /**\\n * @dev Error when the cooldown duration for a given groupIndex is equal to zero.\\n * The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.\\n **/\\n error CooldownDurationNotSetForGroupIndex(uint256 groupIndex);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(bytes memory extraData) external pure returns (uint256);\\n\\n /**\\n * @dev Returns the burn count for a given extraData\\n * @param extraData bytes where the burnCount is encoded\\n */\\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16);\\n\\n /**\\n * @dev Getter, returns the cooldown start of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32);\\n\\n /**\\n * @dev Getter, returns the burnCount of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16);\\n\\n /**\\n * @dev Setter, sets the cooldown duration of a groupIndex\\n * @param groupIndex internal collection id\\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\\n **/\\n function setCooldownDurationForGroupIndex(uint256 groupIndex, uint32 cooldownDuration) external;\\n\\n /*/**\\n * @dev Getter, get the cooldown duration of a groupIndex\\n * @notice returns 0 when the accountbound feature is deactivated for this group\\n * @param groupIndex internal collection id\\n **/\\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32);\\n}\\n\",\"keccak256\":\"0x69293ce8ee200e3ce8b34478b5dde62d934e32c4f82d173314a4ed72731b3663\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Interface\\n * @author Sismo\\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\\n **/\\ninterface IHydraS1SimpleAttester is IHydraS1Base {\\n /**\\n * @dev Error when the nullifier is already used for a destination address\\n **/\\n error NullifierUsed(uint256 nullifier);\\n\\n /**\\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\\n **/\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n /**\\n * @dev Event emitted when the nullifier is associated to a destination address.\\n **/\\n event NullifierDestinationUpdated(uint256 nullifier, address newOwner);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getDestinationOfNullifier(uint256 nullifier) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x8222c187e8314c931121c7632965316f079322b076501a5443d3102a0891a8d5\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // externalNullifier\\n // nullifier\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 externalNullifier;\\n uint256 nullifier;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getNullifier(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(\\n HydraS1ProofData memory self\\n )\\n internal\\n pure\\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[10] memory)\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(\\n HydraS1ProofData memory self\\n ) internal pure returns (uint256[2] memory) {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(\\n HydraS1ProofData memory self\\n ) internal pure returns (uint256) {\\n return self.input[5];\\n }\\n\\n function _getNullifier(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getNullifier(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 nullifier = uint256(_getNullifier(snarkProofData));\\n return nullifier;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(\\n bytes memory encodedProperties\\n ) internal pure returns (uint256) {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0xa484f046e44f6c77177ba6f165573dc3ee90680a057dff7d3de46d67a29c462a\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n address[] memory attestationOwners = new address[](collectionIds.length);\\n\\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\\n\\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n // fetch attestations from the registry\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationOwners[i] = attestationsOwner;\\n attestationCollectionIds[i] = collectionIds[i];\\n\\n attestations[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestations, proofData);\\n\\n _beforeDeleteAttestations(attestations, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n\\n _afterDeleteAttestations(attestations, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestations[i]);\\n }\\n return attestations;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x7743f02ed07e1b40a2ff45f5a45b5fe87d765326cce3528676cbd36c3d08ba37\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0x2d5faf5df56dfe1294202e89180846a1d4a5f938699619ee73b60c7314a97dfe\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3467998cbdb82b0c64aa8627efc5893d2b369f73e66e5d1095305e4609593cc5\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address ownerAddress,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0x1b6ab7a4ba266f3da2c7f6ba3de93e3ab89f389dbd6db14514b43cbdcbe9fe09\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5e882d3091e816f1286837eef92ae17737abf66fdeece1282b752f27ba18492b\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0xcb419cf389baad6f38de28625718f64f551d2669339c1b4e1887e11d62484469\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x6101406040523480156200001257600080fd5b5060405162002b2738038062002b2783398101604081905262000035916200020f565b6001600160a01b0387811660805286811660a05285811660e052841660c0526101008390526101208290526200006b3362000083565b6200007681620000d5565b5050505050505062000292565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054600490610100900460ff16158015620000f8575060005460ff8083169116105b620001605760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff831617610100178155620001876015546001600160a01b031690565b6001600160a01b031614806200019c5750303b155b15620001ad57620001ad8262000083565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b80516001600160a01b03811681146200020a57600080fd5b919050565b600080600080600080600060e0888a0312156200022b57600080fd5b6200023688620001f2565b96506200024660208901620001f2565b95506200025660408901620001f2565b94506200026660608901620001f2565b93506080880151925060a088015191506200028460c08901620001f2565b905092959891949750929550565b60805160a05160c05160e05161010051610120516127ff620003286000396000818161025e0152610d9201526000818161023701528181610d6a01526117200152600081816102dd01526112fa01526000818161017901526113960152600081816101f901526114f7015260008181610323015281816107820152818161096301528181610ae8015261177901526127ff6000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c80638b159099116100b8578063c4d66de81161007c578063c4d66de814610347578063c776adde1461035a578063ca1cc6461461036d578063e60f999f14610380578063f2fde38b14610393578063f7e420b3146103a657600080fd5b80638b159099146102a25780638da5cb5b146102ca578063918447af146102db578063af411a3014610301578063bfa665851461032157600080fd5b806346657fe91161010a57806346657fe9146101f7578063524a32481461021d57806354846d7a146102325780637000b05114610259578063715018a614610280578063754b377c1461028857600080fd5b8063063599db146101475780632254f98e14610177578063345dd9891461019d5780633800a4b9146101be5780633c4a9854146101e4575b600080fd5b61015a610155366004611bbf565b6103b9565b6040516001600160a01b0390911681526020015b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000061015a565b6101b06101ab366004611ce1565b6103d8565b60405190815260200161016e565b6101d16101cc366004611bbf565b6103f7565b60405161ffff909116815260200161016e565b6101d16101f2366004611ce1565b61040f565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61023061022b366004611d27565b61042e565b005b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b610230610494565b610290600481565b60405160ff909116815260200161016e565b6102b56102b0366004611bbf565b6104a8565b60405163ffffffff909116815260200161016e565b6015546001600160a01b031661015a565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61031461030f366004611d9f565b6104c2565b60405161016e9190611ec2565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b610230610355366004611f49565b610573565b610314610368366004611f66565b61068b565b6101d161037b366004612017565b610a46565b61031461038e366004611d9f565b610aaa565b6102306103a1366004611f49565b610bc6565b6102b56103b4366004611bbf565b610c3f565b6000818152600160205260408120546001600160a01b03165b92915050565b600080828060200190518101906103ef919061203c565b509392505050565b6000818152603e602052604081205461ffff166103d2565b60008082806020019051810190610426919061203c565b949350505050565b610436610c59565b600082815260296020908152604091829020805463ffffffff191663ffffffff8516908117909155915191825283917f893e2a4c394b497c1a2b041d18acc02d05deb2cc7ae3ea0f85d001aa93dff48b910160405180910390a25050565b61049c610c59565b6104a66000610cb3565b565b60008181526029602052604081205463ffffffff166103d2565b606060006104d1858585610d05565b905060006104df8585610e84565b9050816000815181106104f4576104f4612068565b602002602001015160a00151610528828460008151811061051757610517612068565b602002602001015160200151610a46565b60405160200161053992919061207e565b6040516020818303038152906040528260008151811061055b5761055b612068565b602090810291909101015160a0015250949350505050565b600054600490610100900460ff16158015610595575060005460ff8083169116105b6105fd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556106236015546001600160a01b031690565b6001600160a01b031614806106375750303b155b156106455761064582610cb3565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60606000856001600160401b038111156106a7576106a7611bd8565b6040519080825280602002602001820160405280156106d0578160200160208202803683370190505b5090506000866001600160401b038111156106ed576106ed611bd8565b604051908082528060200260200182016040528015610716578160200160208202803683370190505b5090506000876001600160401b0381111561073357610733611bd8565b60405190808252806020026020018201604052801561076c57816020015b610759611a9d565b8152602001906001900390816107515790505b50905060005b88811015610940576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106107c1576107c1612068565b905060200201358e6040518363ffffffff1660e01b81526004016107f89291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610815573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261083d91908101906120a4565b93509350935093508b88868151811061085857610858612068565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061088a5761088a612068565b905060200201358786815181106108a3576108a3612068565b6020026020010181815250506040518060c001604052808f8f888181106108cc576108cc612068565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061091e5761091e612068565b60200260200101819052505050505080806109389061216c565b915050610772565b5061094c818787610ea0565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061099a9086908690600401612185565b600060405180830381600087803b1580156109b457600080fd5b505af11580156109c8573d6000803e3d6000fd5b5050505060005b88811015610a39577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b828281518110610a0a57610a0a612068565b6020026020010151604051610a1f9190612209565b60405180910390a180610a318161216c565b9150506109cf565b5098975050505050505050565b600082815260016020908152604080832054603e9092528220546001600160a01b039091169061ffff168115801590610a915750836001600160a01b0316826001600160a01b031614155b1561042657610aa160018261221c565b95945050505050565b6060610ab7848484610eb9565b6000610ac48585856104c2565b9050610ad1858585610f01565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c09390610b1d908490600401611ec2565b600060405180830381600087803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b5050505060005b8151811015610bbd577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610b8e57610b8e612068565b6020026020010151604051610ba39190612209565b60405180910390a180610bb58161216c565b915050610b52565b50949350505050565b610bce610c59565b6001600160a01b038116610c335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b610c3c81610cb3565b50565b6000818152603d602052604081205463ffffffff166103d2565b6015546001600160a01b031633146104a65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105f4565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606000610d1a610d1586612242565b611057565b60408051600180825281830190925291925060009190816020015b610d3d611a9d565b815260200190600190039081610d35575050606083015151909150600090610d8e906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b90507f0000000000000000000000000000000000000000000000000000000000000000811115610dd457604051637bbf29e360e01b8152600481018290526024016105f4565b306000610de18888610e84565b90506040518060c0016040528084815260200186604001516001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff16815260200182604051602001610e4791815260200190565b60405160208183030381529060405281525084600081518110610e6c57610e6c612068565b60209081029190910101525091979650505050505050565b600080610e9383850185612439565b90506000610aa1826110dc565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ec782840184612439565b90506000610ed4826110f2565b90506000610ee4610d1587612242565b9050610ef0818361119c565b610ef9836114cd565b505050505050565b6000610f0d8383610e84565b6000818152600160205260408120549192506001600160a01b0390911690610f37610d1587612242565b90506001600160a01b03821615801590610f67575080604001516001600160a01b0316826001600160a01b031614155b1561103e576060810151516001600160801b031660009081526029602052604081205463ffffffff1690819003610fc35760608201515160405163065ef5f360e01b81526001600160801b0390911660048201526024016105f4565b610fcd848261166a565b15611029576000848152603e602052604081205461ffff16604051630d16862d60e11b8152600481018790526001600160a01b038616602482015261ffff8216604482015263ffffffff841660648201529091506084016105f4565b611033828461169a565b61103c846117e8565b505b610ef9836110526040890160208a01611f49565b61188f565b61105f611aeb565b6000826000015160008151811061107857611078612068565b6020026020010151905061108b816118ee565b600081604001518060200190518101906110a5919061251a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b602081015160009060065b602002015192915050565b6110fa611b4e565b60405180610120016040528061110f8461192e565b6001600160a01b031681526020016111268461193c565b81526020016111348461194b565b81526020016111428461195a565b8152602001611150846110dc565b815260200161115e84611969565b815260200161116c84611978565b81526020016111848460200151610120015160011490565b1515815260200161119484611987565b905292915050565b815160c0820151146111d157815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016105f4565b81606001516040015115158160e0015115150361121c57606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016105f4565b81604001516001600160a01b031681600001516001600160a01b03161461127057604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016105f4565b468160200151146112a3576020810151604051630432cec160e31b815246600482015260248101919091526044016105f4565b81602001518160a00151146112de57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016105f4565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015611349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136d9190612595565b61139257806040015160405163cbfe7bc360e01b81526004016105f491815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa1580156113f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141591906125b0565b80516101008401515191925014158061143c57506020808201516101008401519091015114155b15611486578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016105f4565b6000611491846119df565b9050808360600151146114c7576060830151604051630e6efbdd60e21b81526105f4918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946115309490939290919060040161262c565b602060405180830381865afa925050508015611569575060408051601f3d908101601f1916820190925261156691810190612595565b60015b61163f576115756126b0565b806308c379a0036115ae57506115896126cc565b8061159457506115ed565b8060405162dd577760e81b81526004016105f49190612755565b634e487b71036115ed576115c0612768565b906115cb57506115ed565b60405162dd577760e81b815260206004820152600060248201526044016105f4565b3d808015611617576040519150601f19603f3d011682016040523d82523d6000602084013e61161c565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016105f4565b806116665760405162dd577760e81b815260206004820152600060248201526044016105f4565b5050565b6000828152603d6020526040812054429061168c90849063ffffffff16612788565b63ffffffff16119392505050565b60408051600180825281830190925260009160208083019080368337505060408051600180825281830190925292935060009291506020808301908036833701905050905082826000815181106116f3576116f3612068565b6001600160a01b0390921660209283029190910190910152606084015151611744906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b8160008151811061175757611757612068565b602090810291909101015260405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af7906117b09085908590600401612185565b600060405180830381600087803b1580156117ca57600080fd5b505af11580156117de573d6000803e3d6000fd5b5050505050505050565b6000818152603d60209081526040808320805463ffffffff19164263ffffffff16179055603e909152812080546001929061182890849061ffff1661221c565b82546101009290920a61ffff8181021990931691831602179091556000838152603e60209081526040918290205491519190921681528392507f85183f8abad8891335fb845d2e6b4f84a9c7f7409f242f4e5ec138a84abffacf910160405180910390a250565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f0c5a122814a29e22d1363dacdd6f7c95345b70890f97e65eacb5565da28116ac910161067f565b60006118fd8260400151611a04565b825190915081146116665781516040516337e3d1ab60e01b81526105f4918391600401918252602082015260400190565b6020810151600090816110e7565b602081015160009060016110e7565b602081015160009060046110e7565b602081015160009060056110e7565b602081015160009060076110e7565b602081015160009060086110e7565b61198f611ba1565b604051806040016040528083602001516002600a81106119b1576119b1612068565b6020020151815260200183602001516003600a81106119d2576119d2612068565b6020020151905292915050565b6000806119fd308460600151600001516001600160801b0316611a39565b9392505050565b805160208201206000906103d2907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906127a7565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6119fd91906127a7565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b03168152602001611b49604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001611b495b60405180604001604052806002906020820280368337509192915050565b600060208284031215611bd157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b0382111715611c0d57611c0d611bd8565b60405250565b606081018181106001600160401b0382111715611c0d57611c0d611bd8565b601f8201601f191681016001600160401b0381118282101715611c5757611c57611bd8565b6040525050565b60006001600160401b03821115611c7757611c77611bd8565b50601f01601f191660200190565b600082601f830112611c9657600080fd5b8135611ca181611c5e565b604051611cae8282611c32565b828152856020848701011115611cc357600080fd5b82602086016020830137600092810160200192909252509392505050565b600060208284031215611cf357600080fd5b81356001600160401b03811115611d0957600080fd5b61042684828501611c85565b63ffffffff81168114610c3c57600080fd5b60008060408385031215611d3a57600080fd5b823591506020830135611d4c81611d15565b809150509250929050565b60008083601f840112611d6957600080fd5b5081356001600160401b03811115611d8057600080fd5b602083019150836020828501011115611d9857600080fd5b9250929050565b600080600060408486031215611db457600080fd5b83356001600160401b0380821115611dcb57600080fd5b9085019060408288031215611ddf57600080fd5b90935060208501359080821115611df557600080fd5b50611e0286828701611d57565b9497909650939450505050565b60005b83811015611e2a578181015183820152602001611e12565b838111156114c75750506000910152565b60008151808452611e53816020860160208601611e0f565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261042660c0850182611e3b565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611f1757603f19888603018452611f05858351611e67565b94509285019290850190600101611ee9565b5092979650505050505050565b6001600160a01b0381168114610c3c57600080fd5b8035611f4481611f24565b919050565b600060208284031215611f5b57600080fd5b81356119fd81611f24565b600080600080600060608688031215611f7e57600080fd5b85356001600160401b0380821115611f9557600080fd5b818801915088601f830112611fa957600080fd5b813581811115611fb857600080fd5b8960208260051b8501011115611fcd57600080fd5b60208301975080965050611fe360208901611f39565b94506040880135915080821115611ff957600080fd5b5061200688828901611d57565b969995985093965092949392505050565b6000806040838503121561202a57600080fd5b823591506020830135611d4c81611f24565b6000806040838503121561204f57600080fd5b82519150602083015161ffff81168114611d4c57600080fd5b634e487b7160e01b600052603260045260246000fd5b6040815260006120916040830185611e3b565b905061ffff831660208301529392505050565b600080600080608085870312156120ba57600080fd5b84516120c581611f24565b6020860151604087015191955093506120dd81611d15565b60608601519092506001600160401b038111156120f957600080fd5b8501601f8101871361210a57600080fd5b805161211581611c5e565b6040516121228282611c32565b82815289602084860101111561213757600080fd5b612148836020830160208701611e0f565b969995985093965050505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161217e5761217e612156565b5060010190565b604080825283519082018190526000906020906060840190828701845b828110156121c75781516001600160a01b0316845292840192908401906001016121a2565b5050508381038285015284518082528583019183019060005b818110156121fc578351835292840192918401916001016121e0565b5090979650505050505050565b6020815260006119fd6020830184611e67565b600061ffff80831681851680830382111561223957612239612156565b01949350505050565b6000604080833603121561225557600080fd5b805161226081611bee565b83356001600160401b038082111561227757600080fd5b9085019036601f83011261228a57600080fd5b813560208282111561229e5761229e611bd8565b8160051b86516122b083830182611c32565b928352848101820192828101368511156122c957600080fd5b83870192505b8483101561234d578235868111156122e75760008081fd5b8701606036829003601f19018113156123005760008081fd5b8a5161230b81611c13565b8287013581528b8301358188015290820135908882111561232c5760008081fd5b61233a368884860101611c85565b818d0152835250509183019183016122cf565b5086525061235c888201611f39565b90850152509195945050505050565b6000821982111561237e5761237e612156565b500190565b600082601f83011261239457600080fd5b6040516123a081611bee565b8060408401858111156123b257600080fd5b845b818110156123cc5780358352602092830192016123b4565b509195945050505050565b600082601f8301126123e857600080fd5b6040516101408082018281106001600160401b038211171561240c5761240c611bd8565b6040528301818582111561241f57600080fd5b845b828110156123cc578035825260209182019101612421565b600081830361024081121561244d57600080fd5b6040805161245a81611bee565b6101008084121561246a57600080fd5b8251935061247784611c13565b6124818787612383565b845286605f87011261249257600080fd5b825161249d81611bee565b8060c08801898111156124af57600080fd5b8589015b818110156124d4576124c58b82612383565b835260209092019186016124b3565b508260208801526124e58a82612383565b868801525050508382526124fb878288016123d7565b60208301525095945050505050565b80518015158114611f4457600080fd5b60006060828403121561252c57600080fd5b604051606081018181106001600160401b038211171561254e5761254e611bd8565b60405282516001600160801b038116811461256857600080fd5b8152602083015161257881611d15565b60208201526125896040840161250a565b60408201529392505050565b6000602082840312156125a757600080fd5b6119fd8261250a565b6000604082840312156125c257600080fd5b82601f8301126125d157600080fd5b6040516125dd81611bee565b8060408401858111156125ef57600080fd5b845b818110156123cc5780518352602092830192016125f1565b8060005b60028110156114c757815184526020938401939091019060010161260d565b610240810161263b8287612609565b60408083018660005b600281101561266b57612658838351612609565b9183019160209190910190600101612644565b5050505061267c60c0830185612609565b61010082018360005b600a8110156126a4578151835260209283019290910190600101612685565b50505095945050505050565b600060033d11156126c95760046000803e5060005160e01c5b90565b600060443d10156126da5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561270957505050505090565b82850191508151818111156127215750505050505090565b843d870101602082850101111561273b5750505050505090565b61274a60208286010187611c32565b509095945050505050565b6020815260006119fd6020830184611e3b565b60008060233d1115612784576020600460003e50506000516001905b9091565b600063ffffffff80831681851680830382111561223957612239612156565b6000826127c457634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220202a9a70b259c56940b27ba667618cafc46cd9a9f1eb7ea03e8803b68fee4b3964736f6c634300080e0033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101425760003560e01c80638b159099116100b8578063c4d66de81161007c578063c4d66de814610347578063c776adde1461035a578063ca1cc6461461036d578063e60f999f14610380578063f2fde38b14610393578063f7e420b3146103a657600080fd5b80638b159099146102a25780638da5cb5b146102ca578063918447af146102db578063af411a3014610301578063bfa665851461032157600080fd5b806346657fe91161010a57806346657fe9146101f7578063524a32481461021d57806354846d7a146102325780637000b05114610259578063715018a614610280578063754b377c1461028857600080fd5b8063063599db146101475780632254f98e14610177578063345dd9891461019d5780633800a4b9146101be5780633c4a9854146101e4575b600080fd5b61015a610155366004611bbf565b6103b9565b6040516001600160a01b0390911681526020015b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000061015a565b6101b06101ab366004611ce1565b6103d8565b60405190815260200161016e565b6101d16101cc366004611bbf565b6103f7565b60405161ffff909116815260200161016e565b6101d16101f2366004611ce1565b61040f565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61023061022b366004611d27565b61042e565b005b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b610230610494565b610290600481565b60405160ff909116815260200161016e565b6102b56102b0366004611bbf565b6104a8565b60405163ffffffff909116815260200161016e565b6015546001600160a01b031661015a565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61031461030f366004611d9f565b6104c2565b60405161016e9190611ec2565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b610230610355366004611f49565b610573565b610314610368366004611f66565b61068b565b6101d161037b366004612017565b610a46565b61031461038e366004611d9f565b610aaa565b6102306103a1366004611f49565b610bc6565b6102b56103b4366004611bbf565b610c3f565b6000818152600160205260408120546001600160a01b03165b92915050565b600080828060200190518101906103ef919061203c565b509392505050565b6000818152603e602052604081205461ffff166103d2565b60008082806020019051810190610426919061203c565b949350505050565b610436610c59565b600082815260296020908152604091829020805463ffffffff191663ffffffff8516908117909155915191825283917f893e2a4c394b497c1a2b041d18acc02d05deb2cc7ae3ea0f85d001aa93dff48b910160405180910390a25050565b61049c610c59565b6104a66000610cb3565b565b60008181526029602052604081205463ffffffff166103d2565b606060006104d1858585610d05565b905060006104df8585610e84565b9050816000815181106104f4576104f4612068565b602002602001015160a00151610528828460008151811061051757610517612068565b602002602001015160200151610a46565b60405160200161053992919061207e565b6040516020818303038152906040528260008151811061055b5761055b612068565b602090810291909101015160a0015250949350505050565b600054600490610100900460ff16158015610595575060005460ff8083169116105b6105fd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556106236015546001600160a01b031690565b6001600160a01b031614806106375750303b155b156106455761064582610cb3565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60606000856001600160401b038111156106a7576106a7611bd8565b6040519080825280602002602001820160405280156106d0578160200160208202803683370190505b5090506000866001600160401b038111156106ed576106ed611bd8565b604051908082528060200260200182016040528015610716578160200160208202803683370190505b5090506000876001600160401b0381111561073357610733611bd8565b60405190808252806020026020018201604052801561076c57816020015b610759611a9d565b8152602001906001900390816107515790505b50905060005b88811015610940576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106107c1576107c1612068565b905060200201358e6040518363ffffffff1660e01b81526004016107f89291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610815573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261083d91908101906120a4565b93509350935093508b88868151811061085857610858612068565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061088a5761088a612068565b905060200201358786815181106108a3576108a3612068565b6020026020010181815250506040518060c001604052808f8f888181106108cc576108cc612068565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061091e5761091e612068565b60200260200101819052505050505080806109389061216c565b915050610772565b5061094c818787610ea0565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061099a9086908690600401612185565b600060405180830381600087803b1580156109b457600080fd5b505af11580156109c8573d6000803e3d6000fd5b5050505060005b88811015610a39577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b828281518110610a0a57610a0a612068565b6020026020010151604051610a1f9190612209565b60405180910390a180610a318161216c565b9150506109cf565b5098975050505050505050565b600082815260016020908152604080832054603e9092528220546001600160a01b039091169061ffff168115801590610a915750836001600160a01b0316826001600160a01b031614155b1561042657610aa160018261221c565b95945050505050565b6060610ab7848484610eb9565b6000610ac48585856104c2565b9050610ad1858585610f01565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c09390610b1d908490600401611ec2565b600060405180830381600087803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b5050505060005b8151811015610bbd577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610b8e57610b8e612068565b6020026020010151604051610ba39190612209565b60405180910390a180610bb58161216c565b915050610b52565b50949350505050565b610bce610c59565b6001600160a01b038116610c335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b610c3c81610cb3565b50565b6000818152603d602052604081205463ffffffff166103d2565b6015546001600160a01b031633146104a65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105f4565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606000610d1a610d1586612242565b611057565b60408051600180825281830190925291925060009190816020015b610d3d611a9d565b815260200190600190039081610d35575050606083015151909150600090610d8e906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b90507f0000000000000000000000000000000000000000000000000000000000000000811115610dd457604051637bbf29e360e01b8152600481018290526024016105f4565b306000610de18888610e84565b90506040518060c0016040528084815260200186604001516001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff16815260200182604051602001610e4791815260200190565b60405160208183030381529060405281525084600081518110610e6c57610e6c612068565b60209081029190910101525091979650505050505050565b600080610e9383850185612439565b90506000610aa1826110dc565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ec782840184612439565b90506000610ed4826110f2565b90506000610ee4610d1587612242565b9050610ef0818361119c565b610ef9836114cd565b505050505050565b6000610f0d8383610e84565b6000818152600160205260408120549192506001600160a01b0390911690610f37610d1587612242565b90506001600160a01b03821615801590610f67575080604001516001600160a01b0316826001600160a01b031614155b1561103e576060810151516001600160801b031660009081526029602052604081205463ffffffff1690819003610fc35760608201515160405163065ef5f360e01b81526001600160801b0390911660048201526024016105f4565b610fcd848261166a565b15611029576000848152603e602052604081205461ffff16604051630d16862d60e11b8152600481018790526001600160a01b038616602482015261ffff8216604482015263ffffffff841660648201529091506084016105f4565b611033828461169a565b61103c846117e8565b505b610ef9836110526040890160208a01611f49565b61188f565b61105f611aeb565b6000826000015160008151811061107857611078612068565b6020026020010151905061108b816118ee565b600081604001518060200190518101906110a5919061251a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b602081015160009060065b602002015192915050565b6110fa611b4e565b60405180610120016040528061110f8461192e565b6001600160a01b031681526020016111268461193c565b81526020016111348461194b565b81526020016111428461195a565b8152602001611150846110dc565b815260200161115e84611969565b815260200161116c84611978565b81526020016111848460200151610120015160011490565b1515815260200161119484611987565b905292915050565b815160c0820151146111d157815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016105f4565b81606001516040015115158160e0015115150361121c57606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016105f4565b81604001516001600160a01b031681600001516001600160a01b03161461127057604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016105f4565b468160200151146112a3576020810151604051630432cec160e31b815246600482015260248101919091526044016105f4565b81602001518160a00151146112de57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016105f4565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015611349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136d9190612595565b61139257806040015160405163cbfe7bc360e01b81526004016105f491815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa1580156113f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141591906125b0565b80516101008401515191925014158061143c57506020808201516101008401519091015114155b15611486578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016105f4565b6000611491846119df565b9050808360600151146114c7576060830151604051630e6efbdd60e21b81526105f4918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946115309490939290919060040161262c565b602060405180830381865afa925050508015611569575060408051601f3d908101601f1916820190925261156691810190612595565b60015b61163f576115756126b0565b806308c379a0036115ae57506115896126cc565b8061159457506115ed565b8060405162dd577760e81b81526004016105f49190612755565b634e487b71036115ed576115c0612768565b906115cb57506115ed565b60405162dd577760e81b815260206004820152600060248201526044016105f4565b3d808015611617576040519150601f19603f3d011682016040523d82523d6000602084013e61161c565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016105f4565b806116665760405162dd577760e81b815260206004820152600060248201526044016105f4565b5050565b6000828152603d6020526040812054429061168c90849063ffffffff16612788565b63ffffffff16119392505050565b60408051600180825281830190925260009160208083019080368337505060408051600180825281830190925292935060009291506020808301908036833701905050905082826000815181106116f3576116f3612068565b6001600160a01b0390921660209283029190910190910152606084015151611744906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b8160008151811061175757611757612068565b602090810291909101015260405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af7906117b09085908590600401612185565b600060405180830381600087803b1580156117ca57600080fd5b505af11580156117de573d6000803e3d6000fd5b5050505050505050565b6000818152603d60209081526040808320805463ffffffff19164263ffffffff16179055603e909152812080546001929061182890849061ffff1661221c565b82546101009290920a61ffff8181021990931691831602179091556000838152603e60209081526040918290205491519190921681528392507f85183f8abad8891335fb845d2e6b4f84a9c7f7409f242f4e5ec138a84abffacf910160405180910390a250565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f0c5a122814a29e22d1363dacdd6f7c95345b70890f97e65eacb5565da28116ac910161067f565b60006118fd8260400151611a04565b825190915081146116665781516040516337e3d1ab60e01b81526105f4918391600401918252602082015260400190565b6020810151600090816110e7565b602081015160009060016110e7565b602081015160009060046110e7565b602081015160009060056110e7565b602081015160009060076110e7565b602081015160009060086110e7565b61198f611ba1565b604051806040016040528083602001516002600a81106119b1576119b1612068565b6020020151815260200183602001516003600a81106119d2576119d2612068565b6020020151905292915050565b6000806119fd308460600151600001516001600160801b0316611a39565b9392505050565b805160208201206000906103d2907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906127a7565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6119fd91906127a7565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b03168152602001611b49604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001611b495b60405180604001604052806002906020820280368337509192915050565b600060208284031215611bd157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b0382111715611c0d57611c0d611bd8565b60405250565b606081018181106001600160401b0382111715611c0d57611c0d611bd8565b601f8201601f191681016001600160401b0381118282101715611c5757611c57611bd8565b6040525050565b60006001600160401b03821115611c7757611c77611bd8565b50601f01601f191660200190565b600082601f830112611c9657600080fd5b8135611ca181611c5e565b604051611cae8282611c32565b828152856020848701011115611cc357600080fd5b82602086016020830137600092810160200192909252509392505050565b600060208284031215611cf357600080fd5b81356001600160401b03811115611d0957600080fd5b61042684828501611c85565b63ffffffff81168114610c3c57600080fd5b60008060408385031215611d3a57600080fd5b823591506020830135611d4c81611d15565b809150509250929050565b60008083601f840112611d6957600080fd5b5081356001600160401b03811115611d8057600080fd5b602083019150836020828501011115611d9857600080fd5b9250929050565b600080600060408486031215611db457600080fd5b83356001600160401b0380821115611dcb57600080fd5b9085019060408288031215611ddf57600080fd5b90935060208501359080821115611df557600080fd5b50611e0286828701611d57565b9497909650939450505050565b60005b83811015611e2a578181015183820152602001611e12565b838111156114c75750506000910152565b60008151808452611e53816020860160208601611e0f565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261042660c0850182611e3b565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611f1757603f19888603018452611f05858351611e67565b94509285019290850190600101611ee9565b5092979650505050505050565b6001600160a01b0381168114610c3c57600080fd5b8035611f4481611f24565b919050565b600060208284031215611f5b57600080fd5b81356119fd81611f24565b600080600080600060608688031215611f7e57600080fd5b85356001600160401b0380821115611f9557600080fd5b818801915088601f830112611fa957600080fd5b813581811115611fb857600080fd5b8960208260051b8501011115611fcd57600080fd5b60208301975080965050611fe360208901611f39565b94506040880135915080821115611ff957600080fd5b5061200688828901611d57565b969995985093965092949392505050565b6000806040838503121561202a57600080fd5b823591506020830135611d4c81611f24565b6000806040838503121561204f57600080fd5b82519150602083015161ffff81168114611d4c57600080fd5b634e487b7160e01b600052603260045260246000fd5b6040815260006120916040830185611e3b565b905061ffff831660208301529392505050565b600080600080608085870312156120ba57600080fd5b84516120c581611f24565b6020860151604087015191955093506120dd81611d15565b60608601519092506001600160401b038111156120f957600080fd5b8501601f8101871361210a57600080fd5b805161211581611c5e565b6040516121228282611c32565b82815289602084860101111561213757600080fd5b612148836020830160208701611e0f565b969995985093965050505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161217e5761217e612156565b5060010190565b604080825283519082018190526000906020906060840190828701845b828110156121c75781516001600160a01b0316845292840192908401906001016121a2565b5050508381038285015284518082528583019183019060005b818110156121fc578351835292840192918401916001016121e0565b5090979650505050505050565b6020815260006119fd6020830184611e67565b600061ffff80831681851680830382111561223957612239612156565b01949350505050565b6000604080833603121561225557600080fd5b805161226081611bee565b83356001600160401b038082111561227757600080fd5b9085019036601f83011261228a57600080fd5b813560208282111561229e5761229e611bd8565b8160051b86516122b083830182611c32565b928352848101820192828101368511156122c957600080fd5b83870192505b8483101561234d578235868111156122e75760008081fd5b8701606036829003601f19018113156123005760008081fd5b8a5161230b81611c13565b8287013581528b8301358188015290820135908882111561232c5760008081fd5b61233a368884860101611c85565b818d0152835250509183019183016122cf565b5086525061235c888201611f39565b90850152509195945050505050565b6000821982111561237e5761237e612156565b500190565b600082601f83011261239457600080fd5b6040516123a081611bee565b8060408401858111156123b257600080fd5b845b818110156123cc5780358352602092830192016123b4565b509195945050505050565b600082601f8301126123e857600080fd5b6040516101408082018281106001600160401b038211171561240c5761240c611bd8565b6040528301818582111561241f57600080fd5b845b828110156123cc578035825260209182019101612421565b600081830361024081121561244d57600080fd5b6040805161245a81611bee565b6101008084121561246a57600080fd5b8251935061247784611c13565b6124818787612383565b845286605f87011261249257600080fd5b825161249d81611bee565b8060c08801898111156124af57600080fd5b8589015b818110156124d4576124c58b82612383565b835260209092019186016124b3565b508260208801526124e58a82612383565b868801525050508382526124fb878288016123d7565b60208301525095945050505050565b80518015158114611f4457600080fd5b60006060828403121561252c57600080fd5b604051606081018181106001600160401b038211171561254e5761254e611bd8565b60405282516001600160801b038116811461256857600080fd5b8152602083015161257881611d15565b60208201526125896040840161250a565b60408201529392505050565b6000602082840312156125a757600080fd5b6119fd8261250a565b6000604082840312156125c257600080fd5b82601f8301126125d157600080fd5b6040516125dd81611bee565b8060408401858111156125ef57600080fd5b845b818110156123cc5780518352602092830192016125f1565b8060005b60028110156114c757815184526020938401939091019060010161260d565b610240810161263b8287612609565b60408083018660005b600281101561266b57612658838351612609565b9183019160209190910190600101612644565b5050505061267c60c0830185612609565b61010082018360005b600a8110156126a4578151835260209283019290910190600101612685565b50505095945050505050565b600060033d11156126c95760046000803e5060005160e01c5b90565b600060443d10156126da5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561270957505050505090565b82850191508151818111156127215750505050505090565b843d870101602082850101111561273b5750505050505090565b61274a60208286010187611c32565b509095945050505050565b6020815260006119fd6020830184611e3b565b60008060233d1115612784576020600460003e50506000516001905b9091565b600063ffffffff80831681851680830382111561223957612239612156565b6000826127c457634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220202a9a70b259c56940b27ba667618cafc46cd9a9f1eb7ea03e8803b68fee4b3964736f6c634300080e0033", diff --git a/deployments/mumbaiTestnet/HydraS1AccountboundAttesterProxy.json b/deployments/mumbaiTestnet/HydraS1AccountboundAttesterProxy.json new file mode 100644 index 0000000..7e8883e --- /dev/null +++ b/deployments/mumbaiTestnet/HydraS1AccountboundAttesterProxy.json @@ -0,0 +1,276 @@ +{ + "address": "0xEe6c299A09d352caf53C81621f6D757c7C0B4d7c", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0xa5c02aa0c344f09b97325e99e1c60219ca51c808bbf11340509c5d946d526efe", + "receipt": { + "to": null, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xEe6c299A09d352caf53C81621f6D757c7C0B4d7c", + "transactionIndex": 13, + "gasUsed": "634384", + "logsBloom": "0x00000000000000000000000000000000400000000000000000800000000000000000000000000000000000000000000000008000000000000000000000008000000000000000040000004000000002800001000000000000000100000000000000000000020000000000000000000800000000800000000080000000000000400000000000000000000080000000000400000000000080000000000040800000200000000000000000080000000402100000000000000000400000000000004000008020000000000001000000040100000000000400000000100000000020000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x85cba7c326c34f805453ecdf36b692a7d6ad0209cfa1671262433431d6730731", + "transactionHash": "0xa5c02aa0c344f09b97325e99e1c60219ca51c808bbf11340509c5d946d526efe", + "logs": [ + { + "transactionIndex": 13, + "blockNumber": 29772152, + "transactionHash": "0xa5c02aa0c344f09b97325e99e1c60219ca51c808bbf11340509c5d946d526efe", + "address": "0xEe6c299A09d352caf53C81621f6D757c7C0B4d7c", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000e822eca41be81d15ffe3daeaf9f9f91e8bb5d959" + ], + "data": "0x", + "logIndex": 42, + "blockHash": "0x85cba7c326c34f805453ecdf36b692a7d6ad0209cfa1671262433431d6730731" + }, + { + "transactionIndex": 13, + "blockNumber": 29772152, + "transactionHash": "0xa5c02aa0c344f09b97325e99e1c60219ca51c808bbf11340509c5d946d526efe", + "address": "0xEe6c299A09d352caf53C81621f6D757c7C0B4d7c", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" + ], + "data": "0x", + "logIndex": 43, + "blockHash": "0x85cba7c326c34f805453ecdf36b692a7d6ad0209cfa1671262433431d6730731" + }, + { + "transactionIndex": 13, + "blockNumber": 29772152, + "transactionHash": "0xa5c02aa0c344f09b97325e99e1c60219ca51c808bbf11340509c5d946d526efe", + "address": "0xEe6c299A09d352caf53C81621f6D757c7C0B4d7c", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000004", + "logIndex": 44, + "blockHash": "0x85cba7c326c34f805453ecdf36b692a7d6ad0209cfa1671262433431d6730731" + }, + { + "transactionIndex": 13, + "blockNumber": 29772152, + "transactionHash": "0xa5c02aa0c344f09b97325e99e1c60219ca51c808bbf11340509c5d946d526efe", + "address": "0xEe6c299A09d352caf53C81621f6D757c7C0B4d7c", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002110475dfbb8d331b300178a867372991ff35fa3", + "logIndex": 45, + "blockHash": "0x85cba7c326c34f805453ecdf36b692a7d6ad0209cfa1671262433431d6730731" + }, + { + "transactionIndex": 13, + "blockNumber": 29772152, + "transactionHash": "0xa5c02aa0c344f09b97325e99e1c60219ca51c808bbf11340509c5d946d526efe", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x0000000000000000000000003a22c8bc68e98b0faf40f349dd2b2890fae01484" + ], + "data": "0x000000000000000000000000000000000000000000000000000361740d6193e00000000000000000000000000000000000000000000000001b75df5e7f4e34f1000000000000000000000000000000000000000000000108f4f309d83a19170b0000000000000000000000000000000000000000000000001b727dea71eca111000000000000000000000000000000000000000000000108f4f66b4c477aaaeb", + "logIndex": 46, + "blockHash": "0x85cba7c326c34f805453ecdf36b692a7d6ad0209cfa1671262433431d6730731" + } + ], + "blockNumber": 29772152, + "cumulativeGasUsed": "3549556", + "status": 1, + "byzantium": true + }, + "args": [ + "0xE822EcA41Be81D15ffe3daEaF9f9F91E8bB5D959", + "0x2110475dfbB8d331b300178A867372991ff35fA3", + "0xc4d66de8000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" + ], + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", + "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(\\n address newImplementation,\\n bytes calldata data\\n ) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x1663761dc98da7a84e6570b428877de7de9859e34f99c7002cad71ccfc9d6283\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405162000eeb38038062000eeb8339810160408190526200002691620004ed565b828162000036828260006200009a565b5062000066905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005cd565b60008051602062000ea483398151915214620000865762000086620005f3565b6200009182620000d7565b5050506200065c565b620000a58362000132565b600082511180620000b35750805b15620000d257620000d083836200017460201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f62000102620001a3565b604080516001600160a01b03928316815291841660208301520160405180910390a16200012f81620001dc565b50565b6200013d8162000291565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606200019c838360405180606001604052806027815260200162000ec46027913962000345565b9392505050565b6000620001cd60008051602062000ea483398151915260001b620003c460201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002475760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b806200027060008051602062000ea483398151915260001b620003c460201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002a781620003c760201b6200025a1760201c565b6200030b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200023e565b80620002707f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b620003c460201b620001ea1760201c565b6060600080856001600160a01b03168560405162000364919062000609565b600060405180830381855af49150503d8060008114620003a1576040519150601f19603f3d011682016040523d82523d6000602084013e620003a6565b606091505b509092509050620003ba86838387620003d6565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200044a57825160000362000442576001600160a01b0385163b620004425760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016200023e565b508162000456565b6200045683836200045e565b949350505050565b8151156200046f5781518083602001fd5b8060405162461bcd60e51b81526004016200023e919062000627565b80516001600160a01b0381168114620004a357600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004db578181015183820152602001620004c1565b83811115620000d05750506000910152565b6000806000606084860312156200050357600080fd5b6200050e846200048b565b92506200051e602085016200048b565b60408501519092506001600160401b03808211156200053c57600080fd5b818601915086601f8301126200055157600080fd5b815181811115620005665762000566620004a8565b604051601f8201601f19908116603f01168101908382118183101715620005915762000591620004a8565b81604052828152896020848701011115620005ab57600080fd5b620005be836020830160208801620004be565b80955050505050509250925092565b600082821015620005ee57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b600082516200061d818460208701620004be565b9190910192915050565b602081526000825180602084015262000648816040850160208701620004be565b601f01601f19169190910160400192915050565b610838806200066c6000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106c2565b610118565b61005b6100933660046106dd565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106c2565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107dc602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd610456565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b6103688361047e565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a816104be565b6060600080856001600160a01b0316856040516103fb919061078c565b600060405180830381855af49150503d8060008114610436576040519150601f19603f3d011682016040523d82523d6000602084013e61043b565b606091505b509150915061044c86838387610567565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b610487816105e8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105235760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105d65782516000036105cf576001600160a01b0385163b6105cf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102f5565b50816105e0565b6105e0838361067c565b949350505050565b6001600160a01b0381163b6106555760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610546565b81511561068c5781518083602001fd5b8060405162461bcd60e51b81526004016102f591906107a8565b80356001600160a01b03811681146106bd57600080fd5b919050565b6000602082840312156106d457600080fd5b610253826106a6565b6000806000604084860312156106f257600080fd5b6106fb846106a6565b9250602084013567ffffffffffffffff8082111561071857600080fd5b818601915086601f83011261072c57600080fd5b81358181111561073b57600080fd5b87602082850101111561074d57600080fd5b6020830194508093505050509250925092565b60005b8381101561077b578181015183820152602001610763565b838111156103845750506000910152565b6000825161079e818460208701610760565b9190910192915050565b60208152600082518060208401526107c7816040850160208701610760565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e2b2f80d01b9fee1887f086f33ea33eabe6a896123f3722976ea73e069c365b664736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106c2565b610118565b61005b6100933660046106dd565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106c2565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107dc602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd610456565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b6103688361047e565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a816104be565b6060600080856001600160a01b0316856040516103fb919061078c565b600060405180830381855af49150503d8060008114610436576040519150601f19603f3d011682016040523d82523d6000602084013e61043b565b606091505b509150915061044c86838387610567565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b610487816105e8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105235760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105d65782516000036105cf576001600160a01b0385163b6105cf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102f5565b50816105e0565b6105e0838361067c565b949350505050565b6001600160a01b0381163b6106555760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610546565b81511561068c5781518083602001fd5b8060405162461bcd60e51b81526004016102f591906107a8565b80356001600160a01b03811681146106bd57600080fd5b919050565b6000602082840312156106d457600080fd5b610253826106a6565b6000806000604084860312156106f257600080fd5b6106fb846106a6565b9250602084013567ffffffffffffffff8082111561071857600080fd5b818601915086601f83011261072c57600080fd5b81358181111561073b57600080fd5b87602082850101111561074d57600080fd5b6020830194508093505050509250925092565b60005b8381101561077b578181015183820152602001610763565b838111156103845750506000910152565b6000825161079e818460208701610760565b9190910192915050565b60208152600082518060208401526107c7816040850160208701610760565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e2b2f80d01b9fee1887f086f33ea33eabe6a896123f3722976ea73e069c365b664736f6c634300080e0033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/mumbai/HydraS1Verifier.json b/deployments/mumbaiTestnet/HydraS1Verifier.json similarity index 95% rename from deployments/mumbai/HydraS1Verifier.json rename to deployments/mumbaiTestnet/HydraS1Verifier.json index 2b9b579..cb6f71f 100644 --- a/deployments/mumbai/HydraS1Verifier.json +++ b/deployments/mumbaiTestnet/HydraS1Verifier.json @@ -1,5 +1,5 @@ { - "address": "0xCBB1032416EB875D94Da8a447D73471E4C51998E", + "address": "0x09f35a46C6863F5C8Cd887F690974DCaaDe0A2a5", "abi": [ { "inputs": [ @@ -36,41 +36,41 @@ "type": "function" } ], - "transactionHash": "0xe3c3bf8a6b7bc22131d5ad86b4dce525318bcd677ae484d395463a139ed33ed8", + "transactionHash": "0xecdce13cc6bc10358d68aca565734fd17bf7f578cb812ce1535560778fe135d7", "receipt": { "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0xCBB1032416EB875D94Da8a447D73471E4C51998E", - "transactionIndex": 14, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0x09f35a46C6863F5C8Cd887F690974DCaaDe0A2a5", + "transactionIndex": 12, "gasUsed": "1247435", - "logsBloom": "0x00000000000000020000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000010000000000000000000008000200000000000000020000000000000000001000000000000000000000000004000000000000000000001000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000020000000100000", - "blockHash": "0xcf4a827897c2fe128fb7be483551fb3cacdd2e7860a16a33e07d967c0daf891f", - "transactionHash": "0xe3c3bf8a6b7bc22131d5ad86b4dce525318bcd677ae484d395463a139ed33ed8", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000004000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000080000000000040000000200000000000000000000000000002000000000000000000000000000000004000008000000000000001000000000000000000000000000000100040000000000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x31b9865cd5d0c497d764e0ae010d49000819e65ac3f7e0dd01de0a95ff11b483", + "transactionHash": "0xecdce13cc6bc10358d68aca565734fd17bf7f578cb812ce1535560778fe135d7", "logs": [ { - "transactionIndex": 14, - "blockNumber": 29540603, - "transactionHash": "0xe3c3bf8a6b7bc22131d5ad86b4dce525318bcd677ae484d395463a139ed33ed8", + "transactionIndex": 12, + "blockNumber": 29772137, + "transactionHash": "0xecdce13cc6bc10358d68aca565734fd17bf7f578cb812ce1535560778fe135d7", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000be188d6641e8b680743a4815dfa0f6208038960f" ], - "data": "0x000000000000000000000000000000000000000000000000000a4e725ac3070b0000000000000000000000000000000000000000000000007d747ab63928298a00000000000000000000000000000000000000000000181f39a1f6e4ece51d0d0000000000000000000000000000000000000000000000007d6a2c43de65227f00000000000000000000000000000000000000000000181f39ac455747a82418", - "logIndex": 75, - "blockHash": "0xcf4a827897c2fe128fb7be483551fb3cacdd2e7860a16a33e07d967c0daf891f" + "data": "0x0000000000000000000000000000000000000000000000000006a5cda3ef336a0000000000000000000000000000000000000000000000001b88e5bc8af9a73f0000000000000000000000000000000000000000000028664c1b7f6fd95acd1c0000000000000000000000000000000000000000000000001b823feee70a73d50000000000000000000000000000000000000000000028664c22253d7d4a0086", + "logIndex": 47, + "blockHash": "0x31b9865cd5d0c497d764e0ae010d49000819e65ac3f7e0dd01de0a95ff11b483" } ], - "blockNumber": 29540603, - "cumulativeGasUsed": "4230694", + "blockNumber": 29772137, + "cumulativeGasUsed": "5152448", "status": 1, "byzantium": true }, "args": [], - "numDeployments": 2, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"a\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2][2]\",\"name\":\"b\",\"type\":\"uint256[2][2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"c\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[10]\",\"name\":\"input\",\"type\":\"uint256[10]\"}],\"name\":\"verifyProof\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"r\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"verifyProof(uint256[2],uint256[2][2],uint256[2],uint256[10])\":{\"returns\":{\"r\":\" bool true if proof is valid\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":\"HydraS1Verifier\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [8609986746108439658545470593166889256314951959466775818870246174320018498804,\\n 6848251127850009101372611262053374737897586140140607384018397707035108265914],\\n [21367916863936594568281095443965096905143705300114190558130516981138584550504,\\n 13327705762185115653848159709412003423932761899188342359583872691135383932883]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 19965766170734310004645394427613286415565755728797065894668054116047682895204,\\n 6952067612339183672227137101423582097916038093373585908267153974352032944482\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 13987716160490730015463796942940452666334097189904948795214986996497499925899,\\n 5336810094802209074340875836312868429276540870324469349093948627126061524544\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 14931593253473978964215343699995811275378324235306358485461293343370969283966,\\n 564306919152089917957316877787764763278299990971316475606280877961553231205\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11591267743733991434114686002448165336885445656808796470854638278338319268343,\\n 11495219763417990955889652410266075210402006084183208750635660647824890013350\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 8183184532870222270700473518157259944911700429689031755853536692005688965081,\\n 9121077094104828462137861111631978599019724423614716723152060153405564278301\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 4314095526093128699362232919686741372014146055311239687202926853002748112330,\\n 11665330391505820654128458332883010598817535082070674418723503440883598640597\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 18925967077785550270509493111690046951994174908254476036944536825999614778001,\\n 4990629719417206796668074534812314525340851981015724652256935997545282642849\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x120f0b311a61cabc9d42ef740c19e5f20b4c8ba400d9a6378e33c76dd54f5c42\",\"license\":\"GPL-3.0\"}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b50611597806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f3bb70f614610030575b600080fd5b61004361003e3660046113ce565b610057565b604051901515815260200160405180910390f35b60006100616111e1565b604080518082018252875181526020808901518183015290835281516080810183528751518184019081528851830151606083015281528251808401845288830180515182525183015181840152818301528382015281518083018352865181528682015181830152838301528151600a8082526101608201909352600092909182016101408036833701905050905060005b600a811015610143578481600a811061010f5761010f6114ac565b6020020151828281518110610126576101266114ac565b60209081029190910101528061013b816114d8565b9150506100f4565b5061014e818361016f565b60000361016057600192505050610167565b6000925050505b949350505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018161019b610366565b9050806080015151855160016101b191906114f1565b146101f85760405162461bcd60e51b81526020600482015260126024820152711d995c9a599a595c8b5898590b5a5b9c1d5d60721b60448201526064015b60405180910390fd5b604080518082019091526000808252602082018190525b86518110156102e9578387828151811061022b5761022b6114ac565b6020026020010151106102805760405162461bcd60e51b815260206004820152601f60248201527f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c640060448201526064016101ef565b6102d5826102d0856080015184600161029991906114f1565b815181106102a9576102a96114ac565b60200260200101518a85815181106102c3576102c36114ac565b6020026020010151610b30565b610bc6565b9150806102e1816114d8565b91505061020f565b50610312818360800151600081518110610305576103056114ac565b6020026020010151610bc6565b90506103486103248660000151610c5f565b8660200151846000015185602001518587604001518b604001518960600151610cfe565b6103585760019350505050610360565b600093505050505b92915050565b61036e611232565b6040805180820182527f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e281527f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d19266020808301919091529083528151608080820184527f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c8285019081527f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab606080850191909152908352845180860186527f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a781527f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec8818601528385015285840192909252835180820185527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28186019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed828501528152845180860186527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa818601528185015285850152835190810184527f1309146df5c443e5db6a7a6e809d782667e59deebf9e8a8e6e622196119ea4f48185019081527f0f23f9080c79c8259f4b3d2442e88c6c1f5a3721f82c1bd3cf33912f4c554fba828401528152835180850185527f2f3dcff69745f046c2bfa13f9c4c81083c41a209f287fa0afb44391b5070bc6881527f1d7736d1e061cab0da0b28c319361de25abd329672d1bec1e29f6fdc604d0fd38185015281840152908401528151600b8082526101808201909352919082015b60408051808201909152600080825260208201528152602001906001900390816105ea57505060808201908152604080518082019091527f2c243922d634f38b0cfa04897932397d47699289aed9b414760d4e729b797d6481527f0f5ebb177a11bce83029d6c7ca0aa97d4f6085fc0fffbc63127ba724e33dd16260208201529051805160009061067d5761067d6114ac565b602002602001018190525060405180604001604052807f084d1b300a1ecc4c0d892345551e790b2d49fe22a1b71fbcd94d0be8931871bb81526020017f24861196b6282d728048cae2ec60fbc8496829a8dfbb4273f731b2b726b0f62881525081608001516001815181106106f4576106f46114ac565b602002602001018190525060405180604001604052807f209369983ced02fe1bdfed53e6c88a12bd3efd860515daa6a398aa73bbb09c7181526020017f28e41e5609c0e714afa30a906663b8ee61baecd274f9d30fd36f9c426ff9e593815250816080015160028151811061076b5761076b6114ac565b602002602001018190525060405180604001604052807f1eecc44c2a661c3f66ae217ec542b70f38b6313e8be081e2a8f95f64c881ad8b81526020017f0bcc87084972fb8309ff46ca4afa1b2934755fb38cff3bdf374c4ab7bda6664081525081608001516003815181106107e2576107e26114ac565b602002602001018190525060405180604001604052807f2102fb775a7dfc364bf6a014da09f86e9144e3239534ab25d3bbd48e4a0afd7e81526020017f013f62eaf435acc457bd2a3d8315dab277c802f0bda44517845768371935bd658152508160800151600481518110610859576108596114ac565b602002602001018190525060405180604001604052807f19a06cd017ddcf6192f42073758c82a6eda2adc572c9be2901c15d6e54b0b9f781526020017f196a10567feeb5a9a1903009034de556585c8ea06b30a73e9b4e88da620026a681525081608001516005815181106108d0576108d06114ac565b602002602001018190525060405180604001604052807f121784b003ec4655b1f312d2011a2117a113d4051e94ce94db805d3d99f5f7d981526020017f142a58c0955ecd67ea19afbcbd0347632d515e9979fcb7d6818de26dbff0561d8152508160800151600681518110610947576109476114ac565b602002602001018190525060405180604001604052807f0989b10899b251f5f04f11415d3d4521b5153f7f4a6d4ac9891d95669f162dca81526020017f19ca57d06136d58c9da48f9bb1aa31eea7d60b19dccdd80b224dd9900afa45d581525081608001516007815181106109be576109be6114ac565b602002602001018190525060405180604001604052807f2b567a1e26a932fa728a650315371e9f9df455a5b0c1c0886bd80d6060a9908981526020017e66798780cd5512ad9f5a2373f1fb64535a8e3c4ad8c33ddc8bd18fc441116a8152508160800151600881518110610a3457610a346114ac565b602002602001018190525060405180604001604052807f29d7b7beed21dea04e4e86841f7ecae70b9af771dd1a05fd97c28240207b9a9181526020017f0b0898a882ba7215368d58cb476b23aa95278245216c92c1823fd2ab7cb5a3a18152508160800151600981518110610aab57610aab6114ac565b602002602001018190525060405180604001604052807f102f5e9ec24f58ddf1d39e018b5367ef9ea173301e98cdd899627bd14762ee6981526020017f068105d1e3d4238ec4274b68a5177670d700a905e46fd5c6779ef83d6916c4f18152508160800151600a81518110610b2257610b226114ac565b602002602001018190525090565b6040805180820190915260008082526020820152610b4c611283565b835181526020808501519082015260408101839052600060608360808460076107d05a03fa90508080610b7b57fe5b5080610bbe5760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5b5d5b0b59985a5b195960721b60448201526064016101ef565b505092915050565b6040805180820190915260008082526020820152610be26112a1565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa90508080610c1c57fe5b5080610bbe5760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5859190b59985a5b195960721b60448201526064016101ef565b604080518082019091526000808252602082015281517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4790158015610ca657506020830151155b15610cc65750506040805180820190915260008082526020820152919050565b604051806040016040528084600001518152602001828560200151610ceb9190611509565b610cf5908461152b565b90529392505050565b60408051600480825260a08201909252600091829190816020015b6040805180820190915260008082526020820152815260200190600190039081610d1957505060408051600480825260a0820190925291925060009190602082015b610d636112bf565b815260200190600190039081610d5b5790505090508a82600081518110610d8c57610d8c6114ac565b60200260200101819052508882600181518110610dab57610dab6114ac565b60200260200101819052508682600281518110610dca57610dca6114ac565b60200260200101819052508482600381518110610de957610de96114ac565b60200260200101819052508981600081518110610e0857610e086114ac565b60200260200101819052508781600181518110610e2757610e276114ac565b60200260200101819052508581600281518110610e4657610e466114ac565b60200260200101819052508381600381518110610e6557610e656114ac565b6020026020010181905250610e7a8282610e89565b9b9a5050505050505050505050565b60008151835114610ed55760405162461bcd60e51b81526020600482015260166024820152751c185a5c9a5b99cb5b195b99dd1a1ccb59985a5b195960521b60448201526064016101ef565b82516000610ee4826006611542565b905060008167ffffffffffffffff811115610f0157610f0161131b565b604051908082528060200260200182016040528015610f2a578160200160208202803683370190505b50905060005b8381101561116557868181518110610f4a57610f4a6114ac565b60200260200101516000015182826006610f649190611542565b610f6f9060006114f1565b81518110610f7f57610f7f6114ac565b602002602001018181525050868181518110610f9d57610f9d6114ac565b60200260200101516020015182826006610fb79190611542565b610fc29060016114f1565b81518110610fd257610fd26114ac565b602002602001018181525050858181518110610ff057610ff06114ac565b6020908102919091010151515182611009836006611542565b6110149060026114f1565b81518110611024576110246114ac565b602002602001018181525050858181518110611042576110426114ac565b6020908102919091018101515101518261105d836006611542565b6110689060036114f1565b81518110611078576110786114ac565b602002602001018181525050858181518110611096576110966114ac565b6020026020010151602001516000600281106110b4576110b46114ac565b6020020151826110c5836006611542565b6110d09060046114f1565b815181106110e0576110e06114ac565b6020026020010181815250508581815181106110fe576110fe6114ac565b60200260200101516020015160016002811061111c5761111c6114ac565b60200201518261112d836006611542565b6111389060056114f1565b81518110611148576111486114ac565b60209081029190910101528061115d816114d8565b915050610f30565b5061116e6112df565b6000602082602086026020860160086107d05a03fa9050808061118d57fe5b50806111d35760405162461bcd60e51b81526020600482015260156024820152741c185a5c9a5b99cb5bdc18dbd9194b59985a5b1959605a1b60448201526064016101ef565b505115159695505050505050565b6040805160a08101909152600060608201818152608083019190915281526020810161120b6112bf565b815260200161122d604051806040016040528060008152602001600081525090565b905290565b6040805160e08101909152600060a0820181815260c083019190915281526020810161125c6112bf565b81526020016112696112bf565b81526020016112766112bf565b8152602001606081525090565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b60405180604001604052806112d26112fd565b815260200161122d6112fd565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156113545761135461131b565b60405290565b604051610140810167ffffffffffffffff811182821017156113545761135461131b565b600082601f83011261138f57600080fd5b611397611331565b8060408401858111156113a957600080fd5b845b818110156113c35780358452602093840193016113ab565b509095945050505050565b6000806000806102408086880312156113e657600080fd5b6113f0878761137e565b9450604087605f88011261140357600080fd5b61140b611331565b8060c089018a81111561141d57600080fd5b838a015b81811015611442576114338c8261137e565b84526020909301928401611421565b508197506114508b8261137e565b9650505050508661011f87011261146657600080fd5b61146e61135a565b90860190808883111561148057600080fd5b61010088015b8381101561149e578035835260209283019201611486565b509598949750929550505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016114ea576114ea6114c2565b5060010190565b60008219821115611504576115046114c2565b500190565b60008261152657634e487b7160e01b600052601260045260246000fd5b500690565b60008282101561153d5761153d6114c2565b500390565b600081600019048311821515161561155c5761155c6114c2565b50029056fea264697066735822122032bcacece0452dcb73e92b9569837e33c48751c237fdb79a212c6dfad1fb31b364736f6c634300080e0033", "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f3bb70f614610030575b600080fd5b61004361003e3660046113ce565b610057565b604051901515815260200160405180910390f35b60006100616111e1565b604080518082018252875181526020808901518183015290835281516080810183528751518184019081528851830151606083015281528251808401845288830180515182525183015181840152818301528382015281518083018352865181528682015181830152838301528151600a8082526101608201909352600092909182016101408036833701905050905060005b600a811015610143578481600a811061010f5761010f6114ac565b6020020151828281518110610126576101266114ac565b60209081029190910101528061013b816114d8565b9150506100f4565b5061014e818361016f565b60000361016057600192505050610167565b6000925050505b949350505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018161019b610366565b9050806080015151855160016101b191906114f1565b146101f85760405162461bcd60e51b81526020600482015260126024820152711d995c9a599a595c8b5898590b5a5b9c1d5d60721b60448201526064015b60405180910390fd5b604080518082019091526000808252602082018190525b86518110156102e9578387828151811061022b5761022b6114ac565b6020026020010151106102805760405162461bcd60e51b815260206004820152601f60248201527f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c640060448201526064016101ef565b6102d5826102d0856080015184600161029991906114f1565b815181106102a9576102a96114ac565b60200260200101518a85815181106102c3576102c36114ac565b6020026020010151610b30565b610bc6565b9150806102e1816114d8565b91505061020f565b50610312818360800151600081518110610305576103056114ac565b6020026020010151610bc6565b90506103486103248660000151610c5f565b8660200151846000015185602001518587604001518b604001518960600151610cfe565b6103585760019350505050610360565b600093505050505b92915050565b61036e611232565b6040805180820182527f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e281527f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d19266020808301919091529083528151608080820184527f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c8285019081527f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab606080850191909152908352845180860186527f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a781527f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec8818601528385015285840192909252835180820185527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28186019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed828501528152845180860186527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa818601528185015285850152835190810184527f1309146df5c443e5db6a7a6e809d782667e59deebf9e8a8e6e622196119ea4f48185019081527f0f23f9080c79c8259f4b3d2442e88c6c1f5a3721f82c1bd3cf33912f4c554fba828401528152835180850185527f2f3dcff69745f046c2bfa13f9c4c81083c41a209f287fa0afb44391b5070bc6881527f1d7736d1e061cab0da0b28c319361de25abd329672d1bec1e29f6fdc604d0fd38185015281840152908401528151600b8082526101808201909352919082015b60408051808201909152600080825260208201528152602001906001900390816105ea57505060808201908152604080518082019091527f2c243922d634f38b0cfa04897932397d47699289aed9b414760d4e729b797d6481527f0f5ebb177a11bce83029d6c7ca0aa97d4f6085fc0fffbc63127ba724e33dd16260208201529051805160009061067d5761067d6114ac565b602002602001018190525060405180604001604052807f084d1b300a1ecc4c0d892345551e790b2d49fe22a1b71fbcd94d0be8931871bb81526020017f24861196b6282d728048cae2ec60fbc8496829a8dfbb4273f731b2b726b0f62881525081608001516001815181106106f4576106f46114ac565b602002602001018190525060405180604001604052807f209369983ced02fe1bdfed53e6c88a12bd3efd860515daa6a398aa73bbb09c7181526020017f28e41e5609c0e714afa30a906663b8ee61baecd274f9d30fd36f9c426ff9e593815250816080015160028151811061076b5761076b6114ac565b602002602001018190525060405180604001604052807f1eecc44c2a661c3f66ae217ec542b70f38b6313e8be081e2a8f95f64c881ad8b81526020017f0bcc87084972fb8309ff46ca4afa1b2934755fb38cff3bdf374c4ab7bda6664081525081608001516003815181106107e2576107e26114ac565b602002602001018190525060405180604001604052807f2102fb775a7dfc364bf6a014da09f86e9144e3239534ab25d3bbd48e4a0afd7e81526020017f013f62eaf435acc457bd2a3d8315dab277c802f0bda44517845768371935bd658152508160800151600481518110610859576108596114ac565b602002602001018190525060405180604001604052807f19a06cd017ddcf6192f42073758c82a6eda2adc572c9be2901c15d6e54b0b9f781526020017f196a10567feeb5a9a1903009034de556585c8ea06b30a73e9b4e88da620026a681525081608001516005815181106108d0576108d06114ac565b602002602001018190525060405180604001604052807f121784b003ec4655b1f312d2011a2117a113d4051e94ce94db805d3d99f5f7d981526020017f142a58c0955ecd67ea19afbcbd0347632d515e9979fcb7d6818de26dbff0561d8152508160800151600681518110610947576109476114ac565b602002602001018190525060405180604001604052807f0989b10899b251f5f04f11415d3d4521b5153f7f4a6d4ac9891d95669f162dca81526020017f19ca57d06136d58c9da48f9bb1aa31eea7d60b19dccdd80b224dd9900afa45d581525081608001516007815181106109be576109be6114ac565b602002602001018190525060405180604001604052807f2b567a1e26a932fa728a650315371e9f9df455a5b0c1c0886bd80d6060a9908981526020017e66798780cd5512ad9f5a2373f1fb64535a8e3c4ad8c33ddc8bd18fc441116a8152508160800151600881518110610a3457610a346114ac565b602002602001018190525060405180604001604052807f29d7b7beed21dea04e4e86841f7ecae70b9af771dd1a05fd97c28240207b9a9181526020017f0b0898a882ba7215368d58cb476b23aa95278245216c92c1823fd2ab7cb5a3a18152508160800151600981518110610aab57610aab6114ac565b602002602001018190525060405180604001604052807f102f5e9ec24f58ddf1d39e018b5367ef9ea173301e98cdd899627bd14762ee6981526020017f068105d1e3d4238ec4274b68a5177670d700a905e46fd5c6779ef83d6916c4f18152508160800151600a81518110610b2257610b226114ac565b602002602001018190525090565b6040805180820190915260008082526020820152610b4c611283565b835181526020808501519082015260408101839052600060608360808460076107d05a03fa90508080610b7b57fe5b5080610bbe5760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5b5d5b0b59985a5b195960721b60448201526064016101ef565b505092915050565b6040805180820190915260008082526020820152610be26112a1565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa90508080610c1c57fe5b5080610bbe5760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5859190b59985a5b195960721b60448201526064016101ef565b604080518082019091526000808252602082015281517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4790158015610ca657506020830151155b15610cc65750506040805180820190915260008082526020820152919050565b604051806040016040528084600001518152602001828560200151610ceb9190611509565b610cf5908461152b565b90529392505050565b60408051600480825260a08201909252600091829190816020015b6040805180820190915260008082526020820152815260200190600190039081610d1957505060408051600480825260a0820190925291925060009190602082015b610d636112bf565b815260200190600190039081610d5b5790505090508a82600081518110610d8c57610d8c6114ac565b60200260200101819052508882600181518110610dab57610dab6114ac565b60200260200101819052508682600281518110610dca57610dca6114ac565b60200260200101819052508482600381518110610de957610de96114ac565b60200260200101819052508981600081518110610e0857610e086114ac565b60200260200101819052508781600181518110610e2757610e276114ac565b60200260200101819052508581600281518110610e4657610e466114ac565b60200260200101819052508381600381518110610e6557610e656114ac565b6020026020010181905250610e7a8282610e89565b9b9a5050505050505050505050565b60008151835114610ed55760405162461bcd60e51b81526020600482015260166024820152751c185a5c9a5b99cb5b195b99dd1a1ccb59985a5b195960521b60448201526064016101ef565b82516000610ee4826006611542565b905060008167ffffffffffffffff811115610f0157610f0161131b565b604051908082528060200260200182016040528015610f2a578160200160208202803683370190505b50905060005b8381101561116557868181518110610f4a57610f4a6114ac565b60200260200101516000015182826006610f649190611542565b610f6f9060006114f1565b81518110610f7f57610f7f6114ac565b602002602001018181525050868181518110610f9d57610f9d6114ac565b60200260200101516020015182826006610fb79190611542565b610fc29060016114f1565b81518110610fd257610fd26114ac565b602002602001018181525050858181518110610ff057610ff06114ac565b6020908102919091010151515182611009836006611542565b6110149060026114f1565b81518110611024576110246114ac565b602002602001018181525050858181518110611042576110426114ac565b6020908102919091018101515101518261105d836006611542565b6110689060036114f1565b81518110611078576110786114ac565b602002602001018181525050858181518110611096576110966114ac565b6020026020010151602001516000600281106110b4576110b46114ac565b6020020151826110c5836006611542565b6110d09060046114f1565b815181106110e0576110e06114ac565b6020026020010181815250508581815181106110fe576110fe6114ac565b60200260200101516020015160016002811061111c5761111c6114ac565b60200201518261112d836006611542565b6111389060056114f1565b81518110611148576111486114ac565b60209081029190910101528061115d816114d8565b915050610f30565b5061116e6112df565b6000602082602086026020860160086107d05a03fa9050808061118d57fe5b50806111d35760405162461bcd60e51b81526020600482015260156024820152741c185a5c9a5b99cb5bdc18dbd9194b59985a5b1959605a1b60448201526064016101ef565b505115159695505050505050565b6040805160a08101909152600060608201818152608083019190915281526020810161120b6112bf565b815260200161122d604051806040016040528060008152602001600081525090565b905290565b6040805160e08101909152600060a0820181815260c083019190915281526020810161125c6112bf565b81526020016112696112bf565b81526020016112766112bf565b8152602001606081525090565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b60405180604001604052806112d26112fd565b815260200161122d6112fd565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156113545761135461131b565b60405290565b604051610140810167ffffffffffffffff811182821017156113545761135461131b565b600082601f83011261138f57600080fd5b611397611331565b8060408401858111156113a957600080fd5b845b818110156113c35780358452602093840193016113ab565b509095945050505050565b6000806000806102408086880312156113e657600080fd5b6113f0878761137e565b9450604087605f88011261140357600080fd5b61140b611331565b8060c089018a81111561141d57600080fd5b838a015b81811015611442576114338c8261137e565b84526020909301928401611421565b508197506114508b8261137e565b9650505050508661011f87011261146657600080fd5b61146e61135a565b90860190808883111561148057600080fd5b61010088015b8381101561149e578035835260209283019201611486565b509598949750929550505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016114ea576114ea6114c2565b5060010190565b60008219821115611504576115046114c2565b500190565b60008261152657634e487b7160e01b600052601260045260246000fd5b500690565b60008282101561153d5761153d6114c2565b500390565b600081600019048311821515161561155c5761155c6114c2565b50029056fea264697066735822122032bcacece0452dcb73e92b9569837e33c48751c237fdb79a212c6dfad1fb31b364736f6c634300080e0033", diff --git a/deployments/sandboxPolygon/Pythia1SimpleAttester.json b/deployments/mumbaiTestnet/Pythia1SimpleAttester.json similarity index 98% rename from deployments/sandboxPolygon/Pythia1SimpleAttester.json rename to deployments/mumbaiTestnet/Pythia1SimpleAttester.json index b01a5b9..e68f445 100644 --- a/deployments/sandboxPolygon/Pythia1SimpleAttester.json +++ b/deployments/mumbaiTestnet/Pythia1SimpleAttester.json @@ -1,5 +1,5 @@ { - "address": "0x5ee338769C0205c19c0Bf21C35A42b1645B89998", + "address": "0xBbb56145d961742b1f3E3fc2b91077639C8C302a", "abi": [ { "inputs": [ @@ -776,103 +776,103 @@ "type": "function" } ], - "transactionHash": "0xed206efde6bf00f1e01585ed5fd63a7ccaa41970437cfaed7f5a55db60638b6a", + "transactionHash": "0xa8ff388592aefe88e398ce7efc687d4625ee3fcf904bb421e829ca043be8ff42", "receipt": { "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0xB8733A76521A3e9363E44Da29861ad913c88D4cF", - "transactionIndex": 48, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xEeF6Af6297504f30FFeC8a4E3642d6Da6A15632f", + "transactionIndex": 22, "gasUsed": "1945946", - "logsBloom": "0x00000000000000200000000000000000002200000000000000800000000000000000000000000000000000000000000000008000000040000000000000000000000000000000000000000000000000800001000000000000000100000000000000000040020000000000000000000800000000010000000080000000000000400000000000010000000000100000000000000000000080000000000000000000200000000000000010200000000400000000000000000000000000000000004000800000000000000001000000048000000000000000000000100004000020000000020000000000000000000000000000000200000000000000000000100000", - "blockHash": "0xf27fb22ffc98eeb98c4b2d07a97d7bab06ccf38aaf67e8e753a33e908977a583", - "transactionHash": "0xed206efde6bf00f1e01585ed5fd63a7ccaa41970437cfaed7f5a55db60638b6a", + "logsBloom": "0x00000000000000020000000000000004002000000000000000800000000000000000000000000000000000000000000000008000000040000000000000000000000000000000000000000000000000800001000000000000000100000000000000000000020000000000000000000800000000010000000080000000000000400000000000010000000000000000000000000000000080000000000040000000200000000000000020200000000402000001000000000000000000000000004000008000000000000001000000040000400200000000000000100000000020000000000000000000000000000000000000000200000000000000000000100000", + "blockHash": "0x2e22c024209639795be498f2e7f42c9619054cfb8d534e0236d2766be9a67efc", + "transactionHash": "0xa8ff388592aefe88e398ce7efc687d4625ee3fcf904bb421e829ca043be8ff42", "logs": [ { - "transactionIndex": 48, - "blockNumber": 36626416, - "transactionHash": "0xed206efde6bf00f1e01585ed5fd63a7ccaa41970437cfaed7f5a55db60638b6a", - "address": "0xB8733A76521A3e9363E44Da29861ad913c88D4cF", + "transactionIndex": 22, + "blockNumber": 29772193, + "transactionHash": "0xa8ff388592aefe88e398ce7efc687d4625ee3fcf904bb421e829ca043be8ff42", + "address": "0xEeF6Af6297504f30FFeC8a4E3642d6Da6A15632f", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 245, - "blockHash": "0xf27fb22ffc98eeb98c4b2d07a97d7bab06ccf38aaf67e8e753a33e908977a583" + "logIndex": 84, + "blockHash": "0x2e22c024209639795be498f2e7f42c9619054cfb8d534e0236d2766be9a67efc" }, { - "transactionIndex": 48, - "blockNumber": 36626416, - "transactionHash": "0xed206efde6bf00f1e01585ed5fd63a7ccaa41970437cfaed7f5a55db60638b6a", - "address": "0xB8733A76521A3e9363E44Da29861ad913c88D4cF", + "transactionIndex": 22, + "blockNumber": 29772193, + "transactionHash": "0xa8ff388592aefe88e398ce7efc687d4625ee3fcf904bb421e829ca043be8ff42", + "address": "0xEeF6Af6297504f30FFeC8a4E3642d6Da6A15632f", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", "0x000000000000000000000000aee4acd5c4bf516330ca8fe11b07206fc6709294" ], "data": "0x", - "logIndex": 246, - "blockHash": "0xf27fb22ffc98eeb98c4b2d07a97d7bab06ccf38aaf67e8e753a33e908977a583" + "logIndex": 85, + "blockHash": "0x2e22c024209639795be498f2e7f42c9619054cfb8d534e0236d2766be9a67efc" }, { - "transactionIndex": 48, - "blockNumber": 36626416, - "transactionHash": "0xed206efde6bf00f1e01585ed5fd63a7ccaa41970437cfaed7f5a55db60638b6a", - "address": "0xB8733A76521A3e9363E44Da29861ad913c88D4cF", + "transactionIndex": 22, + "blockNumber": 29772193, + "transactionHash": "0xa8ff388592aefe88e398ce7efc687d4625ee3fcf904bb421e829ca043be8ff42", + "address": "0xEeF6Af6297504f30FFeC8a4E3642d6Da6A15632f", "topics": [ "0xda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df" ], "data": "0x2f8eeb980ebc1342070a35514e1f42fa96381de8f080d3713e80fe99c883d4e9018683c5d2f1f71d7e8b65ab0990635c019de9183359db7e80543c485426e490", - "logIndex": 247, - "blockHash": "0xf27fb22ffc98eeb98c4b2d07a97d7bab06ccf38aaf67e8e753a33e908977a583" + "logIndex": 86, + "blockHash": "0x2e22c024209639795be498f2e7f42c9619054cfb8d534e0236d2766be9a67efc" }, { - "transactionIndex": 48, - "blockNumber": 36626416, - "transactionHash": "0xed206efde6bf00f1e01585ed5fd63a7ccaa41970437cfaed7f5a55db60638b6a", - "address": "0xB8733A76521A3e9363E44Da29861ad913c88D4cF", + "transactionIndex": 22, + "blockNumber": 29772193, + "transactionHash": "0xa8ff388592aefe88e398ce7efc687d4625ee3fcf904bb421e829ca043be8ff42", + "address": "0xEeF6Af6297504f30FFeC8a4E3642d6Da6A15632f", "topics": [ "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 248, - "blockHash": "0xf27fb22ffc98eeb98c4b2d07a97d7bab06ccf38aaf67e8e753a33e908977a583" + "logIndex": 87, + "blockHash": "0x2e22c024209639795be498f2e7f42c9619054cfb8d534e0236d2766be9a67efc" }, { - "transactionIndex": 48, - "blockNumber": 36626416, - "transactionHash": "0xed206efde6bf00f1e01585ed5fd63a7ccaa41970437cfaed7f5a55db60638b6a", + "transactionIndex": 22, + "blockNumber": 29772193, + "transactionHash": "0xa8ff388592aefe88e398ce7efc687d4625ee3fcf904bb421e829ca043be8ff42", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x00000000000000000000000067b94473d81d0cd00849d563c94d0432ac988b49" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" ], - "data": "0x00000000000000000000000000000000000000000000000000d546ed3e1711f0000000000000000000000000000000000000000000000000b64a31e6a80b51d20000000000000000000000000000000000000000000009e3f909c21e378cb628000000000000000000000000000000000000000000000000b574eaf969f43fe20000000000000000000000000000000000000000000009e3f9df090b75a3c818", - "logIndex": 249, - "blockHash": "0xf27fb22ffc98eeb98c4b2d07a97d7bab06ccf38aaf67e8e753a33e908977a583" + "data": "0x000000000000000000000000000000000000000000000000000a5ebdc9e4234c0000000000000000000000000000000000000000000000001b6bfb8b108fa94100000000000000000000000000000000000000000000187b2a4a8f8f9a0c159a0000000000000000000000000000000000000000000000001b619ccd46ab85f500000000000000000000000000000000000000000000187b2a54ee4d63f038e6", + "logIndex": 88, + "blockHash": "0x2e22c024209639795be498f2e7f42c9619054cfb8d534e0236d2766be9a67efc" } ], - "blockNumber": 36626416, - "cumulativeGasUsed": "10437504", + "blockNumber": 29772193, + "cumulativeGasUsed": "11448546", "status": 1, "byzantium": true }, "args": [ - "0xC999390A856e0633f945dD851DeeCE15b533ccA3", + "0xc24F86a8D9f82401b693d4FFaa1DCf3109d88524", "30000001", "30000100", - "0xb7b327Eb974706B548F8c18Ec0Eb35f0f0c655ef", + "0xDA7124b003AeF27A1C44aEe4d6eB6E2Bb0eF9a08", [ "0x2f8eeb980ebc1342070a35514e1f42fa96381de8f080d3713e80fe99c883d4e9", "0x018683c5d2f1f71d7e8b65ab0990635c019de9183359db7e80543c485426e490" ], "0xaee4acd5c4Bf516330ca8fe11B07206fC6709294" ], - "numDeployments": 3, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"pythia1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentSignerPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"GroupIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"TicketUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputdestination\",\"type\":\"address\"}],\"name\":\"UserShouldOwnItsDestination\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256[2]\",\"name\":\"newCommitmentSignerPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"CommitmentSignerPubKeyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentSignerPubKey\",\"outputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"\",\"type\":\"uint256[2]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract Pythia1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"updateCommitmentSignerPubKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns attestations that will be recorded, constructed from the user request\",\"params\":{\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentSignerPubKey\":\"The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\",\"owner\":\"The owner of the contract that can update the commitment signer pub key\",\"pythia1VerifierAddress\":\"ZK Snark Pythia-1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getCommitmentSignerPubKey()\":{\"details\":\"Getter of the Commitment signer Eddsa Public key\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Pythia-1 Verifier contract\"},\"initialize(uint256[2],address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"commitmentSignerPubKey\":\"EdDSA public key of the commitment signer\",\"ownerAddress\":\"Owner of the contract, can update public key and address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"}},\"title\":\"Pythia-1 Simple Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(uint256[2],address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"This attester is part of the family of the Pythia-1 Attesters. Pythia-1 attesters enable users to prove they have a claim and its proof issued by an offchain service in a privacy preserving way. That means no-one can make the link between the account used in the offchain service and the onchain account where the attestation is stored. The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic. We invite readers to refer to: - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each users gets one userTicket per claim For people used to semaphore/ tornado cash people: userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/pythia-1/Pythia1SimpleAttester.sol\":\"Pythia1SimpleAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/pythia-1/contracts/Pythia1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract Pythia1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\\n );\\n vk.IC = new Pairing.G1Point[](10);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 104028078850975554065172701281783302003220555203883119831575537681421753151,\\n 19148240629904598794948591359118971959790791697910953160820265703277306346\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[9] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3babb956e64535b9bf535df94288b4d83ea82c54727f79ee8949fe4a19c1d5ba\",\"license\":\"GPL-3.0\"},\"contracts/attesters/pythia-1/Pythia1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to Pythia1 Proving Scheme\\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\\n\\n/**\\n * @title Pythia-1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Pythia-1 Attesters.\\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \\n * offchain service in a privacy preserving way. \\n * That means no-one can make the link between the account used in the offchain service\\n * and the onchain account where the attestation is stored.\\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\\n * We invite readers to refer to:\\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each users gets one userTicket per claim\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n **/\\n\\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\\n using Pythia1Lib for Pythia1ProofData;\\n using Pythia1Lib for bytes;\\n using Pythia1Lib for Request;\\n\\n uint8 public constant IMPLEMENTATION_VERSION = 3;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n uint256[2] internal _commitmentSignerPubKey;\\n mapping(uint256 => address) internal _ticketsDestinations;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\\n * @param owner The owner of the contract that can update the commitment signer pub key\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n address pythia1VerifierAddress,\\n uint256[2] memory commitmentSignerPubKey,\\n address owner\\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n initialize(commitmentSignerPubKey, owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n uint256[2] memory commitmentSignerPubKey,\\n address ownerAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\\n }\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into Pythia1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\\n Pythia1ProofInput memory snarkInput = snarkProof._input();\\n Pythia1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata\\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\\n Pythia1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.internalCollectionId;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n uint32(block.timestamp),\\n ''\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used\\n * @param request users request. Claim of beiing part of a group.\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n // we get the ticket used from the snark input in the data provided\\n uint256 userTicket = proofData._getTicket();\\n address currentDestination = _getDestinationOfTicket(userTicket);\\n\\n if (currentDestination != address(0)) {\\n revert TicketUsed(userTicket);\\n }\\n\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n /*******************************************************\\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\\n * users bring secretHash as private input in snark which guarantees privacy\\n * the secretHash is only known by the user and never escape the user's browser\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(\\n Pythia1Claim memory claim\\n ) internal view override returns (uint256) {\\n uint256 ticketIdentifier = _encodeInSnarkField(\\n address(this),\\n claim.groupProperties.internalCollectionId\\n );\\n return ticketIdentifier;\\n }\\n\\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\\n return _commitmentSignerPubKey;\\n }\\n\\n /*******************************************************\\n Pythia-1 Attester Specific Functions\\n *******************************************************/\\n\\n function updateCommitmentSignerPubKey(\\n uint256[2] memory commitmentSignerPubKey\\n ) external onlyOwner {\\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\\n }\\n\\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\\n _commitmentSignerPubKey = commitmentSignerPubKey;\\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\\n }\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _ticketsDestinations[userTicket] = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _ticketsDestinations[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x22a505a2f8a3246ad46cf6fdd5eeab1a58b7fcb08982d03ff742f48aec063b82\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/base/IPythia1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\\n\\ninterface IPythia1Base {\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error UserShouldOwnItsDestination(address sender, address inputdestination);\\n error CommitmentSignerPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Pythia-1 Verifier contract\\n */\\n function getVerifier() external view returns (Pythia1Verifier);\\n\\n /**\\n * @dev Getter of the Commitment Signer EdDSA Public Key\\n */\\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\\n}\\n\",\"keccak256\":\"0x61924d768ab0c8cd61d0ff3c9ecbfbc37aacdbec7f575f0d46041b1847222526\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/base/Pythia1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IPythia1Base} from './IPythia1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Pythia 1 ZK Proving Scheme\\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\\n\\n/**\\n * @title Pythia-1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \\n * without anyone being able to make the link between the offchain service and the onchain service.\\n * It is inherited by the family of Pythia-1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to:\\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\\n \\n \\n **/\\nabstract contract Pythia1Base is IPythia1Base, Initializable {\\n using Pythia1Lib for Pythia1ProofData;\\n\\n // ZK-SNARK Verifier\\n Pythia1Verifier immutable VERIFIER;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\\n */\\n constructor(address Pythia1VerifierAddress) {\\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\\n }\\n\\n /**\\n * @dev Getter of Pythia-1 Verifier contract\\n */\\n function getVerifier() external view returns (Pythia1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of the Commitment signer Eddsa Public key\\n */\\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\\n return _getCommitmentSignerPubKey();\\n }\\n\\n /*******************************************************\\n Pythia-1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\\n * the secretHash is a number only known by the user and is used in \\n * the zero knowledge as a private input which guarantees privacy\\n\\n * This function MUST be implemented by Pythia-1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Pythia-1 Simple Attester for an example\\n * @param claim user claim: a particular claim that a user have that he can prove s right.\\n */\\n function _getTicketIdentifierOfClaim(\\n Pythia1Claim memory claim\\n ) internal view virtual returns (uint256);\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\\n * prove the claim was correctly issued for the user.\\n */\\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(\\n Pythia1Claim memory claim,\\n Pythia1ProofInput memory input\\n ) internal view virtual {\\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (claim.destination != msg.sender)\\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\\n if (\\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\\n )\\n revert CommitmentSignerPubKeyMismatch(\\n commitmentSignerPubKey[0],\\n commitmentSignerPubKey[1],\\n input.commitmentSignerPubKey[0],\\n input.commitmentSignerPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the plonk mathematical proof using the circom verifier contract\\n * @param proofData snark public input\\n */\\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(uint256 /*errorCode*/) {\\n revert InvalidGroth16Proof('');\\n } catch (bytes memory /*lowLevelData*/) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc15ec9f4ae345d96e52465049836e9294a37a45a4c219211264b1d7d15779285\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\\n\\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\\n error TicketUsed(uint256 userTicket);\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xa727568cccc2689a13e843d64003ffd6868537c73220e1dc94b86827c8e445d4\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/libs/Pythia1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\\n\\n// user Pythia-1 claim retrieved form his request\\nstruct Pythia1Claim {\\n uint256 groupId; // user claims be part of this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct Pythia1GroupProperties {\\n uint128 internalCollectionId;\\n bool isScore;\\n}\\n\\nstruct Pythia1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct Pythia1ProofData {\\n Pythia1CircomSnarkProof proof;\\n uint256[9] input;\\n // destination;\\n // chainId;\\n // commitmentSignerPubKey.x;\\n // commitmentSignerPubKey.y;\\n // groupId;\\n // ticketIdentifier;\\n // userTicket;\\n // value;\\n // isStrict;\\n}\\n\\nstruct Pythia1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 groupId;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n bool isStrict;\\n uint256[2] commitmentSignerPubKey;\\n}\\n\\nlibrary Pythia1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\\n return\\n Pythia1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getGroupId(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n Pythia1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (Pythia1GroupProperties)\\n );\\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(\\n Pythia1ProofData memory self\\n )\\n internal\\n pure\\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[9] memory)\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(\\n Pythia1ProofData memory self\\n ) internal pure returns (uint256[2] memory) {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(\\n Pythia1ProofData memory self\\n ) internal pure returns (uint256) {\\n return self.input[5];\\n }\\n\\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\\n return self.input[8] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 internalCollectionId,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\\n }\\n\\n function _generateGroupIdFromEncodedProperties(\\n bytes memory encodedProperties\\n ) internal pure returns (uint256) {\\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 internalCollectionId,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(internalCollectionId, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x9f50e72124764619442a1d9ad876661b56bc0abb330bc2ffe7536a1c65eb0d0e\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n address[] memory attestationOwners = new address[](collectionIds.length);\\n\\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\\n\\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n // fetch attestations from the registry\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationOwners[i] = attestationsOwner;\\n attestationCollectionIds[i] = collectionIds[i];\\n\\n attestations[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestations, proofData);\\n\\n _beforeDeleteAttestations(attestations, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n\\n _afterDeleteAttestations(attestations, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestations[i]);\\n }\\n return attestations;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x7743f02ed07e1b40a2ff45f5a45b5fe87d765326cce3528676cbd36c3d08ba37\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0x2d5faf5df56dfe1294202e89180846a1d4a5f938699619ee73b60c7314a97dfe\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x6101006040523480156200001257600080fd5b50604051620024dd380380620024dd8339810160408190526200003591620002d8565b6001600160a01b03838116608052861660a052620000533362000075565b60c085905260e0849052620000698282620000d0565b505050505050620003d9565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600390610100900460ff16158015620000f3575060005460ff8083169116105b6200015b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff831617610100178155620001886000546201000090046001600160a01b031690565b6001600160a01b031614806200019d5750303b155b15620001b957620001ae8262000075565b620001b983620001ff565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6200020e60018260026200024b565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051620002409190620003a6565b60405180910390a150565b82600281019282156200027c579160200282015b828111156200027c5782518255916020019190600101906200025f565b506200028a9291506200028e565b5090565b5b808211156200028a57600081556001016200028f565b80516001600160a01b0381168114620002bd57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060e08789031215620002f257600080fd5b620002fd87620002a5565b95506020808801519550604088015194506200031c60608901620002a5565b935088609f8901126200032e57600080fd5b604080519081016001600160401b0381118282101715620003535762000353620002c2565b6040528060c08a018b8111156200036957600080fd5b60808b015b818110156200038757805183529184019184016200036e565b508295506200039681620002a5565b9450505050509295509295509295565b60408101818360005b6002811015620003d0578151835260209283019290910190600101620003af565b50505092915050565b60805160a05160c05160e0516120a06200043d600039600081816101b4015261038a01526000818161016c01526103620152600081816102310152818161055301528181610734015261097801526000818161012f01526110d501526120a06000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c8063754b377c11610097578063c776adde11610066578063c776adde14610255578063c9cdef0414610268578063e60f999f1461027b578063f2fde38b1461028e57600080fd5b8063754b377c146101de5780638da5cb5b146101f8578063af411a301461020f578063bfa665851461022f57600080fd5b806354846d7a116100d357806354846d7a1461016757806363e4afc21461019c5780637000b051146101af578063715018a6146101d657600080fd5b8063124d7199146100fa5780632785e3221461010f57806346657fe91461012d575b600080fd5b61010d61010836600461164e565b6102a1565b005b6101176102b5565b604051610124919061168d565b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610124565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610124565b61014f6101aa36600461169b565b6102ca565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b61010d6102e9565b6101e6600381565b60405160ff9091168152602001610124565b6000546201000090046001600160a01b031661014f565b61022261021d3660046116fc565b6102fd565b6040516101249190611827565b7f000000000000000000000000000000000000000000000000000000000000000061014f565b6102226102633660046118ae565b61045c565b61010d61027636600461195f565b610817565b6102226102893660046116fc565b61093a565b61010d61029c366004611997565b610a56565b6102a9610acc565b6102b281610b2d565b50565b6102bd611445565b6102c5610b75565b905090565b6000818152600360205260408120546001600160a01b03165b92915050565b6102f1610acc565b6102fb6000610baf565b565b6060600061031261030d866119db565b610c0a565b60408051600180825281830190925291925060009190816020015b610335611463565b81526020019060019003908161032d575050606083015151909150600090610386906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611b6a565b90507f00000000000000000000000000000000000000000000000000000000000000008111156103d157604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b03168152602001856020015181526020014263ffffffff168152602001604051806020016040528060008152508152508360008151811061044557610445611b82565b602090810291909101015250909695505050505050565b60606000856001600160401b0381111561047857610478611559565b6040519080825280602002602001820160405280156104a1578160200160208202803683370190505b5090506000866001600160401b038111156104be576104be611559565b6040519080825280602002602001820160405280156104e7578160200160208202803683370190505b5090506000876001600160401b0381111561050457610504611559565b60405190808252806020026020018201604052801561053d57816020015b61052a611463565b8152602001906001900390816105225790505b50905060005b88811015610711576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f8881811061059257610592611b82565b905060200201358e6040518363ffffffff1660e01b81526004016105c99291909182526001600160a01b0316602082015260400190565b600060405180830381865afa1580156105e6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261060e9190810190611b98565b93509350935093508b88868151811061062957610629611b82565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061065b5761065b611b82565b9050602002013587868151811061067457610674611b82565b6020026020010181815250506040518060c001604052808f8f8881811061069d5761069d611b82565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff168152602001828152508686815181106106ef576106ef611b82565b602002602001018190525050505050808061070990611c53565b915050610543565b5061071d818787610cbe565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061076b9086908690600401611c6c565b600060405180830381600087803b15801561078557600080fd5b505af1158015610799573d6000803e3d6000fd5b5050505060005b8881101561080a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b8282815181106107db576107db611b82565b60200260200101516040516107f09190611cf0565b60405180910390a18061080281611c53565b9150506107a0565b5098975050505050505050565b600054600390610100900460ff16158015610839575060005460ff8083169116105b61089c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103c8565b6000805461ffff191660ff8316176101001781556108c96000546001600160a01b03620100009091041690565b6001600160a01b031614806108dd5750303b155b156108f4576108eb82610baf565b6108f483610b2d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6060610947848484610cd7565b60006109548585856102fd565b9050610961858585610d1f565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906109ad908490600401611827565b600060405180830381600087803b1580156109c757600080fd5b505af11580156109db573d6000803e3d6000fd5b5050505060005b8151811015610a4d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610a1e57610a1e611b82565b6020026020010151604051610a339190611cf0565b60405180910390a180610a4581611c53565b9150506109e2565b50949350505050565b610a5e610acc565b6001600160a01b038116610ac35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103c8565b6102b281610baf565b6000546001600160a01b03620100009091041633146102fb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103c8565b610b3a60018260026114b1565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051610b6a919061168d565b60405180910390a150565b610b7d611445565b60408051808201918290529060019060029082845b815481526020019060010190808311610b92575050505050905090565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b610c416040805160808101825260008082526020808301829052828401829052835180850190945281845283015290606082015290565b60008260000151600081518110610c5a57610c5a611b82565b60200260200101519050610c6d81610d88565b60008160400151806020019051810190610c879190611d13565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ce582840184611ddd565b90506000610cf282610dcc565b90506000610d0261030d876119db565b9050610d0e8183610e68565b610d17836110ab565b505050505050565b6000610d2b8383611244565b6000818152600360205260409020549091506001600160a01b03168015610d6857604051631f5d53e360e01b8152600481018390526024016103c8565b610d8182610d7c6040880160208901611997565b611269565b5050505050565b6000610d9782604001516112cf565b82519091508114610dc85781516040516337e3d1ab60e01b81526103c8918391600401918252602082015260400190565b5050565b610dd46114f4565b604051806101000160405280610de984611304565b6001600160a01b03168152602001610e0084611319565b8152602001610e0e84611328565b8152602001610e1c84611337565b8152602001610e2a84611346565b8152602001610e3884611355565b8152602001610e508460200151610100015160011490565b15158152602001610e6084611364565b905292915050565b8151604082015114610e9d57815160408281015190516347a9715d60e01b8152600481019290925260248201526044016103c8565b81606001516020015115158160c00151151503610ee65760608201516020015160c0820151604051634629f1b560e11b81529115156004830152151560248201526044016103c8565b81604001516001600160a01b031681600001516001600160a01b031614610f3a57604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016103c8565b60408201516001600160a01b03163314610f7e576040808301519051632bfa317f60e11b81523360048201526001600160a01b0390911660248201526044016103c8565b46816020015114610fb1576020810151604051630432cec160e31b815246600482015260248101919091526044016103c8565b81602001518160a0015114610fec57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016103c8565b6000610ff6610b75565b805160e08401515191925014158061101b575060208082015160e08401519091015114155b1561106457805160208083015160e0850151805192015160405163f71cb0f760e01b815260048101949094526024840191909152604483019190915260648201526084016103c8565b600061106f846113bc565b9050808360600151146110a55760608301516040516377bb6d2760e11b81526103c8918391600401918252602082015260400190565b50505050565b8051805160208083015160409384015191850151935163c542c93b60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463c542c93b9461110e94909392909190600401611eae565b602060405180830381865afa925050508015611147575060408051601f3d908101601f1916820190925261114491810190611f55565b60015b61121d57611153611f70565b806308c379a00361118c5750611167611f8c565b8061117257506111cb565b8060405162dd577760e81b81526004016103c89190612015565b634e487b71036111cb5761119e612028565b906111a957506111cb565b60405162dd577760e81b815260206004820152600060248201526044016103c8565b3d8080156111f5576040519150601f19603f3d011682016040523d82523d6000602084013e6111fa565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016103c8565b80610dc85760405162dd577760e81b815260206004820152600060248201526044016103c8565b60008061125383850185611ddd565b9050600061126082611346565b95945050505050565b60008281526003602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102e3907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190612048565b6020810151600090815b602002015192915050565b6020810151600090600161130e565b6020810151600090600461130e565b6020810151600090600561130e565b6020810151600090600661130e565b6020810151600090600761130e565b61136c611445565b6040518060400160405280836020015160026009811061138e5761138e611b82565b6020020151815260200183602001516003600981106113af576113af611b82565b6020020151905292915050565b6000806113da308460600151600001516001600160801b03166113e1565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113da9190612048565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b82600281019282156114df579160200282015b828111156114df5782518255916020019190600101906114c4565b506114eb929150611544565b5090565b905290565b60405180610100016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114ef611445565b5b808211156114eb5760008155600101611545565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b038211171561158e5761158e611559565b60405250565b606081018181106001600160401b038211171561158e5761158e611559565b601f8201601f191681016001600160401b03811182821017156115d8576115d8611559565b6040525050565b600082601f8301126115f057600080fd5b604051604081018181106001600160401b038211171561161257611612611559565b806040525080604084018581111561162957600080fd5b845b8181101561164357803583526020928301920161162b565b509195945050505050565b60006040828403121561166057600080fd5b6113da83836115df565b8060005b60028110156110a557815184526020938401939091019060010161166e565b604081016102e3828461166a565b6000602082840312156116ad57600080fd5b5035919050565b60008083601f8401126116c657600080fd5b5081356001600160401b038111156116dd57600080fd5b6020830191508360208285010111156116f557600080fd5b9250929050565b60008060006040848603121561171157600080fd5b83356001600160401b038082111561172857600080fd5b908501906040828803121561173c57600080fd5b9093506020850135908082111561175257600080fd5b5061175f868287016116b4565b9497909650939450505050565b60005b8381101561178757818101518382015260200161176f565b838111156110a55750506000910152565b600081518084526117b081602086016020860161176c565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261181f60c0850182611798565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561187c57603f1988860301845261186a8583516117c4565b9450928501929085019060010161184e565b5092979650505050505050565b6001600160a01b03811681146102b257600080fd5b80356118a981611889565b919050565b6000806000806000606086880312156118c657600080fd5b85356001600160401b03808211156118dd57600080fd5b818801915088601f8301126118f157600080fd5b81358181111561190057600080fd5b8960208260051b850101111561191557600080fd5b6020830197508096505061192b6020890161189e565b9450604088013591508082111561194157600080fd5b5061194e888289016116b4565b969995985093965092949392505050565b6000806060838503121561197257600080fd5b61197c84846115df565b9150604083013561198c81611889565b809150509250929050565b6000602082840312156119a957600080fd5b81356113da81611889565b60006001600160401b038211156119cd576119cd611559565b50601f01601f191660200190565b600060408083360312156119ee57600080fd5b80516119f98161156f565b83356001600160401b0380821115611a1057600080fd5b9085019036601f830112611a2357600080fd5b8135602082821115611a3757611a37611559565b8160051b8651611a49838301826115b3565b92835284810182019282810136851115611a6257600080fd5b83870192505b84831015611b3657823586811115611a805760008081fd5b8701606036829003601f1901811315611a995760008081fd5b8a51611aa481611594565b8287013581528b83013581880152908201359088821115611ac55760008081fd5b9181019136603f840112611adb57600091508182fd5b868301359150611aea826119b4565b8c51611af682826115b3565b838152368e858701011115611b0d57600091508182fd5b838e86018a830137600093810189019390935250808c0191909152825250918301918301611a68565b50865250611b4588820161189e565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611b7d57611b7d611b54565b500190565b634e487b7160e01b600052603260045260246000fd5b60008060008060808587031215611bae57600080fd5b8451611bb981611889565b60208601516040870151919550935063ffffffff81168114611bda57600080fd5b60608601519092506001600160401b03811115611bf657600080fd5b8501601f81018713611c0757600080fd5b8051611c12816119b4565b604051611c1f82826115b3565b828152896020848601011115611c3457600080fd5b611c4583602083016020870161176c565b969995985093965050505050565b600060018201611c6557611c65611b54565b5060010190565b604080825283519082018190526000906020906060840190828701845b82811015611cae5781516001600160a01b031684529284019290840190600101611c89565b5050508381038285015284518082528583019183019060005b81811015611ce357835183529284019291840191600101611cc7565b5090979650505050505050565b6020815260006113da60208301846117c4565b805180151581146118a957600080fd5b600060408284031215611d2557600080fd5b604051604081018181106001600160401b0382111715611d4757611d47611559565b60405282516001600160801b0381168114611d6157600080fd5b8152611d6f60208401611d03565b60208201529392505050565b600082601f830112611d8c57600080fd5b6040516101208082018281106001600160401b0382111715611db057611db0611559565b60405283018185821115611dc357600080fd5b845b82811015611643578035825260209182019101611dc5565b6000818303610220811215611df157600080fd5b60408051611dfe8161156f565b61010080841215611e0e57600080fd5b82519350611e1b84611594565b611e2587876115df565b845286605f870112611e3657600080fd5b8251611e418161156f565b8060c0880189811115611e5357600080fd5b8589015b81811015611e7857611e698b826115df565b83526020909201918601611e57565b50826020880152611e898a826115df565b86880152505050838252611e9f87828801611d7b565b60208301525095945050505050565b6102208101611ebd828761166a565b60408083018660005b6002808210611ed55750611f10565b82518460005b83811015611ef9578251825260209283019290910190600101611edb565b505050928401925060209190910190600101611ec6565b50505050611f2160c083018561166a565b61010082018360005b6009811015611f49578151835260209283019290910190600101611f2a565b50505095945050505050565b600060208284031215611f6757600080fd5b6113da82611d03565b600060033d1115611f895760046000803e5060005160e01c5b90565b600060443d1015611f9a5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611fc957505050505090565b8285019150815181811115611fe15750505050505090565b843d8701016020828501011115611ffb5750505050505090565b61200a602082860101876115b3565b509095945050505050565b6020815260006113da6020830184611798565b60008060233d1115612044576020600460003e50506000516001905b9091565b60008261206557634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220ecfcdd3ed3aafdf6de9cf8f871557ae2657814cf595e7da8c33a09d25121780964736f6c634300080e0033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063754b377c11610097578063c776adde11610066578063c776adde14610255578063c9cdef0414610268578063e60f999f1461027b578063f2fde38b1461028e57600080fd5b8063754b377c146101de5780638da5cb5b146101f8578063af411a301461020f578063bfa665851461022f57600080fd5b806354846d7a116100d357806354846d7a1461016757806363e4afc21461019c5780637000b051146101af578063715018a6146101d657600080fd5b8063124d7199146100fa5780632785e3221461010f57806346657fe91461012d575b600080fd5b61010d61010836600461164e565b6102a1565b005b6101176102b5565b604051610124919061168d565b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610124565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610124565b61014f6101aa36600461169b565b6102ca565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b61010d6102e9565b6101e6600381565b60405160ff9091168152602001610124565b6000546201000090046001600160a01b031661014f565b61022261021d3660046116fc565b6102fd565b6040516101249190611827565b7f000000000000000000000000000000000000000000000000000000000000000061014f565b6102226102633660046118ae565b61045c565b61010d61027636600461195f565b610817565b6102226102893660046116fc565b61093a565b61010d61029c366004611997565b610a56565b6102a9610acc565b6102b281610b2d565b50565b6102bd611445565b6102c5610b75565b905090565b6000818152600360205260408120546001600160a01b03165b92915050565b6102f1610acc565b6102fb6000610baf565b565b6060600061031261030d866119db565b610c0a565b60408051600180825281830190925291925060009190816020015b610335611463565b81526020019060019003908161032d575050606083015151909150600090610386906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611b6a565b90507f00000000000000000000000000000000000000000000000000000000000000008111156103d157604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b03168152602001856020015181526020014263ffffffff168152602001604051806020016040528060008152508152508360008151811061044557610445611b82565b602090810291909101015250909695505050505050565b60606000856001600160401b0381111561047857610478611559565b6040519080825280602002602001820160405280156104a1578160200160208202803683370190505b5090506000866001600160401b038111156104be576104be611559565b6040519080825280602002602001820160405280156104e7578160200160208202803683370190505b5090506000876001600160401b0381111561050457610504611559565b60405190808252806020026020018201604052801561053d57816020015b61052a611463565b8152602001906001900390816105225790505b50905060005b88811015610711576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f8881811061059257610592611b82565b905060200201358e6040518363ffffffff1660e01b81526004016105c99291909182526001600160a01b0316602082015260400190565b600060405180830381865afa1580156105e6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261060e9190810190611b98565b93509350935093508b88868151811061062957610629611b82565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061065b5761065b611b82565b9050602002013587868151811061067457610674611b82565b6020026020010181815250506040518060c001604052808f8f8881811061069d5761069d611b82565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff168152602001828152508686815181106106ef576106ef611b82565b602002602001018190525050505050808061070990611c53565b915050610543565b5061071d818787610cbe565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061076b9086908690600401611c6c565b600060405180830381600087803b15801561078557600080fd5b505af1158015610799573d6000803e3d6000fd5b5050505060005b8881101561080a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b8282815181106107db576107db611b82565b60200260200101516040516107f09190611cf0565b60405180910390a18061080281611c53565b9150506107a0565b5098975050505050505050565b600054600390610100900460ff16158015610839575060005460ff8083169116105b61089c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103c8565b6000805461ffff191660ff8316176101001781556108c96000546001600160a01b03620100009091041690565b6001600160a01b031614806108dd5750303b155b156108f4576108eb82610baf565b6108f483610b2d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6060610947848484610cd7565b60006109548585856102fd565b9050610961858585610d1f565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906109ad908490600401611827565b600060405180830381600087803b1580156109c757600080fd5b505af11580156109db573d6000803e3d6000fd5b5050505060005b8151811015610a4d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610a1e57610a1e611b82565b6020026020010151604051610a339190611cf0565b60405180910390a180610a4581611c53565b9150506109e2565b50949350505050565b610a5e610acc565b6001600160a01b038116610ac35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103c8565b6102b281610baf565b6000546001600160a01b03620100009091041633146102fb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103c8565b610b3a60018260026114b1565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051610b6a919061168d565b60405180910390a150565b610b7d611445565b60408051808201918290529060019060029082845b815481526020019060010190808311610b92575050505050905090565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b610c416040805160808101825260008082526020808301829052828401829052835180850190945281845283015290606082015290565b60008260000151600081518110610c5a57610c5a611b82565b60200260200101519050610c6d81610d88565b60008160400151806020019051810190610c879190611d13565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ce582840184611ddd565b90506000610cf282610dcc565b90506000610d0261030d876119db565b9050610d0e8183610e68565b610d17836110ab565b505050505050565b6000610d2b8383611244565b6000818152600360205260409020549091506001600160a01b03168015610d6857604051631f5d53e360e01b8152600481018390526024016103c8565b610d8182610d7c6040880160208901611997565b611269565b5050505050565b6000610d9782604001516112cf565b82519091508114610dc85781516040516337e3d1ab60e01b81526103c8918391600401918252602082015260400190565b5050565b610dd46114f4565b604051806101000160405280610de984611304565b6001600160a01b03168152602001610e0084611319565b8152602001610e0e84611328565b8152602001610e1c84611337565b8152602001610e2a84611346565b8152602001610e3884611355565b8152602001610e508460200151610100015160011490565b15158152602001610e6084611364565b905292915050565b8151604082015114610e9d57815160408281015190516347a9715d60e01b8152600481019290925260248201526044016103c8565b81606001516020015115158160c00151151503610ee65760608201516020015160c0820151604051634629f1b560e11b81529115156004830152151560248201526044016103c8565b81604001516001600160a01b031681600001516001600160a01b031614610f3a57604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016103c8565b60408201516001600160a01b03163314610f7e576040808301519051632bfa317f60e11b81523360048201526001600160a01b0390911660248201526044016103c8565b46816020015114610fb1576020810151604051630432cec160e31b815246600482015260248101919091526044016103c8565b81602001518160a0015114610fec57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016103c8565b6000610ff6610b75565b805160e08401515191925014158061101b575060208082015160e08401519091015114155b1561106457805160208083015160e0850151805192015160405163f71cb0f760e01b815260048101949094526024840191909152604483019190915260648201526084016103c8565b600061106f846113bc565b9050808360600151146110a55760608301516040516377bb6d2760e11b81526103c8918391600401918252602082015260400190565b50505050565b8051805160208083015160409384015191850151935163c542c93b60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463c542c93b9461110e94909392909190600401611eae565b602060405180830381865afa925050508015611147575060408051601f3d908101601f1916820190925261114491810190611f55565b60015b61121d57611153611f70565b806308c379a00361118c5750611167611f8c565b8061117257506111cb565b8060405162dd577760e81b81526004016103c89190612015565b634e487b71036111cb5761119e612028565b906111a957506111cb565b60405162dd577760e81b815260206004820152600060248201526044016103c8565b3d8080156111f5576040519150601f19603f3d011682016040523d82523d6000602084013e6111fa565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016103c8565b80610dc85760405162dd577760e81b815260206004820152600060248201526044016103c8565b60008061125383850185611ddd565b9050600061126082611346565b95945050505050565b60008281526003602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102e3907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190612048565b6020810151600090815b602002015192915050565b6020810151600090600161130e565b6020810151600090600461130e565b6020810151600090600561130e565b6020810151600090600661130e565b6020810151600090600761130e565b61136c611445565b6040518060400160405280836020015160026009811061138e5761138e611b82565b6020020151815260200183602001516003600981106113af576113af611b82565b6020020151905292915050565b6000806113da308460600151600001516001600160801b03166113e1565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113da9190612048565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b82600281019282156114df579160200282015b828111156114df5782518255916020019190600101906114c4565b506114eb929150611544565b5090565b905290565b60405180610100016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114ef611445565b5b808211156114eb5760008155600101611545565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b038211171561158e5761158e611559565b60405250565b606081018181106001600160401b038211171561158e5761158e611559565b601f8201601f191681016001600160401b03811182821017156115d8576115d8611559565b6040525050565b600082601f8301126115f057600080fd5b604051604081018181106001600160401b038211171561161257611612611559565b806040525080604084018581111561162957600080fd5b845b8181101561164357803583526020928301920161162b565b509195945050505050565b60006040828403121561166057600080fd5b6113da83836115df565b8060005b60028110156110a557815184526020938401939091019060010161166e565b604081016102e3828461166a565b6000602082840312156116ad57600080fd5b5035919050565b60008083601f8401126116c657600080fd5b5081356001600160401b038111156116dd57600080fd5b6020830191508360208285010111156116f557600080fd5b9250929050565b60008060006040848603121561171157600080fd5b83356001600160401b038082111561172857600080fd5b908501906040828803121561173c57600080fd5b9093506020850135908082111561175257600080fd5b5061175f868287016116b4565b9497909650939450505050565b60005b8381101561178757818101518382015260200161176f565b838111156110a55750506000910152565b600081518084526117b081602086016020860161176c565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261181f60c0850182611798565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561187c57603f1988860301845261186a8583516117c4565b9450928501929085019060010161184e565b5092979650505050505050565b6001600160a01b03811681146102b257600080fd5b80356118a981611889565b919050565b6000806000806000606086880312156118c657600080fd5b85356001600160401b03808211156118dd57600080fd5b818801915088601f8301126118f157600080fd5b81358181111561190057600080fd5b8960208260051b850101111561191557600080fd5b6020830197508096505061192b6020890161189e565b9450604088013591508082111561194157600080fd5b5061194e888289016116b4565b969995985093965092949392505050565b6000806060838503121561197257600080fd5b61197c84846115df565b9150604083013561198c81611889565b809150509250929050565b6000602082840312156119a957600080fd5b81356113da81611889565b60006001600160401b038211156119cd576119cd611559565b50601f01601f191660200190565b600060408083360312156119ee57600080fd5b80516119f98161156f565b83356001600160401b0380821115611a1057600080fd5b9085019036601f830112611a2357600080fd5b8135602082821115611a3757611a37611559565b8160051b8651611a49838301826115b3565b92835284810182019282810136851115611a6257600080fd5b83870192505b84831015611b3657823586811115611a805760008081fd5b8701606036829003601f1901811315611a995760008081fd5b8a51611aa481611594565b8287013581528b83013581880152908201359088821115611ac55760008081fd5b9181019136603f840112611adb57600091508182fd5b868301359150611aea826119b4565b8c51611af682826115b3565b838152368e858701011115611b0d57600091508182fd5b838e86018a830137600093810189019390935250808c0191909152825250918301918301611a68565b50865250611b4588820161189e565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611b7d57611b7d611b54565b500190565b634e487b7160e01b600052603260045260246000fd5b60008060008060808587031215611bae57600080fd5b8451611bb981611889565b60208601516040870151919550935063ffffffff81168114611bda57600080fd5b60608601519092506001600160401b03811115611bf657600080fd5b8501601f81018713611c0757600080fd5b8051611c12816119b4565b604051611c1f82826115b3565b828152896020848601011115611c3457600080fd5b611c4583602083016020870161176c565b969995985093965050505050565b600060018201611c6557611c65611b54565b5060010190565b604080825283519082018190526000906020906060840190828701845b82811015611cae5781516001600160a01b031684529284019290840190600101611c89565b5050508381038285015284518082528583019183019060005b81811015611ce357835183529284019291840191600101611cc7565b5090979650505050505050565b6020815260006113da60208301846117c4565b805180151581146118a957600080fd5b600060408284031215611d2557600080fd5b604051604081018181106001600160401b0382111715611d4757611d47611559565b60405282516001600160801b0381168114611d6157600080fd5b8152611d6f60208401611d03565b60208201529392505050565b600082601f830112611d8c57600080fd5b6040516101208082018281106001600160401b0382111715611db057611db0611559565b60405283018185821115611dc357600080fd5b845b82811015611643578035825260209182019101611dc5565b6000818303610220811215611df157600080fd5b60408051611dfe8161156f565b61010080841215611e0e57600080fd5b82519350611e1b84611594565b611e2587876115df565b845286605f870112611e3657600080fd5b8251611e418161156f565b8060c0880189811115611e5357600080fd5b8589015b81811015611e7857611e698b826115df565b83526020909201918601611e57565b50826020880152611e898a826115df565b86880152505050838252611e9f87828801611d7b565b60208301525095945050505050565b6102208101611ebd828761166a565b60408083018660005b6002808210611ed55750611f10565b82518460005b83811015611ef9578251825260209283019290910190600101611edb565b505050928401925060209190910190600101611ec6565b50505050611f2160c083018561166a565b61010082018360005b6009811015611f49578151835260209283019290910190600101611f2a565b50505095945050505050565b600060208284031215611f6757600080fd5b6113da82611d03565b600060033d1115611f895760046000803e5060005160e01c5b90565b600060443d1015611f9a5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611fc957505050505090565b8285019150815181811115611fe15750505050505090565b843d8701016020828501011115611ffb5750505050505090565b61200a602082860101876115b3565b509095945050505050565b6020815260006113da6020830184611798565b60008060233d1115612044576020600460003e50506000516001905b9091565b60008261206557634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220ecfcdd3ed3aafdf6de9cf8f871557ae2657814cf595e7da8c33a09d25121780964736f6c634300080e0033", diff --git a/deployments/sandboxPolygon/Pythia1SimpleAttesterImplem.json b/deployments/mumbaiTestnet/Pythia1SimpleAttesterImplem.json similarity index 98% rename from deployments/sandboxPolygon/Pythia1SimpleAttesterImplem.json rename to deployments/mumbaiTestnet/Pythia1SimpleAttesterImplem.json index ba180bb..1bf24f4 100644 --- a/deployments/sandboxPolygon/Pythia1SimpleAttesterImplem.json +++ b/deployments/mumbaiTestnet/Pythia1SimpleAttesterImplem.json @@ -1,5 +1,5 @@ { - "address": "0xB8733A76521A3e9363E44Da29861ad913c88D4cF", + "address": "0xEeF6Af6297504f30FFeC8a4E3642d6Da6A15632f", "abi": [ { "inputs": [ @@ -776,103 +776,103 @@ "type": "function" } ], - "transactionHash": "0xed206efde6bf00f1e01585ed5fd63a7ccaa41970437cfaed7f5a55db60638b6a", + "transactionHash": "0xa8ff388592aefe88e398ce7efc687d4625ee3fcf904bb421e829ca043be8ff42", "receipt": { "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0xB8733A76521A3e9363E44Da29861ad913c88D4cF", - "transactionIndex": 48, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xEeF6Af6297504f30FFeC8a4E3642d6Da6A15632f", + "transactionIndex": 22, "gasUsed": "1945946", - "logsBloom": "0x00000000000000200000000000000000002200000000000000800000000000000000000000000000000000000000000000008000000040000000000000000000000000000000000000000000000000800001000000000000000100000000000000000040020000000000000000000800000000010000000080000000000000400000000000010000000000100000000000000000000080000000000000000000200000000000000010200000000400000000000000000000000000000000004000800000000000000001000000048000000000000000000000100004000020000000020000000000000000000000000000000200000000000000000000100000", - "blockHash": "0xf27fb22ffc98eeb98c4b2d07a97d7bab06ccf38aaf67e8e753a33e908977a583", - "transactionHash": "0xed206efde6bf00f1e01585ed5fd63a7ccaa41970437cfaed7f5a55db60638b6a", + "logsBloom": "0x00000000000000020000000000000004002000000000000000800000000000000000000000000000000000000000000000008000000040000000000000000000000000000000000000000000000000800001000000000000000100000000000000000000020000000000000000000800000000010000000080000000000000400000000000010000000000000000000000000000000080000000000040000000200000000000000020200000000402000001000000000000000000000000004000008000000000000001000000040000400200000000000000100000000020000000000000000000000000000000000000000200000000000000000000100000", + "blockHash": "0x2e22c024209639795be498f2e7f42c9619054cfb8d534e0236d2766be9a67efc", + "transactionHash": "0xa8ff388592aefe88e398ce7efc687d4625ee3fcf904bb421e829ca043be8ff42", "logs": [ { - "transactionIndex": 48, - "blockNumber": 36626416, - "transactionHash": "0xed206efde6bf00f1e01585ed5fd63a7ccaa41970437cfaed7f5a55db60638b6a", - "address": "0xB8733A76521A3e9363E44Da29861ad913c88D4cF", + "transactionIndex": 22, + "blockNumber": 29772193, + "transactionHash": "0xa8ff388592aefe88e398ce7efc687d4625ee3fcf904bb421e829ca043be8ff42", + "address": "0xEeF6Af6297504f30FFeC8a4E3642d6Da6A15632f", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed" ], "data": "0x", - "logIndex": 245, - "blockHash": "0xf27fb22ffc98eeb98c4b2d07a97d7bab06ccf38aaf67e8e753a33e908977a583" + "logIndex": 84, + "blockHash": "0x2e22c024209639795be498f2e7f42c9619054cfb8d534e0236d2766be9a67efc" }, { - "transactionIndex": 48, - "blockNumber": 36626416, - "transactionHash": "0xed206efde6bf00f1e01585ed5fd63a7ccaa41970437cfaed7f5a55db60638b6a", - "address": "0xB8733A76521A3e9363E44Da29861ad913c88D4cF", + "transactionIndex": 22, + "blockNumber": 29772193, + "transactionHash": "0xa8ff388592aefe88e398ce7efc687d4625ee3fcf904bb421e829ca043be8ff42", + "address": "0xEeF6Af6297504f30FFeC8a4E3642d6Da6A15632f", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", "0x000000000000000000000000aee4acd5c4bf516330ca8fe11b07206fc6709294" ], "data": "0x", - "logIndex": 246, - "blockHash": "0xf27fb22ffc98eeb98c4b2d07a97d7bab06ccf38aaf67e8e753a33e908977a583" + "logIndex": 85, + "blockHash": "0x2e22c024209639795be498f2e7f42c9619054cfb8d534e0236d2766be9a67efc" }, { - "transactionIndex": 48, - "blockNumber": 36626416, - "transactionHash": "0xed206efde6bf00f1e01585ed5fd63a7ccaa41970437cfaed7f5a55db60638b6a", - "address": "0xB8733A76521A3e9363E44Da29861ad913c88D4cF", + "transactionIndex": 22, + "blockNumber": 29772193, + "transactionHash": "0xa8ff388592aefe88e398ce7efc687d4625ee3fcf904bb421e829ca043be8ff42", + "address": "0xEeF6Af6297504f30FFeC8a4E3642d6Da6A15632f", "topics": [ "0xda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df" ], "data": "0x2f8eeb980ebc1342070a35514e1f42fa96381de8f080d3713e80fe99c883d4e9018683c5d2f1f71d7e8b65ab0990635c019de9183359db7e80543c485426e490", - "logIndex": 247, - "blockHash": "0xf27fb22ffc98eeb98c4b2d07a97d7bab06ccf38aaf67e8e753a33e908977a583" + "logIndex": 86, + "blockHash": "0x2e22c024209639795be498f2e7f42c9619054cfb8d534e0236d2766be9a67efc" }, { - "transactionIndex": 48, - "blockNumber": 36626416, - "transactionHash": "0xed206efde6bf00f1e01585ed5fd63a7ccaa41970437cfaed7f5a55db60638b6a", - "address": "0xB8733A76521A3e9363E44Da29861ad913c88D4cF", + "transactionIndex": 22, + "blockNumber": 29772193, + "transactionHash": "0xa8ff388592aefe88e398ce7efc687d4625ee3fcf904bb421e829ca043be8ff42", + "address": "0xEeF6Af6297504f30FFeC8a4E3642d6Da6A15632f", "topics": [ "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 248, - "blockHash": "0xf27fb22ffc98eeb98c4b2d07a97d7bab06ccf38aaf67e8e753a33e908977a583" + "logIndex": 87, + "blockHash": "0x2e22c024209639795be498f2e7f42c9619054cfb8d534e0236d2766be9a67efc" }, { - "transactionIndex": 48, - "blockNumber": 36626416, - "transactionHash": "0xed206efde6bf00f1e01585ed5fd63a7ccaa41970437cfaed7f5a55db60638b6a", + "transactionIndex": 22, + "blockNumber": 29772193, + "transactionHash": "0xa8ff388592aefe88e398ce7efc687d4625ee3fcf904bb421e829ca043be8ff42", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x00000000000000000000000067b94473d81d0cd00849d563c94d0432ac988b49" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" ], - "data": "0x00000000000000000000000000000000000000000000000000d546ed3e1711f0000000000000000000000000000000000000000000000000b64a31e6a80b51d20000000000000000000000000000000000000000000009e3f909c21e378cb628000000000000000000000000000000000000000000000000b574eaf969f43fe20000000000000000000000000000000000000000000009e3f9df090b75a3c818", - "logIndex": 249, - "blockHash": "0xf27fb22ffc98eeb98c4b2d07a97d7bab06ccf38aaf67e8e753a33e908977a583" + "data": "0x000000000000000000000000000000000000000000000000000a5ebdc9e4234c0000000000000000000000000000000000000000000000001b6bfb8b108fa94100000000000000000000000000000000000000000000187b2a4a8f8f9a0c159a0000000000000000000000000000000000000000000000001b619ccd46ab85f500000000000000000000000000000000000000000000187b2a54ee4d63f038e6", + "logIndex": 88, + "blockHash": "0x2e22c024209639795be498f2e7f42c9619054cfb8d534e0236d2766be9a67efc" } ], - "blockNumber": 36626416, - "cumulativeGasUsed": "10437504", + "blockNumber": 29772193, + "cumulativeGasUsed": "11448546", "status": 1, "byzantium": true }, "args": [ - "0xC999390A856e0633f945dD851DeeCE15b533ccA3", + "0xc24F86a8D9f82401b693d4FFaa1DCf3109d88524", "30000001", "30000100", - "0xb7b327Eb974706B548F8c18Ec0Eb35f0f0c655ef", + "0xDA7124b003AeF27A1C44aEe4d6eB6E2Bb0eF9a08", [ "0x2f8eeb980ebc1342070a35514e1f42fa96381de8f080d3713e80fe99c883d4e9", "0x018683c5d2f1f71d7e8b65ab0990635c019de9183359db7e80543c485426e490" ], "0xaee4acd5c4Bf516330ca8fe11B07206fC6709294" ], - "numDeployments": 2, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"pythia1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentSignerPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"GroupIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"TicketUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputdestination\",\"type\":\"address\"}],\"name\":\"UserShouldOwnItsDestination\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256[2]\",\"name\":\"newCommitmentSignerPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"CommitmentSignerPubKeyUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentSignerPubKey\",\"outputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"\",\"type\":\"uint256[2]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract Pythia1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"},{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"commitmentSignerPubKey\",\"type\":\"uint256[2]\"}],\"name\":\"updateCommitmentSignerPubKey\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns attestations that will be recorded, constructed from the user request\",\"params\":{\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentSignerPubKey\":\"The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\",\"owner\":\"The owner of the contract that can update the commitment signer pub key\",\"pythia1VerifierAddress\":\"ZK Snark Pythia-1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getCommitmentSignerPubKey()\":{\"details\":\"Getter of the Commitment signer Eddsa Public key\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Pythia-1 Verifier contract\"},\"initialize(uint256[2],address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"commitmentSignerPubKey\":\"EdDSA public key of the commitment signer\",\"ownerAddress\":\"Owner of the contract, can update public key and address\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"}},\"title\":\"Pythia-1 Simple Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(uint256[2],address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"This attester is part of the family of the Pythia-1 Attesters. Pythia-1 attesters enable users to prove they have a claim and its proof issued by an offchain service in a privacy preserving way. That means no-one can make the link between the account used in the offchain service and the onchain account where the attestation is stored. The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic. We invite readers to refer to: - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each users gets one userTicket per claim For people used to semaphore/ tornado cash people: userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/pythia-1/Pythia1SimpleAttester.sol\":\"Pythia1SimpleAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/pythia-1/contracts/Pythia1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract Pythia1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\\n );\\n vk.IC = new Pairing.G1Point[](10);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 104028078850975554065172701281783302003220555203883119831575537681421753151,\\n 19148240629904598794948591359118971959790791697910953160820265703277306346\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[9] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3babb956e64535b9bf535df94288b4d83ea82c54727f79ee8949fe4a19c1d5ba\",\"license\":\"GPL-3.0\"},\"contracts/attesters/pythia-1/Pythia1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to Pythia1 Proving Scheme\\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\\n\\n/**\\n * @title Pythia-1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Pythia-1 Attesters.\\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \\n * offchain service in a privacy preserving way. \\n * That means no-one can make the link between the account used in the offchain service\\n * and the onchain account where the attestation is stored.\\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\\n * We invite readers to refer to:\\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each users gets one userTicket per claim\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n **/\\n\\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\\n using Pythia1Lib for Pythia1ProofData;\\n using Pythia1Lib for bytes;\\n using Pythia1Lib for Request;\\n\\n uint8 public constant IMPLEMENTATION_VERSION = 3;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n uint256[2] internal _commitmentSignerPubKey;\\n mapping(uint256 => address) internal _ticketsDestinations;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\\n * @param owner The owner of the contract that can update the commitment signer pub key\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n address pythia1VerifierAddress,\\n uint256[2] memory commitmentSignerPubKey,\\n address owner\\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n initialize(commitmentSignerPubKey, owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n uint256[2] memory commitmentSignerPubKey,\\n address ownerAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\\n }\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into Pythia1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\\n Pythia1ProofInput memory snarkInput = snarkProof._input();\\n Pythia1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata\\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\\n Pythia1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.internalCollectionId;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n uint32(block.timestamp),\\n ''\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used\\n * @param request users request. Claim of beiing part of a group.\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n // we get the ticket used from the snark input in the data provided\\n uint256 userTicket = proofData._getTicket();\\n address currentDestination = _getDestinationOfTicket(userTicket);\\n\\n if (currentDestination != address(0)) {\\n revert TicketUsed(userTicket);\\n }\\n\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n /*******************************************************\\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\\n * users bring secretHash as private input in snark which guarantees privacy\\n * the secretHash is only known by the user and never escape the user's browser\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(\\n Pythia1Claim memory claim\\n ) internal view override returns (uint256) {\\n uint256 ticketIdentifier = _encodeInSnarkField(\\n address(this),\\n claim.groupProperties.internalCollectionId\\n );\\n return ticketIdentifier;\\n }\\n\\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\\n return _commitmentSignerPubKey;\\n }\\n\\n /*******************************************************\\n Pythia-1 Attester Specific Functions\\n *******************************************************/\\n\\n function updateCommitmentSignerPubKey(\\n uint256[2] memory commitmentSignerPubKey\\n ) external onlyOwner {\\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\\n }\\n\\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\\n _commitmentSignerPubKey = commitmentSignerPubKey;\\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\\n }\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _ticketsDestinations[userTicket] = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _ticketsDestinations[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x22a505a2f8a3246ad46cf6fdd5eeab1a58b7fcb08982d03ff742f48aec063b82\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/base/IPythia1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\\n\\ninterface IPythia1Base {\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error UserShouldOwnItsDestination(address sender, address inputdestination);\\n error CommitmentSignerPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Pythia-1 Verifier contract\\n */\\n function getVerifier() external view returns (Pythia1Verifier);\\n\\n /**\\n * @dev Getter of the Commitment Signer EdDSA Public Key\\n */\\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\\n}\\n\",\"keccak256\":\"0x61924d768ab0c8cd61d0ff3c9ecbfbc37aacdbec7f575f0d46041b1847222526\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/base/Pythia1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IPythia1Base} from './IPythia1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Pythia 1 ZK Proving Scheme\\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\\n\\n/**\\n * @title Pythia-1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \\n * without anyone being able to make the link between the offchain service and the onchain service.\\n * It is inherited by the family of Pythia-1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to:\\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\\n \\n \\n **/\\nabstract contract Pythia1Base is IPythia1Base, Initializable {\\n using Pythia1Lib for Pythia1ProofData;\\n\\n // ZK-SNARK Verifier\\n Pythia1Verifier immutable VERIFIER;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\\n */\\n constructor(address Pythia1VerifierAddress) {\\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\\n }\\n\\n /**\\n * @dev Getter of Pythia-1 Verifier contract\\n */\\n function getVerifier() external view returns (Pythia1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of the Commitment signer Eddsa Public key\\n */\\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\\n return _getCommitmentSignerPubKey();\\n }\\n\\n /*******************************************************\\n Pythia-1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\\n * the secretHash is a number only known by the user and is used in \\n * the zero knowledge as a private input which guarantees privacy\\n\\n * This function MUST be implemented by Pythia-1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Pythia-1 Simple Attester for an example\\n * @param claim user claim: a particular claim that a user have that he can prove s right.\\n */\\n function _getTicketIdentifierOfClaim(\\n Pythia1Claim memory claim\\n ) internal view virtual returns (uint256);\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\\n * prove the claim was correctly issued for the user.\\n */\\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(\\n Pythia1Claim memory claim,\\n Pythia1ProofInput memory input\\n ) internal view virtual {\\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (claim.destination != msg.sender)\\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\\n if (\\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\\n )\\n revert CommitmentSignerPubKeyMismatch(\\n commitmentSignerPubKey[0],\\n commitmentSignerPubKey[1],\\n input.commitmentSignerPubKey[0],\\n input.commitmentSignerPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the plonk mathematical proof using the circom verifier contract\\n * @param proofData snark public input\\n */\\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(uint256 /*errorCode*/) {\\n revert InvalidGroth16Proof('');\\n } catch (bytes memory /*lowLevelData*/) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0xc15ec9f4ae345d96e52465049836e9294a37a45a4c219211264b1d7d15779285\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\\n\\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\\n error TicketUsed(uint256 userTicket);\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xa727568cccc2689a13e843d64003ffd6868537c73220e1dc94b86827c8e445d4\",\"license\":\"MIT\"},\"contracts/attesters/pythia-1/libs/Pythia1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\\n\\n// user Pythia-1 claim retrieved form his request\\nstruct Pythia1Claim {\\n uint256 groupId; // user claims be part of this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct Pythia1GroupProperties {\\n uint128 internalCollectionId;\\n bool isScore;\\n}\\n\\nstruct Pythia1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct Pythia1ProofData {\\n Pythia1CircomSnarkProof proof;\\n uint256[9] input;\\n // destination;\\n // chainId;\\n // commitmentSignerPubKey.x;\\n // commitmentSignerPubKey.y;\\n // groupId;\\n // ticketIdentifier;\\n // userTicket;\\n // value;\\n // isStrict;\\n}\\n\\nstruct Pythia1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 groupId;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n bool isStrict;\\n uint256[2] commitmentSignerPubKey;\\n}\\n\\nlibrary Pythia1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\\n return\\n Pythia1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getGroupId(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n Pythia1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (Pythia1GroupProperties)\\n );\\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(\\n Pythia1ProofData memory self\\n )\\n internal\\n pure\\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[9] memory)\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(\\n Pythia1ProofData memory self\\n ) internal pure returns (uint256[2] memory) {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(\\n Pythia1ProofData memory self\\n ) internal pure returns (uint256) {\\n return self.input[5];\\n }\\n\\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\\n return self.input[8] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 internalCollectionId,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\\n }\\n\\n function _generateGroupIdFromEncodedProperties(\\n bytes memory encodedProperties\\n ) internal pure returns (uint256) {\\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 internalCollectionId,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(internalCollectionId, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x9f50e72124764619442a1d9ad876661b56bc0abb330bc2ffe7536a1c65eb0d0e\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n address[] memory attestationOwners = new address[](collectionIds.length);\\n\\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\\n\\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n // fetch attestations from the registry\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationOwners[i] = attestationsOwner;\\n attestationCollectionIds[i] = collectionIds[i];\\n\\n attestations[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestations, proofData);\\n\\n _beforeDeleteAttestations(attestations, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n\\n _afterDeleteAttestations(attestations, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestations[i]);\\n }\\n return attestations;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x7743f02ed07e1b40a2ff45f5a45b5fe87d765326cce3528676cbd36c3d08ba37\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0x2d5faf5df56dfe1294202e89180846a1d4a5f938699619ee73b60c7314a97dfe\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", "bytecode": "0x6101006040523480156200001257600080fd5b50604051620024dd380380620024dd8339810160408190526200003591620002d8565b6001600160a01b03838116608052861660a052620000533362000075565b60c085905260e0849052620000698282620000d0565b505050505050620003d9565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054600390610100900460ff16158015620000f3575060005460ff8083169116105b6200015b5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff831617610100178155620001886000546201000090046001600160a01b031690565b6001600160a01b031614806200019d5750303b155b15620001b957620001ae8262000075565b620001b983620001ff565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6200020e60018260026200024b565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051620002409190620003a6565b60405180910390a150565b82600281019282156200027c579160200282015b828111156200027c5782518255916020019190600101906200025f565b506200028a9291506200028e565b5090565b5b808211156200028a57600081556001016200028f565b80516001600160a01b0381168114620002bd57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60008060008060008060e08789031215620002f257600080fd5b620002fd87620002a5565b95506020808801519550604088015194506200031c60608901620002a5565b935088609f8901126200032e57600080fd5b604080519081016001600160401b0381118282101715620003535762000353620002c2565b6040528060c08a018b8111156200036957600080fd5b60808b015b818110156200038757805183529184019184016200036e565b508295506200039681620002a5565b9450505050509295509295509295565b60408101818360005b6002811015620003d0578151835260209283019290910190600101620003af565b50505092915050565b60805160a05160c05160e0516120a06200043d600039600081816101b4015261038a01526000818161016c01526103620152600081816102310152818161055301528181610734015261097801526000818161012f01526110d501526120a06000f3fe608060405234801561001057600080fd5b50600436106100f55760003560e01c8063754b377c11610097578063c776adde11610066578063c776adde14610255578063c9cdef0414610268578063e60f999f1461027b578063f2fde38b1461028e57600080fd5b8063754b377c146101de5780638da5cb5b146101f8578063af411a301461020f578063bfa665851461022f57600080fd5b806354846d7a116100d357806354846d7a1461016757806363e4afc21461019c5780637000b051146101af578063715018a6146101d657600080fd5b8063124d7199146100fa5780632785e3221461010f57806346657fe91461012d575b600080fd5b61010d61010836600461164e565b6102a1565b005b6101176102b5565b604051610124919061168d565b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610124565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610124565b61014f6101aa36600461169b565b6102ca565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b61010d6102e9565b6101e6600381565b60405160ff9091168152602001610124565b6000546201000090046001600160a01b031661014f565b61022261021d3660046116fc565b6102fd565b6040516101249190611827565b7f000000000000000000000000000000000000000000000000000000000000000061014f565b6102226102633660046118ae565b61045c565b61010d61027636600461195f565b610817565b6102226102893660046116fc565b61093a565b61010d61029c366004611997565b610a56565b6102a9610acc565b6102b281610b2d565b50565b6102bd611445565b6102c5610b75565b905090565b6000818152600360205260408120546001600160a01b03165b92915050565b6102f1610acc565b6102fb6000610baf565b565b6060600061031261030d866119db565b610c0a565b60408051600180825281830190925291925060009190816020015b610335611463565b81526020019060019003908161032d575050606083015151909150600090610386906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611b6a565b90507f00000000000000000000000000000000000000000000000000000000000000008111156103d157604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b03168152602001856020015181526020014263ffffffff168152602001604051806020016040528060008152508152508360008151811061044557610445611b82565b602090810291909101015250909695505050505050565b60606000856001600160401b0381111561047857610478611559565b6040519080825280602002602001820160405280156104a1578160200160208202803683370190505b5090506000866001600160401b038111156104be576104be611559565b6040519080825280602002602001820160405280156104e7578160200160208202803683370190505b5090506000876001600160401b0381111561050457610504611559565b60405190808252806020026020018201604052801561053d57816020015b61052a611463565b8152602001906001900390816105225790505b50905060005b88811015610711576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f8881811061059257610592611b82565b905060200201358e6040518363ffffffff1660e01b81526004016105c99291909182526001600160a01b0316602082015260400190565b600060405180830381865afa1580156105e6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261060e9190810190611b98565b93509350935093508b88868151811061062957610629611b82565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061065b5761065b611b82565b9050602002013587868151811061067457610674611b82565b6020026020010181815250506040518060c001604052808f8f8881811061069d5761069d611b82565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff168152602001828152508686815181106106ef576106ef611b82565b602002602001018190525050505050808061070990611c53565b915050610543565b5061071d818787610cbe565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061076b9086908690600401611c6c565b600060405180830381600087803b15801561078557600080fd5b505af1158015610799573d6000803e3d6000fd5b5050505060005b8881101561080a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b8282815181106107db576107db611b82565b60200260200101516040516107f09190611cf0565b60405180910390a18061080281611c53565b9150506107a0565b5098975050505050505050565b600054600390610100900460ff16158015610839575060005460ff8083169116105b61089c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103c8565b6000805461ffff191660ff8316176101001781556108c96000546001600160a01b03620100009091041690565b6001600160a01b031614806108dd5750303b155b156108f4576108eb82610baf565b6108f483610b2d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6060610947848484610cd7565b60006109548585856102fd565b9050610961858585610d1f565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906109ad908490600401611827565b600060405180830381600087803b1580156109c757600080fd5b505af11580156109db573d6000803e3d6000fd5b5050505060005b8151811015610a4d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610a1e57610a1e611b82565b6020026020010151604051610a339190611cf0565b60405180910390a180610a4581611c53565b9150506109e2565b50949350505050565b610a5e610acc565b6001600160a01b038116610ac35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103c8565b6102b281610baf565b6000546001600160a01b03620100009091041633146102fb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103c8565b610b3a60018260026114b1565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051610b6a919061168d565b60405180910390a150565b610b7d611445565b60408051808201918290529060019060029082845b815481526020019060010190808311610b92575050505050905090565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b610c416040805160808101825260008082526020808301829052828401829052835180850190945281845283015290606082015290565b60008260000151600081518110610c5a57610c5a611b82565b60200260200101519050610c6d81610d88565b60008160400151806020019051810190610c879190611d13565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ce582840184611ddd565b90506000610cf282610dcc565b90506000610d0261030d876119db565b9050610d0e8183610e68565b610d17836110ab565b505050505050565b6000610d2b8383611244565b6000818152600360205260409020549091506001600160a01b03168015610d6857604051631f5d53e360e01b8152600481018390526024016103c8565b610d8182610d7c6040880160208901611997565b611269565b5050505050565b6000610d9782604001516112cf565b82519091508114610dc85781516040516337e3d1ab60e01b81526103c8918391600401918252602082015260400190565b5050565b610dd46114f4565b604051806101000160405280610de984611304565b6001600160a01b03168152602001610e0084611319565b8152602001610e0e84611328565b8152602001610e1c84611337565b8152602001610e2a84611346565b8152602001610e3884611355565b8152602001610e508460200151610100015160011490565b15158152602001610e6084611364565b905292915050565b8151604082015114610e9d57815160408281015190516347a9715d60e01b8152600481019290925260248201526044016103c8565b81606001516020015115158160c00151151503610ee65760608201516020015160c0820151604051634629f1b560e11b81529115156004830152151560248201526044016103c8565b81604001516001600160a01b031681600001516001600160a01b031614610f3a57604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016103c8565b60408201516001600160a01b03163314610f7e576040808301519051632bfa317f60e11b81523360048201526001600160a01b0390911660248201526044016103c8565b46816020015114610fb1576020810151604051630432cec160e31b815246600482015260248101919091526044016103c8565b81602001518160a0015114610fec57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016103c8565b6000610ff6610b75565b805160e08401515191925014158061101b575060208082015160e08401519091015114155b1561106457805160208083015160e0850151805192015160405163f71cb0f760e01b815260048101949094526024840191909152604483019190915260648201526084016103c8565b600061106f846113bc565b9050808360600151146110a55760608301516040516377bb6d2760e11b81526103c8918391600401918252602082015260400190565b50505050565b8051805160208083015160409384015191850151935163c542c93b60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463c542c93b9461110e94909392909190600401611eae565b602060405180830381865afa925050508015611147575060408051601f3d908101601f1916820190925261114491810190611f55565b60015b61121d57611153611f70565b806308c379a00361118c5750611167611f8c565b8061117257506111cb565b8060405162dd577760e81b81526004016103c89190612015565b634e487b71036111cb5761119e612028565b906111a957506111cb565b60405162dd577760e81b815260206004820152600060248201526044016103c8565b3d8080156111f5576040519150601f19603f3d011682016040523d82523d6000602084013e6111fa565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016103c8565b80610dc85760405162dd577760e81b815260206004820152600060248201526044016103c8565b60008061125383850185611ddd565b9050600061126082611346565b95945050505050565b60008281526003602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102e3907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190612048565b6020810151600090815b602002015192915050565b6020810151600090600161130e565b6020810151600090600461130e565b6020810151600090600561130e565b6020810151600090600661130e565b6020810151600090600761130e565b61136c611445565b6040518060400160405280836020015160026009811061138e5761138e611b82565b6020020151815260200183602001516003600981106113af576113af611b82565b6020020151905292915050565b6000806113da308460600151600001516001600160801b03166113e1565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113da9190612048565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b82600281019282156114df579160200282015b828111156114df5782518255916020019190600101906114c4565b506114eb929150611544565b5090565b905290565b60405180610100016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114ef611445565b5b808211156114eb5760008155600101611545565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b038211171561158e5761158e611559565b60405250565b606081018181106001600160401b038211171561158e5761158e611559565b601f8201601f191681016001600160401b03811182821017156115d8576115d8611559565b6040525050565b600082601f8301126115f057600080fd5b604051604081018181106001600160401b038211171561161257611612611559565b806040525080604084018581111561162957600080fd5b845b8181101561164357803583526020928301920161162b565b509195945050505050565b60006040828403121561166057600080fd5b6113da83836115df565b8060005b60028110156110a557815184526020938401939091019060010161166e565b604081016102e3828461166a565b6000602082840312156116ad57600080fd5b5035919050565b60008083601f8401126116c657600080fd5b5081356001600160401b038111156116dd57600080fd5b6020830191508360208285010111156116f557600080fd5b9250929050565b60008060006040848603121561171157600080fd5b83356001600160401b038082111561172857600080fd5b908501906040828803121561173c57600080fd5b9093506020850135908082111561175257600080fd5b5061175f868287016116b4565b9497909650939450505050565b60005b8381101561178757818101518382015260200161176f565b838111156110a55750506000910152565b600081518084526117b081602086016020860161176c565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261181f60c0850182611798565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561187c57603f1988860301845261186a8583516117c4565b9450928501929085019060010161184e565b5092979650505050505050565b6001600160a01b03811681146102b257600080fd5b80356118a981611889565b919050565b6000806000806000606086880312156118c657600080fd5b85356001600160401b03808211156118dd57600080fd5b818801915088601f8301126118f157600080fd5b81358181111561190057600080fd5b8960208260051b850101111561191557600080fd5b6020830197508096505061192b6020890161189e565b9450604088013591508082111561194157600080fd5b5061194e888289016116b4565b969995985093965092949392505050565b6000806060838503121561197257600080fd5b61197c84846115df565b9150604083013561198c81611889565b809150509250929050565b6000602082840312156119a957600080fd5b81356113da81611889565b60006001600160401b038211156119cd576119cd611559565b50601f01601f191660200190565b600060408083360312156119ee57600080fd5b80516119f98161156f565b83356001600160401b0380821115611a1057600080fd5b9085019036601f830112611a2357600080fd5b8135602082821115611a3757611a37611559565b8160051b8651611a49838301826115b3565b92835284810182019282810136851115611a6257600080fd5b83870192505b84831015611b3657823586811115611a805760008081fd5b8701606036829003601f1901811315611a995760008081fd5b8a51611aa481611594565b8287013581528b83013581880152908201359088821115611ac55760008081fd5b9181019136603f840112611adb57600091508182fd5b868301359150611aea826119b4565b8c51611af682826115b3565b838152368e858701011115611b0d57600091508182fd5b838e86018a830137600093810189019390935250808c0191909152825250918301918301611a68565b50865250611b4588820161189e565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611b7d57611b7d611b54565b500190565b634e487b7160e01b600052603260045260246000fd5b60008060008060808587031215611bae57600080fd5b8451611bb981611889565b60208601516040870151919550935063ffffffff81168114611bda57600080fd5b60608601519092506001600160401b03811115611bf657600080fd5b8501601f81018713611c0757600080fd5b8051611c12816119b4565b604051611c1f82826115b3565b828152896020848601011115611c3457600080fd5b611c4583602083016020870161176c565b969995985093965050505050565b600060018201611c6557611c65611b54565b5060010190565b604080825283519082018190526000906020906060840190828701845b82811015611cae5781516001600160a01b031684529284019290840190600101611c89565b5050508381038285015284518082528583019183019060005b81811015611ce357835183529284019291840191600101611cc7565b5090979650505050505050565b6020815260006113da60208301846117c4565b805180151581146118a957600080fd5b600060408284031215611d2557600080fd5b604051604081018181106001600160401b0382111715611d4757611d47611559565b60405282516001600160801b0381168114611d6157600080fd5b8152611d6f60208401611d03565b60208201529392505050565b600082601f830112611d8c57600080fd5b6040516101208082018281106001600160401b0382111715611db057611db0611559565b60405283018185821115611dc357600080fd5b845b82811015611643578035825260209182019101611dc5565b6000818303610220811215611df157600080fd5b60408051611dfe8161156f565b61010080841215611e0e57600080fd5b82519350611e1b84611594565b611e2587876115df565b845286605f870112611e3657600080fd5b8251611e418161156f565b8060c0880189811115611e5357600080fd5b8589015b81811015611e7857611e698b826115df565b83526020909201918601611e57565b50826020880152611e898a826115df565b86880152505050838252611e9f87828801611d7b565b60208301525095945050505050565b6102208101611ebd828761166a565b60408083018660005b6002808210611ed55750611f10565b82518460005b83811015611ef9578251825260209283019290910190600101611edb565b505050928401925060209190910190600101611ec6565b50505050611f2160c083018561166a565b61010082018360005b6009811015611f49578151835260209283019290910190600101611f2a565b50505095945050505050565b600060208284031215611f6757600080fd5b6113da82611d03565b600060033d1115611f895760046000803e5060005160e01c5b90565b600060443d1015611f9a5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611fc957505050505090565b8285019150815181811115611fe15750505050505090565b843d8701016020828501011115611ffb5750505050505090565b61200a602082860101876115b3565b509095945050505050565b6020815260006113da6020830184611798565b60008060233d1115612044576020600460003e50506000516001905b9091565b60008261206557634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220ecfcdd3ed3aafdf6de9cf8f871557ae2657814cf595e7da8c33a09d25121780964736f6c634300080e0033", "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100f55760003560e01c8063754b377c11610097578063c776adde11610066578063c776adde14610255578063c9cdef0414610268578063e60f999f1461027b578063f2fde38b1461028e57600080fd5b8063754b377c146101de5780638da5cb5b146101f8578063af411a301461020f578063bfa665851461022f57600080fd5b806354846d7a116100d357806354846d7a1461016757806363e4afc21461019c5780637000b051146101af578063715018a6146101d657600080fd5b8063124d7199146100fa5780632785e3221461010f57806346657fe91461012d575b600080fd5b61010d61010836600461164e565b6102a1565b005b6101176102b5565b604051610124919061168d565b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b039091168152602001610124565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b604051908152602001610124565b61014f6101aa36600461169b565b6102ca565b61018e7f000000000000000000000000000000000000000000000000000000000000000081565b61010d6102e9565b6101e6600381565b60405160ff9091168152602001610124565b6000546201000090046001600160a01b031661014f565b61022261021d3660046116fc565b6102fd565b6040516101249190611827565b7f000000000000000000000000000000000000000000000000000000000000000061014f565b6102226102633660046118ae565b61045c565b61010d61027636600461195f565b610817565b6102226102893660046116fc565b61093a565b61010d61029c366004611997565b610a56565b6102a9610acc565b6102b281610b2d565b50565b6102bd611445565b6102c5610b75565b905090565b6000818152600360205260408120546001600160a01b03165b92915050565b6102f1610acc565b6102fb6000610baf565b565b6060600061031261030d866119db565b610c0a565b60408051600180825281830190925291925060009190816020015b610335611463565b81526020019060019003908161032d575050606083015151909150600090610386906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611b6a565b90507f00000000000000000000000000000000000000000000000000000000000000008111156103d157604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b03168152602001856020015181526020014263ffffffff168152602001604051806020016040528060008152508152508360008151811061044557610445611b82565b602090810291909101015250909695505050505050565b60606000856001600160401b0381111561047857610478611559565b6040519080825280602002602001820160405280156104a1578160200160208202803683370190505b5090506000866001600160401b038111156104be576104be611559565b6040519080825280602002602001820160405280156104e7578160200160208202803683370190505b5090506000876001600160401b0381111561050457610504611559565b60405190808252806020026020018201604052801561053d57816020015b61052a611463565b8152602001906001900390816105225790505b50905060005b88811015610711576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f8881811061059257610592611b82565b905060200201358e6040518363ffffffff1660e01b81526004016105c99291909182526001600160a01b0316602082015260400190565b600060405180830381865afa1580156105e6573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261060e9190810190611b98565b93509350935093508b88868151811061062957610629611b82565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061065b5761065b611b82565b9050602002013587868151811061067457610674611b82565b6020026020010181815250506040518060c001604052808f8f8881811061069d5761069d611b82565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff168152602001828152508686815181106106ef576106ef611b82565b602002602001018190525050505050808061070990611c53565b915050610543565b5061071d818787610cbe565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061076b9086908690600401611c6c565b600060405180830381600087803b15801561078557600080fd5b505af1158015610799573d6000803e3d6000fd5b5050505060005b8881101561080a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b8282815181106107db576107db611b82565b60200260200101516040516107f09190611cf0565b60405180910390a18061080281611c53565b9150506107a0565b5098975050505050505050565b600054600390610100900460ff16158015610839575060005460ff8083169116105b61089c5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016103c8565b6000805461ffff191660ff8316176101001781556108c96000546001600160a01b03620100009091041690565b6001600160a01b031614806108dd5750303b155b156108f4576108eb82610baf565b6108f483610b2d565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b6060610947848484610cd7565b60006109548585856102fd565b9050610961858585610d1f565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906109ad908490600401611827565b600060405180830381600087803b1580156109c757600080fd5b505af11580156109db573d6000803e3d6000fd5b5050505060005b8151811015610a4d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610a1e57610a1e611b82565b6020026020010151604051610a339190611cf0565b60405180910390a180610a4581611c53565b9150506109e2565b50949350505050565b610a5e610acc565b6001600160a01b038116610ac35760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016103c8565b6102b281610baf565b6000546001600160a01b03620100009091041633146102fb5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016103c8565b610b3a60018260026114b1565b507fda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df81604051610b6a919061168d565b60405180910390a150565b610b7d611445565b60408051808201918290529060019060029082845b815481526020019060010190808311610b92575050505050905090565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b610c416040805160808101825260008082526020808301829052828401829052835180850190945281845283015290606082015290565b60008260000151600081518110610c5a57610c5a611b82565b60200260200101519050610c6d81610d88565b60008160400151806020019051810190610c879190611d13565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ce582840184611ddd565b90506000610cf282610dcc565b90506000610d0261030d876119db565b9050610d0e8183610e68565b610d17836110ab565b505050505050565b6000610d2b8383611244565b6000818152600360205260409020549091506001600160a01b03168015610d6857604051631f5d53e360e01b8152600481018390526024016103c8565b610d8182610d7c6040880160208901611997565b611269565b5050505050565b6000610d9782604001516112cf565b82519091508114610dc85781516040516337e3d1ab60e01b81526103c8918391600401918252602082015260400190565b5050565b610dd46114f4565b604051806101000160405280610de984611304565b6001600160a01b03168152602001610e0084611319565b8152602001610e0e84611328565b8152602001610e1c84611337565b8152602001610e2a84611346565b8152602001610e3884611355565b8152602001610e508460200151610100015160011490565b15158152602001610e6084611364565b905292915050565b8151604082015114610e9d57815160408281015190516347a9715d60e01b8152600481019290925260248201526044016103c8565b81606001516020015115158160c00151151503610ee65760608201516020015160c0820151604051634629f1b560e11b81529115156004830152151560248201526044016103c8565b81604001516001600160a01b031681600001516001600160a01b031614610f3a57604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016103c8565b60408201516001600160a01b03163314610f7e576040808301519051632bfa317f60e11b81523360048201526001600160a01b0390911660248201526044016103c8565b46816020015114610fb1576020810151604051630432cec160e31b815246600482015260248101919091526044016103c8565b81602001518160a0015114610fec57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016103c8565b6000610ff6610b75565b805160e08401515191925014158061101b575060208082015160e08401519091015114155b1561106457805160208083015160e0850151805192015160405163f71cb0f760e01b815260048101949094526024840191909152604483019190915260648201526084016103c8565b600061106f846113bc565b9050808360600151146110a55760608301516040516377bb6d2760e11b81526103c8918391600401918252602082015260400190565b50505050565b8051805160208083015160409384015191850151935163c542c93b60e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463c542c93b9461110e94909392909190600401611eae565b602060405180830381865afa925050508015611147575060408051601f3d908101601f1916820190925261114491810190611f55565b60015b61121d57611153611f70565b806308c379a00361118c5750611167611f8c565b8061117257506111cb565b8060405162dd577760e81b81526004016103c89190612015565b634e487b71036111cb5761119e612028565b906111a957506111cb565b60405162dd577760e81b815260206004820152600060248201526044016103c8565b3d8080156111f5576040519150601f19603f3d011682016040523d82523d6000602084013e6111fa565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016103c8565b80610dc85760405162dd577760e81b815260206004820152600060248201526044016103c8565b60008061125383850185611ddd565b9050600061126082611346565b95945050505050565b60008281526003602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102e3907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190612048565b6020810151600090815b602002015192915050565b6020810151600090600161130e565b6020810151600090600461130e565b6020810151600090600561130e565b6020810151600090600661130e565b6020810151600090600761130e565b61136c611445565b6040518060400160405280836020015160026009811061138e5761138e611b82565b6020020151815260200183602001516003600981106113af576113af611b82565b6020020151905292915050565b6000806113da308460600151600001516001600160801b03166113e1565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113da9190612048565b60405180604001604052806002906020820280368337509192915050565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b82600281019282156114df579160200282015b828111156114df5782518255916020019190600101906114c4565b506114eb929150611544565b5090565b905290565b60405180610100016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114ef611445565b5b808211156114eb5760008155600101611545565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b038211171561158e5761158e611559565b60405250565b606081018181106001600160401b038211171561158e5761158e611559565b601f8201601f191681016001600160401b03811182821017156115d8576115d8611559565b6040525050565b600082601f8301126115f057600080fd5b604051604081018181106001600160401b038211171561161257611612611559565b806040525080604084018581111561162957600080fd5b845b8181101561164357803583526020928301920161162b565b509195945050505050565b60006040828403121561166057600080fd5b6113da83836115df565b8060005b60028110156110a557815184526020938401939091019060010161166e565b604081016102e3828461166a565b6000602082840312156116ad57600080fd5b5035919050565b60008083601f8401126116c657600080fd5b5081356001600160401b038111156116dd57600080fd5b6020830191508360208285010111156116f557600080fd5b9250929050565b60008060006040848603121561171157600080fd5b83356001600160401b038082111561172857600080fd5b908501906040828803121561173c57600080fd5b9093506020850135908082111561175257600080fd5b5061175f868287016116b4565b9497909650939450505050565b60005b8381101561178757818101518382015260200161176f565b838111156110a55750506000910152565b600081518084526117b081602086016020860161176c565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261181f60c0850182611798565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561187c57603f1988860301845261186a8583516117c4565b9450928501929085019060010161184e565b5092979650505050505050565b6001600160a01b03811681146102b257600080fd5b80356118a981611889565b919050565b6000806000806000606086880312156118c657600080fd5b85356001600160401b03808211156118dd57600080fd5b818801915088601f8301126118f157600080fd5b81358181111561190057600080fd5b8960208260051b850101111561191557600080fd5b6020830197508096505061192b6020890161189e565b9450604088013591508082111561194157600080fd5b5061194e888289016116b4565b969995985093965092949392505050565b6000806060838503121561197257600080fd5b61197c84846115df565b9150604083013561198c81611889565b809150509250929050565b6000602082840312156119a957600080fd5b81356113da81611889565b60006001600160401b038211156119cd576119cd611559565b50601f01601f191660200190565b600060408083360312156119ee57600080fd5b80516119f98161156f565b83356001600160401b0380821115611a1057600080fd5b9085019036601f830112611a2357600080fd5b8135602082821115611a3757611a37611559565b8160051b8651611a49838301826115b3565b92835284810182019282810136851115611a6257600080fd5b83870192505b84831015611b3657823586811115611a805760008081fd5b8701606036829003601f1901811315611a995760008081fd5b8a51611aa481611594565b8287013581528b83013581880152908201359088821115611ac55760008081fd5b9181019136603f840112611adb57600091508182fd5b868301359150611aea826119b4565b8c51611af682826115b3565b838152368e858701011115611b0d57600091508182fd5b838e86018a830137600093810189019390935250808c0191909152825250918301918301611a68565b50865250611b4588820161189e565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611b7d57611b7d611b54565b500190565b634e487b7160e01b600052603260045260246000fd5b60008060008060808587031215611bae57600080fd5b8451611bb981611889565b60208601516040870151919550935063ffffffff81168114611bda57600080fd5b60608601519092506001600160401b03811115611bf657600080fd5b8501601f81018713611c0757600080fd5b8051611c12816119b4565b604051611c1f82826115b3565b828152896020848601011115611c3457600080fd5b611c4583602083016020870161176c565b969995985093965050505050565b600060018201611c6557611c65611b54565b5060010190565b604080825283519082018190526000906020906060840190828701845b82811015611cae5781516001600160a01b031684529284019290840190600101611c89565b5050508381038285015284518082528583019183019060005b81811015611ce357835183529284019291840191600101611cc7565b5090979650505050505050565b6020815260006113da60208301846117c4565b805180151581146118a957600080fd5b600060408284031215611d2557600080fd5b604051604081018181106001600160401b0382111715611d4757611d47611559565b60405282516001600160801b0381168114611d6157600080fd5b8152611d6f60208401611d03565b60208201529392505050565b600082601f830112611d8c57600080fd5b6040516101208082018281106001600160401b0382111715611db057611db0611559565b60405283018185821115611dc357600080fd5b845b82811015611643578035825260209182019101611dc5565b6000818303610220811215611df157600080fd5b60408051611dfe8161156f565b61010080841215611e0e57600080fd5b82519350611e1b84611594565b611e2587876115df565b845286605f870112611e3657600080fd5b8251611e418161156f565b8060c0880189811115611e5357600080fd5b8589015b81811015611e7857611e698b826115df565b83526020909201918601611e57565b50826020880152611e898a826115df565b86880152505050838252611e9f87828801611d7b565b60208301525095945050505050565b6102208101611ebd828761166a565b60408083018660005b6002808210611ed55750611f10565b82518460005b83811015611ef9578251825260209283019290910190600101611edb565b505050928401925060209190910190600101611ec6565b50505050611f2160c083018561166a565b61010082018360005b6009811015611f49578151835260209283019290910190600101611f2a565b50505095945050505050565b600060208284031215611f6757600080fd5b6113da82611d03565b600060033d1115611f895760046000803e5060005160e01c5b90565b600060443d1015611f9a5790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611fc957505050505090565b8285019150815181811115611fe15750505050505090565b843d8701016020828501011115611ffb5750505050505090565b61200a602082860101876115b3565b509095945050505050565b6020815260006113da6020830184611798565b60008060233d1115612044576020600460003e50506000516001905b9091565b60008261206557634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220ecfcdd3ed3aafdf6de9cf8f871557ae2657814cf595e7da8c33a09d25121780964736f6c634300080e0033", diff --git a/deployments/mumbaiTestnet/Pythia1SimpleAttesterProxy.json b/deployments/mumbaiTestnet/Pythia1SimpleAttesterProxy.json new file mode 100644 index 0000000..672410c --- /dev/null +++ b/deployments/mumbaiTestnet/Pythia1SimpleAttesterProxy.json @@ -0,0 +1,288 @@ +{ + "address": "0xBbb56145d961742b1f3E3fc2b91077639C8C302a", + "abi": [ + { + "inputs": [ + { + "internalType": "address", + "name": "_logic", + "type": "address" + }, + { + "internalType": "address", + "name": "admin_", + "type": "address" + }, + { + "internalType": "bytes", + "name": "_data", + "type": "bytes" + } + ], + "stateMutability": "payable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "previousAdmin", + "type": "address" + }, + { + "indexed": false, + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "AdminChanged", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "beacon", + "type": "address" + } + ], + "name": "BeaconUpgraded", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "implementation", + "type": "address" + } + ], + "name": "Upgraded", + "type": "event" + }, + { + "stateMutability": "payable", + "type": "fallback" + }, + { + "inputs": [], + "name": "admin", + "outputs": [ + { + "internalType": "address", + "name": "admin_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newAdmin", + "type": "address" + } + ], + "name": "changeAdmin", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "implementation", + "outputs": [ + { + "internalType": "address", + "name": "implementation_", + "type": "address" + } + ], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + } + ], + "name": "upgradeTo", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newImplementation", + "type": "address" + }, + { + "internalType": "bytes", + "name": "data", + "type": "bytes" + } + ], + "name": "upgradeToAndCall", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "stateMutability": "payable", + "type": "receive" + } + ], + "transactionHash": "0x9b12b426ba11913e8e48195791f52d8d122c48cc424bd5a4a9f930c10fac4fc1", + "receipt": { + "to": null, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xBbb56145d961742b1f3E3fc2b91077639C8C302a", + "transactionIndex": 17, + "gasUsed": "660362", + "logsBloom": "0x00000000000000820000000000000000402000000000000000800000000000000000000000000000000000000000000000008000000040000000000000000000000002000000000000000000000002800001000000000000000100000000000000000000020000000000000000000800000000810000000080000000000000400000000000010000000000020000000000000000000080000000000040800000200000000002000020200000000402000001000000000000000000000000004000008020000000000001000000040000004000000400100000100000000020000000000000000000000000000000000000000200000000000000000000100000", + "blockHash": "0xa146a85331ab1181b9645a1dc8c4221c43e351917ea121bf0db5c496b05317b4", + "transactionHash": "0x9b12b426ba11913e8e48195791f52d8d122c48cc424bd5a4a9f930c10fac4fc1", + "logs": [ + { + "transactionIndex": 17, + "blockNumber": 29772195, + "transactionHash": "0x9b12b426ba11913e8e48195791f52d8d122c48cc424bd5a4a9f930c10fac4fc1", + "address": "0xBbb56145d961742b1f3E3fc2b91077639C8C302a", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000eef6af6297504f30ffec8a4e3642d6da6a15632f" + ], + "data": "0x", + "logIndex": 74, + "blockHash": "0xa146a85331ab1181b9645a1dc8c4221c43e351917ea121bf0db5c496b05317b4" + }, + { + "transactionIndex": 17, + "blockNumber": 29772195, + "transactionHash": "0x9b12b426ba11913e8e48195791f52d8d122c48cc424bd5a4a9f930c10fac4fc1", + "address": "0xBbb56145d961742b1f3E3fc2b91077639C8C302a", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000aee4acd5c4bf516330ca8fe11b07206fc6709294" + ], + "data": "0x", + "logIndex": 75, + "blockHash": "0xa146a85331ab1181b9645a1dc8c4221c43e351917ea121bf0db5c496b05317b4" + }, + { + "transactionIndex": 17, + "blockNumber": 29772195, + "transactionHash": "0x9b12b426ba11913e8e48195791f52d8d122c48cc424bd5a4a9f930c10fac4fc1", + "address": "0xBbb56145d961742b1f3E3fc2b91077639C8C302a", + "topics": [ + "0xda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df" + ], + "data": "0x2f8eeb980ebc1342070a35514e1f42fa96381de8f080d3713e80fe99c883d4e9018683c5d2f1f71d7e8b65ab0990635c019de9183359db7e80543c485426e490", + "logIndex": 76, + "blockHash": "0xa146a85331ab1181b9645a1dc8c4221c43e351917ea121bf0db5c496b05317b4" + }, + { + "transactionIndex": 17, + "blockNumber": 29772195, + "transactionHash": "0x9b12b426ba11913e8e48195791f52d8d122c48cc424bd5a4a9f930c10fac4fc1", + "address": "0xBbb56145d961742b1f3E3fc2b91077639C8C302a", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000003", + "logIndex": 77, + "blockHash": "0xa146a85331ab1181b9645a1dc8c4221c43e351917ea121bf0db5c496b05317b4" + }, + { + "transactionIndex": 17, + "blockNumber": 29772195, + "transactionHash": "0x9b12b426ba11913e8e48195791f52d8d122c48cc424bd5a4a9f930c10fac4fc1", + "address": "0xBbb56145d961742b1f3E3fc2b91077639C8C302a", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002110475dfbb8d331b300178a867372991ff35fa3", + "logIndex": 78, + "blockHash": "0xa146a85331ab1181b9645a1dc8c4221c43e351917ea121bf0db5c496b05317b4" + }, + { + "transactionIndex": 17, + "blockNumber": 29772195, + "transactionHash": "0x9b12b426ba11913e8e48195791f52d8d122c48cc424bd5a4a9f930c10fac4fc1", + "address": "0x0000000000000000000000000000000000001010", + "topics": [ + "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", + "0x0000000000000000000000000000000000000000000000000000000000001010", + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x000000000000000000000000c26880a0af2ea0c7e8130e6ec47af756465452e8" + ], + "data": "0x000000000000000000000000000000000000000000000000000384e4c3881b620000000000000000000000000000000000000000000000001b619ccd44b2befb00000000000000000000000000000000000000000000187b2cfa11981a88ce040000000000000000000000000000000000000000000000001b5e17e8812aa39900000000000000000000000000000000000000000000187b2cfd967cde10e966", + "logIndex": 79, + "blockHash": "0xa146a85331ab1181b9645a1dc8c4221c43e351917ea121bf0db5c496b05317b4" + } + ], + "blockNumber": 29772195, + "cumulativeGasUsed": "8518986", + "status": 1, + "byzantium": true + }, + "args": [ + "0xEeF6Af6297504f30FFeC8a4E3642d6Da6A15632f", + "0x2110475dfbB8d331b300178A867372991ff35fA3", + "0xc9cdef042f8eeb980ebc1342070a35514e1f42fa96381de8f080d3713e80fe99c883d4e9018683c5d2f1f71d7e8b65ab0990635c019de9183359db7e80543c485426e490000000000000000000000000aee4acd5c4bf516330ca8fe11b07206fc6709294" + ], + "numDeployments": 1, + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", + "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0xa2b22da3032e50b55f95ec1d13336102d675f341167aa76db571ef7f8bb7975d\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overridden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0xc130fe33f1b2132158531a87734153293f6d07bc263ff4ac90e85da9c82c0e27\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n /// @solidity memory-safe-assembly\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xd5c50c54bf02740ebd122ff06832546cb5fa84486d52695a9ccfd11666e0c81d\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(\\n address newImplementation,\\n bytes calldata data\\n ) external payable ifAdmin {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x1663761dc98da7a84e6570b428877de7de9859e34f99c7002cad71ccfc9d6283\",\"license\":\"MIT\"}},\"version\":1}", + "bytecode": "0x608060405260405162000eeb38038062000eeb8339810160408190526200002691620004ed565b828162000036828260006200009a565b5062000066905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005cd565b60008051602062000ea483398151915214620000865762000086620005f3565b6200009182620000d7565b5050506200065c565b620000a58362000132565b600082511180620000b35750805b15620000d257620000d083836200017460201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f62000102620001a3565b604080516001600160a01b03928316815291841660208301520160405180910390a16200012f81620001dc565b50565b6200013d8162000291565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606200019c838360405180606001604052806027815260200162000ec46027913962000345565b9392505050565b6000620001cd60008051602062000ea483398151915260001b620003c460201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002475760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b806200027060008051602062000ea483398151915260001b620003c460201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002a781620003c760201b6200025a1760201c565b6200030b5760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200023e565b80620002707f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b620003c460201b620001ea1760201c565b6060600080856001600160a01b03168560405162000364919062000609565b600060405180830381855af49150503d8060008114620003a1576040519150601f19603f3d011682016040523d82523d6000602084013e620003a6565b606091505b509092509050620003ba86838387620003d6565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200044a57825160000362000442576001600160a01b0385163b620004425760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016200023e565b508162000456565b6200045683836200045e565b949350505050565b8151156200046f5781518083602001fd5b8060405162461bcd60e51b81526004016200023e919062000627565b80516001600160a01b0381168114620004a357600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004db578181015183820152602001620004c1565b83811115620000d05750506000910152565b6000806000606084860312156200050357600080fd5b6200050e846200048b565b92506200051e602085016200048b565b60408501519092506001600160401b03808211156200053c57600080fd5b818601915086601f8301126200055157600080fd5b815181811115620005665762000566620004a8565b604051601f8201601f19908116603f01168101908382118183101715620005915762000591620004a8565b81604052828152896020848701011115620005ab57600080fd5b620005be836020830160208801620004be565b80955050505050509250925092565b600082821015620005ee57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b600082516200061d818460208701620004be565b9190910192915050565b602081526000825180602084015262000648816040850160208701620004be565b601f01601f19169190910160400192915050565b610838806200066c6000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106c2565b610118565b61005b6100933660046106dd565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106c2565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107dc602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd610456565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b6103688361047e565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a816104be565b6060600080856001600160a01b0316856040516103fb919061078c565b600060405180830381855af49150503d8060008114610436576040519150601f19603f3d011682016040523d82523d6000602084013e61043b565b606091505b509150915061044c86838387610567565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b610487816105e8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105235760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105d65782516000036105cf576001600160a01b0385163b6105cf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102f5565b50816105e0565b6105e0838361067c565b949350505050565b6001600160a01b0381163b6106555760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610546565b81511561068c5781518083602001fd5b8060405162461bcd60e51b81526004016102f591906107a8565b80356001600160a01b03811681146106bd57600080fd5b919050565b6000602082840312156106d457600080fd5b610253826106a6565b6000806000604084860312156106f257600080fd5b6106fb846106a6565b9250602084013567ffffffffffffffff8082111561071857600080fd5b818601915086601f83011261072c57600080fd5b81358181111561073b57600080fd5b87602082850101111561074d57600080fd5b6020830194508093505050509250925092565b60005b8381101561077b578181015183820152602001610763565b838111156103845750506000910152565b6000825161079e818460208701610760565b9190910192915050565b60208152600082518060208401526107c7816040850160208701610760565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e2b2f80d01b9fee1887f086f33ea33eabe6a896123f3722976ea73e069c365b664736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", + "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106c2565b610118565b61005b6100933660046106dd565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106c2565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107dc602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd610456565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b6103688361047e565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a816104be565b6060600080856001600160a01b0316856040516103fb919061078c565b600060405180830381855af49150503d8060008114610436576040519150601f19603f3d011682016040523d82523d6000602084013e61043b565b606091505b509150915061044c86838387610567565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b610487816105e8565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105235760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105d65782516000036105cf576001600160a01b0385163b6105cf5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064016102f5565b50816105e0565b6105e0838361067c565b949350505050565b6001600160a01b0381163b6106555760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610546565b81511561068c5781518083602001fd5b8060405162461bcd60e51b81526004016102f591906107a8565b80356001600160a01b03811681146106bd57600080fd5b919050565b6000602082840312156106d457600080fd5b610253826106a6565b6000806000604084860312156106f257600080fd5b6106fb846106a6565b9250602084013567ffffffffffffffff8082111561071857600080fd5b818601915086601f83011261072c57600080fd5b81358181111561073b57600080fd5b87602082850101111561074d57600080fd5b6020830194508093505050509250925092565b60005b8381101561077b578181015183820152602001610763565b838111156103845750506000910152565b6000825161079e818460208701610760565b9190910192915050565b60208152600082518060208401526107c7816040850160208701610760565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a2646970667358221220e2b2f80d01b9fee1887f086f33ea33eabe6a896123f3722976ea73e069c365b664736f6c634300080e0033", + "devdoc": { + "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", + "kind": "dev", + "methods": { + "admin()": { + "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" + }, + "changeAdmin(address)": { + "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." + }, + "constructor": { + "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." + }, + "implementation()": { + "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" + }, + "upgradeTo(address)": { + "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." + }, + "upgradeToAndCall(address,bytes)": { + "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." + } + }, + "version": 1 + }, + "userdoc": { + "kind": "user", + "methods": {}, + "version": 1 + }, + "storageLayout": { + "storage": [], + "types": null + } +} \ No newline at end of file diff --git a/deployments/mumbai/Pythia1Verifier.json b/deployments/mumbaiTestnet/Pythia1Verifier.json similarity index 95% rename from deployments/mumbai/Pythia1Verifier.json rename to deployments/mumbaiTestnet/Pythia1Verifier.json index 992ceba..525ddf4 100644 --- a/deployments/mumbai/Pythia1Verifier.json +++ b/deployments/mumbaiTestnet/Pythia1Verifier.json @@ -1,5 +1,5 @@ { - "address": "0x115dFa344C877fF74e970F06BE10FF5A59EAba02", + "address": "0xDA7124b003AeF27A1C44aEe4d6eB6E2Bb0eF9a08", "abi": [ { "inputs": [ @@ -36,41 +36,41 @@ "type": "function" } ], - "transactionHash": "0x16f1c0c6e8bd77f3d470f3dedda19d89247917fe6f7918e831531d7add662d4a", + "transactionHash": "0xf05587facb684d6b64e8488935d8b87895250046ba1a4ac96dda104a9b3ed7de", "receipt": { "to": null, - "from": "0x346d40b5BF73C5eB43c4c5E55A3fd22d25257DC6", - "contractAddress": "0x115dFa344C877fF74e970F06BE10FF5A59EAba02", - "transactionIndex": 47, + "from": "0x298E8E58549257d122fB0F42B26aCaDBb041f2ED", + "contractAddress": "0xDA7124b003AeF27A1C44aEe4d6eB6E2Bb0eF9a08", + "transactionIndex": 8, "gasUsed": "1221464", - "logsBloom": "0x00000000000000000000000000000000000000000000000000000010000000000000000000000020000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000010000000000000000000008000200000000000000000000000000000000000000000000000000000000000004000000000000000000001000000000000000000000000000000100000001000000000000000000000000000000000000000000000000000000020000000100000", - "blockHash": "0xcf9a0856f376a52189220b0ce35d92734ae301243530ed010e48c813e542bddc", - "transactionHash": "0x16f1c0c6e8bd77f3d470f3dedda19d89247917fe6f7918e831531d7add662d4a", + "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000008000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000040000000200000000000000000080000000002000000000000000000000000000000004000008000000000000001000000000100000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000100000", + "blockHash": "0x74b8b31576aa78f629df01caabe9f481bf4d7742441ed4b827acee9ca92a4d80", + "transactionHash": "0xf05587facb684d6b64e8488935d8b87895250046ba1a4ac96dda104a9b3ed7de", "logs": [ { - "transactionIndex": 47, - "blockNumber": 28600078, - "transactionHash": "0x16f1c0c6e8bd77f3d470f3dedda19d89247917fe6f7918e831531d7add662d4a", + "transactionIndex": 8, + "blockNumber": 29772157, + "transactionHash": "0xf05587facb684d6b64e8488935d8b87895250046ba1a4ac96dda104a9b3ed7de", "address": "0x0000000000000000000000000000000000001010", "topics": [ "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000346d40b5bf73c5eb43c4c5e55a3fd22d25257dc6", - "0x000000000000000000000000f903ba9e006193c1527bfbe65fe2123704ea3f99" + "0x000000000000000000000000298e8e58549257d122fb0f42b26acadbb041f2ed", + "0x0000000000000000000000003a22c8bc68e98b0faf40f349dd2b2890fae01484" ], - "data": "0x000000000000000000000000000000000000000000000000001569ae17fbc83800000000000000000000000000000000000000000000000080b66afa93ee8ef40000000000000000000000000000000000000000000007c52cad548d0060ac1200000000000000000000000000000000000000000000000080a1014c7bf2c6bc0000000000000000000000000000000000000000000007c52cc2be3b185c744a", - "logIndex": 268, - "blockHash": "0xcf9a0856f376a52189220b0ce35d92734ae301243530ed010e48c813e542bddc" + "data": "0x0000000000000000000000000000000000000000000000000006825f5f97e1500000000000000000000000000000000000000000000000001b727dea7151c011000000000000000000000000000000000000000000000108f56773eb63d4f1fe0000000000000000000000000000000000000000000000001b6bfb8b11b9dec1000000000000000000000000000000000000000000000108f56df64ac36cd34e", + "logIndex": 20, + "blockHash": "0x74b8b31576aa78f629df01caabe9f481bf4d7742441ed4b827acee9ca92a4d80" } ], - "blockNumber": 28600078, - "cumulativeGasUsed": "9445272", + "blockNumber": 29772157, + "cumulativeGasUsed": "3573197", "status": 1, "byzantium": true }, "args": [], "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", + "solcInputHash": "61c38ae61d36c4e0fe74ede913f00b14", "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"a\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2][2]\",\"name\":\"b\",\"type\":\"uint256[2][2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"c\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[9]\",\"name\":\"input\",\"type\":\"uint256[9]\"}],\"name\":\"verifyProof\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"r\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"verifyProof(uint256[2],uint256[2][2],uint256[2],uint256[9])\":{\"returns\":{\"r\":\" bool true if proof is valid\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@sismo-core/pythia-1/contracts/Pythia1Verifier.sol\":\"Pythia1Verifier\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@sismo-core/pythia-1/contracts/Pythia1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract Pythia1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\\n );\\n vk.IC = new Pairing.G1Point[](10);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 104028078850975554065172701281783302003220555203883119831575537681421753151,\\n 19148240629904598794948591359118971959790791697910953160820265703277306346\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[9] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3babb956e64535b9bf535df94288b4d83ea82c54727f79ee8949fe4a19c1d5ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", "bytecode": "0x608060405234801561001057600080fd5b5061151f806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c542c93b14610030575b600080fd5b61004361003e366004611356565b610057565b604051901515815260200160405180910390f35b6000610061611169565b60408051808201825287518152602080890151818301529083528151608081018352875151818401908152885183015160608301528152825180840184528883018051518252518301518184015281830152838201528151808301835286518152868201518183015283830152815160098082526101408201909352600092909182016101208036833701905050905060005b60098110156101435784816009811061010f5761010f611434565b602002015182828151811061012657610126611434565b60209081029190910101528061013b81611460565b9150506100f4565b5061014e818361016f565b60000361016057600192505050610167565b6000925050505b949350505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018161019b610366565b9050806080015151855160016101b19190611479565b146101f85760405162461bcd60e51b81526020600482015260126024820152711d995c9a599a595c8b5898590b5a5b9c1d5d60721b60448201526064015b60405180910390fd5b604080518082019091526000808252602082018190525b86518110156102e9578387828151811061022b5761022b611434565b6020026020010151106102805760405162461bcd60e51b815260206004820152601f60248201527f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c640060448201526064016101ef565b6102d5826102d085608001518460016102999190611479565b815181106102a9576102a9611434565b60200260200101518a85815181106102c3576102c3611434565b6020026020010151610ab8565b610b4e565b9150806102e181611460565b91505061020f565b5061031281836080015160008151811061030557610305611434565b6020026020010151610b4e565b90506103486103248660000151610be7565b8660200151846000015185602001518587604001518b604001518960600151610c86565b6103585760019350505050610360565b600093505050505b92915050565b61036e6111ba565b6040805180820182527f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e281527f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d19266020808301919091529083528151608080820184527f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c8285019081527f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab606080850191909152908352845180860186527f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a781527f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec8818601528385015285840192909252835180820185527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28186019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed828501528152845180860186527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa818601528185015285850152835190810184527f174892b5bad4ddcfd89eda92cc1a5fb630cfd006cdb1659b082e3fae39df9b9c8185019081527f256176846e5a9b02d671495ae4d617f2bd45ce621c1a181cb505f4b5b8b785ae828401528152835180850185527f02ca7609b5aecf9430434e2f4ecb35f1d85090b34f1e9db416b6ed27a47211ac81527f232e1bb08a19b6cc0e639c831b21a6fefdb07f9361801b61dcab9871483b7c528185015281840152908401528151600a8082526101608201909352919082015b60408051808201909152600080825260208201528152602001906001900390816105ea57505060808201908152604080518082019091527f0c32e6a2033cd6027d1a46a68265e41b8a47bfb7a3e130a2c0f533ef102de83d81527f0cc770fbf603ef9467a0c6e6cc28e85214afd8411c933e69178479d2841e976c60208201529051805160009061067d5761067d611434565b602002602001018190525060405180604001604052807f1c12c8210513044ddb9ea2a7cfb8f3b529b6d43abe416e35c005a63a6fffc83a81526020017f11921fe7e6b849a03a0428e49a6465a87f3c98016eb6d13ad110ab15ee0cb5bd81525081608001516001815181106106f4576106f4611434565b602002602001018190525060405180604001604052807e3ae0b7e630d0708e4da300f02dd27c42654381541ab974a678042eb4fadb3f81526020017e0ad667b81d05c6e95487a6140ca0dc3ba85d47509073a2c1b457cfbf67a1ea815250816080015160028151811061076957610769611434565b602002602001018190525060405180604001604052807f0bea1f762ed1b817dddb25a7b7e60f69ff7671eb72fe695a8a24b620fae6515381526020017f069f91831bbeea0bcb8e658c68c110e35e033ae01637be60803083e3696b439181525081608001516003815181106107e0576107e0611434565b602002602001018190525060405180604001604052807f1d8a4973e60e7186c4dd89fd553304f628ebac9870b43dead962ce96064803a681526020017f1ce0f6623640030a2a8210d5e37d04e983127c85dd0bca8f503b2b24c8ad04d1815250816080015160048151811061085757610857611434565b602002602001018190525060405180604001604052807f1955b5fc797055fe5682e71ee08375742622a371f736e40a827fde747dbc7b1881526020017f259ab98a8122832a5779c0c1373733a1d9204803eabd831c550583852bab2c1e81525081608001516005815181106108ce576108ce611434565b602002602001018190525060405180604001604052807f0f2d07869bdb9a50651a2ad87da88a78d29bc7f5abb0c866769189f94f3b37d581526020017f3042b79c235d1a7e6781dde92773e7a52276a8912fe06de16a781d3995ed1319815250816080015160068151811061094557610945611434565b602002602001018190525060405180604001604052807f14dde6710af95fd2d6c49a1cadc761ae8b093e2b80fe9d7b980538baf49b854981526020017f0c4f6f112e147b22270b3c65f5d65a07842b81682deb09f6d4236dac4b9b1fd081525081608001516007815181106109bc576109bc611434565b602002602001018190525060405180604001604052807f1239824d3a77d0e97d55504525df59d36e148fab147bc75b41e74e47478c5f6c81526020017f25393a4bf81046bad1869efc59edfb1a6b379d1d1eab45fcb634b73c0108ebf98152508160800151600881518110610a3357610a33611434565b602002602001018190525060405180604001604052807f13ae19e280548637b1ce4de3d1405ffdd1d8838f2c34a3017cb05810880cd9a481526020017f0803bdf0743261ea96d28d68f7f3cce9505ad2dbce28eb78ba7ccc002c93991a8152508160800151600981518110610aaa57610aaa611434565b602002602001018190525090565b6040805180820190915260008082526020820152610ad461120b565b835181526020808501519082015260408101839052600060608360808460076107d05a03fa90508080610b0357fe5b5080610b465760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5b5d5b0b59985a5b195960721b60448201526064016101ef565b505092915050565b6040805180820190915260008082526020820152610b6a611229565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa90508080610ba457fe5b5080610b465760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5859190b59985a5b195960721b60448201526064016101ef565b604080518082019091526000808252602082015281517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4790158015610c2e57506020830151155b15610c4e5750506040805180820190915260008082526020820152919050565b604051806040016040528084600001518152602001828560200151610c739190611491565b610c7d90846114b3565b90529392505050565b60408051600480825260a08201909252600091829190816020015b6040805180820190915260008082526020820152815260200190600190039081610ca157505060408051600480825260a0820190925291925060009190602082015b610ceb611247565b815260200190600190039081610ce35790505090508a82600081518110610d1457610d14611434565b60200260200101819052508882600181518110610d3357610d33611434565b60200260200101819052508682600281518110610d5257610d52611434565b60200260200101819052508482600381518110610d7157610d71611434565b60200260200101819052508981600081518110610d9057610d90611434565b60200260200101819052508781600181518110610daf57610daf611434565b60200260200101819052508581600281518110610dce57610dce611434565b60200260200101819052508381600381518110610ded57610ded611434565b6020026020010181905250610e028282610e11565b9b9a5050505050505050505050565b60008151835114610e5d5760405162461bcd60e51b81526020600482015260166024820152751c185a5c9a5b99cb5b195b99dd1a1ccb59985a5b195960521b60448201526064016101ef565b82516000610e6c8260066114ca565b905060008167ffffffffffffffff811115610e8957610e896112a3565b604051908082528060200260200182016040528015610eb2578160200160208202803683370190505b50905060005b838110156110ed57868181518110610ed257610ed2611434565b60200260200101516000015182826006610eec91906114ca565b610ef7906000611479565b81518110610f0757610f07611434565b602002602001018181525050868181518110610f2557610f25611434565b60200260200101516020015182826006610f3f91906114ca565b610f4a906001611479565b81518110610f5a57610f5a611434565b602002602001018181525050858181518110610f7857610f78611434565b6020908102919091010151515182610f918360066114ca565b610f9c906002611479565b81518110610fac57610fac611434565b602002602001018181525050858181518110610fca57610fca611434565b60209081029190910181015151015182610fe58360066114ca565b610ff0906003611479565b8151811061100057611000611434565b60200260200101818152505085818151811061101e5761101e611434565b60200260200101516020015160006002811061103c5761103c611434565b60200201518261104d8360066114ca565b611058906004611479565b8151811061106857611068611434565b60200260200101818152505085818151811061108657611086611434565b6020026020010151602001516001600281106110a4576110a4611434565b6020020151826110b58360066114ca565b6110c0906005611479565b815181106110d0576110d0611434565b6020908102919091010152806110e581611460565b915050610eb8565b506110f6611267565b6000602082602086026020860160086107d05a03fa9050808061111557fe5b508061115b5760405162461bcd60e51b81526020600482015260156024820152741c185a5c9a5b99cb5bdc18dbd9194b59985a5b1959605a1b60448201526064016101ef565b505115159695505050505050565b6040805160a081019091526000606082018181526080830191909152815260208101611193611247565b81526020016111b5604051806040016040528060008152602001600081525090565b905290565b6040805160e08101909152600060a0820181815260c08301919091528152602081016111e4611247565b81526020016111f1611247565b81526020016111fe611247565b8152602001606081525090565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b604051806040016040528061125a611285565b81526020016111b5611285565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156112dc576112dc6112a3565b60405290565b604051610120810167ffffffffffffffff811182821017156112dc576112dc6112a3565b600082601f83011261131757600080fd5b61131f6112b9565b80604084018581111561133157600080fd5b845b8181101561134b578035845260209384019301611333565b509095945050505050565b60008060008061022080868803121561136e57600080fd5b6113788787611306565b9450604087605f88011261138b57600080fd5b6113936112b9565b8060c089018a8111156113a557600080fd5b838a015b818110156113ca576113bb8c82611306565b845260209093019284016113a9565b508197506113d88b82611306565b9650505050508661011f8701126113ee57600080fd5b6113f66112e2565b90860190808883111561140857600080fd5b61010088015b8381101561142657803583526020928301920161140e565b509598949750929550505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016114725761147261144a565b5060010190565b6000821982111561148c5761148c61144a565b500190565b6000826114ae57634e487b7160e01b600052601260045260246000fd5b500690565b6000828210156114c5576114c561144a565b500390565b60008160001904831182151516156114e4576114e461144a565b50029056fea264697066735822122064ca8e728369809bbfe58b0cff27a54a0e5e793919a8ed928a392738c3f2924564736f6c634300080e0033", "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c542c93b14610030575b600080fd5b61004361003e366004611356565b610057565b604051901515815260200160405180910390f35b6000610061611169565b60408051808201825287518152602080890151818301529083528151608081018352875151818401908152885183015160608301528152825180840184528883018051518252518301518184015281830152838201528151808301835286518152868201518183015283830152815160098082526101408201909352600092909182016101208036833701905050905060005b60098110156101435784816009811061010f5761010f611434565b602002015182828151811061012657610126611434565b60209081029190910101528061013b81611460565b9150506100f4565b5061014e818361016f565b60000361016057600192505050610167565b6000925050505b949350505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018161019b610366565b9050806080015151855160016101b19190611479565b146101f85760405162461bcd60e51b81526020600482015260126024820152711d995c9a599a595c8b5898590b5a5b9c1d5d60721b60448201526064015b60405180910390fd5b604080518082019091526000808252602082018190525b86518110156102e9578387828151811061022b5761022b611434565b6020026020010151106102805760405162461bcd60e51b815260206004820152601f60248201527f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c640060448201526064016101ef565b6102d5826102d085608001518460016102999190611479565b815181106102a9576102a9611434565b60200260200101518a85815181106102c3576102c3611434565b6020026020010151610ab8565b610b4e565b9150806102e181611460565b91505061020f565b5061031281836080015160008151811061030557610305611434565b6020026020010151610b4e565b90506103486103248660000151610be7565b8660200151846000015185602001518587604001518b604001518960600151610c86565b6103585760019350505050610360565b600093505050505b92915050565b61036e6111ba565b6040805180820182527f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e281527f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d19266020808301919091529083528151608080820184527f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c8285019081527f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab606080850191909152908352845180860186527f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a781527f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec8818601528385015285840192909252835180820185527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28186019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed828501528152845180860186527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa818601528185015285850152835190810184527f174892b5bad4ddcfd89eda92cc1a5fb630cfd006cdb1659b082e3fae39df9b9c8185019081527f256176846e5a9b02d671495ae4d617f2bd45ce621c1a181cb505f4b5b8b785ae828401528152835180850185527f02ca7609b5aecf9430434e2f4ecb35f1d85090b34f1e9db416b6ed27a47211ac81527f232e1bb08a19b6cc0e639c831b21a6fefdb07f9361801b61dcab9871483b7c528185015281840152908401528151600a8082526101608201909352919082015b60408051808201909152600080825260208201528152602001906001900390816105ea57505060808201908152604080518082019091527f0c32e6a2033cd6027d1a46a68265e41b8a47bfb7a3e130a2c0f533ef102de83d81527f0cc770fbf603ef9467a0c6e6cc28e85214afd8411c933e69178479d2841e976c60208201529051805160009061067d5761067d611434565b602002602001018190525060405180604001604052807f1c12c8210513044ddb9ea2a7cfb8f3b529b6d43abe416e35c005a63a6fffc83a81526020017f11921fe7e6b849a03a0428e49a6465a87f3c98016eb6d13ad110ab15ee0cb5bd81525081608001516001815181106106f4576106f4611434565b602002602001018190525060405180604001604052807e3ae0b7e630d0708e4da300f02dd27c42654381541ab974a678042eb4fadb3f81526020017e0ad667b81d05c6e95487a6140ca0dc3ba85d47509073a2c1b457cfbf67a1ea815250816080015160028151811061076957610769611434565b602002602001018190525060405180604001604052807f0bea1f762ed1b817dddb25a7b7e60f69ff7671eb72fe695a8a24b620fae6515381526020017f069f91831bbeea0bcb8e658c68c110e35e033ae01637be60803083e3696b439181525081608001516003815181106107e0576107e0611434565b602002602001018190525060405180604001604052807f1d8a4973e60e7186c4dd89fd553304f628ebac9870b43dead962ce96064803a681526020017f1ce0f6623640030a2a8210d5e37d04e983127c85dd0bca8f503b2b24c8ad04d1815250816080015160048151811061085757610857611434565b602002602001018190525060405180604001604052807f1955b5fc797055fe5682e71ee08375742622a371f736e40a827fde747dbc7b1881526020017f259ab98a8122832a5779c0c1373733a1d9204803eabd831c550583852bab2c1e81525081608001516005815181106108ce576108ce611434565b602002602001018190525060405180604001604052807f0f2d07869bdb9a50651a2ad87da88a78d29bc7f5abb0c866769189f94f3b37d581526020017f3042b79c235d1a7e6781dde92773e7a52276a8912fe06de16a781d3995ed1319815250816080015160068151811061094557610945611434565b602002602001018190525060405180604001604052807f14dde6710af95fd2d6c49a1cadc761ae8b093e2b80fe9d7b980538baf49b854981526020017f0c4f6f112e147b22270b3c65f5d65a07842b81682deb09f6d4236dac4b9b1fd081525081608001516007815181106109bc576109bc611434565b602002602001018190525060405180604001604052807f1239824d3a77d0e97d55504525df59d36e148fab147bc75b41e74e47478c5f6c81526020017f25393a4bf81046bad1869efc59edfb1a6b379d1d1eab45fcb634b73c0108ebf98152508160800151600881518110610a3357610a33611434565b602002602001018190525060405180604001604052807f13ae19e280548637b1ce4de3d1405ffdd1d8838f2c34a3017cb05810880cd9a481526020017f0803bdf0743261ea96d28d68f7f3cce9505ad2dbce28eb78ba7ccc002c93991a8152508160800151600981518110610aaa57610aaa611434565b602002602001018190525090565b6040805180820190915260008082526020820152610ad461120b565b835181526020808501519082015260408101839052600060608360808460076107d05a03fa90508080610b0357fe5b5080610b465760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5b5d5b0b59985a5b195960721b60448201526064016101ef565b505092915050565b6040805180820190915260008082526020820152610b6a611229565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa90508080610ba457fe5b5080610b465760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5859190b59985a5b195960721b60448201526064016101ef565b604080518082019091526000808252602082015281517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4790158015610c2e57506020830151155b15610c4e5750506040805180820190915260008082526020820152919050565b604051806040016040528084600001518152602001828560200151610c739190611491565b610c7d90846114b3565b90529392505050565b60408051600480825260a08201909252600091829190816020015b6040805180820190915260008082526020820152815260200190600190039081610ca157505060408051600480825260a0820190925291925060009190602082015b610ceb611247565b815260200190600190039081610ce35790505090508a82600081518110610d1457610d14611434565b60200260200101819052508882600181518110610d3357610d33611434565b60200260200101819052508682600281518110610d5257610d52611434565b60200260200101819052508482600381518110610d7157610d71611434565b60200260200101819052508981600081518110610d9057610d90611434565b60200260200101819052508781600181518110610daf57610daf611434565b60200260200101819052508581600281518110610dce57610dce611434565b60200260200101819052508381600381518110610ded57610ded611434565b6020026020010181905250610e028282610e11565b9b9a5050505050505050505050565b60008151835114610e5d5760405162461bcd60e51b81526020600482015260166024820152751c185a5c9a5b99cb5b195b99dd1a1ccb59985a5b195960521b60448201526064016101ef565b82516000610e6c8260066114ca565b905060008167ffffffffffffffff811115610e8957610e896112a3565b604051908082528060200260200182016040528015610eb2578160200160208202803683370190505b50905060005b838110156110ed57868181518110610ed257610ed2611434565b60200260200101516000015182826006610eec91906114ca565b610ef7906000611479565b81518110610f0757610f07611434565b602002602001018181525050868181518110610f2557610f25611434565b60200260200101516020015182826006610f3f91906114ca565b610f4a906001611479565b81518110610f5a57610f5a611434565b602002602001018181525050858181518110610f7857610f78611434565b6020908102919091010151515182610f918360066114ca565b610f9c906002611479565b81518110610fac57610fac611434565b602002602001018181525050858181518110610fca57610fca611434565b60209081029190910181015151015182610fe58360066114ca565b610ff0906003611479565b8151811061100057611000611434565b60200260200101818152505085818151811061101e5761101e611434565b60200260200101516020015160006002811061103c5761103c611434565b60200201518261104d8360066114ca565b611058906004611479565b8151811061106857611068611434565b60200260200101818152505085818151811061108657611086611434565b6020026020010151602001516001600281106110a4576110a4611434565b6020020151826110b58360066114ca565b6110c0906005611479565b815181106110d0576110d0611434565b6020908102919091010152806110e581611460565b915050610eb8565b506110f6611267565b6000602082602086026020860160086107d05a03fa9050808061111557fe5b508061115b5760405162461bcd60e51b81526020600482015260156024820152741c185a5c9a5b99cb5bdc18dbd9194b59985a5b1959605a1b60448201526064016101ef565b505115159695505050505050565b6040805160a081019091526000606082018181526080830191909152815260208101611193611247565b81526020016111b5604051806040016040528060008152602001600081525090565b905290565b6040805160e08101909152600060a0820181815260c08301919091528152602081016111e4611247565b81526020016111f1611247565b81526020016111fe611247565b8152602001606081525090565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b604051806040016040528061125a611285565b81526020016111b5611285565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156112dc576112dc6112a3565b60405290565b604051610120810167ffffffffffffffff811182821017156112dc576112dc6112a3565b600082601f83011261131757600080fd5b61131f6112b9565b80604084018581111561133157600080fd5b845b8181101561134b578035845260209384019301611333565b509095945050505050565b60008060008061022080868803121561136e57600080fd5b6113788787611306565b9450604087605f88011261138b57600080fd5b6113936112b9565b8060c089018a8111156113a557600080fd5b838a015b818110156113ca576113bb8c82611306565b845260209093019284016113a9565b508197506113d88b82611306565b9650505050508661011f8701126113ee57600080fd5b6113f66112e2565b90860190808883111561140857600080fd5b61010088015b8381101561142657803583526020928301920161140e565b509598949750929550505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016114725761147261144a565b5060010190565b6000821982111561148c5761148c61144a565b500190565b6000826114ae57634e487b7160e01b600052601260045260246000fd5b500690565b6000828210156114c5576114c561144a565b500390565b60008160001904831182151516156114e4576114e461144a565b50029056fea264697066735822122064ca8e728369809bbfe58b0cff27a54a0e5e793919a8ed928a392738c3f2924564736f6c634300080e0033", diff --git a/deployments/goerli/solcInputs/61c38ae61d36c4e0fe74ede913f00b14.json b/deployments/mumbaiTestnet/solcInputs/61c38ae61d36c4e0fe74ede913f00b14.json similarity index 100% rename from deployments/goerli/solcInputs/61c38ae61d36c4e0fe74ede913f00b14.json rename to deployments/mumbaiTestnet/solcInputs/61c38ae61d36c4e0fe74ede913f00b14.json diff --git a/deployments/sandboxPolygon/.chainId b/deployments/sandboxPolygon/.chainId deleted file mode 100644 index 0973804..0000000 --- a/deployments/sandboxPolygon/.chainId +++ /dev/null @@ -1 +0,0 @@ -137 \ No newline at end of file diff --git a/deployments/sandboxPolygon/AttestationsRegistryProxy.json b/deployments/sandboxPolygon/AttestationsRegistryProxy.json deleted file mode 100644 index d772f45..0000000 --- a/deployments/sandboxPolygon/AttestationsRegistryProxy.json +++ /dev/null @@ -1,264 +0,0 @@ -{ - "address": "0xC999390A856e0633f945dD851DeeCE15b533ccA3", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x4e707a0f3e31f6c1da80877fa83dc03d20207abd3e93bbc3175f9a074dd6b32f", - "receipt": { - "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0xC999390A856e0633f945dD851DeeCE15b533ccA3", - "transactionIndex": 84, - "gasUsed": "609943", - "logsBloom": "0x00000000000000200000000000000000400000000000000000800000000000000000000000000000000000000000000000008000010000000000000000000000200000000000000000000000000002800001000000000000000100000000000000000000020000000000000000000800000000800000000088000000040000400000000000000000000000100000000000000008000000000000000000800000200000000000000000000000000000000000000000000000000000000000004000000120000000000001000000000000000000000400000000100004004020002000000000000000000000000000000000000000000000000000000000100000", - "blockHash": "0xab37c4ac5229e3362c28ddeeeb6528f5d8f07a23d473940311921940acb41350", - "transactionHash": "0x4e707a0f3e31f6c1da80877fa83dc03d20207abd3e93bbc3175f9a074dd6b32f", - "logs": [ - { - "transactionIndex": 84, - "blockNumber": 32513024, - "transactionHash": "0x4e707a0f3e31f6c1da80877fa83dc03d20207abd3e93bbc3175f9a074dd6b32f", - "address": "0xC999390A856e0633f945dD851DeeCE15b533ccA3", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000eeba69785a8019900e1dd28d865be99d246f71a4" - ], - "data": "0x", - "logIndex": 418, - "blockHash": "0xab37c4ac5229e3362c28ddeeeb6528f5d8f07a23d473940311921940acb41350" - }, - { - "transactionIndex": 84, - "blockNumber": 32513024, - "transactionHash": "0x4e707a0f3e31f6c1da80877fa83dc03d20207abd3e93bbc3175f9a074dd6b32f", - "address": "0xC999390A856e0633f945dD851DeeCE15b533ccA3", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e" - ], - "data": "0x", - "logIndex": 419, - "blockHash": "0xab37c4ac5229e3362c28ddeeeb6528f5d8f07a23d473940311921940acb41350" - }, - { - "transactionIndex": 84, - "blockNumber": 32513024, - "transactionHash": "0x4e707a0f3e31f6c1da80877fa83dc03d20207abd3e93bbc3175f9a074dd6b32f", - "address": "0xC999390A856e0633f945dD851DeeCE15b533ccA3", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002110475dfbb8d331b300178a867372991ff35fa3", - "logIndex": 420, - "blockHash": "0xab37c4ac5229e3362c28ddeeeb6528f5d8f07a23d473940311921940acb41350" - }, - { - "transactionIndex": 84, - "blockNumber": 32513024, - "transactionHash": "0x4e707a0f3e31f6c1da80877fa83dc03d20207abd3e93bbc3175f9a074dd6b32f", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x0000000000000000000000001efecb61a2f80aa34d3b9218b564a64d05946290" - ], - "data": "0x0000000000000000000000000000000000000000000000000063d4a875b15dab0000000000000000000000000000000000000000000000002d62c7bb66747b330000000000000000000000000000000000000000000008aeddb8aaf62b4df09d0000000000000000000000000000000000000000000000002cfef312f0c31d880000000000000000000000000000000000000000000008aede1c7f9ea0ff4e48", - "logIndex": 421, - "blockHash": "0xab37c4ac5229e3362c28ddeeeb6528f5d8f07a23d473940311921940acb41350" - } - ], - "blockNumber": 32513024, - "cumulativeGasUsed": "19030858", - "status": 1, - "byzantium": true - }, - "args": [ - "0xeEBa69785a8019900e1DD28D865be99D246f71A4", - "0x2110475dfbB8d331b300178A867372991ff35fA3", - "0xc4d66de8000000000000000000000000597660c921af06523a458d2596680db1d631732e" - ], - "numDeployments": 1, - "solcInputHash": "c872f238f220b3571ef309821a459203", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/AvailableRootsRegistryProxy.json b/deployments/sandboxPolygon/AvailableRootsRegistryProxy.json deleted file mode 100644 index ae56464..0000000 --- a/deployments/sandboxPolygon/AvailableRootsRegistryProxy.json +++ /dev/null @@ -1,264 +0,0 @@ -{ - "address": "0xb8797eBa1048f6A6AfCbE4F08a582b4Dde69C05d", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0xf3fda09fefd06e2e6830652b0ddf379dc9adbfbafac599239f815ab986cca44f", - "receipt": { - "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0xb8797eBa1048f6A6AfCbE4F08a582b4Dde69C05d", - "transactionIndex": 30, - "gasUsed": "609930", - "logsBloom": "0x00004000000000200000000400000000400000000000000000800000000000000000000008000000000000000000000000008000000000000000000000000000000000000000000000000000000002800001000000000000000100000000000000000000020000000002000000000800000000800000000080000000000000400000000000000000000000100000000000000000000000000000000000800000200000000000000004000000000000000000008000000000000000000000004000000028000004000001000000000000000000000400000000100004000020000000000002000000000000000000000000000000000000000000000000100000", - "blockHash": "0x7f60d200563723d107ea42be096019931abb6b7ca87d5fd9812ec95389757007", - "transactionHash": "0xf3fda09fefd06e2e6830652b0ddf379dc9adbfbafac599239f815ab986cca44f", - "logs": [ - { - "transactionIndex": 30, - "blockNumber": 32513126, - "transactionHash": "0xf3fda09fefd06e2e6830652b0ddf379dc9adbfbafac599239f815ab986cca44f", - "address": "0xb8797eBa1048f6A6AfCbE4F08a582b4Dde69C05d", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000c71fb000981bb051fed063cefa2381f47c937e6a" - ], - "data": "0x", - "logIndex": 102, - "blockHash": "0x7f60d200563723d107ea42be096019931abb6b7ca87d5fd9812ec95389757007" - }, - { - "transactionIndex": 30, - "blockNumber": 32513126, - "transactionHash": "0xf3fda09fefd06e2e6830652b0ddf379dc9adbfbafac599239f815ab986cca44f", - "address": "0xb8797eBa1048f6A6AfCbE4F08a582b4Dde69C05d", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e" - ], - "data": "0x", - "logIndex": 103, - "blockHash": "0x7f60d200563723d107ea42be096019931abb6b7ca87d5fd9812ec95389757007" - }, - { - "transactionIndex": 30, - "blockNumber": 32513126, - "transactionHash": "0xf3fda09fefd06e2e6830652b0ddf379dc9adbfbafac599239f815ab986cca44f", - "address": "0xb8797eBa1048f6A6AfCbE4F08a582b4Dde69C05d", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002110475dfbb8d331b300178a867372991ff35fa3", - "logIndex": 104, - "blockHash": "0x7f60d200563723d107ea42be096019931abb6b7ca87d5fd9812ec95389757007" - }, - { - "transactionIndex": 30, - "blockNumber": 32513126, - "transactionHash": "0xf3fda09fefd06e2e6830652b0ddf379dc9adbfbafac599239f815ab986cca44f", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x000000000000000000000000ec20607aa654d823dd01beb8780a44863c57ed07" - ], - "data": "0x0000000000000000000000000000000000000000000000000063349291a613120000000000000000000000000000000000000000000000002875ea8e3fef74470000000000000000000000000000000000000000000001e28eb05c83afd9b5580000000000000000000000000000000000000000000000002812b5fbae4961350000000000000000000000000000000000000000000001e28f139116417fc86a", - "logIndex": 105, - "blockHash": "0x7f60d200563723d107ea42be096019931abb6b7ca87d5fd9812ec95389757007" - } - ], - "blockNumber": 32513126, - "cumulativeGasUsed": "5301597", - "status": 1, - "byzantium": true - }, - "args": [ - "0xC71FB000981bB051Fed063cEFa2381f47c937E6A", - "0x2110475dfbB8d331b300178A867372991ff35fA3", - "0xc4d66de8000000000000000000000000597660c921af06523a458d2596680db1d631732e" - ], - "numDeployments": 1, - "solcInputHash": "c872f238f220b3571ef309821a459203", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/Badges.json b/deployments/sandboxPolygon/Badges.json deleted file mode 100644 index e616663..0000000 --- a/deployments/sandboxPolygon/Badges.json +++ /dev/null @@ -1,1129 +0,0 @@ -{ - "address": "0x71a7089C56DFf528f330Bc0116C0917cd05B51Fc", - "abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "BadgesNonTransferrable", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - } - ], - "name": "TransferBatch", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "TransferSingle", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "value", - "type": "string" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "URI", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "EVENT_TRIGGERER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "accounts", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - } - ], - "name": "balanceOfBatch", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationsRegistry", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "getAttributeValueForBadge", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "getAttributesNamesAndValuesForBadge", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - }, - { - "internalType": "uint8[]", - "name": "", - "type": "uint8[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "getBadgeExtraData", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "getBadgeIssuer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "getBadgeTimestamp", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeBatchTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistry", - "type": "address" - } - ], - "name": "setAttestationsRegistry", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "setUri", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "triggerTransferEvent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "uri", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x4192c454751f88bb334e8b886fae9ca7a845605753dca2884d04f712d5391d67", - "receipt": { - "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0xc7927B693bd310546b17F38f33028DACa76aB3f0", - "transactionIndex": 49, - "gasUsed": "2131290", - "logsBloom": "0x00000004000000200000000000000000002000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000020000000000000000000800000000010000000080000000000000000040000000150000000000100004000000000000000080000000000000000000200000000000000000000000000400000000000000000000001000000000004000000000000000000001000000040000000000000000000100120004000020000000000000000000000000000000000000000000000000000000000002100000", - "blockHash": "0x6463ab17ec2267ddf3c5cb65df17fedc2fcf2591435de10048c0fa6e48f5fe6d", - "transactionHash": "0x4192c454751f88bb334e8b886fae9ca7a845605753dca2884d04f712d5391d67", - "logs": [ - { - "transactionIndex": 49, - "blockNumber": 36626315, - "transactionHash": "0x4192c454751f88bb334e8b886fae9ca7a845605753dca2884d04f712d5391d67", - "address": "0xc7927B693bd310546b17F38f33028DACa76aB3f0", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000aee4acd5c4bf516330ca8fe11b07206fc6709294", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e" - ], - "data": "0x", - "logIndex": 260, - "blockHash": "0x6463ab17ec2267ddf3c5cb65df17fedc2fcf2591435de10048c0fa6e48f5fe6d" - }, - { - "transactionIndex": 49, - "blockNumber": 36626315, - "transactionHash": "0x4192c454751f88bb334e8b886fae9ca7a845605753dca2884d04f712d5391d67", - "address": "0xc7927B693bd310546b17F38f33028DACa76aB3f0", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 261, - "blockHash": "0x6463ab17ec2267ddf3c5cb65df17fedc2fcf2591435de10048c0fa6e48f5fe6d" - }, - { - "transactionIndex": 49, - "blockNumber": 36626315, - "transactionHash": "0x4192c454751f88bb334e8b886fae9ca7a845605753dca2884d04f712d5391d67", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x0000000000000000000000009ead03f7136fc6b4bdb0780b00a1c14ae5a8b6d0" - ], - "data": "0x0000000000000000000000000000000000000000000000000107ca96b4ce888a000000000000000000000000000000000000000000000000b8bd51a3e02d591e0000000000000000000000000000000000000000000083e270b3d0f5c591b608000000000000000000000000000000000000000000000000b7b5870d2b5ed0940000000000000000000000000000000000000000000083e271bb9b8c7a603e92", - "logIndex": 262, - "blockHash": "0x6463ab17ec2267ddf3c5cb65df17fedc2fcf2591435de10048c0fa6e48f5fe6d" - } - ], - "blockNumber": 36626315, - "cumulativeGasUsed": "12696272", - "status": 1, - "byzantium": true - }, - "args": [ - "https://hub.playground.sismo.io/badges/polygon/{id}.json", - "0xaee4acd5c4Bf516330ca8fe11B07206fC6709294" - ], - "numDeployments": 9, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BadgesNonTransferrable\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EVENT_TRIGGERER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationsRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"getAttributeValueForBadge\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getAttributesNamesAndValuesForBadge\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBadgeExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBadgeIssuer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBadgeTimestamp\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistry\",\"type\":\"address\"}],\"name\":\"setAttestationsRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"setUri\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"triggerTransferEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"balanceOf(address,uint256)\":{\"details\":\"Main function of the ERC1155 badge The balance of a user is equal to the value of the underlying attestation. attestationCollectionId == badgeId\",\"params\":{\"account\":\"Address to check badge balance (= value of attestation)\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"balanceOfBatch(address[],uint256[])\":{\"details\":\"See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length.\"},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"owner\":\"Owner of the contract, super admin, can setup roles and update the attestation registry\",\"uri\":\"Uri for the metadata of badges\"}},\"getAttestationsRegistry()\":{\"details\":\"Getter of the attestations registry\"},\"getAttributeValueForBadge(uint256,uint8)\":{\"details\":\"Getter of the value of a specific badge attribute\",\"params\":{\"id\":\"Badge Id to check (= attestationCollectionId)\",\"index\":\"Index of the attribute\"}},\"getAttributesNamesAndValuesForBadge(uint256)\":{\"details\":\"Getter of all badge attributes and their values for a specific badge\",\"params\":{\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getBadgeExtraData(address,uint256)\":{\"details\":\"Getter of the badge extra data (it can store nullifier and burnCount)\",\"params\":{\"account\":\"Address that holds the badge\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getBadgeIssuer(address,uint256)\":{\"details\":\"Getter of the badge issuer\",\"params\":{\"account\":\"Address that holds the badge\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getBadgeTimestamp(address,uint256)\":{\"details\":\"Getter of the badge timestamp\",\"params\":{\"account\":\"Address that holds the badge\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initialize(string,address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"owner\":\"Owner of the contract, super admin, can setup roles and update the attestation registry\",\"uri\":\"Uri for the metadata of badges\"}},\"isApprovedForAll(address,address)\":{\"details\":\"Reverts, this is a non transferable ERC115 contract\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)\":{\"details\":\"See {IERC1155-safeBatchTransferFrom}.\"},\"safeTransferFrom(address,address,uint256,uint256,bytes)\":{\"details\":\"See {IERC1155-safeTransferFrom}.\"},\"setApprovalForAll(address,bool)\":{\"details\":\"Reverts, this is a non transferable ERC115 contract\"},\"setAttestationsRegistry(address)\":{\"details\":\"Set the attestations registry address. Can only be called by owner (default admin)\",\"params\":{\"attestationsRegistry\":\"new attestations registry address\"}},\"setUri(string)\":{\"details\":\"Set the URI. Can only be called by owner (default admin)\",\"params\":{\"uri\":\"new attestations registry address\"}},\"supportsInterface(bytes4)\":{\"details\":\"ERC165\"},\"triggerTransferEvent(address,address,address,uint256,uint256)\":{\"details\":\"Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\",\"params\":{\"from\":\"address(0) if minting, address of the badge holder if burning\",\"id\":\"badgeId for which to trigger the event\",\"operator\":\"who is calling the TransferEvent\",\"to\":\"address of the badge holder is minting, address(0) if burning\",\"value\":\"minted/burned balance\"}},\"uri(uint256)\":{\"details\":\"See {IERC1155MetadataURI-uri}. This implementation returns the same URI for *all* token types. It relies on the token type ID substitution mechanism https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. Clients calling this function must replace the `\\\\{id\\\\}` substring with the actual token type ID.\"}},\"title\":\"Badges contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(string,address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations The associated attestations registry triggers TransferSingle events from this contract It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms For more information: https://badges.docs.sismo.io\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/Badges.sol\":\"Badges\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\nimport \\\"../utils/Context.sol\\\";\\nimport \\\"../utils/Strings.sol\\\";\\nimport \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\\n * Overriding this function changes the behavior of the {onlyRole} modifier.\\n *\\n * Format of the revert message is described in {_checkRole}.\\n *\\n * _Available since v4.6._\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n Strings.toHexString(account),\\n \\\" is missing role \\\",\\n Strings.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * May emit a {RoleGranted} event.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n}\\n\",\"keccak256\":\"0x67e3daf189111d6d5b0464ed09cf9f0605a22c4b965a7fcecd707101faff008a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/security/Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract Pausable is Context {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0x0849d93b16c9940beb286a7864ed02724b248b93e0d80ef6355af5ef15c64773\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/ERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC1155.sol\\\";\\nimport \\\"./IERC1155Receiver.sol\\\";\\nimport \\\"./extensions/IERC1155MetadataURI.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\nimport \\\"../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the basic standard multi-token.\\n * See https://eips.ethereum.org/EIPS/eip-1155\\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\\n *\\n * _Available since v3.1._\\n */\\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\\n using Address for address;\\n\\n // Mapping from token ID to account balances\\n mapping(uint256 => mapping(address => uint256)) private _balances;\\n\\n // Mapping from account to operator approvals\\n mapping(address => mapping(address => bool)) private _operatorApprovals;\\n\\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\\n string private _uri;\\n\\n /**\\n * @dev See {_setURI}.\\n */\\n constructor(string memory uri_) {\\n _setURI(uri_);\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC1155).interfaceId ||\\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC1155MetadataURI-uri}.\\n *\\n * This implementation returns the same URI for *all* token types. It relies\\n * on the token type ID substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * Clients calling this function must replace the `\\\\{id\\\\}` substring with the\\n * actual token type ID.\\n */\\n function uri(uint256) public view virtual override returns (string memory) {\\n return _uri;\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\\n require(account != address(0), \\\"ERC1155: address zero is not a valid owner\\\");\\n return _balances[id][account];\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOfBatch}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\\n public\\n view\\n virtual\\n override\\n returns (uint256[] memory)\\n {\\n require(accounts.length == ids.length, \\\"ERC1155: accounts and ids length mismatch\\\");\\n\\n uint256[] memory batchBalances = new uint256[](accounts.length);\\n\\n for (uint256 i = 0; i < accounts.length; ++i) {\\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\\n }\\n\\n return batchBalances;\\n }\\n\\n /**\\n * @dev See {IERC1155-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC1155-isApprovedForAll}.\\n */\\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\\n return _operatorApprovals[account][operator];\\n }\\n\\n /**\\n * @dev See {IERC1155-safeTransferFrom}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner or approved\\\"\\n );\\n _safeTransferFrom(from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev See {IERC1155-safeBatchTransferFrom}.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner or approved\\\"\\n );\\n _safeBatchTransferFrom(from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n\\n emit TransferSingle(operator, from, to, id, amount);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; ++i) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n }\\n\\n emit TransferBatch(operator, from, to, ids, amounts);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Sets a new URI for all token types, by relying on the token type ID\\n * substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * By this mechanism, any occurrence of the `\\\\{id\\\\}` substring in either the\\n * URI or any of the amounts in the JSON file at said URI will be replaced by\\n * clients with the token type ID.\\n *\\n * For example, the `https://token-cdn-domain/\\\\{id\\\\}.json` URI would be\\n * interpreted by clients as\\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\\n * for token type ID 0x4cce0.\\n *\\n * See {uri}.\\n *\\n * Because these URIs cannot be meaningfully represented by the {URI} event,\\n * this function emits no events.\\n */\\n function _setURI(string memory newuri) internal virtual {\\n _uri = newuri;\\n }\\n\\n /**\\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _mint(\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _balances[id][to] += amount;\\n emit TransferSingle(operator, address(0), to, id, amount);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _mintBatch(\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n _balances[ids[i]][to] += amounts[i];\\n }\\n\\n emit TransferBatch(operator, address(0), to, ids, amounts);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens of token type `id` from `from`\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `from` must have at least `amount` tokens of token type `id`.\\n */\\n function _burn(\\n address from,\\n uint256 id,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n\\n emit TransferSingle(operator, from, address(0), id, amount);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n */\\n function _burnBatch(\\n address from,\\n uint256[] memory ids,\\n uint256[] memory amounts\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n }\\n\\n emit TransferBatch(operator, from, address(0), ids, amounts);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(\\n address owner,\\n address operator,\\n bool approved\\n ) internal virtual {\\n require(owner != operator, \\\"ERC1155: setting approval status for self\\\");\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Hook that is called before any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `ids` and `amounts` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `id` and `amount` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n function _doSafeTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\\n if (response != IERC1155Receiver.onERC1155Received.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non-ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _doSafeBatchTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\\n bytes4 response\\n ) {\\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non-ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\\n uint256[] memory array = new uint256[](1);\\n array[0] = element;\\n\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0xd917747dc87f189c6779b894f367a028f9dca4be930283cccec8f312966af820\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155 is IERC165 {\\n /**\\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\\n */\\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\\n\\n /**\\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\\n * transfers.\\n */\\n event TransferBatch(\\n address indexed operator,\\n address indexed from,\\n address indexed to,\\n uint256[] ids,\\n uint256[] values\\n );\\n\\n /**\\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\\n * `approved`.\\n */\\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\\n\\n /**\\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\\n *\\n * If an {URI} event was emitted for `id`, the standard\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\\n * returned by {IERC1155MetadataURI-uri}.\\n */\\n event URI(string value, uint256 indexed id);\\n\\n /**\\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\\n external\\n view\\n returns (uint256[] memory);\\n\\n /**\\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\\n *\\n * Emits an {ApprovalForAll} event.\\n *\\n * Requirements:\\n *\\n * - `operator` cannot be the caller.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\\n *\\n * See {setApprovalForAll}.\\n */\\n function isApprovedForAll(address account, address operator) external view returns (bool);\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] calldata ids,\\n uint256[] calldata amounts,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x6392f2cfe3a5ee802227fe7a2dfd47096d881aec89bddd214b35c5b46d3cd941\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev _Available since v3.1._\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xeb373f1fdc7b755c6a750123a9b9e3a8a02c1470042fd6505d875000a80bde0b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1155.sol\\\";\\nimport \\\"../../../security/Pausable.sol\\\";\\n\\n/**\\n * @dev ERC1155 token with pausable token transfers, minting and burning.\\n *\\n * Useful for scenarios such as preventing trades until the end of an evaluation\\n * period, or having an emergency switch for freezing all token transfers in the\\n * event of a large bug.\\n *\\n * _Available since v3.1._\\n */\\nabstract contract ERC1155Pausable is ERC1155, Pausable {\\n /**\\n * @dev See {ERC1155-_beforeTokenTransfer}.\\n *\\n * Requirements:\\n *\\n * - the contract must not be paused.\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override {\\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n require(!paused(), \\\"ERC1155Pausable: token transfer while paused\\\");\\n }\\n}\\n\",\"keccak256\":\"0xdad22b949de979bb2ad9001c044b2aeaacf8a25e3de09ed6f022a9469f936d5b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC1155.sol\\\";\\n\\n/**\\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155MetadataURI is IERC1155 {\\n /**\\n * @dev Returns the URI for token type `id`.\\n *\\n * If the `\\\\{id\\\\}` substring is present in the URI, it must be replaced by\\n * clients with the actual token type ID.\\n */\\n function uri(uint256 id) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xa66d18b9a85458d28fc3304717964502ae36f7f8a2ff35bc83f6f85d74b03574\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"},\"contracts/core/Badges.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {IBadges} from './interfaces/IBadges.sol';\\n\\n/**\\n * @title Badges contract\\n * @author Sismo\\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\\n * The associated attestations registry triggers TransferSingle events from this contract\\n * It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms\\n * For more information: https://badges.docs.sismo.io\\n */\\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\\n uint8 public constant IMPLEMENTATION_VERSION = 3;\\n\\n IAttestationsRegistry internal _attestationsRegistry;\\n\\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\\n\\n /**\\n * @dev Constructor\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n */\\n constructor(\\n string memory uri,\\n address owner // This is Sismo Frontend Contract\\n ) ERC1155(uri) {\\n initialize(uri, owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n string memory uri,\\n address owner\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup uri yet or if called by constructor (for implem setup)\\n if (bytes(ERC1155.uri(0)).length == 0 || address(this).code.length == 0) {\\n _setURI(uri);\\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\\n }\\n }\\n\\n /**\\n * @dev Main function of the ERC1155 badge\\n * The balance of a user is equal to the value of the underlying attestation.\\n * attestationCollectionId == badgeId\\n * @param account Address to check badge balance (= value of attestation)\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function balanceOf(\\n address account,\\n uint256 id\\n ) public view virtual override(ERC1155, IBadges) returns (uint256) {\\n return _attestationsRegistry.getAttestationValue(id, account);\\n }\\n\\n /**\\n * @dev Reverts, this is a non transferable ERC115 contract\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n revert BadgesNonTransferrable();\\n }\\n\\n /**\\n * @dev Reverts, this is a non transferable ERC115 contract\\n */\\n function isApprovedForAll(\\n address account,\\n address operator\\n ) public view virtual override returns (bool) {\\n revert BadgesNonTransferrable();\\n }\\n\\n /**\\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\\n * @param operator who is calling the TransferEvent\\n * @param from address(0) if minting, address of the badge holder if burning\\n * @param to address of the badge holder is minting, address(0) if burning\\n * @param id badgeId for which to trigger the event\\n * @param value minted/burned balance\\n */\\n function triggerTransferEvent(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 value\\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\\n emit TransferSingle(operator, from, to, id, value);\\n }\\n\\n /**\\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\\n * @param attestationsRegistry new attestations registry address\\n */\\n function setAttestationsRegistry(\\n address attestationsRegistry\\n ) external override onlyRole(DEFAULT_ADMIN_ROLE) {\\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\\n }\\n\\n /**\\n * @dev Set the URI. Can only be called by owner (default admin)\\n * @param uri new attestations registry address\\n */\\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\\n _setURI(uri);\\n }\\n\\n /**\\n * @dev Getter of the attestations registry\\n */\\n function getAttestationsRegistry() external view override returns (address) {\\n return address(_attestationsRegistry);\\n }\\n\\n /**\\n * @dev Getter of the badge issuer\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeIssuer(address account, uint256 id) external view returns (address) {\\n return _attestationsRegistry.getAttestationIssuer(id, account);\\n }\\n\\n /**\\n * @dev Getter of the badge timestamp\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32) {\\n return _attestationsRegistry.getAttestationTimestamp(id, account);\\n }\\n\\n /**\\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory) {\\n return _attestationsRegistry.getAttestationExtraData(id, account);\\n }\\n\\n /**\\n * @dev Getter of the value of a specific badge attribute\\n * @param id Badge Id to check (= attestationCollectionId)\\n * @param index Index of the attribute\\n */\\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8) {\\n return _attestationsRegistry.getAttributeValueForAttestationsCollection(id, index);\\n }\\n\\n /**\\n * @dev Getter of all badge attributes and their values for a specific badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getAttributesNamesAndValuesForBadge(\\n uint256 id\\n ) external view returns (bytes32[] memory, uint8[] memory) {\\n return _attestationsRegistry.getAttributesNamesAndValuesForAttestationsCollection(id);\\n }\\n\\n /**\\n * @dev ERC165\\n */\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view virtual override(AccessControl, ERC1155) returns (bool) {\\n return super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Reverts, this is a non transferable ERC115 contract\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override {\\n revert BadgesNonTransferrable();\\n }\\n}\\n\",\"keccak256\":\"0x9982b753d43f2a4a9edb5987714b09f518b419339d4bf9cd63b600bee442fd01\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IBadges.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Interface for Badges contract\\n * @author Sismo\\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\\n * The associated attestations registry triggers TransferSingle events from this contract\\n * It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms\\n */\\ninterface IBadges {\\n error BadgesNonTransferrable();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(string memory uri, address owner) external;\\n\\n /**\\n * @dev Main function of the ERC1155 badge\\n * The balance of a user is equal to the value of the underlying attestation.\\n * attestationCollectionId == badgeId\\n * @param account Address to check badge balance (= value of attestation)\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\\n * @param operator who is calling the TransferEvent\\n * @param from address(0) if minting, address of the badge holder if burning\\n * @param to address of the badge holder is minting, address(0) if burning\\n * @param id badgeId for which to trigger the event\\n * @param value minted/burned balance\\n */\\n function triggerTransferEvent(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 value\\n ) external;\\n\\n /**\\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\\n * @param attestationsRegistry new attestations registry address\\n */\\n function setAttestationsRegistry(address attestationsRegistry) external;\\n\\n /**\\n * @dev Set the URI. Can only be called by owner (default admin)\\n * @param uri new attestations registry address\\n */\\n function setUri(string memory uri) external;\\n\\n /**\\n * @dev Getter of the attestations registry\\n */\\n function getAttestationsRegistry() external view returns (address);\\n\\n /**\\n * @dev Getter of the badge issuer\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeIssuer(address account, uint256 id) external view returns (address);\\n\\n /**\\n * @dev Getter of the badge timestamp\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the value of a specific badge attribute\\n * @param id Badge Id to check (= attestationCollectionId)\\n * @param index Index of the attribute\\n */\\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);\\n\\n /**\\n * @dev Getter of all badge attributes and their values for a specific badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getAttributesNamesAndValuesForBadge(\\n uint256 id\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n}\\n\",\"keccak256\":\"0xd6bdfc887ef15ee022eb05d89dbe2e2938ee6c0a55a55f8db527ef650242c6bb\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b50604051620027eb380380620027eb833981016040819052620000349162000395565b81620000408162000055565b506200004d82826200006e565b5050620004c2565b80516200006a906004906020840190620002bc565b5050565b600054600390610100900460ff1615801562000091575060005460ff8083169116105b620000f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff83161761010017815562000127906200051d62000198602090811b91909117901c565b511580620001345750303b155b156200015257620001458362000055565b6200015260008362000234565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b606060048054620001a99062000486565b80601f0160208091040260200160405190810160405280929190818152602001828054620001d79062000486565b8015620002285780601f10620001fc5761010080835404028352916020019162000228565b820191906000526020600020905b8154815290600101906020018083116200020a57829003601f168201915b50505050509050919050565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff166200006a5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b828054620002ca9062000486565b90600052602060002090601f016020900481019282620002ee576000855562000339565b82601f106200030957805160ff191683800117855562000339565b8280016001018555821562000339579182015b82811115620003395782518255916020019190600101906200031c565b50620003479291506200034b565b5090565b5b808211156200034757600081556001016200034c565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200039057600080fd5b919050565b60008060408385031215620003a957600080fd5b82516001600160401b0380821115620003c157600080fd5b818501915085601f830112620003d657600080fd5b815181811115620003eb57620003eb62000362565b604051601f8201601f19908116603f0116810190838211818310171562000416576200041662000362565b816040528281526020935088848487010111156200043357600080fd5b600091505b8282101562000457578482018401518183018501529083019062000438565b82821115620004695760008484830101525b95506200047b91505085820162000378565b925050509250929050565b600181811c908216806200049b57607f821691505b602082108103620004bc57634e487b7160e01b600052602260045260246000fd5b50919050565b61231980620004d26000396000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c8063754b377c116100de578063aed8c6bc11610097578063e37ffe7c11610071578063e37ffe7c146103aa578063e985e9c5146103cb578063f242432a146103de578063ff4468c4146103f157600080fd5b8063aed8c6bc14610371578063b3c1cb2114610384578063d547741f1461039757600080fd5b8063754b377c146103035780637ab4339d1461031d57806391d14854146103305780639b642de114610343578063a217fddf14610356578063a22cb4651461035e57600080fd5b80632f2ff15d1161014b57806344112ed81161012557806344112ed8146102985780634e1273f4146102bf578063710b3096146102df578063730cb7d5146102f257600080fd5b80632f2ff15d1461025f57806336568abe146102725780633e1f3c271461028557600080fd5b8062fdd58e1461019257806301ffc9a7146101b85780630e064366146101db5780630e89341c14610206578063248a9ca3146102265780632eb2c2d61461024a575b600080fd5b6101a56101a0366004611618565b610419565b6040519081526020015b60405180910390f35b6101cb6101c636600461165a565b610496565b60405190151581526020016101af565b6101ee6101e9366004611618565b6104a7565b6040516001600160a01b0390911681526020016101af565b610219610214366004611677565b61051d565b6040516101af91906116ec565b6101a5610234366004611677565b6000908152600160208190526040909120015490565b61025d610258366004611858565b6105b1565b005b61025d61026d366004611905565b610606565b61025d610280366004611905565b610631565b610219610293366004611618565b6106af565b6101a57fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa481565b6102d26102cd366004611935565b610729565b6040516101af9190611a3c565b61025d6102ed366004611a4f565b610852565b6005546001600160a01b03166101ee565b61030b600381565b60405160ff90911681526020016101af565b61025d61032b366004611aaa565b6108e4565b6101cb61033e366004611905565b6109f1565b61025d610351366004611af0565b610a1c565b6101a5600081565b61025d61036c366004611b2c565b610a30565b61030b61037f366004611b6e565b610a49565b61025d610392366004611b93565b610ac0565b61025d6103a5366004611905565b610aee565b6103bd6103b8366004611677565b610b14565b6040516101af929190611bb0565b6101cb6103d9366004611c2e565b610b93565b61025d6103ec366004611c5c565b610bae565b6104046103ff366004611618565b610bf3565b60405163ffffffff90911681526020016101af565b60055460405163461e4f1960e11b8152600481018390526001600160a01b0384811660248301526000921690638c3c9e3290604401602060405180830381865afa15801561046b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cc4565b9392505050565b60006104a182610c69565b92915050565b6005546040516363ed4d5360e11b8152600481018390526001600160a01b038481166024830152600092169063c7da9aa690604401602060405180830381865afa1580156104f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cdd565b60606004805461052c90611cfa565b80601f016020809104026020016040519081016040528092919081815260200182805461055890611cfa565b80156105a55780601f1061057a576101008083540402835291602001916105a5565b820191906000526020600020905b81548152906001019060200180831161058857829003601f168201915b50505050509050919050565b6001600160a01b0385163314806105cd57506105cd8533610b93565b6105f25760405162461bcd60e51b81526004016105e990611d34565b60405180910390fd5b6105ff8585858585610ca9565b5050505050565b6000828152600160208190526040909120015461062281610e97565b61062c8383610ea4565b505050565b6001600160a01b03811633146106a15760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105e9565b6106ab8282610f0f565b5050565b600554604051636d7fbb6760e01b8152600481018390526001600160a01b0384811660248301526060921690636d7fbb6790604401600060405180830381865afa158015610701573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261048f9190810190611d82565b6060815183511461078e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016105e9565b600083516001600160401b038111156107a9576107a96116ff565b6040519080825280602002602001820160405280156107d2578160200160208202803683370190505b50905060005b845181101561084a5761081d8582815181106107f6576107f6611e03565b602002602001015185838151811061081057610810611e03565b6020026020010151610419565b82828151811061082f5761082f611e03565b602090810291909101015261084381611e2f565b90506107d8565b509392505050565b7fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa461087c81610e97565b836001600160a01b0316856001600160a01b0316876001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6286866040516108d4929190918252602082015260400190565b60405180910390a4505050505050565b600054600390610100900460ff16158015610906575060005460ff8083169116105b6109695760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e9565b6000805461ffff191660ff8316176101001781556109869061051d565b5115806109925750303b155b156109ab576109a083610f76565b6109ab600083610ea4565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610a2781610e97565b6106ab82610f76565b6040516309a711b960e31b815260040160405180910390fd5b600554604051630e972f9160e41b81526004810184905260ff831660248201526000916001600160a01b03169063e972f91090604401602060405180830381865afa158015610a9c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611e48565b6000610acb81610e97565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526001602081905260409091200154610b0a81610e97565b61062c8383610f0f565b600554604051632b2bf81b60e11b81526004810183905260609182916001600160a01b0390911690635657f03690602401600060405180830381865afa158015610b62573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b8a9190810190611ed4565b91509150915091565b60006040516309a711b960e31b815260040160405180910390fd5b6001600160a01b038516331480610bca5750610bca8533610b93565b610be65760405162461bcd60e51b81526004016105e990611d34565b6105ff8585858585610f89565b6005546040516314067f8b60e01b8152600481018390526001600160a01b03848116602483015260009216906314067f8b90604401602060405180830381865afa158015610c45573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611f90565b60006001600160e01b03198216636cdb3d1360e11b1480610c9a57506001600160e01b031982166303a24d0760e21b145b806104a157506104a1826110c5565b8151835114610d0b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016105e9565b6001600160a01b038416610d315760405162461bcd60e51b81526004016105e990611fb6565b33610d40818787878787610a30565b60005b8451811015610e29576000858281518110610d6057610d60611e03565b602002602001015190506000858381518110610d7e57610d7e611e03565b60209081029190910181015160008481526002835260408082206001600160a01b038e168352909352919091205490915081811015610dcf5760405162461bcd60e51b81526004016105e990611ffb565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610e0e908490612045565b9250508190555050505080610e2290611e2f565b9050610d43565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610e7992919061205d565b60405180910390a4610e8f8187878787876110fa565b505050505050565b610ea1813361125e565b50565b610eae82826109f1565b6106ab5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b610f1982826109f1565b156106ab5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b80516106ab90600490602084019061156a565b6001600160a01b038416610faf5760405162461bcd60e51b81526004016105e990611fb6565b336000610fbb856112b7565b90506000610fc8856112b7565b9050610fd8838989858589610a30565b60008681526002602090815260408083206001600160a01b038c1684529091529020548581101561101b5760405162461bcd60e51b81526004016105e990611ffb565b60008781526002602090815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061105a908490612045565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46110ba848a8a8a8a8a611302565b505050505050505050565b60006001600160e01b03198216637965db0b60e01b14806104a157506301ffc9a760e01b6001600160e01b03198316146104a1565b6001600160a01b0384163b15610e8f5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061113e908990899088908890889060040161208b565b6020604051808303816000875af1925050508015611179575060408051601f3d908101601f19168201909252611176918101906120e9565b60015b61122557611185612106565b806308c379a0036111be5750611199612122565b806111a457506111c0565b8060405162461bcd60e51b81526004016105e991906116ec565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016105e9565b6001600160e01b0319811663bc197c8160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b50505050505050565b61126882826109f1565b6106ab57611275816113bd565b6112808360206113cf565b6040516020016112919291906121f3565b60408051601f198184030181529082905262461bcd60e51b82526105e9916004016116ec565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106112f1576112f1611e03565b602090810291909101015292915050565b6001600160a01b0384163b15610e8f5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906113469089908990889088908890600401612268565b6020604051808303816000875af1925050508015611381575060408051601f3d908101601f1916820190925261137e918101906120e9565b60015b61138d57611185612106565b6001600160e01b0319811663f23a6e6160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b60606104a16001600160a01b03831660145b606060006113de8360026122ad565b6113e9906002612045565b6001600160401b03811115611400576114006116ff565b6040519080825280601f01601f19166020018201604052801561142a576020820181803683370190505b509050600360fc1b8160008151811061144557611445611e03565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061147457611474611e03565b60200101906001600160f81b031916908160001a90535060006114988460026122ad565b6114a3906001612045565b90505b600181111561151b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106114d7576114d7611e03565b1a60f81b8282815181106114ed576114ed611e03565b60200101906001600160f81b031916908160001a90535060049490941c93611514816122cc565b90506114a6565b50831561048f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105e9565b82805461157690611cfa565b90600052602060002090601f01602090048101928261159857600085556115de565b82601f106115b157805160ff19168380011785556115de565b828001600101855582156115de579182015b828111156115de5782518255916020019190600101906115c3565b506115ea9291506115ee565b5090565b5b808211156115ea57600081556001016115ef565b6001600160a01b0381168114610ea157600080fd5b6000806040838503121561162b57600080fd5b823561163681611603565b946020939093013593505050565b6001600160e01b031981168114610ea157600080fd5b60006020828403121561166c57600080fd5b813561048f81611644565b60006020828403121561168957600080fd5b5035919050565b60005b838110156116ab578181015183820152602001611693565b838111156116ba576000848401525b50505050565b600081518084526116d8816020860160208601611690565b601f01601f19169290920160200192915050565b60208152600061048f60208301846116c0565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561173a5761173a6116ff565b6040525050565b60006001600160401b0382111561175a5761175a6116ff565b5060051b60200190565b600082601f83011261177557600080fd5b8135602061178282611741565b60405161178f8282611715565b83815260059390931b85018201928281019150868411156117af57600080fd5b8286015b848110156117ca57803583529183019183016117b3565b509695505050505050565b60006001600160401b038211156117ee576117ee6116ff565b50601f01601f191660200190565b600082601f83011261180d57600080fd5b8135611818816117d5565b6040516118258282611715565b82815285602084870101111561183a57600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a0868803121561187057600080fd5b853561187b81611603565b9450602086013561188b81611603565b935060408601356001600160401b03808211156118a757600080fd5b6118b389838a01611764565b945060608801359150808211156118c957600080fd5b6118d589838a01611764565b935060808801359150808211156118eb57600080fd5b506118f8888289016117fc565b9150509295509295909350565b6000806040838503121561191857600080fd5b82359150602083013561192a81611603565b809150509250929050565b6000806040838503121561194857600080fd5b82356001600160401b038082111561195f57600080fd5b818501915085601f83011261197357600080fd5b8135602061198082611741565b60405161198d8282611715565b83815260059390931b85018201928281019150898411156119ad57600080fd5b948201945b838610156119d45785356119c581611603565b825294820194908201906119b2565b965050860135925050808211156119ea57600080fd5b506119f785828601611764565b9150509250929050565b600081518084526020808501945080840160005b83811015611a3157815187529582019590820190600101611a15565b509495945050505050565b60208152600061048f6020830184611a01565b600080600080600060a08688031215611a6757600080fd5b8535611a7281611603565b94506020860135611a8281611603565b93506040860135611a9281611603565b94979396509394606081013594506080013592915050565b60008060408385031215611abd57600080fd5b82356001600160401b03811115611ad357600080fd5b611adf858286016117fc565b925050602083013561192a81611603565b600060208284031215611b0257600080fd5b81356001600160401b03811115611b1857600080fd5b611b24848285016117fc565b949350505050565b60008060408385031215611b3f57600080fd5b8235611b4a81611603565b91506020830135801515811461192a57600080fd5b60ff81168114610ea157600080fd5b60008060408385031215611b8157600080fd5b82359150602083013561192a81611b5f565b600060208284031215611ba557600080fd5b813561048f81611603565b604080825283519082018190526000906020906060840190828701845b82811015611be957815184529284019290840190600101611bcd565b5050508381038285015284518082528583019183019060005b81811015611c2157835160ff1683529284019291840191600101611c02565b5090979650505050505050565b60008060408385031215611c4157600080fd5b8235611c4c81611603565b9150602083013561192a81611603565b600080600080600060a08688031215611c7457600080fd5b8535611c7f81611603565b94506020860135611c8f81611603565b9350604086013592506060860135915060808601356001600160401b03811115611cb857600080fd5b6118f8888289016117fc565b600060208284031215611cd657600080fd5b5051919050565b600060208284031215611cef57600080fd5b815161048f81611603565b600181811c90821680611d0e57607f821691505b602082108103611d2e57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b600060208284031215611d9457600080fd5b81516001600160401b03811115611daa57600080fd5b8201601f81018413611dbb57600080fd5b8051611dc6816117d5565b604051611dd38282611715565b828152866020848601011115611de857600080fd5b611df9836020830160208701611690565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e4157611e41611e19565b5060010190565b600060208284031215611e5a57600080fd5b815161048f81611b5f565b600082601f830112611e7657600080fd5b81516020611e8382611741565b604051611e908282611715565b83815260059390931b8501820192828101915086841115611eb057600080fd5b8286015b848110156117ca578051611ec781611b5f565b8352918301918301611eb4565b60008060408385031215611ee757600080fd5b82516001600160401b0380821115611efe57600080fd5b818501915085601f830112611f1257600080fd5b81516020611f1f82611741565b604051611f2c8282611715565b83815260059390931b8501820192828101915089841115611f4c57600080fd5b948201945b83861015611f6a57855182529482019490820190611f51565b91880151919650909350505080821115611f8357600080fd5b506119f785828601611e65565b600060208284031215611fa257600080fd5b815163ffffffff8116811461048f57600080fd5b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6000821982111561205857612058611e19565b500190565b6040815260006120706040830185611a01565b82810360208401526120828185611a01565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906120b790830186611a01565b82810360608401526120c98186611a01565b905082810360808401526120dd81856116c0565b98975050505050505050565b6000602082840312156120fb57600080fd5b815161048f81611644565b600060033d111561211f5760046000803e5060005160e01c5b90565b600060443d10156121305790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561215f57505050505090565b82850191508151818111156121775750505050505090565b843d87010160208285010111156121915750505050505090565b6121a060208286010187611715565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161222b816017850160208801611690565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161225c816028840160208801611690565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906122a2908301846116c0565b979650505050505050565b60008160001904831182151516156122c7576122c7611e19565b500290565b6000816122db576122db611e19565b50600019019056fea26469706673582212209e33646a1ed2d51fcc749870e94aa69546c518fc5bfee43d37014ebc54dd767864736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061018d5760003560e01c8063754b377c116100de578063aed8c6bc11610097578063e37ffe7c11610071578063e37ffe7c146103aa578063e985e9c5146103cb578063f242432a146103de578063ff4468c4146103f157600080fd5b8063aed8c6bc14610371578063b3c1cb2114610384578063d547741f1461039757600080fd5b8063754b377c146103035780637ab4339d1461031d57806391d14854146103305780639b642de114610343578063a217fddf14610356578063a22cb4651461035e57600080fd5b80632f2ff15d1161014b57806344112ed81161012557806344112ed8146102985780634e1273f4146102bf578063710b3096146102df578063730cb7d5146102f257600080fd5b80632f2ff15d1461025f57806336568abe146102725780633e1f3c271461028557600080fd5b8062fdd58e1461019257806301ffc9a7146101b85780630e064366146101db5780630e89341c14610206578063248a9ca3146102265780632eb2c2d61461024a575b600080fd5b6101a56101a0366004611618565b610419565b6040519081526020015b60405180910390f35b6101cb6101c636600461165a565b610496565b60405190151581526020016101af565b6101ee6101e9366004611618565b6104a7565b6040516001600160a01b0390911681526020016101af565b610219610214366004611677565b61051d565b6040516101af91906116ec565b6101a5610234366004611677565b6000908152600160208190526040909120015490565b61025d610258366004611858565b6105b1565b005b61025d61026d366004611905565b610606565b61025d610280366004611905565b610631565b610219610293366004611618565b6106af565b6101a57fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa481565b6102d26102cd366004611935565b610729565b6040516101af9190611a3c565b61025d6102ed366004611a4f565b610852565b6005546001600160a01b03166101ee565b61030b600381565b60405160ff90911681526020016101af565b61025d61032b366004611aaa565b6108e4565b6101cb61033e366004611905565b6109f1565b61025d610351366004611af0565b610a1c565b6101a5600081565b61025d61036c366004611b2c565b610a30565b61030b61037f366004611b6e565b610a49565b61025d610392366004611b93565b610ac0565b61025d6103a5366004611905565b610aee565b6103bd6103b8366004611677565b610b14565b6040516101af929190611bb0565b6101cb6103d9366004611c2e565b610b93565b61025d6103ec366004611c5c565b610bae565b6104046103ff366004611618565b610bf3565b60405163ffffffff90911681526020016101af565b60055460405163461e4f1960e11b8152600481018390526001600160a01b0384811660248301526000921690638c3c9e3290604401602060405180830381865afa15801561046b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cc4565b9392505050565b60006104a182610c69565b92915050565b6005546040516363ed4d5360e11b8152600481018390526001600160a01b038481166024830152600092169063c7da9aa690604401602060405180830381865afa1580156104f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cdd565b60606004805461052c90611cfa565b80601f016020809104026020016040519081016040528092919081815260200182805461055890611cfa565b80156105a55780601f1061057a576101008083540402835291602001916105a5565b820191906000526020600020905b81548152906001019060200180831161058857829003601f168201915b50505050509050919050565b6001600160a01b0385163314806105cd57506105cd8533610b93565b6105f25760405162461bcd60e51b81526004016105e990611d34565b60405180910390fd5b6105ff8585858585610ca9565b5050505050565b6000828152600160208190526040909120015461062281610e97565b61062c8383610ea4565b505050565b6001600160a01b03811633146106a15760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105e9565b6106ab8282610f0f565b5050565b600554604051636d7fbb6760e01b8152600481018390526001600160a01b0384811660248301526060921690636d7fbb6790604401600060405180830381865afa158015610701573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261048f9190810190611d82565b6060815183511461078e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016105e9565b600083516001600160401b038111156107a9576107a96116ff565b6040519080825280602002602001820160405280156107d2578160200160208202803683370190505b50905060005b845181101561084a5761081d8582815181106107f6576107f6611e03565b602002602001015185838151811061081057610810611e03565b6020026020010151610419565b82828151811061082f5761082f611e03565b602090810291909101015261084381611e2f565b90506107d8565b509392505050565b7fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa461087c81610e97565b836001600160a01b0316856001600160a01b0316876001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6286866040516108d4929190918252602082015260400190565b60405180910390a4505050505050565b600054600390610100900460ff16158015610906575060005460ff8083169116105b6109695760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e9565b6000805461ffff191660ff8316176101001781556109869061051d565b5115806109925750303b155b156109ab576109a083610f76565b6109ab600083610ea4565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610a2781610e97565b6106ab82610f76565b6040516309a711b960e31b815260040160405180910390fd5b600554604051630e972f9160e41b81526004810184905260ff831660248201526000916001600160a01b03169063e972f91090604401602060405180830381865afa158015610a9c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611e48565b6000610acb81610e97565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526001602081905260409091200154610b0a81610e97565b61062c8383610f0f565b600554604051632b2bf81b60e11b81526004810183905260609182916001600160a01b0390911690635657f03690602401600060405180830381865afa158015610b62573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b8a9190810190611ed4565b91509150915091565b60006040516309a711b960e31b815260040160405180910390fd5b6001600160a01b038516331480610bca5750610bca8533610b93565b610be65760405162461bcd60e51b81526004016105e990611d34565b6105ff8585858585610f89565b6005546040516314067f8b60e01b8152600481018390526001600160a01b03848116602483015260009216906314067f8b90604401602060405180830381865afa158015610c45573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611f90565b60006001600160e01b03198216636cdb3d1360e11b1480610c9a57506001600160e01b031982166303a24d0760e21b145b806104a157506104a1826110c5565b8151835114610d0b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016105e9565b6001600160a01b038416610d315760405162461bcd60e51b81526004016105e990611fb6565b33610d40818787878787610a30565b60005b8451811015610e29576000858281518110610d6057610d60611e03565b602002602001015190506000858381518110610d7e57610d7e611e03565b60209081029190910181015160008481526002835260408082206001600160a01b038e168352909352919091205490915081811015610dcf5760405162461bcd60e51b81526004016105e990611ffb565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610e0e908490612045565b9250508190555050505080610e2290611e2f565b9050610d43565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610e7992919061205d565b60405180910390a4610e8f8187878787876110fa565b505050505050565b610ea1813361125e565b50565b610eae82826109f1565b6106ab5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b610f1982826109f1565b156106ab5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b80516106ab90600490602084019061156a565b6001600160a01b038416610faf5760405162461bcd60e51b81526004016105e990611fb6565b336000610fbb856112b7565b90506000610fc8856112b7565b9050610fd8838989858589610a30565b60008681526002602090815260408083206001600160a01b038c1684529091529020548581101561101b5760405162461bcd60e51b81526004016105e990611ffb565b60008781526002602090815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061105a908490612045565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46110ba848a8a8a8a8a611302565b505050505050505050565b60006001600160e01b03198216637965db0b60e01b14806104a157506301ffc9a760e01b6001600160e01b03198316146104a1565b6001600160a01b0384163b15610e8f5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061113e908990899088908890889060040161208b565b6020604051808303816000875af1925050508015611179575060408051601f3d908101601f19168201909252611176918101906120e9565b60015b61122557611185612106565b806308c379a0036111be5750611199612122565b806111a457506111c0565b8060405162461bcd60e51b81526004016105e991906116ec565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016105e9565b6001600160e01b0319811663bc197c8160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b50505050505050565b61126882826109f1565b6106ab57611275816113bd565b6112808360206113cf565b6040516020016112919291906121f3565b60408051601f198184030181529082905262461bcd60e51b82526105e9916004016116ec565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106112f1576112f1611e03565b602090810291909101015292915050565b6001600160a01b0384163b15610e8f5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906113469089908990889088908890600401612268565b6020604051808303816000875af1925050508015611381575060408051601f3d908101601f1916820190925261137e918101906120e9565b60015b61138d57611185612106565b6001600160e01b0319811663f23a6e6160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b60606104a16001600160a01b03831660145b606060006113de8360026122ad565b6113e9906002612045565b6001600160401b03811115611400576114006116ff565b6040519080825280601f01601f19166020018201604052801561142a576020820181803683370190505b509050600360fc1b8160008151811061144557611445611e03565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061147457611474611e03565b60200101906001600160f81b031916908160001a90535060006114988460026122ad565b6114a3906001612045565b90505b600181111561151b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106114d7576114d7611e03565b1a60f81b8282815181106114ed576114ed611e03565b60200101906001600160f81b031916908160001a90535060049490941c93611514816122cc565b90506114a6565b50831561048f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105e9565b82805461157690611cfa565b90600052602060002090601f01602090048101928261159857600085556115de565b82601f106115b157805160ff19168380011785556115de565b828001600101855582156115de579182015b828111156115de5782518255916020019190600101906115c3565b506115ea9291506115ee565b5090565b5b808211156115ea57600081556001016115ef565b6001600160a01b0381168114610ea157600080fd5b6000806040838503121561162b57600080fd5b823561163681611603565b946020939093013593505050565b6001600160e01b031981168114610ea157600080fd5b60006020828403121561166c57600080fd5b813561048f81611644565b60006020828403121561168957600080fd5b5035919050565b60005b838110156116ab578181015183820152602001611693565b838111156116ba576000848401525b50505050565b600081518084526116d8816020860160208601611690565b601f01601f19169290920160200192915050565b60208152600061048f60208301846116c0565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561173a5761173a6116ff565b6040525050565b60006001600160401b0382111561175a5761175a6116ff565b5060051b60200190565b600082601f83011261177557600080fd5b8135602061178282611741565b60405161178f8282611715565b83815260059390931b85018201928281019150868411156117af57600080fd5b8286015b848110156117ca57803583529183019183016117b3565b509695505050505050565b60006001600160401b038211156117ee576117ee6116ff565b50601f01601f191660200190565b600082601f83011261180d57600080fd5b8135611818816117d5565b6040516118258282611715565b82815285602084870101111561183a57600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a0868803121561187057600080fd5b853561187b81611603565b9450602086013561188b81611603565b935060408601356001600160401b03808211156118a757600080fd5b6118b389838a01611764565b945060608801359150808211156118c957600080fd5b6118d589838a01611764565b935060808801359150808211156118eb57600080fd5b506118f8888289016117fc565b9150509295509295909350565b6000806040838503121561191857600080fd5b82359150602083013561192a81611603565b809150509250929050565b6000806040838503121561194857600080fd5b82356001600160401b038082111561195f57600080fd5b818501915085601f83011261197357600080fd5b8135602061198082611741565b60405161198d8282611715565b83815260059390931b85018201928281019150898411156119ad57600080fd5b948201945b838610156119d45785356119c581611603565b825294820194908201906119b2565b965050860135925050808211156119ea57600080fd5b506119f785828601611764565b9150509250929050565b600081518084526020808501945080840160005b83811015611a3157815187529582019590820190600101611a15565b509495945050505050565b60208152600061048f6020830184611a01565b600080600080600060a08688031215611a6757600080fd5b8535611a7281611603565b94506020860135611a8281611603565b93506040860135611a9281611603565b94979396509394606081013594506080013592915050565b60008060408385031215611abd57600080fd5b82356001600160401b03811115611ad357600080fd5b611adf858286016117fc565b925050602083013561192a81611603565b600060208284031215611b0257600080fd5b81356001600160401b03811115611b1857600080fd5b611b24848285016117fc565b949350505050565b60008060408385031215611b3f57600080fd5b8235611b4a81611603565b91506020830135801515811461192a57600080fd5b60ff81168114610ea157600080fd5b60008060408385031215611b8157600080fd5b82359150602083013561192a81611b5f565b600060208284031215611ba557600080fd5b813561048f81611603565b604080825283519082018190526000906020906060840190828701845b82811015611be957815184529284019290840190600101611bcd565b5050508381038285015284518082528583019183019060005b81811015611c2157835160ff1683529284019291840191600101611c02565b5090979650505050505050565b60008060408385031215611c4157600080fd5b8235611c4c81611603565b9150602083013561192a81611603565b600080600080600060a08688031215611c7457600080fd5b8535611c7f81611603565b94506020860135611c8f81611603565b9350604086013592506060860135915060808601356001600160401b03811115611cb857600080fd5b6118f8888289016117fc565b600060208284031215611cd657600080fd5b5051919050565b600060208284031215611cef57600080fd5b815161048f81611603565b600181811c90821680611d0e57607f821691505b602082108103611d2e57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b600060208284031215611d9457600080fd5b81516001600160401b03811115611daa57600080fd5b8201601f81018413611dbb57600080fd5b8051611dc6816117d5565b604051611dd38282611715565b828152866020848601011115611de857600080fd5b611df9836020830160208701611690565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e4157611e41611e19565b5060010190565b600060208284031215611e5a57600080fd5b815161048f81611b5f565b600082601f830112611e7657600080fd5b81516020611e8382611741565b604051611e908282611715565b83815260059390931b8501820192828101915086841115611eb057600080fd5b8286015b848110156117ca578051611ec781611b5f565b8352918301918301611eb4565b60008060408385031215611ee757600080fd5b82516001600160401b0380821115611efe57600080fd5b818501915085601f830112611f1257600080fd5b81516020611f1f82611741565b604051611f2c8282611715565b83815260059390931b8501820192828101915089841115611f4c57600080fd5b948201945b83861015611f6a57855182529482019490820190611f51565b91880151919650909350505080821115611f8357600080fd5b506119f785828601611e65565b600060208284031215611fa257600080fd5b815163ffffffff8116811461048f57600080fd5b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6000821982111561205857612058611e19565b500190565b6040815260006120706040830185611a01565b82810360208401526120828185611a01565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906120b790830186611a01565b82810360608401526120c98186611a01565b905082810360808401526120dd81856116c0565b98975050505050505050565b6000602082840312156120fb57600080fd5b815161048f81611644565b600060033d111561211f5760046000803e5060005160e01c5b90565b600060443d10156121305790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561215f57505050505090565b82850191508151818111156121775750505050505090565b843d87010160208285010111156121915750505050505090565b6121a060208286010187611715565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161222b816017850160208801611690565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161225c816028840160208801611690565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906122a2908301846116c0565b979650505050505050565b60008160001904831182151516156122c7576122c7611e19565b500290565b6000816122db576122db611e19565b50600019019056fea26469706673582212209e33646a1ed2d51fcc749870e94aa69546c518fc5bfee43d37014ebc54dd767864736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "balanceOf(address,uint256)": { - "details": "Main function of the ERC1155 badge The balance of a user is equal to the value of the underlying attestation. attestationCollectionId == badgeId", - "params": { - "account": "Address to check badge balance (= value of attestation)", - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "balanceOfBatch(address[],uint256[])": { - "details": "See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length." - }, - "constructor": { - "details": "Constructor", - "params": { - "owner": "Owner of the contract, super admin, can setup roles and update the attestation registry", - "uri": "Uri for the metadata of badges" - } - }, - "getAttestationsRegistry()": { - "details": "Getter of the attestations registry" - }, - "getAttributeValueForBadge(uint256,uint8)": { - "details": "Getter of the value of a specific badge attribute", - "params": { - "id": "Badge Id to check (= attestationCollectionId)", - "index": "Index of the attribute" - } - }, - "getAttributesNamesAndValuesForBadge(uint256)": { - "details": "Getter of all badge attributes and their values for a specific badge", - "params": { - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "getBadgeExtraData(address,uint256)": { - "details": "Getter of the badge extra data (it can store nullifier and burnCount)", - "params": { - "account": "Address that holds the badge", - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "getBadgeIssuer(address,uint256)": { - "details": "Getter of the badge issuer", - "params": { - "account": "Address that holds the badge", - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "getBadgeTimestamp(address,uint256)": { - "details": "Getter of the badge timestamp", - "params": { - "account": "Address that holds the badge", - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "getRoleAdmin(bytes32)": { - "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." - }, - "grantRole(bytes32,address)": { - "details": "Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event." - }, - "hasRole(bytes32,address)": { - "details": "Returns `true` if `account` has been granted `role`." - }, - "initialize(string,address)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "owner": "Owner of the contract, super admin, can setup roles and update the attestation registry", - "uri": "Uri for the metadata of badges" - } - }, - "isApprovedForAll(address,address)": { - "details": "Reverts, this is a non transferable ERC115 contract" - }, - "renounceRole(bytes32,address)": { - "details": "Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event." - }, - "revokeRole(bytes32,address)": { - "details": "Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event." - }, - "safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)": { - "details": "See {IERC1155-safeBatchTransferFrom}." - }, - "safeTransferFrom(address,address,uint256,uint256,bytes)": { - "details": "See {IERC1155-safeTransferFrom}." - }, - "setApprovalForAll(address,bool)": { - "details": "Reverts, this is a non transferable ERC115 contract" - }, - "setAttestationsRegistry(address)": { - "details": "Set the attestations registry address. Can only be called by owner (default admin)", - "params": { - "attestationsRegistry": "new attestations registry address" - } - }, - "setUri(string)": { - "details": "Set the URI. Can only be called by owner (default admin)", - "params": { - "uri": "new attestations registry address" - } - }, - "supportsInterface(bytes4)": { - "details": "ERC165" - }, - "triggerTransferEvent(address,address,address,uint256,uint256)": { - "details": "Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)", - "params": { - "from": "address(0) if minting, address of the badge holder if burning", - "id": "badgeId for which to trigger the event", - "operator": "who is calling the TransferEvent", - "to": "address of the badge holder is minting, address(0) if burning", - "value": "minted/burned balance" - } - }, - "uri(uint256)": { - "details": "See {IERC1155MetadataURI-uri}. This implementation returns the same URI for *all* token types. It relies on the token type ID substitution mechanism https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. Clients calling this function must replace the `\\{id\\}` substring with the actual token type ID." - } - }, - "title": "Badges contract", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(string,address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations The associated attestations registry triggers TransferSingle events from this contract It allows badge \"shadow mints and burns\" to be caught by off-chain platforms For more information: https://badges.docs.sismo.io", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 24, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_roles", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 1231, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_balances", - "offset": 0, - "slot": "2", - "type": "t_mapping(t_uint256,t_mapping(t_address,t_uint256))" - }, - { - "astId": 1237, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_operatorApprovals", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_address,t_mapping(t_address,t_bool))" - }, - { - "astId": 1239, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_uri", - "offset": 0, - "slot": "4", - "type": "t_string_storage" - }, - { - "astId": 11990, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_attestationsRegistry", - "offset": 0, - "slot": "5", - "type": "t_contract(IAttestationsRegistry)12822" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(IAttestationsRegistry)12822": { - "encoding": "inplace", - "label": "contract IAttestationsRegistry", - "numberOfBytes": "20" - }, - "t_mapping(t_address,t_bool)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_address,t_mapping(t_address,t_bool))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(address => bool))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_bool)" - }, - "t_mapping(t_address,t_uint256)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => struct AccessControl.RoleData)", - "numberOfBytes": "32", - "value": "t_struct(RoleData)19_storage" - }, - "t_mapping(t_uint256,t_mapping(t_address,t_uint256))": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => mapping(address => uint256))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_uint256)" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(RoleData)19_storage": { - "encoding": "inplace", - "label": "struct AccessControl.RoleData", - "members": [ - { - "astId": 16, - "contract": "contracts/core/Badges.sol:Badges", - "label": "members", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_address,t_bool)" - }, - { - "astId": 18, - "contract": "contracts/core/Badges.sol:Badges", - "label": "adminRole", - "offset": 0, - "slot": "1", - "type": "t_bytes32" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/BadgesImplem.json b/deployments/sandboxPolygon/BadgesImplem.json deleted file mode 100644 index aae8848..0000000 --- a/deployments/sandboxPolygon/BadgesImplem.json +++ /dev/null @@ -1,1129 +0,0 @@ -{ - "address": "0xc7927B693bd310546b17F38f33028DACa76aB3f0", - "abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [], - "name": "BadgesNonTransferrable", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": false, - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "ApprovalForAll", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "indexed": false, - "internalType": "uint256[]", - "name": "values", - "type": "uint256[]" - } - ], - "name": "TransferBatch", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "TransferSingle", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "value", - "type": "string" - }, - { - "indexed": true, - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "URI", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "EVENT_TRIGGERER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address[]", - "name": "accounts", - "type": "address[]" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - } - ], - "name": "balanceOfBatch", - "outputs": [ - { - "internalType": "uint256[]", - "name": "", - "type": "uint256[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationsRegistry", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "index", - "type": "uint8" - } - ], - "name": "getAttributeValueForBadge", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "getAttributesNamesAndValuesForBadge", - "outputs": [ - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - }, - { - "internalType": "uint8[]", - "name": "", - "type": "uint8[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "getBadgeExtraData", - "outputs": [ - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "getBadgeIssuer", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - } - ], - "name": "getBadgeTimestamp", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "address", - "name": "operator", - "type": "address" - } - ], - "name": "isApprovedForAll", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256[]", - "name": "ids", - "type": "uint256[]" - }, - { - "internalType": "uint256[]", - "name": "amounts", - "type": "uint256[]" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeBatchTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "safeTransferFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "bool", - "name": "approved", - "type": "bool" - } - ], - "name": "setApprovalForAll", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistry", - "type": "address" - } - ], - "name": "setAttestationsRegistry", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "uri", - "type": "string" - } - ], - "name": "setUri", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "operator", - "type": "address" - }, - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "id", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "triggerTransferEvent", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "uri", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x4192c454751f88bb334e8b886fae9ca7a845605753dca2884d04f712d5391d67", - "receipt": { - "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0xc7927B693bd310546b17F38f33028DACa76aB3f0", - "transactionIndex": 49, - "gasUsed": "2131290", - "logsBloom": "0x00000004000000200000000000000000002000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000020000000000000000000800000000010000000080000000000000000040000000150000000000100004000000000000000080000000000000000000200000000000000000000000000400000000000000000000001000000000004000000000000000000001000000040000000000000000000100120004000020000000000000000000000000000000000000000000000000000000000002100000", - "blockHash": "0x6463ab17ec2267ddf3c5cb65df17fedc2fcf2591435de10048c0fa6e48f5fe6d", - "transactionHash": "0x4192c454751f88bb334e8b886fae9ca7a845605753dca2884d04f712d5391d67", - "logs": [ - { - "transactionIndex": 49, - "blockNumber": 36626315, - "transactionHash": "0x4192c454751f88bb334e8b886fae9ca7a845605753dca2884d04f712d5391d67", - "address": "0xc7927B693bd310546b17F38f33028DACa76aB3f0", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000aee4acd5c4bf516330ca8fe11b07206fc6709294", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e" - ], - "data": "0x", - "logIndex": 260, - "blockHash": "0x6463ab17ec2267ddf3c5cb65df17fedc2fcf2591435de10048c0fa6e48f5fe6d" - }, - { - "transactionIndex": 49, - "blockNumber": 36626315, - "transactionHash": "0x4192c454751f88bb334e8b886fae9ca7a845605753dca2884d04f712d5391d67", - "address": "0xc7927B693bd310546b17F38f33028DACa76aB3f0", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000003", - "logIndex": 261, - "blockHash": "0x6463ab17ec2267ddf3c5cb65df17fedc2fcf2591435de10048c0fa6e48f5fe6d" - }, - { - "transactionIndex": 49, - "blockNumber": 36626315, - "transactionHash": "0x4192c454751f88bb334e8b886fae9ca7a845605753dca2884d04f712d5391d67", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x0000000000000000000000009ead03f7136fc6b4bdb0780b00a1c14ae5a8b6d0" - ], - "data": "0x0000000000000000000000000000000000000000000000000107ca96b4ce888a000000000000000000000000000000000000000000000000b8bd51a3e02d591e0000000000000000000000000000000000000000000083e270b3d0f5c591b608000000000000000000000000000000000000000000000000b7b5870d2b5ed0940000000000000000000000000000000000000000000083e271bb9b8c7a603e92", - "logIndex": 262, - "blockHash": "0x6463ab17ec2267ddf3c5cb65df17fedc2fcf2591435de10048c0fa6e48f5fe6d" - } - ], - "blockNumber": 36626315, - "cumulativeGasUsed": "12696272", - "status": 1, - "byzantium": true - }, - "args": [ - "https://hub.playground.sismo.io/badges/polygon/{id}.json", - "0xaee4acd5c4Bf516330ca8fe11B07206fC6709294" - ], - "numDeployments": 2, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[],\"name\":\"BadgesNonTransferrable\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"ApprovalForAll\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"previousAdminRole\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"newAdminRole\",\"type\":\"bytes32\"}],\"name\":\"RoleAdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleGranted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"RoleRevoked\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"indexed\":false,\"internalType\":\"uint256[]\",\"name\":\"values\",\"type\":\"uint256[]\"}],\"name\":\"TransferBatch\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"TransferSingle\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"string\",\"name\":\"value\",\"type\":\"string\"},{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"URI\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"DEFAULT_ADMIN_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"EVENT_TRIGGERER_ROLE\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address[]\",\"name\":\"accounts\",\"type\":\"address[]\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"}],\"name\":\"balanceOfBatch\",\"outputs\":[{\"internalType\":\"uint256[]\",\"name\":\"\",\"type\":\"uint256[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationsRegistry\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint8\",\"name\":\"index\",\"type\":\"uint8\"}],\"name\":\"getAttributeValueForBadge\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getAttributesNamesAndValuesForBadge\",\"outputs\":[{\"internalType\":\"bytes32[]\",\"name\":\"\",\"type\":\"bytes32[]\"},{\"internalType\":\"uint8[]\",\"name\":\"\",\"type\":\"uint8[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBadgeExtraData\",\"outputs\":[{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBadgeIssuer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"}],\"name\":\"getBadgeTimestamp\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"}],\"name\":\"getRoleAdmin\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"grantRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"hasRole\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"}],\"name\":\"isApprovedForAll\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"renounceRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes32\",\"name\":\"role\",\"type\":\"bytes32\"},{\"internalType\":\"address\",\"name\":\"account\",\"type\":\"address\"}],\"name\":\"revokeRole\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256[]\",\"name\":\"ids\",\"type\":\"uint256[]\"},{\"internalType\":\"uint256[]\",\"name\":\"amounts\",\"type\":\"uint256[]\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeBatchTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"safeTransferFrom\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"bool\",\"name\":\"approved\",\"type\":\"bool\"}],\"name\":\"setApprovalForAll\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistry\",\"type\":\"address\"}],\"name\":\"setAttestationsRegistry\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"uri\",\"type\":\"string\"}],\"name\":\"setUri\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes4\",\"name\":\"interfaceId\",\"type\":\"bytes4\"}],\"name\":\"supportsInterface\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"operator\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"from\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"id\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"triggerTransferEvent\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"name\":\"uri\",\"outputs\":[{\"internalType\":\"string\",\"name\":\"\",\"type\":\"string\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"balanceOf(address,uint256)\":{\"details\":\"Main function of the ERC1155 badge The balance of a user is equal to the value of the underlying attestation. attestationCollectionId == badgeId\",\"params\":{\"account\":\"Address to check badge balance (= value of attestation)\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"balanceOfBatch(address[],uint256[])\":{\"details\":\"See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length.\"},\"constructor\":{\"details\":\"Constructor\",\"params\":{\"owner\":\"Owner of the contract, super admin, can setup roles and update the attestation registry\",\"uri\":\"Uri for the metadata of badges\"}},\"getAttestationsRegistry()\":{\"details\":\"Getter of the attestations registry\"},\"getAttributeValueForBadge(uint256,uint8)\":{\"details\":\"Getter of the value of a specific badge attribute\",\"params\":{\"id\":\"Badge Id to check (= attestationCollectionId)\",\"index\":\"Index of the attribute\"}},\"getAttributesNamesAndValuesForBadge(uint256)\":{\"details\":\"Getter of all badge attributes and their values for a specific badge\",\"params\":{\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getBadgeExtraData(address,uint256)\":{\"details\":\"Getter of the badge extra data (it can store nullifier and burnCount)\",\"params\":{\"account\":\"Address that holds the badge\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getBadgeIssuer(address,uint256)\":{\"details\":\"Getter of the badge issuer\",\"params\":{\"account\":\"Address that holds the badge\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getBadgeTimestamp(address,uint256)\":{\"details\":\"Getter of the badge timestamp\",\"params\":{\"account\":\"Address that holds the badge\",\"id\":\"Badge Id to check (= attestationCollectionId)\"}},\"getRoleAdmin(bytes32)\":{\"details\":\"Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}.\"},\"grantRole(bytes32,address)\":{\"details\":\"Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event.\"},\"hasRole(bytes32,address)\":{\"details\":\"Returns `true` if `account` has been granted `role`.\"},\"initialize(string,address)\":{\"details\":\"Initializes the contract, to be called by the proxy delegating calls to this implementation\",\"params\":{\"owner\":\"Owner of the contract, super admin, can setup roles and update the attestation registry\",\"uri\":\"Uri for the metadata of badges\"}},\"isApprovedForAll(address,address)\":{\"details\":\"Reverts, this is a non transferable ERC115 contract\"},\"renounceRole(bytes32,address)\":{\"details\":\"Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event.\"},\"revokeRole(bytes32,address)\":{\"details\":\"Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event.\"},\"safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)\":{\"details\":\"See {IERC1155-safeBatchTransferFrom}.\"},\"safeTransferFrom(address,address,uint256,uint256,bytes)\":{\"details\":\"See {IERC1155-safeTransferFrom}.\"},\"setApprovalForAll(address,bool)\":{\"details\":\"Reverts, this is a non transferable ERC115 contract\"},\"setAttestationsRegistry(address)\":{\"details\":\"Set the attestations registry address. Can only be called by owner (default admin)\",\"params\":{\"attestationsRegistry\":\"new attestations registry address\"}},\"setUri(string)\":{\"details\":\"Set the URI. Can only be called by owner (default admin)\",\"params\":{\"uri\":\"new attestations registry address\"}},\"supportsInterface(bytes4)\":{\"details\":\"ERC165\"},\"triggerTransferEvent(address,address,address,uint256,uint256)\":{\"details\":\"Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\",\"params\":{\"from\":\"address(0) if minting, address of the badge holder if burning\",\"id\":\"badgeId for which to trigger the event\",\"operator\":\"who is calling the TransferEvent\",\"to\":\"address of the badge holder is minting, address(0) if burning\",\"value\":\"minted/burned balance\"}},\"uri(uint256)\":{\"details\":\"See {IERC1155MetadataURI-uri}. This implementation returns the same URI for *all* token types. It relies on the token type ID substitution mechanism https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. Clients calling this function must replace the `\\\\{id\\\\}` substring with the actual token type ID.\"}},\"title\":\"Badges contract\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"initialize(string,address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"}},\"notice\":\"Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations The associated attestations registry triggers TransferSingle events from this contract It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms For more information: https://badges.docs.sismo.io\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/core/Badges.sol\":\"Badges\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/AccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IAccessControl.sol\\\";\\nimport \\\"../utils/Context.sol\\\";\\nimport \\\"../utils/Strings.sol\\\";\\nimport \\\"../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Contract module that allows children to implement role-based access\\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\\n * members except through off-chain means by accessing the contract event logs. Some\\n * applications may benefit from on-chain enumerability, for those cases see\\n * {AccessControlEnumerable}.\\n *\\n * Roles are referred to by their `bytes32` identifier. These should be exposed\\n * in the external API and be unique. The best way to achieve this is by\\n * using `public constant` hash digests:\\n *\\n * ```\\n * bytes32 public constant MY_ROLE = keccak256(\\\"MY_ROLE\\\");\\n * ```\\n *\\n * Roles can be used to represent a set of permissions. To restrict access to a\\n * function call, use {hasRole}:\\n *\\n * ```\\n * function foo() public {\\n * require(hasRole(MY_ROLE, msg.sender));\\n * ...\\n * }\\n * ```\\n *\\n * Roles can be granted and revoked dynamically via the {grantRole} and\\n * {revokeRole} functions. Each role has an associated admin role, and only\\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\\n *\\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\\n * that only accounts with this role will be able to grant or revoke other\\n * roles. More complex role relationships can be created by using\\n * {_setRoleAdmin}.\\n *\\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\\n * grant and revoke this role. Extra precautions should be taken to secure\\n * accounts that have been granted it.\\n */\\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\\n struct RoleData {\\n mapping(address => bool) members;\\n bytes32 adminRole;\\n }\\n\\n mapping(bytes32 => RoleData) private _roles;\\n\\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\\n\\n /**\\n * @dev Modifier that checks that an account has a specific role. Reverts\\n * with a standardized message including the required role.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n *\\n * _Available since v4.1._\\n */\\n modifier onlyRole(bytes32 role) {\\n _checkRole(role);\\n _;\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\\n return _roles[role].members[account];\\n }\\n\\n /**\\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\\n * Overriding this function changes the behavior of the {onlyRole} modifier.\\n *\\n * Format of the revert message is described in {_checkRole}.\\n *\\n * _Available since v4.6._\\n */\\n function _checkRole(bytes32 role) internal view virtual {\\n _checkRole(role, _msgSender());\\n }\\n\\n /**\\n * @dev Revert with a standard message if `account` is missing `role`.\\n *\\n * The format of the revert reason is given by the following regular expression:\\n *\\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\\n */\\n function _checkRole(bytes32 role, address account) internal view virtual {\\n if (!hasRole(role, account)) {\\n revert(\\n string(\\n abi.encodePacked(\\n \\\"AccessControl: account \\\",\\n Strings.toHexString(account),\\n \\\" is missing role \\\",\\n Strings.toHexString(uint256(role), 32)\\n )\\n )\\n );\\n }\\n }\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\\n return _roles[role].adminRole;\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function renounceRole(bytes32 role, address account) public virtual override {\\n require(account == _msgSender(), \\\"AccessControl: can only renounce roles for self\\\");\\n\\n _revokeRole(role, account);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event. Note that unlike {grantRole}, this function doesn't perform any\\n * checks on the calling account.\\n *\\n * May emit a {RoleGranted} event.\\n *\\n * [WARNING]\\n * ====\\n * This function should only be called from the constructor when setting\\n * up the initial roles for the system.\\n *\\n * Using this function in any other way is effectively circumventing the admin\\n * system imposed by {AccessControl}.\\n * ====\\n *\\n * NOTE: This function is deprecated in favor of {_grantRole}.\\n */\\n function _setupRole(bytes32 role, address account) internal virtual {\\n _grantRole(role, account);\\n }\\n\\n /**\\n * @dev Sets `adminRole` as ``role``'s admin role.\\n *\\n * Emits a {RoleAdminChanged} event.\\n */\\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\\n bytes32 previousAdminRole = getRoleAdmin(role);\\n _roles[role].adminRole = adminRole;\\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\\n }\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleGranted} event.\\n */\\n function _grantRole(bytes32 role, address account) internal virtual {\\n if (!hasRole(role, account)) {\\n _roles[role].members[account] = true;\\n emit RoleGranted(role, account, _msgSender());\\n }\\n }\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * Internal function without access restriction.\\n *\\n * May emit a {RoleRevoked} event.\\n */\\n function _revokeRole(bytes32 role, address account) internal virtual {\\n if (hasRole(role, account)) {\\n _roles[role].members[account] = false;\\n emit RoleRevoked(role, account, _msgSender());\\n }\\n }\\n}\\n\",\"keccak256\":\"0x67e3daf189111d6d5b0464ed09cf9f0605a22c4b965a7fcecd707101faff008a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/access/IAccessControl.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev External interface of AccessControl declared to support ERC165 detection.\\n */\\ninterface IAccessControl {\\n /**\\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\\n *\\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\\n * {RoleAdminChanged} not being emitted signaling this.\\n *\\n * _Available since v3.1._\\n */\\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\\n\\n /**\\n * @dev Emitted when `account` is granted `role`.\\n *\\n * `sender` is the account that originated the contract call, an admin role\\n * bearer except when using {AccessControl-_setupRole}.\\n */\\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Emitted when `account` is revoked `role`.\\n *\\n * `sender` is the account that originated the contract call:\\n * - if using `revokeRole`, it is the admin role bearer\\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\\n */\\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\\n\\n /**\\n * @dev Returns `true` if `account` has been granted `role`.\\n */\\n function hasRole(bytes32 role, address account) external view returns (bool);\\n\\n /**\\n * @dev Returns the admin role that controls `role`. See {grantRole} and\\n * {revokeRole}.\\n *\\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\\n */\\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\\n\\n /**\\n * @dev Grants `role` to `account`.\\n *\\n * If `account` had not been already granted `role`, emits a {RoleGranted}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function grantRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from `account`.\\n *\\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\\n *\\n * Requirements:\\n *\\n * - the caller must have ``role``'s admin role.\\n */\\n function revokeRole(bytes32 role, address account) external;\\n\\n /**\\n * @dev Revokes `role` from the calling account.\\n *\\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\\n * purpose is to provide a mechanism for accounts to lose their privileges\\n * if they are compromised (such as when a trusted device is misplaced).\\n *\\n * If the calling account had been granted `role`, emits a {RoleRevoked}\\n * event.\\n *\\n * Requirements:\\n *\\n * - the caller must be `account`.\\n */\\n function renounceRole(bytes32 role, address account) external;\\n}\\n\",\"keccak256\":\"0x59ce320a585d7e1f163cd70390a0ef2ff9cec832e2aa544293a00692465a7a57\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/security/Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which allows children to implement an emergency stop\\n * mechanism that can be triggered by an authorized account.\\n *\\n * This module is used through inheritance. It will make available the\\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\\n * the functions of your contract. Note that they will not be pausable by\\n * simply including this module, only once the modifiers are put in place.\\n */\\nabstract contract Pausable is Context {\\n /**\\n * @dev Emitted when the pause is triggered by `account`.\\n */\\n event Paused(address account);\\n\\n /**\\n * @dev Emitted when the pause is lifted by `account`.\\n */\\n event Unpaused(address account);\\n\\n bool private _paused;\\n\\n /**\\n * @dev Initializes the contract in unpaused state.\\n */\\n constructor() {\\n _paused = false;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is not paused.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n modifier whenNotPaused() {\\n _requireNotPaused();\\n _;\\n }\\n\\n /**\\n * @dev Modifier to make a function callable only when the contract is paused.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n modifier whenPaused() {\\n _requirePaused();\\n _;\\n }\\n\\n /**\\n * @dev Returns true if the contract is paused, and false otherwise.\\n */\\n function paused() public view virtual returns (bool) {\\n return _paused;\\n }\\n\\n /**\\n * @dev Throws if the contract is paused.\\n */\\n function _requireNotPaused() internal view virtual {\\n require(!paused(), \\\"Pausable: paused\\\");\\n }\\n\\n /**\\n * @dev Throws if the contract is not paused.\\n */\\n function _requirePaused() internal view virtual {\\n require(paused(), \\\"Pausable: not paused\\\");\\n }\\n\\n /**\\n * @dev Triggers stopped state.\\n *\\n * Requirements:\\n *\\n * - The contract must not be paused.\\n */\\n function _pause() internal virtual whenNotPaused {\\n _paused = true;\\n emit Paused(_msgSender());\\n }\\n\\n /**\\n * @dev Returns to normal state.\\n *\\n * Requirements:\\n *\\n * - The contract must be paused.\\n */\\n function _unpause() internal virtual whenPaused {\\n _paused = false;\\n emit Unpaused(_msgSender());\\n }\\n}\\n\",\"keccak256\":\"0x0849d93b16c9940beb286a7864ed02724b248b93e0d80ef6355af5ef15c64773\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/ERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC1155.sol\\\";\\nimport \\\"./IERC1155Receiver.sol\\\";\\nimport \\\"./extensions/IERC1155MetadataURI.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/Context.sol\\\";\\nimport \\\"../../utils/introspection/ERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the basic standard multi-token.\\n * See https://eips.ethereum.org/EIPS/eip-1155\\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\\n *\\n * _Available since v3.1._\\n */\\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\\n using Address for address;\\n\\n // Mapping from token ID to account balances\\n mapping(uint256 => mapping(address => uint256)) private _balances;\\n\\n // Mapping from account to operator approvals\\n mapping(address => mapping(address => bool)) private _operatorApprovals;\\n\\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\\n string private _uri;\\n\\n /**\\n * @dev See {_setURI}.\\n */\\n constructor(string memory uri_) {\\n _setURI(uri_);\\n }\\n\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\\n return\\n interfaceId == type(IERC1155).interfaceId ||\\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\\n super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev See {IERC1155MetadataURI-uri}.\\n *\\n * This implementation returns the same URI for *all* token types. It relies\\n * on the token type ID substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * Clients calling this function must replace the `\\\\{id\\\\}` substring with the\\n * actual token type ID.\\n */\\n function uri(uint256) public view virtual override returns (string memory) {\\n return _uri;\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\\n require(account != address(0), \\\"ERC1155: address zero is not a valid owner\\\");\\n return _balances[id][account];\\n }\\n\\n /**\\n * @dev See {IERC1155-balanceOfBatch}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\\n public\\n view\\n virtual\\n override\\n returns (uint256[] memory)\\n {\\n require(accounts.length == ids.length, \\\"ERC1155: accounts and ids length mismatch\\\");\\n\\n uint256[] memory batchBalances = new uint256[](accounts.length);\\n\\n for (uint256 i = 0; i < accounts.length; ++i) {\\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\\n }\\n\\n return batchBalances;\\n }\\n\\n /**\\n * @dev See {IERC1155-setApprovalForAll}.\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n _setApprovalForAll(_msgSender(), operator, approved);\\n }\\n\\n /**\\n * @dev See {IERC1155-isApprovedForAll}.\\n */\\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\\n return _operatorApprovals[account][operator];\\n }\\n\\n /**\\n * @dev See {IERC1155-safeTransferFrom}.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner or approved\\\"\\n );\\n _safeTransferFrom(from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev See {IERC1155-safeBatchTransferFrom}.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) public virtual override {\\n require(\\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\\n \\\"ERC1155: caller is not token owner or approved\\\"\\n );\\n _safeBatchTransferFrom(from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n\\n emit TransferSingle(operator, from, to, id, amount);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n require(to != address(0), \\\"ERC1155: transfer to the zero address\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; ++i) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: insufficient balance for transfer\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n _balances[id][to] += amount;\\n }\\n\\n emit TransferBatch(operator, from, to, ids, amounts);\\n\\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Sets a new URI for all token types, by relying on the token type ID\\n * substitution mechanism\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\\n *\\n * By this mechanism, any occurrence of the `\\\\{id\\\\}` substring in either the\\n * URI or any of the amounts in the JSON file at said URI will be replaced by\\n * clients with the token type ID.\\n *\\n * For example, the `https://token-cdn-domain/\\\\{id\\\\}.json` URI would be\\n * interpreted by clients as\\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\\n * for token type ID 0x4cce0.\\n *\\n * See {uri}.\\n *\\n * Because these URIs cannot be meaningfully represented by the {URI} event,\\n * this function emits no events.\\n */\\n function _setURI(string memory newuri) internal virtual {\\n _uri = newuri;\\n }\\n\\n /**\\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function _mint(\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _balances[id][to] += amount;\\n emit TransferSingle(operator, address(0), to, id, amount);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function _mintBatch(\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {\\n require(to != address(0), \\\"ERC1155: mint to the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n _balances[ids[i]][to] += amounts[i];\\n }\\n\\n emit TransferBatch(operator, address(0), to, ids, amounts);\\n\\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\\n\\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\\n }\\n\\n /**\\n * @dev Destroys `amount` tokens of token type `id` from `from`\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `from` cannot be the zero address.\\n * - `from` must have at least `amount` tokens of token type `id`.\\n */\\n function _burn(\\n address from,\\n uint256 id,\\n uint256 amount\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n\\n address operator = _msgSender();\\n uint256[] memory ids = _asSingletonArray(id);\\n uint256[] memory amounts = _asSingletonArray(amount);\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n\\n emit TransferSingle(operator, from, address(0), id, amount);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n */\\n function _burnBatch(\\n address from,\\n uint256[] memory ids,\\n uint256[] memory amounts\\n ) internal virtual {\\n require(from != address(0), \\\"ERC1155: burn from the zero address\\\");\\n require(ids.length == amounts.length, \\\"ERC1155: ids and amounts length mismatch\\\");\\n\\n address operator = _msgSender();\\n\\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n\\n for (uint256 i = 0; i < ids.length; i++) {\\n uint256 id = ids[i];\\n uint256 amount = amounts[i];\\n\\n uint256 fromBalance = _balances[id][from];\\n require(fromBalance >= amount, \\\"ERC1155: burn amount exceeds balance\\\");\\n unchecked {\\n _balances[id][from] = fromBalance - amount;\\n }\\n }\\n\\n emit TransferBatch(operator, from, address(0), ids, amounts);\\n\\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \\\"\\\");\\n }\\n\\n /**\\n * @dev Approve `operator` to operate on all of `owner` tokens\\n *\\n * Emits an {ApprovalForAll} event.\\n */\\n function _setApprovalForAll(\\n address owner,\\n address operator,\\n bool approved\\n ) internal virtual {\\n require(owner != operator, \\\"ERC1155: setting approval status for self\\\");\\n _operatorApprovals[owner][operator] = approved;\\n emit ApprovalForAll(owner, operator, approved);\\n }\\n\\n /**\\n * @dev Hook that is called before any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `ids` and `amounts` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n /**\\n * @dev Hook that is called after any token transfer. This includes minting\\n * and burning, as well as batched variants.\\n *\\n * The same hook is called on both single and batched variants. For single\\n * transfers, the length of the `id` and `amount` arrays will be 1.\\n *\\n * Calling conditions (for each `id` and `amount` pair):\\n *\\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n * of token type `id` will be transferred to `to`.\\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\\n * for `to`.\\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\\n * will be burned.\\n * - `from` and `to` are never both zero.\\n * - `ids` and `amounts` have the same, non-zero length.\\n *\\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n */\\n function _afterTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual {}\\n\\n function _doSafeTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\\n if (response != IERC1155Receiver.onERC1155Received.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non-ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _doSafeBatchTransferAcceptanceCheck(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) private {\\n if (to.isContract()) {\\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\\n bytes4 response\\n ) {\\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\\n revert(\\\"ERC1155: ERC1155Receiver rejected tokens\\\");\\n }\\n } catch Error(string memory reason) {\\n revert(reason);\\n } catch {\\n revert(\\\"ERC1155: transfer to non-ERC1155Receiver implementer\\\");\\n }\\n }\\n }\\n\\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\\n uint256[] memory array = new uint256[](1);\\n array[0] = element;\\n\\n return array;\\n }\\n}\\n\",\"keccak256\":\"0xd917747dc87f189c6779b894f367a028f9dca4be930283cccec8f312966af820\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155 is IERC165 {\\n /**\\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\\n */\\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\\n\\n /**\\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\\n * transfers.\\n */\\n event TransferBatch(\\n address indexed operator,\\n address indexed from,\\n address indexed to,\\n uint256[] ids,\\n uint256[] values\\n );\\n\\n /**\\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\\n * `approved`.\\n */\\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\\n\\n /**\\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\\n *\\n * If an {URI} event was emitted for `id`, the standard\\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\\n * returned by {IERC1155MetadataURI-uri}.\\n */\\n event URI(string value, uint256 indexed id);\\n\\n /**\\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\\n *\\n * Requirements:\\n *\\n * - `account` cannot be the zero address.\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\\n *\\n * Requirements:\\n *\\n * - `accounts` and `ids` must have the same length.\\n */\\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\\n external\\n view\\n returns (uint256[] memory);\\n\\n /**\\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\\n *\\n * Emits an {ApprovalForAll} event.\\n *\\n * Requirements:\\n *\\n * - `operator` cannot be the caller.\\n */\\n function setApprovalForAll(address operator, bool approved) external;\\n\\n /**\\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\\n *\\n * See {setApprovalForAll}.\\n */\\n function isApprovedForAll(address account, address operator) external view returns (bool);\\n\\n /**\\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\\n *\\n * Emits a {TransferSingle} event.\\n *\\n * Requirements:\\n *\\n * - `to` cannot be the zero address.\\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\\n * acceptance magic value.\\n */\\n function safeTransferFrom(\\n address from,\\n address to,\\n uint256 id,\\n uint256 amount,\\n bytes calldata data\\n ) external;\\n\\n /**\\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\\n *\\n * Emits a {TransferBatch} event.\\n *\\n * Requirements:\\n *\\n * - `ids` and `amounts` must have the same length.\\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\\n * acceptance magic value.\\n */\\n function safeBatchTransferFrom(\\n address from,\\n address to,\\n uint256[] calldata ids,\\n uint256[] calldata amounts,\\n bytes calldata data\\n ) external;\\n}\\n\",\"keccak256\":\"0x6392f2cfe3a5ee802227fe7a2dfd47096d881aec89bddd214b35c5b46d3cd941\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/introspection/IERC165.sol\\\";\\n\\n/**\\n * @dev _Available since v3.1._\\n */\\ninterface IERC1155Receiver is IERC165 {\\n /**\\n * @dev Handles the receipt of a single ERC1155 token type. This function is\\n * called at the end of a `safeTransferFrom` after the balance has been updated.\\n *\\n * NOTE: To accept the transfer, this must return\\n * `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))`\\n * (i.e. 0xf23a6e61, or its own function selector).\\n *\\n * @param operator The address which initiated the transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param id The ID of the token being transferred\\n * @param value The amount of tokens being transferred\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155Received(address,address,uint256,uint256,bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155Received(\\n address operator,\\n address from,\\n uint256 id,\\n uint256 value,\\n bytes calldata data\\n ) external returns (bytes4);\\n\\n /**\\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\\n * is called at the end of a `safeBatchTransferFrom` after the balances have\\n * been updated.\\n *\\n * NOTE: To accept the transfer(s), this must return\\n * `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))`\\n * (i.e. 0xbc197c81, or its own function selector).\\n *\\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\\n * @param from The address which previously owned the token\\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\\n * @param data Additional data with no specified format\\n * @return `bytes4(keccak256(\\\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\\\"))` if transfer is allowed\\n */\\n function onERC1155BatchReceived(\\n address operator,\\n address from,\\n uint256[] calldata ids,\\n uint256[] calldata values,\\n bytes calldata data\\n ) external returns (bytes4);\\n}\\n\",\"keccak256\":\"0xeb373f1fdc7b755c6a750123a9b9e3a8a02c1470042fd6505d875000a80bde0b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../ERC1155.sol\\\";\\nimport \\\"../../../security/Pausable.sol\\\";\\n\\n/**\\n * @dev ERC1155 token with pausable token transfers, minting and burning.\\n *\\n * Useful for scenarios such as preventing trades until the end of an evaluation\\n * period, or having an emergency switch for freezing all token transfers in the\\n * event of a large bug.\\n *\\n * _Available since v3.1._\\n */\\nabstract contract ERC1155Pausable is ERC1155, Pausable {\\n /**\\n * @dev See {ERC1155-_beforeTokenTransfer}.\\n *\\n * Requirements:\\n *\\n * - the contract must not be paused.\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override {\\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\\n\\n require(!paused(), \\\"ERC1155Pausable: token transfer while paused\\\");\\n }\\n}\\n\",\"keccak256\":\"0xdad22b949de979bb2ad9001c044b2aeaacf8a25e3de09ed6f022a9469f936d5b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC1155.sol\\\";\\n\\n/**\\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\\n *\\n * _Available since v3.1._\\n */\\ninterface IERC1155MetadataURI is IERC1155 {\\n /**\\n * @dev Returns the URI for token type `id`.\\n *\\n * If the `\\\\{id\\\\}` substring is present in the URI, it must be replaced by\\n * clients with the actual token type ID.\\n */\\n function uri(uint256 id) external view returns (string memory);\\n}\\n\",\"keccak256\":\"0xa66d18b9a85458d28fc3304717964502ae36f7f8a2ff35bc83f6f85d74b03574\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Strings.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./math/Math.sol\\\";\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary Strings {\\n bytes16 private constant _SYMBOLS = \\\"0123456789abcdef\\\";\\n uint8 private constant _ADDRESS_LENGTH = 20;\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n */\\n function toString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n uint256 length = Math.log10(value) + 1;\\n string memory buffer = new string(length);\\n uint256 ptr;\\n /// @solidity memory-safe-assembly\\n assembly {\\n ptr := add(buffer, add(32, length))\\n }\\n while (true) {\\n ptr--;\\n /// @solidity memory-safe-assembly\\n assembly {\\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\\n }\\n value /= 10;\\n if (value == 0) break;\\n }\\n return buffer;\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n */\\n function toHexString(uint256 value) internal pure returns (string memory) {\\n unchecked {\\n return toHexString(value, Math.log256(value) + 1);\\n }\\n }\\n\\n /**\\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n */\\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n bytes memory buffer = new bytes(2 * length + 2);\\n buffer[0] = \\\"0\\\";\\n buffer[1] = \\\"x\\\";\\n for (uint256 i = 2 * length + 1; i > 1; --i) {\\n buffer[i] = _SYMBOLS[value & 0xf];\\n value >>= 4;\\n }\\n require(value == 0, \\\"Strings: hex length insufficient\\\");\\n return string(buffer);\\n }\\n\\n /**\\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\\n */\\n function toHexString(address addr) internal pure returns (string memory) {\\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\\n }\\n}\\n\",\"keccak256\":\"0xa4d1d62251f8574deb032a35fc948386a9b4de74b812d4f545a1ac120486b48a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/ERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./IERC165.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC165} interface.\\n *\\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\\n * for the additional interface id that will be supported. For example:\\n *\\n * ```solidity\\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\\n * }\\n * ```\\n *\\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\\n */\\nabstract contract ERC165 is IERC165 {\\n /**\\n * @dev See {IERC165-supportsInterface}.\\n */\\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\\n return interfaceId == type(IERC165).interfaceId;\\n }\\n}\\n\",\"keccak256\":\"0xd10975de010d89fd1c78dc5e8a9a7e7f496198085c151648f20cba166b32582b\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/introspection/IERC165.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC165 standard, as defined in the\\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\\n *\\n * Implementers can declare support of contract interfaces, which can then be\\n * queried by others ({ERC165Checker}).\\n *\\n * For an implementation, see {ERC165}.\\n */\\ninterface IERC165 {\\n /**\\n * @dev Returns true if this contract implements the interface defined by\\n * `interfaceId`. See the corresponding\\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\\n * to learn more about how these ids are created.\\n *\\n * This function call must use less than 30 000 gas.\\n */\\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x447a5f3ddc18419d41ff92b3773fb86471b1db25773e07f877f548918a185bf1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/math/Math.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Standard math utilities missing in the Solidity language.\\n */\\nlibrary Math {\\n enum Rounding {\\n Down, // Toward negative infinity\\n Up, // Toward infinity\\n Zero // Toward zero\\n }\\n\\n /**\\n * @dev Returns the largest of two numbers.\\n */\\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a > b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the smallest of two numbers.\\n */\\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\\n return a < b ? a : b;\\n }\\n\\n /**\\n * @dev Returns the average of two numbers. The result is rounded towards\\n * zero.\\n */\\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b) / 2 can overflow.\\n return (a & b) + (a ^ b) / 2;\\n }\\n\\n /**\\n * @dev Returns the ceiling of the division of two numbers.\\n *\\n * This differs from standard division with `/` in that it rounds up instead\\n * of rounding down.\\n */\\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\\n // (a + b - 1) / b can overflow on addition, so we distribute.\\n return a == 0 ? 0 : (a - 1) / b + 1;\\n }\\n\\n /**\\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\\n * with further edits by Uniswap Labs also under MIT license.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator\\n ) internal pure returns (uint256 result) {\\n unchecked {\\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\\n // variables such that product = prod1 * 2^256 + prod0.\\n uint256 prod0; // Least significant 256 bits of the product\\n uint256 prod1; // Most significant 256 bits of the product\\n assembly {\\n let mm := mulmod(x, y, not(0))\\n prod0 := mul(x, y)\\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\\n }\\n\\n // Handle non-overflow cases, 256 by 256 division.\\n if (prod1 == 0) {\\n return prod0 / denominator;\\n }\\n\\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\\n require(denominator > prod1);\\n\\n ///////////////////////////////////////////////\\n // 512 by 256 division.\\n ///////////////////////////////////////////////\\n\\n // Make division exact by subtracting the remainder from [prod1 prod0].\\n uint256 remainder;\\n assembly {\\n // Compute remainder using mulmod.\\n remainder := mulmod(x, y, denominator)\\n\\n // Subtract 256 bit number from 512 bit number.\\n prod1 := sub(prod1, gt(remainder, prod0))\\n prod0 := sub(prod0, remainder)\\n }\\n\\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\\n // See https://cs.stackexchange.com/q/138556/92363.\\n\\n // Does not overflow because the denominator cannot be zero at this stage in the function.\\n uint256 twos = denominator & (~denominator + 1);\\n assembly {\\n // Divide denominator by twos.\\n denominator := div(denominator, twos)\\n\\n // Divide [prod1 prod0] by twos.\\n prod0 := div(prod0, twos)\\n\\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\\n twos := add(div(sub(0, twos), twos), 1)\\n }\\n\\n // Shift in bits from prod1 into prod0.\\n prod0 |= prod1 * twos;\\n\\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\\n // four bits. That is, denominator * inv = 1 mod 2^4.\\n uint256 inverse = (3 * denominator) ^ 2;\\n\\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\\n // in modular arithmetic, doubling the correct bits in each step.\\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\\n\\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\\n // is no longer required.\\n result = prod0 * inverse;\\n return result;\\n }\\n }\\n\\n /**\\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\\n */\\n function mulDiv(\\n uint256 x,\\n uint256 y,\\n uint256 denominator,\\n Rounding rounding\\n ) internal pure returns (uint256) {\\n uint256 result = mulDiv(x, y, denominator);\\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\\n result += 1;\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\\n *\\n * Inspired by Henry S. Warren, Jr.'s \\\"Hacker's Delight\\\" (Chapter 11).\\n */\\n function sqrt(uint256 a) internal pure returns (uint256) {\\n if (a == 0) {\\n return 0;\\n }\\n\\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\\n //\\n // We know that the \\\"msb\\\" (most significant bit) of our target number `a` is a power of 2 such that we have\\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\\n //\\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\\n // \\u2192 `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\\n // \\u2192 `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\\n //\\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\\n uint256 result = 1 << (log2(a) >> 1);\\n\\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\\n // into the expected uint128 result.\\n unchecked {\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n result = (result + a / result) >> 1;\\n return min(result, a / result);\\n }\\n }\\n\\n /**\\n * @notice Calculates sqrt(a), following the selected rounding direction.\\n */\\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = sqrt(a);\\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 2, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 128;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 64;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 32;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 16;\\n }\\n if (value >> 8 > 0) {\\n value >>= 8;\\n result += 8;\\n }\\n if (value >> 4 > 0) {\\n value >>= 4;\\n result += 4;\\n }\\n if (value >> 2 > 0) {\\n value >>= 2;\\n result += 2;\\n }\\n if (value >> 1 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log2(value);\\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 10, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >= 10**64) {\\n value /= 10**64;\\n result += 64;\\n }\\n if (value >= 10**32) {\\n value /= 10**32;\\n result += 32;\\n }\\n if (value >= 10**16) {\\n value /= 10**16;\\n result += 16;\\n }\\n if (value >= 10**8) {\\n value /= 10**8;\\n result += 8;\\n }\\n if (value >= 10**4) {\\n value /= 10**4;\\n result += 4;\\n }\\n if (value >= 10**2) {\\n value /= 10**2;\\n result += 2;\\n }\\n if (value >= 10**1) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log10(value);\\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\\n }\\n }\\n\\n /**\\n * @dev Return the log in base 256, rounded down, of a positive value.\\n * Returns 0 if given 0.\\n *\\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\\n */\\n function log256(uint256 value) internal pure returns (uint256) {\\n uint256 result = 0;\\n unchecked {\\n if (value >> 128 > 0) {\\n value >>= 128;\\n result += 16;\\n }\\n if (value >> 64 > 0) {\\n value >>= 64;\\n result += 8;\\n }\\n if (value >> 32 > 0) {\\n value >>= 32;\\n result += 4;\\n }\\n if (value >> 16 > 0) {\\n value >>= 16;\\n result += 2;\\n }\\n if (value >> 8 > 0) {\\n result += 1;\\n }\\n }\\n return result;\\n }\\n\\n /**\\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\\n * Returns 0 if given 0.\\n */\\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\\n unchecked {\\n uint256 result = log256(value);\\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xa1e8e83cd0087785df04ac79fb395d9f3684caeaf973d9e2c71caef723a3a5d6\",\"license\":\"MIT\"},\"contracts/core/Badges.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {IBadges} from './interfaces/IBadges.sol';\\n\\n/**\\n * @title Badges contract\\n * @author Sismo\\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\\n * The associated attestations registry triggers TransferSingle events from this contract\\n * It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms\\n * For more information: https://badges.docs.sismo.io\\n */\\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\\n uint8 public constant IMPLEMENTATION_VERSION = 3;\\n\\n IAttestationsRegistry internal _attestationsRegistry;\\n\\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\\n\\n /**\\n * @dev Constructor\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n */\\n constructor(\\n string memory uri,\\n address owner // This is Sismo Frontend Contract\\n ) ERC1155(uri) {\\n initialize(uri, owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n string memory uri,\\n address owner\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup uri yet or if called by constructor (for implem setup)\\n if (bytes(ERC1155.uri(0)).length == 0 || address(this).code.length == 0) {\\n _setURI(uri);\\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\\n }\\n }\\n\\n /**\\n * @dev Main function of the ERC1155 badge\\n * The balance of a user is equal to the value of the underlying attestation.\\n * attestationCollectionId == badgeId\\n * @param account Address to check badge balance (= value of attestation)\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function balanceOf(\\n address account,\\n uint256 id\\n ) public view virtual override(ERC1155, IBadges) returns (uint256) {\\n return _attestationsRegistry.getAttestationValue(id, account);\\n }\\n\\n /**\\n * @dev Reverts, this is a non transferable ERC115 contract\\n */\\n function setApprovalForAll(address operator, bool approved) public virtual override {\\n revert BadgesNonTransferrable();\\n }\\n\\n /**\\n * @dev Reverts, this is a non transferable ERC115 contract\\n */\\n function isApprovedForAll(\\n address account,\\n address operator\\n ) public view virtual override returns (bool) {\\n revert BadgesNonTransferrable();\\n }\\n\\n /**\\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\\n * @param operator who is calling the TransferEvent\\n * @param from address(0) if minting, address of the badge holder if burning\\n * @param to address of the badge holder is minting, address(0) if burning\\n * @param id badgeId for which to trigger the event\\n * @param value minted/burned balance\\n */\\n function triggerTransferEvent(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 value\\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\\n emit TransferSingle(operator, from, to, id, value);\\n }\\n\\n /**\\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\\n * @param attestationsRegistry new attestations registry address\\n */\\n function setAttestationsRegistry(\\n address attestationsRegistry\\n ) external override onlyRole(DEFAULT_ADMIN_ROLE) {\\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\\n }\\n\\n /**\\n * @dev Set the URI. Can only be called by owner (default admin)\\n * @param uri new attestations registry address\\n */\\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\\n _setURI(uri);\\n }\\n\\n /**\\n * @dev Getter of the attestations registry\\n */\\n function getAttestationsRegistry() external view override returns (address) {\\n return address(_attestationsRegistry);\\n }\\n\\n /**\\n * @dev Getter of the badge issuer\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeIssuer(address account, uint256 id) external view returns (address) {\\n return _attestationsRegistry.getAttestationIssuer(id, account);\\n }\\n\\n /**\\n * @dev Getter of the badge timestamp\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32) {\\n return _attestationsRegistry.getAttestationTimestamp(id, account);\\n }\\n\\n /**\\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory) {\\n return _attestationsRegistry.getAttestationExtraData(id, account);\\n }\\n\\n /**\\n * @dev Getter of the value of a specific badge attribute\\n * @param id Badge Id to check (= attestationCollectionId)\\n * @param index Index of the attribute\\n */\\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8) {\\n return _attestationsRegistry.getAttributeValueForAttestationsCollection(id, index);\\n }\\n\\n /**\\n * @dev Getter of all badge attributes and their values for a specific badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getAttributesNamesAndValuesForBadge(\\n uint256 id\\n ) external view returns (bytes32[] memory, uint8[] memory) {\\n return _attestationsRegistry.getAttributesNamesAndValuesForAttestationsCollection(id);\\n }\\n\\n /**\\n * @dev ERC165\\n */\\n function supportsInterface(\\n bytes4 interfaceId\\n ) public view virtual override(AccessControl, ERC1155) returns (bool) {\\n return super.supportsInterface(interfaceId);\\n }\\n\\n /**\\n * @dev Reverts, this is a non transferable ERC115 contract\\n */\\n function _beforeTokenTransfer(\\n address operator,\\n address from,\\n address to,\\n uint256[] memory ids,\\n uint256[] memory amounts,\\n bytes memory data\\n ) internal virtual override {\\n revert BadgesNonTransferrable();\\n }\\n}\\n\",\"keccak256\":\"0x9982b753d43f2a4a9edb5987714b09f518b419339d4bf9cd63b600bee442fd01\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IBadges.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Interface for Badges contract\\n * @author Sismo\\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\\n * The associated attestations registry triggers TransferSingle events from this contract\\n * It allows badge \\\"shadow mints and burns\\\" to be caught by off-chain platforms\\n */\\ninterface IBadges {\\n error BadgesNonTransferrable();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param uri Uri for the metadata of badges\\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(string memory uri, address owner) external;\\n\\n /**\\n * @dev Main function of the ERC1155 badge\\n * The balance of a user is equal to the value of the underlying attestation.\\n * attestationCollectionId == badgeId\\n * @param account Address to check badge balance (= value of attestation)\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function balanceOf(address account, uint256 id) external view returns (uint256);\\n\\n /**\\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\\n * @param operator who is calling the TransferEvent\\n * @param from address(0) if minting, address of the badge holder if burning\\n * @param to address of the badge holder is minting, address(0) if burning\\n * @param id badgeId for which to trigger the event\\n * @param value minted/burned balance\\n */\\n function triggerTransferEvent(\\n address operator,\\n address from,\\n address to,\\n uint256 id,\\n uint256 value\\n ) external;\\n\\n /**\\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\\n * @param attestationsRegistry new attestations registry address\\n */\\n function setAttestationsRegistry(address attestationsRegistry) external;\\n\\n /**\\n * @dev Set the URI. Can only be called by owner (default admin)\\n * @param uri new attestations registry address\\n */\\n function setUri(string memory uri) external;\\n\\n /**\\n * @dev Getter of the attestations registry\\n */\\n function getAttestationsRegistry() external view returns (address);\\n\\n /**\\n * @dev Getter of the badge issuer\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeIssuer(address account, uint256 id) external view returns (address);\\n\\n /**\\n * @dev Getter of the badge timestamp\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\\n * @param account Address that holds the badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the value of a specific badge attribute\\n * @param id Badge Id to check (= attestationCollectionId)\\n * @param index Index of the attribute\\n */\\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);\\n\\n /**\\n * @dev Getter of all badge attributes and their values for a specific badge\\n * @param id Badge Id to check (= attestationCollectionId)\\n */\\n function getAttributesNamesAndValuesForBadge(\\n uint256 id\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n}\\n\",\"keccak256\":\"0xd6bdfc887ef15ee022eb05d89dbe2e2938ee6c0a55a55f8db527ef650242c6bb\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x60806040523480156200001157600080fd5b50604051620027eb380380620027eb833981016040819052620000349162000395565b81620000408162000055565b506200004d82826200006e565b5050620004c2565b80516200006a906004906020840190620002bc565b5050565b600054600390610100900460ff1615801562000091575060005460ff8083169116105b620000f95760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff83161761010017815562000127906200051d62000198602090811b91909117901c565b511580620001345750303b155b156200015257620001458362000055565b6200015260008362000234565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b606060048054620001a99062000486565b80601f0160208091040260200160405190810160405280929190818152602001828054620001d79062000486565b8015620002285780601f10620001fc5761010080835404028352916020019162000228565b820191906000526020600020905b8154815290600101906020018083116200020a57829003601f168201915b50505050509050919050565b60008281526001602090815260408083206001600160a01b038516845290915290205460ff166200006a5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b828054620002ca9062000486565b90600052602060002090601f016020900481019282620002ee576000855562000339565b82601f106200030957805160ff191683800117855562000339565b8280016001018555821562000339579182015b82811115620003395782518255916020019190600101906200031c565b50620003479291506200034b565b5090565b5b808211156200034757600081556001016200034c565b634e487b7160e01b600052604160045260246000fd5b80516001600160a01b03811681146200039057600080fd5b919050565b60008060408385031215620003a957600080fd5b82516001600160401b0380821115620003c157600080fd5b818501915085601f830112620003d657600080fd5b815181811115620003eb57620003eb62000362565b604051601f8201601f19908116603f0116810190838211818310171562000416576200041662000362565b816040528281526020935088848487010111156200043357600080fd5b600091505b8282101562000457578482018401518183018501529083019062000438565b82821115620004695760008484830101525b95506200047b91505085820162000378565b925050509250929050565b600181811c908216806200049b57607f821691505b602082108103620004bc57634e487b7160e01b600052602260045260246000fd5b50919050565b61231980620004d26000396000f3fe608060405234801561001057600080fd5b506004361061018d5760003560e01c8063754b377c116100de578063aed8c6bc11610097578063e37ffe7c11610071578063e37ffe7c146103aa578063e985e9c5146103cb578063f242432a146103de578063ff4468c4146103f157600080fd5b8063aed8c6bc14610371578063b3c1cb2114610384578063d547741f1461039757600080fd5b8063754b377c146103035780637ab4339d1461031d57806391d14854146103305780639b642de114610343578063a217fddf14610356578063a22cb4651461035e57600080fd5b80632f2ff15d1161014b57806344112ed81161012557806344112ed8146102985780634e1273f4146102bf578063710b3096146102df578063730cb7d5146102f257600080fd5b80632f2ff15d1461025f57806336568abe146102725780633e1f3c271461028557600080fd5b8062fdd58e1461019257806301ffc9a7146101b85780630e064366146101db5780630e89341c14610206578063248a9ca3146102265780632eb2c2d61461024a575b600080fd5b6101a56101a0366004611618565b610419565b6040519081526020015b60405180910390f35b6101cb6101c636600461165a565b610496565b60405190151581526020016101af565b6101ee6101e9366004611618565b6104a7565b6040516001600160a01b0390911681526020016101af565b610219610214366004611677565b61051d565b6040516101af91906116ec565b6101a5610234366004611677565b6000908152600160208190526040909120015490565b61025d610258366004611858565b6105b1565b005b61025d61026d366004611905565b610606565b61025d610280366004611905565b610631565b610219610293366004611618565b6106af565b6101a57fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa481565b6102d26102cd366004611935565b610729565b6040516101af9190611a3c565b61025d6102ed366004611a4f565b610852565b6005546001600160a01b03166101ee565b61030b600381565b60405160ff90911681526020016101af565b61025d61032b366004611aaa565b6108e4565b6101cb61033e366004611905565b6109f1565b61025d610351366004611af0565b610a1c565b6101a5600081565b61025d61036c366004611b2c565b610a30565b61030b61037f366004611b6e565b610a49565b61025d610392366004611b93565b610ac0565b61025d6103a5366004611905565b610aee565b6103bd6103b8366004611677565b610b14565b6040516101af929190611bb0565b6101cb6103d9366004611c2e565b610b93565b61025d6103ec366004611c5c565b610bae565b6104046103ff366004611618565b610bf3565b60405163ffffffff90911681526020016101af565b60055460405163461e4f1960e11b8152600481018390526001600160a01b0384811660248301526000921690638c3c9e3290604401602060405180830381865afa15801561046b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cc4565b9392505050565b60006104a182610c69565b92915050565b6005546040516363ed4d5360e11b8152600481018390526001600160a01b038481166024830152600092169063c7da9aa690604401602060405180830381865afa1580156104f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cdd565b60606004805461052c90611cfa565b80601f016020809104026020016040519081016040528092919081815260200182805461055890611cfa565b80156105a55780601f1061057a576101008083540402835291602001916105a5565b820191906000526020600020905b81548152906001019060200180831161058857829003601f168201915b50505050509050919050565b6001600160a01b0385163314806105cd57506105cd8533610b93565b6105f25760405162461bcd60e51b81526004016105e990611d34565b60405180910390fd5b6105ff8585858585610ca9565b5050505050565b6000828152600160208190526040909120015461062281610e97565b61062c8383610ea4565b505050565b6001600160a01b03811633146106a15760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105e9565b6106ab8282610f0f565b5050565b600554604051636d7fbb6760e01b8152600481018390526001600160a01b0384811660248301526060921690636d7fbb6790604401600060405180830381865afa158015610701573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261048f9190810190611d82565b6060815183511461078e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016105e9565b600083516001600160401b038111156107a9576107a96116ff565b6040519080825280602002602001820160405280156107d2578160200160208202803683370190505b50905060005b845181101561084a5761081d8582815181106107f6576107f6611e03565b602002602001015185838151811061081057610810611e03565b6020026020010151610419565b82828151811061082f5761082f611e03565b602090810291909101015261084381611e2f565b90506107d8565b509392505050565b7fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa461087c81610e97565b836001600160a01b0316856001600160a01b0316876001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6286866040516108d4929190918252602082015260400190565b60405180910390a4505050505050565b600054600390610100900460ff16158015610906575060005460ff8083169116105b6109695760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e9565b6000805461ffff191660ff8316176101001781556109869061051d565b5115806109925750303b155b156109ab576109a083610f76565b6109ab600083610ea4565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610a2781610e97565b6106ab82610f76565b6040516309a711b960e31b815260040160405180910390fd5b600554604051630e972f9160e41b81526004810184905260ff831660248201526000916001600160a01b03169063e972f91090604401602060405180830381865afa158015610a9c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611e48565b6000610acb81610e97565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526001602081905260409091200154610b0a81610e97565b61062c8383610f0f565b600554604051632b2bf81b60e11b81526004810183905260609182916001600160a01b0390911690635657f03690602401600060405180830381865afa158015610b62573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b8a9190810190611ed4565b91509150915091565b60006040516309a711b960e31b815260040160405180910390fd5b6001600160a01b038516331480610bca5750610bca8533610b93565b610be65760405162461bcd60e51b81526004016105e990611d34565b6105ff8585858585610f89565b6005546040516314067f8b60e01b8152600481018390526001600160a01b03848116602483015260009216906314067f8b90604401602060405180830381865afa158015610c45573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611f90565b60006001600160e01b03198216636cdb3d1360e11b1480610c9a57506001600160e01b031982166303a24d0760e21b145b806104a157506104a1826110c5565b8151835114610d0b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016105e9565b6001600160a01b038416610d315760405162461bcd60e51b81526004016105e990611fb6565b33610d40818787878787610a30565b60005b8451811015610e29576000858281518110610d6057610d60611e03565b602002602001015190506000858381518110610d7e57610d7e611e03565b60209081029190910181015160008481526002835260408082206001600160a01b038e168352909352919091205490915081811015610dcf5760405162461bcd60e51b81526004016105e990611ffb565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610e0e908490612045565b9250508190555050505080610e2290611e2f565b9050610d43565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610e7992919061205d565b60405180910390a4610e8f8187878787876110fa565b505050505050565b610ea1813361125e565b50565b610eae82826109f1565b6106ab5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b610f1982826109f1565b156106ab5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b80516106ab90600490602084019061156a565b6001600160a01b038416610faf5760405162461bcd60e51b81526004016105e990611fb6565b336000610fbb856112b7565b90506000610fc8856112b7565b9050610fd8838989858589610a30565b60008681526002602090815260408083206001600160a01b038c1684529091529020548581101561101b5760405162461bcd60e51b81526004016105e990611ffb565b60008781526002602090815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061105a908490612045565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46110ba848a8a8a8a8a611302565b505050505050505050565b60006001600160e01b03198216637965db0b60e01b14806104a157506301ffc9a760e01b6001600160e01b03198316146104a1565b6001600160a01b0384163b15610e8f5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061113e908990899088908890889060040161208b565b6020604051808303816000875af1925050508015611179575060408051601f3d908101601f19168201909252611176918101906120e9565b60015b61122557611185612106565b806308c379a0036111be5750611199612122565b806111a457506111c0565b8060405162461bcd60e51b81526004016105e991906116ec565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016105e9565b6001600160e01b0319811663bc197c8160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b50505050505050565b61126882826109f1565b6106ab57611275816113bd565b6112808360206113cf565b6040516020016112919291906121f3565b60408051601f198184030181529082905262461bcd60e51b82526105e9916004016116ec565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106112f1576112f1611e03565b602090810291909101015292915050565b6001600160a01b0384163b15610e8f5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906113469089908990889088908890600401612268565b6020604051808303816000875af1925050508015611381575060408051601f3d908101601f1916820190925261137e918101906120e9565b60015b61138d57611185612106565b6001600160e01b0319811663f23a6e6160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b60606104a16001600160a01b03831660145b606060006113de8360026122ad565b6113e9906002612045565b6001600160401b03811115611400576114006116ff565b6040519080825280601f01601f19166020018201604052801561142a576020820181803683370190505b509050600360fc1b8160008151811061144557611445611e03565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061147457611474611e03565b60200101906001600160f81b031916908160001a90535060006114988460026122ad565b6114a3906001612045565b90505b600181111561151b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106114d7576114d7611e03565b1a60f81b8282815181106114ed576114ed611e03565b60200101906001600160f81b031916908160001a90535060049490941c93611514816122cc565b90506114a6565b50831561048f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105e9565b82805461157690611cfa565b90600052602060002090601f01602090048101928261159857600085556115de565b82601f106115b157805160ff19168380011785556115de565b828001600101855582156115de579182015b828111156115de5782518255916020019190600101906115c3565b506115ea9291506115ee565b5090565b5b808211156115ea57600081556001016115ef565b6001600160a01b0381168114610ea157600080fd5b6000806040838503121561162b57600080fd5b823561163681611603565b946020939093013593505050565b6001600160e01b031981168114610ea157600080fd5b60006020828403121561166c57600080fd5b813561048f81611644565b60006020828403121561168957600080fd5b5035919050565b60005b838110156116ab578181015183820152602001611693565b838111156116ba576000848401525b50505050565b600081518084526116d8816020860160208601611690565b601f01601f19169290920160200192915050565b60208152600061048f60208301846116c0565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561173a5761173a6116ff565b6040525050565b60006001600160401b0382111561175a5761175a6116ff565b5060051b60200190565b600082601f83011261177557600080fd5b8135602061178282611741565b60405161178f8282611715565b83815260059390931b85018201928281019150868411156117af57600080fd5b8286015b848110156117ca57803583529183019183016117b3565b509695505050505050565b60006001600160401b038211156117ee576117ee6116ff565b50601f01601f191660200190565b600082601f83011261180d57600080fd5b8135611818816117d5565b6040516118258282611715565b82815285602084870101111561183a57600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a0868803121561187057600080fd5b853561187b81611603565b9450602086013561188b81611603565b935060408601356001600160401b03808211156118a757600080fd5b6118b389838a01611764565b945060608801359150808211156118c957600080fd5b6118d589838a01611764565b935060808801359150808211156118eb57600080fd5b506118f8888289016117fc565b9150509295509295909350565b6000806040838503121561191857600080fd5b82359150602083013561192a81611603565b809150509250929050565b6000806040838503121561194857600080fd5b82356001600160401b038082111561195f57600080fd5b818501915085601f83011261197357600080fd5b8135602061198082611741565b60405161198d8282611715565b83815260059390931b85018201928281019150898411156119ad57600080fd5b948201945b838610156119d45785356119c581611603565b825294820194908201906119b2565b965050860135925050808211156119ea57600080fd5b506119f785828601611764565b9150509250929050565b600081518084526020808501945080840160005b83811015611a3157815187529582019590820190600101611a15565b509495945050505050565b60208152600061048f6020830184611a01565b600080600080600060a08688031215611a6757600080fd5b8535611a7281611603565b94506020860135611a8281611603565b93506040860135611a9281611603565b94979396509394606081013594506080013592915050565b60008060408385031215611abd57600080fd5b82356001600160401b03811115611ad357600080fd5b611adf858286016117fc565b925050602083013561192a81611603565b600060208284031215611b0257600080fd5b81356001600160401b03811115611b1857600080fd5b611b24848285016117fc565b949350505050565b60008060408385031215611b3f57600080fd5b8235611b4a81611603565b91506020830135801515811461192a57600080fd5b60ff81168114610ea157600080fd5b60008060408385031215611b8157600080fd5b82359150602083013561192a81611b5f565b600060208284031215611ba557600080fd5b813561048f81611603565b604080825283519082018190526000906020906060840190828701845b82811015611be957815184529284019290840190600101611bcd565b5050508381038285015284518082528583019183019060005b81811015611c2157835160ff1683529284019291840191600101611c02565b5090979650505050505050565b60008060408385031215611c4157600080fd5b8235611c4c81611603565b9150602083013561192a81611603565b600080600080600060a08688031215611c7457600080fd5b8535611c7f81611603565b94506020860135611c8f81611603565b9350604086013592506060860135915060808601356001600160401b03811115611cb857600080fd5b6118f8888289016117fc565b600060208284031215611cd657600080fd5b5051919050565b600060208284031215611cef57600080fd5b815161048f81611603565b600181811c90821680611d0e57607f821691505b602082108103611d2e57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b600060208284031215611d9457600080fd5b81516001600160401b03811115611daa57600080fd5b8201601f81018413611dbb57600080fd5b8051611dc6816117d5565b604051611dd38282611715565b828152866020848601011115611de857600080fd5b611df9836020830160208701611690565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e4157611e41611e19565b5060010190565b600060208284031215611e5a57600080fd5b815161048f81611b5f565b600082601f830112611e7657600080fd5b81516020611e8382611741565b604051611e908282611715565b83815260059390931b8501820192828101915086841115611eb057600080fd5b8286015b848110156117ca578051611ec781611b5f565b8352918301918301611eb4565b60008060408385031215611ee757600080fd5b82516001600160401b0380821115611efe57600080fd5b818501915085601f830112611f1257600080fd5b81516020611f1f82611741565b604051611f2c8282611715565b83815260059390931b8501820192828101915089841115611f4c57600080fd5b948201945b83861015611f6a57855182529482019490820190611f51565b91880151919650909350505080821115611f8357600080fd5b506119f785828601611e65565b600060208284031215611fa257600080fd5b815163ffffffff8116811461048f57600080fd5b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6000821982111561205857612058611e19565b500190565b6040815260006120706040830185611a01565b82810360208401526120828185611a01565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906120b790830186611a01565b82810360608401526120c98186611a01565b905082810360808401526120dd81856116c0565b98975050505050505050565b6000602082840312156120fb57600080fd5b815161048f81611644565b600060033d111561211f5760046000803e5060005160e01c5b90565b600060443d10156121305790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561215f57505050505090565b82850191508151818111156121775750505050505090565b843d87010160208285010111156121915750505050505090565b6121a060208286010187611715565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161222b816017850160208801611690565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161225c816028840160208801611690565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906122a2908301846116c0565b979650505050505050565b60008160001904831182151516156122c7576122c7611e19565b500290565b6000816122db576122db611e19565b50600019019056fea26469706673582212209e33646a1ed2d51fcc749870e94aa69546c518fc5bfee43d37014ebc54dd767864736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061018d5760003560e01c8063754b377c116100de578063aed8c6bc11610097578063e37ffe7c11610071578063e37ffe7c146103aa578063e985e9c5146103cb578063f242432a146103de578063ff4468c4146103f157600080fd5b8063aed8c6bc14610371578063b3c1cb2114610384578063d547741f1461039757600080fd5b8063754b377c146103035780637ab4339d1461031d57806391d14854146103305780639b642de114610343578063a217fddf14610356578063a22cb4651461035e57600080fd5b80632f2ff15d1161014b57806344112ed81161012557806344112ed8146102985780634e1273f4146102bf578063710b3096146102df578063730cb7d5146102f257600080fd5b80632f2ff15d1461025f57806336568abe146102725780633e1f3c271461028557600080fd5b8062fdd58e1461019257806301ffc9a7146101b85780630e064366146101db5780630e89341c14610206578063248a9ca3146102265780632eb2c2d61461024a575b600080fd5b6101a56101a0366004611618565b610419565b6040519081526020015b60405180910390f35b6101cb6101c636600461165a565b610496565b60405190151581526020016101af565b6101ee6101e9366004611618565b6104a7565b6040516001600160a01b0390911681526020016101af565b610219610214366004611677565b61051d565b6040516101af91906116ec565b6101a5610234366004611677565b6000908152600160208190526040909120015490565b61025d610258366004611858565b6105b1565b005b61025d61026d366004611905565b610606565b61025d610280366004611905565b610631565b610219610293366004611618565b6106af565b6101a57fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa481565b6102d26102cd366004611935565b610729565b6040516101af9190611a3c565b61025d6102ed366004611a4f565b610852565b6005546001600160a01b03166101ee565b61030b600381565b60405160ff90911681526020016101af565b61025d61032b366004611aaa565b6108e4565b6101cb61033e366004611905565b6109f1565b61025d610351366004611af0565b610a1c565b6101a5600081565b61025d61036c366004611b2c565b610a30565b61030b61037f366004611b6e565b610a49565b61025d610392366004611b93565b610ac0565b61025d6103a5366004611905565b610aee565b6103bd6103b8366004611677565b610b14565b6040516101af929190611bb0565b6101cb6103d9366004611c2e565b610b93565b61025d6103ec366004611c5c565b610bae565b6104046103ff366004611618565b610bf3565b60405163ffffffff90911681526020016101af565b60055460405163461e4f1960e11b8152600481018390526001600160a01b0384811660248301526000921690638c3c9e3290604401602060405180830381865afa15801561046b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cc4565b9392505050565b60006104a182610c69565b92915050565b6005546040516363ed4d5360e11b8152600481018390526001600160a01b038481166024830152600092169063c7da9aa690604401602060405180830381865afa1580156104f9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611cdd565b60606004805461052c90611cfa565b80601f016020809104026020016040519081016040528092919081815260200182805461055890611cfa565b80156105a55780601f1061057a576101008083540402835291602001916105a5565b820191906000526020600020905b81548152906001019060200180831161058857829003601f168201915b50505050509050919050565b6001600160a01b0385163314806105cd57506105cd8533610b93565b6105f25760405162461bcd60e51b81526004016105e990611d34565b60405180910390fd5b6105ff8585858585610ca9565b5050505050565b6000828152600160208190526040909120015461062281610e97565b61062c8383610ea4565b505050565b6001600160a01b03811633146106a15760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084016105e9565b6106ab8282610f0f565b5050565b600554604051636d7fbb6760e01b8152600481018390526001600160a01b0384811660248301526060921690636d7fbb6790604401600060405180830381865afa158015610701573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261048f9190810190611d82565b6060815183511461078e5760405162461bcd60e51b815260206004820152602960248201527f455243313135353a206163636f756e747320616e6420696473206c656e677468604482015268040dad2e6dac2e8c6d60bb1b60648201526084016105e9565b600083516001600160401b038111156107a9576107a96116ff565b6040519080825280602002602001820160405280156107d2578160200160208202803683370190505b50905060005b845181101561084a5761081d8582815181106107f6576107f6611e03565b602002602001015185838151811061081057610810611e03565b6020026020010151610419565b82828151811061082f5761082f611e03565b602090810291909101015261084381611e2f565b90506107d8565b509392505050565b7fe6cd5415a09470f57cb652d653ef635ecd9a997fef2537decaf18eb7545b7fa461087c81610e97565b836001600160a01b0316856001600160a01b0316876001600160a01b03167fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6286866040516108d4929190918252602082015260400190565b60405180910390a4505050505050565b600054600390610100900460ff16158015610906575060005460ff8083169116105b6109695760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084016105e9565b6000805461ffff191660ff8316176101001781556109869061051d565b5115806109925750303b155b156109ab576109a083610f76565b6109ab600083610ea4565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a1505050565b60009182526001602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610a2781610e97565b6106ab82610f76565b6040516309a711b960e31b815260040160405180910390fd5b600554604051630e972f9160e41b81526004810184905260ff831660248201526000916001600160a01b03169063e972f91090604401602060405180830381865afa158015610a9c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611e48565b6000610acb81610e97565b50600580546001600160a01b0319166001600160a01b0392909216919091179055565b60008281526001602081905260409091200154610b0a81610e97565b61062c8383610f0f565b600554604051632b2bf81b60e11b81526004810183905260609182916001600160a01b0390911690635657f03690602401600060405180830381865afa158015610b62573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f19168201604052610b8a9190810190611ed4565b91509150915091565b60006040516309a711b960e31b815260040160405180910390fd5b6001600160a01b038516331480610bca5750610bca8533610b93565b610be65760405162461bcd60e51b81526004016105e990611d34565b6105ff8585858585610f89565b6005546040516314067f8b60e01b8152600481018390526001600160a01b03848116602483015260009216906314067f8b90604401602060405180830381865afa158015610c45573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061048f9190611f90565b60006001600160e01b03198216636cdb3d1360e11b1480610c9a57506001600160e01b031982166303a24d0760e21b145b806104a157506104a1826110c5565b8151835114610d0b5760405162461bcd60e51b815260206004820152602860248201527f455243313135353a2069647320616e6420616d6f756e7473206c656e677468206044820152670dad2e6dac2e8c6d60c31b60648201526084016105e9565b6001600160a01b038416610d315760405162461bcd60e51b81526004016105e990611fb6565b33610d40818787878787610a30565b60005b8451811015610e29576000858281518110610d6057610d60611e03565b602002602001015190506000858381518110610d7e57610d7e611e03565b60209081029190910181015160008481526002835260408082206001600160a01b038e168352909352919091205490915081811015610dcf5760405162461bcd60e51b81526004016105e990611ffb565b60008381526002602090815260408083206001600160a01b038e8116855292528083208585039055908b16825281208054849290610e0e908490612045565b9250508190555050505080610e2290611e2f565b9050610d43565b50846001600160a01b0316866001600160a01b0316826001600160a01b03167f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb8787604051610e7992919061205d565b60405180910390a4610e8f8187878787876110fa565b505050505050565b610ea1813361125e565b50565b610eae82826109f1565b6106ab5760008281526001602081815260408084206001600160a01b0386168086529252808420805460ff19169093179092559051339285917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9190a45050565b610f1982826109f1565b156106ab5760008281526001602090815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b80516106ab90600490602084019061156a565b6001600160a01b038416610faf5760405162461bcd60e51b81526004016105e990611fb6565b336000610fbb856112b7565b90506000610fc8856112b7565b9050610fd8838989858589610a30565b60008681526002602090815260408083206001600160a01b038c1684529091529020548581101561101b5760405162461bcd60e51b81526004016105e990611ffb565b60008781526002602090815260408083206001600160a01b038d8116855292528083208985039055908a1682528120805488929061105a908490612045565b909155505060408051888152602081018890526001600160a01b03808b16928c821692918816917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f62910160405180910390a46110ba848a8a8a8a8a611302565b505050505050505050565b60006001600160e01b03198216637965db0b60e01b14806104a157506301ffc9a760e01b6001600160e01b03198316146104a1565b6001600160a01b0384163b15610e8f5760405163bc197c8160e01b81526001600160a01b0385169063bc197c819061113e908990899088908890889060040161208b565b6020604051808303816000875af1925050508015611179575060408051601f3d908101601f19168201909252611176918101906120e9565b60015b61122557611185612106565b806308c379a0036111be5750611199612122565b806111a457506111c0565b8060405162461bcd60e51b81526004016105e991906116ec565b505b60405162461bcd60e51b815260206004820152603460248201527f455243313135353a207472616e7366657220746f206e6f6e2d455243313135356044820152732932b1b2b4bb32b91034b6b83632b6b2b73a32b960611b60648201526084016105e9565b6001600160e01b0319811663bc197c8160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b50505050505050565b61126882826109f1565b6106ab57611275816113bd565b6112808360206113cf565b6040516020016112919291906121f3565b60408051601f198184030181529082905262461bcd60e51b82526105e9916004016116ec565b604080516001808252818301909252606091600091906020808301908036833701905050905082816000815181106112f1576112f1611e03565b602090810291909101015292915050565b6001600160a01b0384163b15610e8f5760405163f23a6e6160e01b81526001600160a01b0385169063f23a6e61906113469089908990889088908890600401612268565b6020604051808303816000875af1925050508015611381575060408051601f3d908101601f1916820190925261137e918101906120e9565b60015b61138d57611185612106565b6001600160e01b0319811663f23a6e6160e01b146112555760405162461bcd60e51b81526004016105e9906121ab565b60606104a16001600160a01b03831660145b606060006113de8360026122ad565b6113e9906002612045565b6001600160401b03811115611400576114006116ff565b6040519080825280601f01601f19166020018201604052801561142a576020820181803683370190505b509050600360fc1b8160008151811061144557611445611e03565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061147457611474611e03565b60200101906001600160f81b031916908160001a90535060006114988460026122ad565b6114a3906001612045565b90505b600181111561151b576f181899199a1a9b1b9c1cb0b131b232b360811b85600f16601081106114d7576114d7611e03565b1a60f81b8282815181106114ed576114ed611e03565b60200101906001600160f81b031916908160001a90535060049490941c93611514816122cc565b90506114a6565b50831561048f5760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e7460448201526064016105e9565b82805461157690611cfa565b90600052602060002090601f01602090048101928261159857600085556115de565b82601f106115b157805160ff19168380011785556115de565b828001600101855582156115de579182015b828111156115de5782518255916020019190600101906115c3565b506115ea9291506115ee565b5090565b5b808211156115ea57600081556001016115ef565b6001600160a01b0381168114610ea157600080fd5b6000806040838503121561162b57600080fd5b823561163681611603565b946020939093013593505050565b6001600160e01b031981168114610ea157600080fd5b60006020828403121561166c57600080fd5b813561048f81611644565b60006020828403121561168957600080fd5b5035919050565b60005b838110156116ab578181015183820152602001611693565b838111156116ba576000848401525b50505050565b600081518084526116d8816020860160208601611690565b601f01601f19169290920160200192915050565b60208152600061048f60208301846116c0565b634e487b7160e01b600052604160045260246000fd5b601f8201601f191681016001600160401b038111828210171561173a5761173a6116ff565b6040525050565b60006001600160401b0382111561175a5761175a6116ff565b5060051b60200190565b600082601f83011261177557600080fd5b8135602061178282611741565b60405161178f8282611715565b83815260059390931b85018201928281019150868411156117af57600080fd5b8286015b848110156117ca57803583529183019183016117b3565b509695505050505050565b60006001600160401b038211156117ee576117ee6116ff565b50601f01601f191660200190565b600082601f83011261180d57600080fd5b8135611818816117d5565b6040516118258282611715565b82815285602084870101111561183a57600080fd5b82602086016020830137600092810160200192909252509392505050565b600080600080600060a0868803121561187057600080fd5b853561187b81611603565b9450602086013561188b81611603565b935060408601356001600160401b03808211156118a757600080fd5b6118b389838a01611764565b945060608801359150808211156118c957600080fd5b6118d589838a01611764565b935060808801359150808211156118eb57600080fd5b506118f8888289016117fc565b9150509295509295909350565b6000806040838503121561191857600080fd5b82359150602083013561192a81611603565b809150509250929050565b6000806040838503121561194857600080fd5b82356001600160401b038082111561195f57600080fd5b818501915085601f83011261197357600080fd5b8135602061198082611741565b60405161198d8282611715565b83815260059390931b85018201928281019150898411156119ad57600080fd5b948201945b838610156119d45785356119c581611603565b825294820194908201906119b2565b965050860135925050808211156119ea57600080fd5b506119f785828601611764565b9150509250929050565b600081518084526020808501945080840160005b83811015611a3157815187529582019590820190600101611a15565b509495945050505050565b60208152600061048f6020830184611a01565b600080600080600060a08688031215611a6757600080fd5b8535611a7281611603565b94506020860135611a8281611603565b93506040860135611a9281611603565b94979396509394606081013594506080013592915050565b60008060408385031215611abd57600080fd5b82356001600160401b03811115611ad357600080fd5b611adf858286016117fc565b925050602083013561192a81611603565b600060208284031215611b0257600080fd5b81356001600160401b03811115611b1857600080fd5b611b24848285016117fc565b949350505050565b60008060408385031215611b3f57600080fd5b8235611b4a81611603565b91506020830135801515811461192a57600080fd5b60ff81168114610ea157600080fd5b60008060408385031215611b8157600080fd5b82359150602083013561192a81611b5f565b600060208284031215611ba557600080fd5b813561048f81611603565b604080825283519082018190526000906020906060840190828701845b82811015611be957815184529284019290840190600101611bcd565b5050508381038285015284518082528583019183019060005b81811015611c2157835160ff1683529284019291840191600101611c02565b5090979650505050505050565b60008060408385031215611c4157600080fd5b8235611c4c81611603565b9150602083013561192a81611603565b600080600080600060a08688031215611c7457600080fd5b8535611c7f81611603565b94506020860135611c8f81611603565b9350604086013592506060860135915060808601356001600160401b03811115611cb857600080fd5b6118f8888289016117fc565b600060208284031215611cd657600080fd5b5051919050565b600060208284031215611cef57600080fd5b815161048f81611603565b600181811c90821680611d0e57607f821691505b602082108103611d2e57634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602e908201527f455243313135353a2063616c6c6572206973206e6f7420746f6b656e206f776e60408201526d195c881bdc88185c1c1c9bdd995960921b606082015260800190565b600060208284031215611d9457600080fd5b81516001600160401b03811115611daa57600080fd5b8201601f81018413611dbb57600080fd5b8051611dc6816117d5565b604051611dd38282611715565b828152866020848601011115611de857600080fd5b611df9836020830160208701611690565b9695505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201611e4157611e41611e19565b5060010190565b600060208284031215611e5a57600080fd5b815161048f81611b5f565b600082601f830112611e7657600080fd5b81516020611e8382611741565b604051611e908282611715565b83815260059390931b8501820192828101915086841115611eb057600080fd5b8286015b848110156117ca578051611ec781611b5f565b8352918301918301611eb4565b60008060408385031215611ee757600080fd5b82516001600160401b0380821115611efe57600080fd5b818501915085601f830112611f1257600080fd5b81516020611f1f82611741565b604051611f2c8282611715565b83815260059390931b8501820192828101915089841115611f4c57600080fd5b948201945b83861015611f6a57855182529482019490820190611f51565b91880151919650909350505080821115611f8357600080fd5b506119f785828601611e65565b600060208284031215611fa257600080fd5b815163ffffffff8116811461048f57600080fd5b60208082526025908201527f455243313135353a207472616e7366657220746f20746865207a65726f206164604082015264647265737360d81b606082015260800190565b6020808252602a908201527f455243313135353a20696e73756666696369656e742062616c616e636520666f60408201526939103a3930b739b332b960b11b606082015260800190565b6000821982111561205857612058611e19565b500190565b6040815260006120706040830185611a01565b82810360208401526120828185611a01565b95945050505050565b6001600160a01b0386811682528516602082015260a0604082018190526000906120b790830186611a01565b82810360608401526120c98186611a01565b905082810360808401526120dd81856116c0565b98975050505050505050565b6000602082840312156120fb57600080fd5b815161048f81611644565b600060033d111561211f5760046000803e5060005160e01c5b90565b600060443d10156121305790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561215f57505050505090565b82850191508151818111156121775750505050505090565b843d87010160208285010111156121915750505050505090565b6121a060208286010187611715565b509095945050505050565b60208082526028908201527f455243313135353a204552433131353552656365697665722072656a656374656040820152676420746f6b656e7360c01b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e742000000000000000000081526000835161222b816017850160208801611690565b7001034b99036b4b9b9b4b733903937b6329607d1b601791840191820152835161225c816028840160208801611690565b01602801949350505050565b6001600160a01b03868116825285166020820152604081018490526060810183905260a0608082018190526000906122a2908301846116c0565b979650505050505050565b60008160001904831182151516156122c7576122c7611e19565b500290565b6000816122db576122db611e19565b50600019019056fea26469706673582212209e33646a1ed2d51fcc749870e94aa69546c518fc5bfee43d37014ebc54dd767864736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "balanceOf(address,uint256)": { - "details": "Main function of the ERC1155 badge The balance of a user is equal to the value of the underlying attestation. attestationCollectionId == badgeId", - "params": { - "account": "Address to check badge balance (= value of attestation)", - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "balanceOfBatch(address[],uint256[])": { - "details": "See {IERC1155-balanceOfBatch}. Requirements: - `accounts` and `ids` must have the same length." - }, - "constructor": { - "details": "Constructor", - "params": { - "owner": "Owner of the contract, super admin, can setup roles and update the attestation registry", - "uri": "Uri for the metadata of badges" - } - }, - "getAttestationsRegistry()": { - "details": "Getter of the attestations registry" - }, - "getAttributeValueForBadge(uint256,uint8)": { - "details": "Getter of the value of a specific badge attribute", - "params": { - "id": "Badge Id to check (= attestationCollectionId)", - "index": "Index of the attribute" - } - }, - "getAttributesNamesAndValuesForBadge(uint256)": { - "details": "Getter of all badge attributes and their values for a specific badge", - "params": { - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "getBadgeExtraData(address,uint256)": { - "details": "Getter of the badge extra data (it can store nullifier and burnCount)", - "params": { - "account": "Address that holds the badge", - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "getBadgeIssuer(address,uint256)": { - "details": "Getter of the badge issuer", - "params": { - "account": "Address that holds the badge", - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "getBadgeTimestamp(address,uint256)": { - "details": "Getter of the badge timestamp", - "params": { - "account": "Address that holds the badge", - "id": "Badge Id to check (= attestationCollectionId)" - } - }, - "getRoleAdmin(bytes32)": { - "details": "Returns the admin role that controls `role`. See {grantRole} and {revokeRole}. To change a role's admin, use {_setRoleAdmin}." - }, - "grantRole(bytes32,address)": { - "details": "Grants `role` to `account`. If `account` had not been already granted `role`, emits a {RoleGranted} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleGranted} event." - }, - "hasRole(bytes32,address)": { - "details": "Returns `true` if `account` has been granted `role`." - }, - "initialize(string,address)": { - "details": "Initializes the contract, to be called by the proxy delegating calls to this implementation", - "params": { - "owner": "Owner of the contract, super admin, can setup roles and update the attestation registry", - "uri": "Uri for the metadata of badges" - } - }, - "isApprovedForAll(address,address)": { - "details": "Reverts, this is a non transferable ERC115 contract" - }, - "renounceRole(bytes32,address)": { - "details": "Revokes `role` from the calling account. Roles are often managed via {grantRole} and {revokeRole}: this function's purpose is to provide a mechanism for accounts to lose their privileges if they are compromised (such as when a trusted device is misplaced). If the calling account had been revoked `role`, emits a {RoleRevoked} event. Requirements: - the caller must be `account`. May emit a {RoleRevoked} event." - }, - "revokeRole(bytes32,address)": { - "details": "Revokes `role` from `account`. If `account` had been granted `role`, emits a {RoleRevoked} event. Requirements: - the caller must have ``role``'s admin role. May emit a {RoleRevoked} event." - }, - "safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)": { - "details": "See {IERC1155-safeBatchTransferFrom}." - }, - "safeTransferFrom(address,address,uint256,uint256,bytes)": { - "details": "See {IERC1155-safeTransferFrom}." - }, - "setApprovalForAll(address,bool)": { - "details": "Reverts, this is a non transferable ERC115 contract" - }, - "setAttestationsRegistry(address)": { - "details": "Set the attestations registry address. Can only be called by owner (default admin)", - "params": { - "attestationsRegistry": "new attestations registry address" - } - }, - "setUri(string)": { - "details": "Set the URI. Can only be called by owner (default admin)", - "params": { - "uri": "new attestations registry address" - } - }, - "supportsInterface(bytes4)": { - "details": "ERC165" - }, - "triggerTransferEvent(address,address,address,uint256,uint256)": { - "details": "Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)", - "params": { - "from": "address(0) if minting, address of the badge holder if burning", - "id": "badgeId for which to trigger the event", - "operator": "who is calling the TransferEvent", - "to": "address of the badge holder is minting, address(0) if burning", - "value": "minted/burned balance" - } - }, - "uri(uint256)": { - "details": "See {IERC1155MetadataURI-uri}. This implementation returns the same URI for *all* token types. It relies on the token type ID substitution mechanism https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP]. Clients calling this function must replace the `\\{id\\}` substring with the actual token type ID." - } - }, - "title": "Badges contract", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "initialize(string,address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - } - }, - "notice": "Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations The associated attestations registry triggers TransferSingle events from this contract It allows badge \"shadow mints and burns\" to be caught by off-chain platforms For more information: https://badges.docs.sismo.io", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 24, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_roles", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_bytes32,t_struct(RoleData)19_storage)" - }, - { - "astId": 1231, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_balances", - "offset": 0, - "slot": "2", - "type": "t_mapping(t_uint256,t_mapping(t_address,t_uint256))" - }, - { - "astId": 1237, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_operatorApprovals", - "offset": 0, - "slot": "3", - "type": "t_mapping(t_address,t_mapping(t_address,t_bool))" - }, - { - "astId": 1239, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_uri", - "offset": 0, - "slot": "4", - "type": "t_string_storage" - }, - { - "astId": 11990, - "contract": "contracts/core/Badges.sol:Badges", - "label": "_attestationsRegistry", - "offset": 0, - "slot": "5", - "type": "t_contract(IAttestationsRegistry)12822" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_bytes32": { - "encoding": "inplace", - "label": "bytes32", - "numberOfBytes": "32" - }, - "t_contract(IAttestationsRegistry)12822": { - "encoding": "inplace", - "label": "contract IAttestationsRegistry", - "numberOfBytes": "20" - }, - "t_mapping(t_address,t_bool)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => bool)", - "numberOfBytes": "32", - "value": "t_bool" - }, - "t_mapping(t_address,t_mapping(t_address,t_bool))": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => mapping(address => bool))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_bool)" - }, - "t_mapping(t_address,t_uint256)": { - "encoding": "mapping", - "key": "t_address", - "label": "mapping(address => uint256)", - "numberOfBytes": "32", - "value": "t_uint256" - }, - "t_mapping(t_bytes32,t_struct(RoleData)19_storage)": { - "encoding": "mapping", - "key": "t_bytes32", - "label": "mapping(bytes32 => struct AccessControl.RoleData)", - "numberOfBytes": "32", - "value": "t_struct(RoleData)19_storage" - }, - "t_mapping(t_uint256,t_mapping(t_address,t_uint256))": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => mapping(address => uint256))", - "numberOfBytes": "32", - "value": "t_mapping(t_address,t_uint256)" - }, - "t_string_storage": { - "encoding": "bytes", - "label": "string", - "numberOfBytes": "32" - }, - "t_struct(RoleData)19_storage": { - "encoding": "inplace", - "label": "struct AccessControl.RoleData", - "members": [ - { - "astId": 16, - "contract": "contracts/core/Badges.sol:Badges", - "label": "members", - "offset": 0, - "slot": "0", - "type": "t_mapping(t_address,t_bool)" - }, - { - "astId": 18, - "contract": "contracts/core/Badges.sol:Badges", - "label": "adminRole", - "offset": 0, - "slot": "1", - "type": "t_bytes32" - } - ], - "numberOfBytes": "64" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/BadgesProxy.json b/deployments/sandboxPolygon/BadgesProxy.json deleted file mode 100644 index 2ffea3c..0000000 --- a/deployments/sandboxPolygon/BadgesProxy.json +++ /dev/null @@ -1,265 +0,0 @@ -{ - "address": "0x71a7089C56DFf528f330Bc0116C0917cd05B51Fc", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x6e2ffae5418fa41f4ffbd8f5fd6e958e83b9a6e65a66c98842cfa81b76691c22", - "receipt": { - "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0x71a7089C56DFf528f330Bc0116C0917cd05B51Fc", - "transactionIndex": 40, - "gasUsed": "724288", - "logsBloom": "0x00000004000000200000000000000000400000000000000000000000000000400000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000002800000000000400000000100000010000000000000220000000000000000000c00000000800000000080000400000000000000000000000000000000100000000000000000000000000000000000800000200000000000000000000000000000000000000000000000001000000000004000000020001000000001000000000008000000000400000100100004000020000000000000000000000000000000000000000000000000000000000000100000", - "blockHash": "0x061e9ab4641111ea34712ac3e42e419ea3a39598e013ee8070742cfd74016e4e", - "transactionHash": "0x6e2ffae5418fa41f4ffbd8f5fd6e958e83b9a6e65a66c98842cfa81b76691c22", - "logs": [ - { - "transactionIndex": 40, - "blockNumber": 32512910, - "transactionHash": "0x6e2ffae5418fa41f4ffbd8f5fd6e958e83b9a6e65a66c98842cfa81b76691c22", - "address": "0x71a7089C56DFf528f330Bc0116C0917cd05B51Fc", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000c5efff6b98dd943538a515139bfcf3f2dc8e8bec" - ], - "data": "0x", - "logIndex": 131, - "blockHash": "0x061e9ab4641111ea34712ac3e42e419ea3a39598e013ee8070742cfd74016e4e" - }, - { - "transactionIndex": 40, - "blockNumber": 32512910, - "transactionHash": "0x6e2ffae5418fa41f4ffbd8f5fd6e958e83b9a6e65a66c98842cfa81b76691c22", - "address": "0x71a7089C56DFf528f330Bc0116C0917cd05B51Fc", - "topics": [ - "0x2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e" - ], - "data": "0x", - "logIndex": 132, - "blockHash": "0x061e9ab4641111ea34712ac3e42e419ea3a39598e013ee8070742cfd74016e4e" - }, - { - "transactionIndex": 40, - "blockNumber": 32512910, - "transactionHash": "0x6e2ffae5418fa41f4ffbd8f5fd6e958e83b9a6e65a66c98842cfa81b76691c22", - "address": "0x71a7089C56DFf528f330Bc0116C0917cd05B51Fc", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002110475dfbb8d331b300178a867372991ff35fa3", - "logIndex": 133, - "blockHash": "0x061e9ab4641111ea34712ac3e42e419ea3a39598e013ee8070742cfd74016e4e" - }, - { - "transactionIndex": 40, - "blockNumber": 32512910, - "transactionHash": "0x6e2ffae5418fa41f4ffbd8f5fd6e958e83b9a6e65a66c98842cfa81b76691c22", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x0000000000000000000000007c7379531b2aee82e4ca06d4175d13b9cbeafd49" - ], - "data": "0x00000000000000000000000000000000000000000000000000cdc50189bd7c40000000000000000000000000000000000000000000000000350179442e0d708a000000000000000000000000000000000000000000016c08a28edc152cde21f20000000000000000000000000000000000000000000000003433b442a44ff44a000000000000000000000000000000000000000000016c08a35ca116b69b9e32", - "logIndex": 134, - "blockHash": "0x061e9ab4641111ea34712ac3e42e419ea3a39598e013ee8070742cfd74016e4e" - } - ], - "blockNumber": 32512910, - "cumulativeGasUsed": "6262181", - "status": 1, - "byzantium": true - }, - "args": [ - "0xc5efFf6B98dd943538a515139BFcf3F2Dc8e8beC", - "0x2110475dfbB8d331b300178A867372991ff35fA3", - "0x7ab4339d0000000000000000000000000000000000000000000000000000000000000040000000000000000000000000597660c921af06523a458d2596680db1d631732e000000000000000000000000000000000000000000000000000000000000004168747470733a2f2f6d657461646174612e6261646765732e7369736d6f2e696f2f6261646765732f706f6c79676f6e2d73616e64626f782f7b69647d2e6a736f6e00000000000000000000000000000000000000000000000000000000000000" - ], - "numDeployments": 1, - "solcInputHash": "c872f238f220b3571ef309821a459203", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/CommitmentMapperRegistryProxy.json b/deployments/sandboxPolygon/CommitmentMapperRegistryProxy.json deleted file mode 100644 index a762388..0000000 --- a/deployments/sandboxPolygon/CommitmentMapperRegistryProxy.json +++ /dev/null @@ -1,288 +0,0 @@ -{ - "address": "0xC44F46A31B752b773685be6B5ce8616fFeb97C8D", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0xc10b30023bada1d9658f24234a762c5a2efed451d7447a389abd6e588c4e2d30", - "receipt": { - "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0xC44F46A31B752b773685be6B5ce8616fFeb97C8D", - "transactionIndex": 46, - "gasUsed": "661445", - "logsBloom": "0x00000000000000200000020000000000400000000000000000800000000000000000000000000000000000000000000000008000000000000000000004000000000000000000008000000000000402800001000000000000000102000000000000000000020000000000000000000800000000800000000084000000000000400000000000000000000000100000000000000000000002000000000000800000200000000000000000000000000000000000000000000000000000000000004000800024000000000001000000008000000010000400000000100004000020000000128000000000000000000000000000000000000000000000000000100000", - "blockHash": "0xde23169e478107b4810f7459d04efa61cd8b7c5ac3bdfdd1c107bb91db71a2f4", - "transactionHash": "0xc10b30023bada1d9658f24234a762c5a2efed451d7447a389abd6e588c4e2d30", - "logs": [ - { - "transactionIndex": 46, - "blockNumber": 32513174, - "transactionHash": "0xc10b30023bada1d9658f24234a762c5a2efed451d7447a389abd6e588c4e2d30", - "address": "0xC44F46A31B752b773685be6B5ce8616fFeb97C8D", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000b9fec8e0ce1d15357790491b8f7621a3cf869056" - ], - "data": "0x", - "logIndex": 161, - "blockHash": "0xde23169e478107b4810f7459d04efa61cd8b7c5ac3bdfdd1c107bb91db71a2f4" - }, - { - "transactionIndex": 46, - "blockNumber": 32513174, - "transactionHash": "0xc10b30023bada1d9658f24234a762c5a2efed451d7447a389abd6e588c4e2d30", - "address": "0xC44F46A31B752b773685be6B5ce8616fFeb97C8D", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e" - ], - "data": "0x", - "logIndex": 162, - "blockHash": "0xde23169e478107b4810f7459d04efa61cd8b7c5ac3bdfdd1c107bb91db71a2f4" - }, - { - "transactionIndex": 46, - "blockNumber": 32513174, - "transactionHash": "0xc10b30023bada1d9658f24234a762c5a2efed451d7447a389abd6e588c4e2d30", - "address": "0xC44F46A31B752b773685be6B5ce8616fFeb97C8D", - "topics": [ - "0x9d99ec80e15298d9dae698493e9c61daaae3977b0f131ded44fc6b0f7766ab15" - ], - "data": "0x0c6c16efc72c198f4549bd069f1e57f091885234b9c140286d80ef431151d64412c54731563d974ead25d469d2263fdf0e230d5a09f6cd40a06e60210610d642", - "logIndex": 163, - "blockHash": "0xde23169e478107b4810f7459d04efa61cd8b7c5ac3bdfdd1c107bb91db71a2f4" - }, - { - "transactionIndex": 46, - "blockNumber": 32513174, - "transactionHash": "0xc10b30023bada1d9658f24234a762c5a2efed451d7447a389abd6e588c4e2d30", - "address": "0xC44F46A31B752b773685be6B5ce8616fFeb97C8D", - "topics": [ - "0xa37a473be736ea014730a555941f412164222d9d1b07f5a0a61932a1b3c3f2f4" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000", - "logIndex": 164, - "blockHash": "0xde23169e478107b4810f7459d04efa61cd8b7c5ac3bdfdd1c107bb91db71a2f4" - }, - { - "transactionIndex": 46, - "blockNumber": 32513174, - "transactionHash": "0xc10b30023bada1d9658f24234a762c5a2efed451d7447a389abd6e588c4e2d30", - "address": "0xC44F46A31B752b773685be6B5ce8616fFeb97C8D", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002110475dfbb8d331b300178a867372991ff35fa3", - "logIndex": 165, - "blockHash": "0xde23169e478107b4810f7459d04efa61cd8b7c5ac3bdfdd1c107bb91db71a2f4" - }, - { - "transactionIndex": 46, - "blockNumber": 32513174, - "transactionHash": "0xc10b30023bada1d9658f24234a762c5a2efed451d7447a389abd6e588c4e2d30", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x00000000000000000000000067b94473d81d0cd00849d563c94d0432ac988b49" - ], - "data": "0x0000000000000000000000000000000000000000000000000054e7b01fda304800000000000000000000000000000000000000000000000027b750f1f22ec56300000000000000000000000000000000000000000000020006d765953258931d00000000000000000000000000000000000000000000000027626941d254951b000000000000000000000000000000000000000000000200072c4d455232c365", - "logIndex": 166, - "blockHash": "0xde23169e478107b4810f7459d04efa61cd8b7c5ac3bdfdd1c107bb91db71a2f4" - } - ], - "blockNumber": 32513174, - "cumulativeGasUsed": "8041537", - "status": 1, - "byzantium": true - }, - "args": [ - "0xb9fEc8e0CE1D15357790491b8f7621A3cF869056", - "0x2110475dfbB8d331b300178A867372991ff35fA3", - "0x78cf75d7000000000000000000000000597660c921af06523a458d2596680db1d631732e0c6c16efc72c198f4549bd069f1e57f091885234b9c140286d80ef431151d64412c54731563d974ead25d469d2263fdf0e230d5a09f6cd40a06e60210610d6420000000000000000000000000000000000000000000000000000000000000000" - ], - "numDeployments": 1, - "solcInputHash": "c872f238f220b3571ef309821a459203", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/FrontProxy.json b/deployments/sandboxPolygon/FrontProxy.json deleted file mode 100644 index 9af6298..0000000 --- a/deployments/sandboxPolygon/FrontProxy.json +++ /dev/null @@ -1,250 +0,0 @@ -{ - "address": "0xfC6f6b50B9Ee651B73B481E2cd221aFffc26a5E4", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x95a48998be3a3a585f40b82a15a936f80cb47b326a1c6bd50d843d47b38fa56c", - "receipt": { - "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0xfC6f6b50B9Ee651B73B481E2cd221aFffc26a5E4", - "transactionIndex": 48, - "gasUsed": "583372", - "logsBloom": "0x00000000000000200000000400000000400000000000000000000000000000000000000000000000000000000000000000008000000000000000000000400000000000000000000000000000000002800000000000000000000100000000000000000000000000000002000000000000000000802000000080000000000000040000000000000000000000100000000000000000000000000000000040800000200000000000000000000000000000040010000000000000000000000000004000000020000000000001000000000000000000000400000000100004000000000000000002000000000000000000000000000000000000000000000000100000", - "blockHash": "0x8c94dd2151ffbb474decf4d2e2dd72a513d5fbc74e163a95da2bcbcf2760fda4", - "transactionHash": "0x95a48998be3a3a585f40b82a15a936f80cb47b326a1c6bd50d843d47b38fa56c", - "logs": [ - { - "transactionIndex": 48, - "blockNumber": 32513097, - "transactionHash": "0x95a48998be3a3a585f40b82a15a936f80cb47b326a1c6bd50d843d47b38fa56c", - "address": "0xfC6f6b50B9Ee651B73B481E2cd221aFffc26a5E4", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000bc356247570b2584e567f7ef7a54e09ec668400b" - ], - "data": "0x", - "logIndex": 153, - "blockHash": "0x8c94dd2151ffbb474decf4d2e2dd72a513d5fbc74e163a95da2bcbcf2760fda4" - }, - { - "transactionIndex": 48, - "blockNumber": 32513097, - "transactionHash": "0x95a48998be3a3a585f40b82a15a936f80cb47b326a1c6bd50d843d47b38fa56c", - "address": "0xfC6f6b50B9Ee651B73B481E2cd221aFffc26a5E4", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002110475dfbb8d331b300178a867372991ff35fa3", - "logIndex": 154, - "blockHash": "0x8c94dd2151ffbb474decf4d2e2dd72a513d5fbc74e163a95da2bcbcf2760fda4" - }, - { - "transactionIndex": 48, - "blockNumber": 32513097, - "transactionHash": "0x95a48998be3a3a585f40b82a15a936f80cb47b326a1c6bd50d843d47b38fa56c", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x000000000000000000000000ec20607aa654d823dd01beb8780a44863c57ed07" - ], - "data": "0x000000000000000000000000000000000000000000000000004caf3a7ec7d800000000000000000000000000000000000000000000000000298663f84869b2c00000000000000000000000000000000000000000000001e1324e1ee0d81223680000000000000000000000000000000000000000000000002939b4bdc9a1dac00000000000000000000000000000000000000000000001e1329ace1b56d9fb68", - "logIndex": 155, - "blockHash": "0x8c94dd2151ffbb474decf4d2e2dd72a513d5fbc74e163a95da2bcbcf2760fda4" - } - ], - "blockNumber": 32513097, - "cumulativeGasUsed": "6406885", - "status": 1, - "byzantium": true - }, - "args": [ - "0xbC356247570B2584E567F7eF7a54e09Ec668400B", - "0x2110475dfbB8d331b300178A867372991ff35fA3", - "0x" - ], - "numDeployments": 1, - "solcInputHash": "c872f238f220b3571ef309821a459203", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/HydraS1AccountboundAttester.json b/deployments/sandboxPolygon/HydraS1AccountboundAttester.json deleted file mode 100644 index 1c8ebcf..0000000 --- a/deployments/sandboxPolygon/HydraS1AccountboundAttester.json +++ /dev/null @@ -1,1393 +0,0 @@ -{ - "address": "0x0AB188c7260666146B300aD3ad5b2AB99eb91D45", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "hydraS1VerifierAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "availableRootsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "AccountsTreeValueMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "claimLength", - "type": "uint256" - } - ], - "name": "ClaimsLengthDifferentThanOne", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentMapperPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupIndex", - "type": "uint256" - } - ], - "name": "CooldownDurationNotSetForGroupIndex", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedExternalNullifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "externalNullifier", - "type": "uint256" - } - ], - "name": "ExternalNullifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - }, - { - "internalType": "uint16", - "name": "burnCount", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "cooldownStart", - "type": "uint32" - } - ], - "name": "NullifierOnCooldown", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - } - ], - "name": "NullifierUsed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "inputRoot", - "type": "uint256" - } - ], - "name": "RegistryRootMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "groupIndex", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "cooldownDuration", - "type": "uint32" - } - ], - "name": "CooldownDurationSetForGroupIndex", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "NullifierDestinationUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "burnCount", - "type": "uint16" - } - ], - "name": "NullifierSetOnCooldown", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "internalType": "address", - "name": "claimDestination", - "type": "address" - } - ], - "name": "_getNextBurnCount", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAvailableRootsRegistry", - "outputs": [ - { - "internalType": "contract IAvailableRootsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "name": "getBurnCountFromExtraData", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentMapperRegistry", - "outputs": [ - { - "internalType": "contract ICommitmentMapperRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupIndex", - "type": "uint256" - } - ], - "name": "getCooldownDurationForGroupIndex", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - } - ], - "name": "getDestinationOfNullifier", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - } - ], - "name": "getNullifierBurnCount", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - } - ], - "name": "getNullifierCooldownStart", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "name": "getNullifierFromExtraData", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract HydraS1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupIndex", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "cooldownDuration", - "type": "uint32" - } - ], - "name": "setCooldownDurationForGroupIndex", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xd989ad0b1fd904a02441dc0d6f7ffcdd1c625b006fd79b48976be15011e0cb1c", - "receipt": { - "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0xD8837a59159614A506aeBa453952f3bbDE68Fde2", - "transactionIndex": 46, - "gasUsed": "2322582", - "logsBloom": "0x00000000000000200000000000000000002000000000000000800000000000000000000000000000000008000000000000008000000000000000000000000000000000000000000000000000000000800001000000000000000100000000000000000000020000000000000000000800000000010000000080000000000000400000000000010000000000100000000000000000000080000000000000000000200000000000800000000000000400000000000000000000000000000000004000000000000000000001800000040000000000000000000000100004000020000000000000000000000000100000000010000000000000000000000000100002", - "blockHash": "0x5aadc06fbd8d1f1fbb172022acb9b400248801921ac1594ccf14e4b476a5136e", - "transactionHash": "0xd989ad0b1fd904a02441dc0d6f7ffcdd1c625b006fd79b48976be15011e0cb1c", - "logs": [ - { - "transactionIndex": 46, - "blockNumber": 36625870, - "transactionHash": "0xd989ad0b1fd904a02441dc0d6f7ffcdd1c625b006fd79b48976be15011e0cb1c", - "address": "0xD8837a59159614A506aeBa453952f3bbDE68Fde2", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e" - ], - "data": "0x", - "logIndex": 141, - "blockHash": "0x5aadc06fbd8d1f1fbb172022acb9b400248801921ac1594ccf14e4b476a5136e" - }, - { - "transactionIndex": 46, - "blockNumber": 36625870, - "transactionHash": "0xd989ad0b1fd904a02441dc0d6f7ffcdd1c625b006fd79b48976be15011e0cb1c", - "address": "0xD8837a59159614A506aeBa453952f3bbDE68Fde2", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x000000000000000000000000aee4acd5c4bf516330ca8fe11b07206fc6709294" - ], - "data": "0x", - "logIndex": 142, - "blockHash": "0x5aadc06fbd8d1f1fbb172022acb9b400248801921ac1594ccf14e4b476a5136e" - }, - { - "transactionIndex": 46, - "blockNumber": 36625870, - "transactionHash": "0xd989ad0b1fd904a02441dc0d6f7ffcdd1c625b006fd79b48976be15011e0cb1c", - "address": "0xD8837a59159614A506aeBa453952f3bbDE68Fde2", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000004", - "logIndex": 143, - "blockHash": "0x5aadc06fbd8d1f1fbb172022acb9b400248801921ac1594ccf14e4b476a5136e" - }, - { - "transactionIndex": 46, - "blockNumber": 36625870, - "transactionHash": "0xd989ad0b1fd904a02441dc0d6f7ffcdd1c625b006fd79b48976be15011e0cb1c", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x00000000000000000000000046a3a41bd932244dd08186e4c19f1a7e48cbcdf4" - ], - "data": "0x0000000000000000000000000000000000000000000000000100c9e990f278e8000000000000000000000000000000000000000000000000bfee773d65b8548a000000000000000000000000000000000000000000000034c375888fd5c8fc20000000000000000000000000000000000000000000000000beedad53d4c5dba2000000000000000000000000000000000000000000000034c476527966bb7508", - "logIndex": 144, - "blockHash": "0x5aadc06fbd8d1f1fbb172022acb9b400248801921ac1594ccf14e4b476a5136e" - } - ], - "blockNumber": 36625870, - "cumulativeGasUsed": "7539727", - "status": 1, - "byzantium": true - }, - "args": [ - "0xC999390A856e0633f945dD851DeeCE15b533ccA3", - "0xD029177639cc29042D2E6D9De985cbE762092529", - "0xb8797eBa1048f6A6AfCbE4F08a582b4Dde69C05d", - "0xC44F46A31B752b773685be6B5ce8616fFeb97C8D", - "10000001", - "20000000", - "0xaee4acd5c4Bf516330ca8fe11B07206fC6709294" - ], - "numDeployments": 2, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"hydraS1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"availableRootsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"AccountsTreeValueMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimLength\",\"type\":\"uint256\"}],\"name\":\"ClaimsLengthDifferentThanOne\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentMapperPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"}],\"name\":\"CooldownDurationNotSetForGroupIndex\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedExternalNullifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"externalNullifier\",\"type\":\"uint256\"}],\"name\":\"ExternalNullifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"burnCount\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"cooldownStart\",\"type\":\"uint32\"}],\"name\":\"NullifierOnCooldown\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"NullifierUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inputRoot\",\"type\":\"uint256\"}],\"name\":\"RegistryRootMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"cooldownDuration\",\"type\":\"uint32\"}],\"name\":\"CooldownDurationSetForGroupIndex\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"NullifierDestinationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"burnCount\",\"type\":\"uint16\"}],\"name\":\"NullifierSetOnCooldown\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"claimDestination\",\"type\":\"address\"}],\"name\":\"_getNextBurnCount\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAvailableRootsRegistry\",\"outputs\":[{\"internalType\":\"contract IAvailableRootsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"getBurnCountFromExtraData\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentMapperRegistry\",\"outputs\":[{\"internalType\":\"contract ICommitmentMapperRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"}],\"name\":\"getCooldownDurationForGroupIndex\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfNullifier\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"getNullifierBurnCount\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"getNullifierCooldownStart\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"getNullifierFromExtraData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract HydraS1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"cooldownDuration\",\"type\":\"uint32\"}],\"name\":\"setCooldownDurationForGroupIndex\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"errors\":{\"CollectionIdOutOfBound(uint256)\":[{\"details\":\"Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST*\"}],\"CooldownDurationNotSetForGroupIndex(uint256)\":[{\"details\":\"Error when the cooldown duration for a given groupIndex is equal to zero. The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.*\"}],\"NullifierOnCooldown(uint256,address,uint16,uint32)\":[{\"details\":\"Error when the nullifier is on cooldown. The user have to wait the cooldownDuration before being able to change again the destination address.*\"}],\"NullifierUsed(uint256)\":[{\"details\":\"Error when the nullifier is already used for a destination address*\"}]},\"kind\":\"dev\",\"methods\":{\"_getNextBurnCount(uint256,address)\":{\"details\":\"returns burn count or burn count + 1 if new burn will happen\",\"params\":{\"claimDestination\":\"destination referenced in the user claim\",\"nullifier\":\"user nullifier\"}},\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns the actual attestations constructed from the user request\",\"params\":{\"proofData\":\"snark public input as well as snark proof\",\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"availableRootsRegistryAddress\":\"Registry storing the available groups for this attester (e.g roots of registry merkle trees)\",\"collectionIdFirst\":\"Id of the first attestation collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last attestation collection in which the attester is supposed to record\",\"commitmentMapperAddress\":\"commitment mapper's public key registry\",\"hydraS1VerifierAddress\":\"ZK Snark Hydra-S1 Verifier contract\",\"owner\":\"Address of attester's owner\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getAvailableRootsRegistry()\":{\"details\":\"Getter of Roots Registry Contract\"},\"getBurnCountFromExtraData(bytes)\":{\"details\":\"Returns the burn count for a given extraData\",\"params\":{\"extraData\":\"bytes where the burnCount is encoded\"}},\"getCommitmentMapperRegistry()\":{\"details\":\"Getter of Commitment Mapper Registry contract\"},\"getCooldownDurationForGroupIndex(uint256)\":{\"details\":\"Getter, get the cooldown duration of a groupIndex\",\"params\":{\"groupIndex\":\"internal collection id*\"}},\"getDestinationOfNullifier(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a nullifier\",\"params\":{\"nullifier\":\"nullifier used*\"}},\"getNullifierBurnCount(uint256)\":{\"details\":\"Getter, returns the burnCount of a nullifier\",\"params\":{\"nullifier\":\"nullifier used*\"}},\"getNullifierCooldownStart(uint256)\":{\"details\":\"Getter, returns the cooldown start of a nullifier\",\"params\":{\"nullifier\":\"nullifier used*\"}},\"getNullifierFromExtraData(bytes)\":{\"details\":\"returns the nullifier for a given extraData\",\"params\":{\"extraData\":\"bytes where the nullifier is encoded\"}},\"getVerifier()\":{\"details\":\"Getter of Hydra-S1 Verifier contract\"},\"initialize(address)\":{\"details\":\"Initialize function, to be called by the proxy delegating calls to this implementation\",\"params\":{\"ownerAddress\":\"Owner of the contract, has the right to authorize/unauthorize attestations issuers\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setCooldownDurationForGroupIndex(uint256,uint32)\":{\"details\":\"Setter, sets the cooldown duration of a groupIndex\",\"params\":{\"cooldownDuration\":\"cooldown duration we want to set for the groupIndex*\",\"groupIndex\":\"internal collection id\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Hydra-S1 Accountbound Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getCooldownDurationForGroupIndex(uint256)\":{\"notice\":\"returns 0 when the accountbound feature is deactivated for this group\"},\"initialize(address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"},\"setCooldownDurationForGroupIndex(uint256,uint32)\":{\"notice\":\"set to 0 to deactivate the accountbound feature for this group\"}},\"notice\":\"This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic. Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic. However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation. The _beforeRecordAttestations is also overriden to fit the Accountbound logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Nullified Each source account gets one nullifier per claim (i.e only one attestation per source account per claim) While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier) We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation. We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation. Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier) - Accountbound (opt-in, with cooldown period) The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group. Users can update their attestation's destination by providing a new Hydra-S1 ZK proof It means the attestation is bound to the source account, stored on an updatable destination account. When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional. A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations. - Renewable A nullifier can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol\":\"HydraS1AccountboundAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [8609986746108439658545470593166889256314951959466775818870246174320018498804,\\n 6848251127850009101372611262053374737897586140140607384018397707035108265914],\\n [21367916863936594568281095443965096905143705300114190558130516981138584550504,\\n 13327705762185115653848159709412003423932761899188342359583872691135383932883]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 19965766170734310004645394427613286415565755728797065894668054116047682895204,\\n 6952067612339183672227137101423582097916038093373585908267153974352032944482\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 13987716160490730015463796942940452666334097189904948795214986996497499925899,\\n 5336810094802209074340875836312868429276540870324469349093948627126061524544\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 14931593253473978964215343699995811275378324235306358485461293343370969283966,\\n 564306919152089917957316877787764763278299990971316475606280877961553231205\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11591267743733991434114686002448165336885445656808796470854638278338319268343,\\n 11495219763417990955889652410266075210402006084183208750635660647824890013350\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 8183184532870222270700473518157259944911700429689031755853536692005688965081,\\n 9121077094104828462137861111631978599019724423614716723152060153405564278301\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 4314095526093128699362232919686741372014146055311239687202926853002748112330,\\n 11665330391505820654128458332883010598817535082070674418723503440883598640597\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 18925967077785550270509493111690046951994174908254476036944536825999614778001,\\n 4990629719417206796668074534812314525340851981015724652256935997545282642849\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x120f0b311a61cabc9d42ef740c19e5f20b4c8ba400d9a6378e33c76dd54f5c42\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\n\\nimport {IHydraS1AccountboundAttester} from './interfaces/IHydraS1AccountboundAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from '../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra-S1\\nimport {HydraS1SimpleAttester, IAttester, HydraS1Lib, HydraS1ProofData, HydraS1Claim} from './HydraS1SimpleAttester.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic.\\n * Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic.\\n * However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation.\\n * The _beforeRecordAttestations is also overriden to fit the Accountbound logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Nullified\\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\\n * While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier)\\n * We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation.\\n * We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation.\\n * Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier)\\n\\n * - Accountbound (opt-in, with cooldown period)\\n * The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group.\\n * Users can update their attestation's destination by providing a new Hydra-S1 ZK proof \\n * It means the attestation is bound to the source account, stored on an updatable destination account.\\n * When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional.\\n * A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred\\n * One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations.\\n \\n * - Renewable\\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew or update their attestations\\n **/\\n\\ncontract HydraS1AccountboundAttester is\\n IHydraS1AccountboundAttester,\\n HydraS1SimpleAttester,\\n Ownable\\n{\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n uint8 public constant IMPLEMENTATION_VERSION = 4;\\n\\n /*******************************************************\\n Storage layout:\\n 20 slots between HydraS1SimpleAttester and HydraS1AccountboundAttester\\n 1 currently used by Ownable\\n 19 place holders\\n 2O for config\\n 1 currently used\\n 19 place holders\\n 20 for logic\\n 2 currently used\\n 18 place holders\\n *******************************************************/\\n\\n // keeping some space for future config logics\\n uint256[19] private _placeHolderBeforeHydraS1Accountbound;\\n\\n // cooldown durations for each groupIndex\\n mapping(uint256 => uint32) internal _cooldownDurations;\\n\\n // keeping some space for future config logics\\n uint256[19] private _placeHoldersHydraS1AccountboundConfig;\\n\\n mapping(uint256 => uint32) internal _nullifiersCooldownStart;\\n mapping(uint256 => uint16) internal _nullifiersBurnCount;\\n\\n // keeping some space for future config logics\\n uint256[18] private _placeHoldersHydraS1AccountboundLogic;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first attestation collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last attestation collection in which the attester is supposed to record\\n * @param owner Address of attester's owner\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n address owner\\n )\\n HydraS1SimpleAttester(\\n attestationsRegistryAddress,\\n hydraS1VerifierAddress,\\n availableRootsRegistryAddress,\\n commitmentMapperAddress,\\n collectionIdFirst,\\n collectionIdLast\\n )\\n {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Returns the actual attestations constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark public input as well as snark proof\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual override(IAttester, HydraS1SimpleAttester) returns (Attestation[] memory) {\\n Attestation[] memory attestations = super.buildAttestations(request, proofData);\\n\\n uint256 nullifier = proofData._getNullifier();\\n attestations[0].extraData = abi.encode(\\n attestations[0].extraData, // nullifier, from HydraS1 Simple\\n _getNextBurnCount(nullifier, attestations[0].owner) // BurnCount\\n );\\n\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if nullifier already used, not a renewal, and nullifier on cooldown.\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n uint256 nullifier = proofData._getNullifier();\\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\\n\\n HydraS1Claim memory claim = request._claim();\\n\\n // check if the nullifier has already been used previously, if so it may be on cooldown\\n if (\\n previousNullifierDestination != address(0) &&\\n previousNullifierDestination != claim.destination\\n ) {\\n uint32 cooldownDuration = _getCooldownDurationForGroupIndex(claim.groupProperties.groupIndex);\\n if (cooldownDuration == 0) {\\n revert CooldownDurationNotSetForGroupIndex(claim.groupProperties.groupIndex);\\n }\\n if (_isOnCooldown(nullifier, cooldownDuration)) {\\n uint16 burnCount = _getNullifierBurnCount(nullifier);\\n revert NullifierOnCooldown(\\n nullifier,\\n previousNullifierDestination,\\n burnCount,\\n cooldownDuration\\n );\\n }\\n\\n // Delete the old Attestation linked to the nullifier before recording the new one (accountbound feature)\\n _deletePreviousAttestation(claim, previousNullifierDestination);\\n\\n _setNullifierOnCooldownAndIncrementBurnCount(nullifier);\\n }\\n _setDestinationForNullifier(nullifier, request.destination);\\n }\\n\\n /*******************************************************\\n LOGIC FUNCTIONS RELATED TO ACCOUNTBOUND FEATURE\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the burnCount of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16) {\\n return _getNullifierBurnCount(nullifier);\\n }\\n\\n /**\\n * @dev Getter, returns the cooldown start of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32) {\\n return _getNullifierCooldownStart(nullifier);\\n }\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external pure override(HydraS1SimpleAttester, IHydraS1AccountboundAttester) returns (uint256) {\\n (uint256 nullifier, ) = abi.decode(extraData, (uint256, uint16));\\n\\n return nullifier;\\n }\\n\\n /**\\n * @dev Returns the burn count for a given extraData\\n * @param extraData bytes where the burnCount is encoded\\n */\\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16) {\\n (, uint16 burnCount) = abi.decode(extraData, (uint256, uint16));\\n\\n return burnCount;\\n }\\n\\n /**\\n * @dev Checks if a nullifier is on cooldown\\n * @param nullifier user nullifier\\n * @param cooldownDuration waiting time before the user can change its badge destination\\n */\\n function _isOnCooldown(uint256 nullifier, uint32 cooldownDuration) internal view returns (bool) {\\n return _getNullifierCooldownStart(nullifier) + cooldownDuration > block.timestamp;\\n }\\n\\n /**\\n * @dev Delete the previous attestation created with this nullifier\\n * @param claim user claim\\n * @param previousNullifierDestination previous destination chosen for this user nullifier\\n */\\n function _deletePreviousAttestation(\\n HydraS1Claim memory claim,\\n address previousNullifierDestination\\n ) internal {\\n address[] memory attestationOwners = new address[](1);\\n uint256[] memory attestationCollectionIds = new uint256[](1);\\n\\n attestationOwners[0] = previousNullifierDestination;\\n attestationCollectionIds[0] = AUTHORIZED_COLLECTION_ID_FIRST + claim.groupProperties.groupIndex;\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n }\\n\\n function _setNullifierOnCooldownAndIncrementBurnCount(uint256 nullifier) internal {\\n _nullifiersCooldownStart[nullifier] = uint32(block.timestamp);\\n _nullifiersBurnCount[nullifier] += 1;\\n emit NullifierSetOnCooldown(nullifier, _nullifiersBurnCount[nullifier]);\\n }\\n\\n function _getNullifierCooldownStart(uint256 nullifier) internal view returns (uint32) {\\n return _nullifiersCooldownStart[nullifier];\\n }\\n\\n function _getNullifierBurnCount(uint256 nullifier) internal view returns (uint16) {\\n return _nullifiersBurnCount[nullifier];\\n }\\n\\n /**\\n * @dev returns burn count or burn count + 1 if new burn will happen\\n * @param nullifier user nullifier\\n * @param claimDestination destination referenced in the user claim\\n */\\n function _getNextBurnCount(\\n uint256 nullifier,\\n address claimDestination\\n ) public view virtual returns (uint16) {\\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\\n uint16 burnCount = _getNullifierBurnCount(nullifier);\\n // If the attestation is minted on a new destination address\\n // the burnCount that will be encoded in the extraData of the Attestation should be incremented\\n if (\\n previousNullifierDestination != address(0) && previousNullifierDestination != claimDestination\\n ) {\\n burnCount += 1;\\n }\\n return burnCount;\\n }\\n\\n /*******************************************************\\n GROUP CONFIGURATION LOGIC\\n *******************************************************/\\n\\n /**\\n * @dev Setter, sets the cooldown duration of a groupIndex\\n * @notice set to 0 to deactivate the accountbound feature for this group\\n * @param groupIndex internal collection id\\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\\n **/\\n function setCooldownDurationForGroupIndex(\\n uint256 groupIndex,\\n uint32 cooldownDuration\\n ) external onlyOwner {\\n _cooldownDurations[groupIndex] = cooldownDuration;\\n emit CooldownDurationSetForGroupIndex(groupIndex, cooldownDuration);\\n }\\n\\n /**\\n * @dev Getter, get the cooldown duration of a groupIndex\\n * @notice returns 0 when the accountbound feature is deactivated for this group\\n * @param groupIndex internal collection id\\n **/\\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32) {\\n return _getCooldownDurationForGroupIndex(groupIndex);\\n }\\n\\n // = 0 means that the accountbound feature is deactivated for this group\\n function _getCooldownDurationForGroupIndex(uint256 groupIndex) internal view returns (uint32) {\\n return _cooldownDurations[groupIndex];\\n }\\n}\\n\",\"keccak256\":\"0x4c391f4bbfdd1b22039fdc7b43f12d7933deca89cc6ae9e5a2b5afa8c427762c\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\\nimport {IHydraS1Base} from './base/IHydraS1Base.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Nullified\\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * nullifier = hash(sourceSecret, externalNullifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - Renewable\\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew their attestations\\n **/\\n\\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n /*******************************************************\\n Storage layout:\\n 20 slots for HydraS1\\n 1 slot used\\n 19 place holders\\n *******************************************************/\\n\\n mapping(uint256 => address) internal _nullifiersDestinations;\\n\\n // keeping some space for future\\n uint256[19] private _placeHoldersHydraS1Simple;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n uint256 nullifier = proofData._getNullifier();\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n abi.encode(nullifier)\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if nullifier already used and not a renewal (e.g destination different that last)\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n // we get the nullifier used from the snark input in the data provided\\n uint256 nullifier = proofData._getNullifier();\\n address currentDestination = _getDestinationOfNullifier(nullifier);\\n\\n if (currentDestination != address(0) && currentDestination != request.destination) {\\n revert NullifierUsed(nullifier);\\n }\\n\\n _setDestinationForNullifier(nullifier, request.destination);\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the external nullifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose externalNullifier = hash(attesterAddress, claim.GroupId)\\n * Creates one nullifier per group, per user and makes sure no collision with other attester's nullifiers\\n **/\\n function _getExternalNullifierOfClaim(\\n HydraS1Claim memory claim\\n ) internal view override returns (uint256) {\\n uint256 externalNullifier = _encodeInSnarkField(\\n address(this),\\n claim.groupProperties.groupIndex\\n );\\n return externalNullifier;\\n }\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external pure virtual override(IHydraS1Base, HydraS1Base) returns (uint256) {\\n return abi.decode(extraData, (uint256));\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getDestinationOfNullifier(uint256 nullifier) external view override returns (address) {\\n return _getDestinationOfNullifier(nullifier);\\n }\\n\\n function _setDestinationForNullifier(uint256 nullifier, address destination) internal virtual {\\n _nullifiersDestinations[nullifier] = destination;\\n emit NullifierDestinationUpdated(nullifier, destination);\\n }\\n\\n function _getDestinationOfNullifier(uint256 nullifier) internal view returns (address) {\\n return _nullifiersDestinations[nullifier];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x7bb2f154f8b33d4c536ebe7828baeb25853d9c288d85b75f0f9d4c3a8e01e735\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Attester} from '../../../core/Attester.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n *\\n */\\nabstract contract HydraS1Base is IHydraS1Base, Attester, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the nullifier from an attestation extraData\\n * @dev Getter of a nullifier encoded in extraData\\n * @notice Must be implemented by the inheriting contracts\\n * @param extraData extraData where nullifier can be encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external view virtual returns (uint256);\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the external nullifier from a user request\\n * so it can be checked against snark input\\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n *\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of external nullifiers\\n *\\n * Do they get one external nullifier per claim?\\n * Do they get 2 external nullifiers per claim?\\n * Do they get 1 external nullifier per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getExternalNullifierOfClaim(\\n HydraS1Claim memory claim\\n ) internal view virtual returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(\\n HydraS1Claim memory claim,\\n HydraS1ProofInput memory input\\n ) internal view virtual {\\n if (input.accountsTreeValue != claim.groupId) {\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n }\\n\\n if (input.isStrict == claim.groupProperties.isScore) {\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n }\\n\\n if (input.destination != claim.destination) {\\n revert DestinationMismatch(claim.destination, input.destination);\\n }\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot)) {\\n revert RegistryRootMismatch(input.registryRoot);\\n }\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n ) {\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n }\\n\\n uint256 externalNullifier = _getExternalNullifierOfClaim(claim);\\n\\n if (input.externalNullifier != externalNullifier) {\\n revert ExternalNullifierMismatch(externalNullifier, input.externalNullifier);\\n }\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(uint256 /*errorCode*/) {\\n revert InvalidGroth16Proof('');\\n } catch (bytes memory /*lowLevelData*/) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0x8614a04a2a58649b4434fab39ca30e3ff0d94d09998355dbd9fa5bf762b3c845\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Interface\\n * @author Sismo\\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n **/\\ninterface IHydraS1Base is IAttester {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error ExternalNullifierMismatch(uint256 expectedExternalNullifier, uint256 externalNullifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n function getNullifierFromExtraData(bytes memory extraData) external view returns (uint256);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x65b9966e5cf43975edb64c742057153058ee31bea1beadf4456577e9d5dbc76d\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1AccountboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from '././IHydraS1SimpleAttester.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Interface\\n * @author Sismo\\n * @notice Interface of the HydraS1AccountboundAttester contract which inherits from the errors, events and methods specific to the HydraS1SimpleAttester interface.\\n **/\\ninterface IHydraS1AccountboundAttester is IHydraS1SimpleAttester {\\n /**\\n * @dev Event emitted when the duration of the cooldown duration for a group index (internal collection id) has been set\\n * @param groupIndex internal collection id\\n * @param cooldownDuration the duration of the cooldown period\\n **/\\n event CooldownDurationSetForGroupIndex(uint256 indexed groupIndex, uint32 cooldownDuration);\\n\\n /**\\n * @dev Event emitted when the nullifier has been set on cooldown. This happens when the\\n * attestation destination of a nullifier has been changed\\n * @param nullifier user nullifier\\n * @param burnCount the number of times the attestation destination of a nullifier has been changed\\n **/\\n event NullifierSetOnCooldown(uint256 indexed nullifier, uint16 burnCount);\\n\\n /**\\n * @dev Error when the nullifier is on cooldown. The user have to wait the cooldownDuration\\n * before being able to change again the destination address.\\n **/\\n error NullifierOnCooldown(\\n uint256 nullifier,\\n address destination,\\n uint16 burnCount,\\n uint32 cooldownStart\\n );\\n\\n /**\\n * @dev Error when the cooldown duration for a given groupIndex is equal to zero.\\n * The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.\\n **/\\n error CooldownDurationNotSetForGroupIndex(uint256 groupIndex);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(bytes memory extraData) external pure returns (uint256);\\n\\n /**\\n * @dev Returns the burn count for a given extraData\\n * @param extraData bytes where the burnCount is encoded\\n */\\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16);\\n\\n /**\\n * @dev Getter, returns the cooldown start of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32);\\n\\n /**\\n * @dev Getter, returns the burnCount of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16);\\n\\n /**\\n * @dev Setter, sets the cooldown duration of a groupIndex\\n * @param groupIndex internal collection id\\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\\n **/\\n function setCooldownDurationForGroupIndex(uint256 groupIndex, uint32 cooldownDuration) external;\\n\\n /*/**\\n * @dev Getter, get the cooldown duration of a groupIndex\\n * @notice returns 0 when the accountbound feature is deactivated for this group\\n * @param groupIndex internal collection id\\n **/\\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32);\\n}\\n\",\"keccak256\":\"0x69293ce8ee200e3ce8b34478b5dde62d934e32c4f82d173314a4ed72731b3663\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Interface\\n * @author Sismo\\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\\n **/\\ninterface IHydraS1SimpleAttester is IHydraS1Base {\\n /**\\n * @dev Error when the nullifier is already used for a destination address\\n **/\\n error NullifierUsed(uint256 nullifier);\\n\\n /**\\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\\n **/\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n /**\\n * @dev Event emitted when the nullifier is associated to a destination address.\\n **/\\n event NullifierDestinationUpdated(uint256 nullifier, address newOwner);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getDestinationOfNullifier(uint256 nullifier) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x8222c187e8314c931121c7632965316f079322b076501a5443d3102a0891a8d5\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // externalNullifier\\n // nullifier\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 externalNullifier;\\n uint256 nullifier;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getNullifier(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(\\n HydraS1ProofData memory self\\n )\\n internal\\n pure\\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[10] memory)\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(\\n HydraS1ProofData memory self\\n ) internal pure returns (uint256[2] memory) {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(\\n HydraS1ProofData memory self\\n ) internal pure returns (uint256) {\\n return self.input[5];\\n }\\n\\n function _getNullifier(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getNullifier(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 nullifier = uint256(_getNullifier(snarkProofData));\\n return nullifier;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(\\n bytes memory encodedProperties\\n ) internal pure returns (uint256) {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0xa484f046e44f6c77177ba6f165573dc3ee90680a057dff7d3de46d67a29c462a\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n address[] memory attestationOwners = new address[](collectionIds.length);\\n\\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\\n\\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n // fetch attestations from the registry\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationOwners[i] = attestationsOwner;\\n attestationCollectionIds[i] = collectionIds[i];\\n\\n attestations[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestations, proofData);\\n\\n _beforeDeleteAttestations(attestations, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n\\n _afterDeleteAttestations(attestations, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestations[i]);\\n }\\n return attestations;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x7743f02ed07e1b40a2ff45f5a45b5fe87d765326cce3528676cbd36c3d08ba37\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0x2d5faf5df56dfe1294202e89180846a1d4a5f938699619ee73b60c7314a97dfe\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3467998cbdb82b0c64aa8627efc5893d2b369f73e66e5d1095305e4609593cc5\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address ownerAddress,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0x1b6ab7a4ba266f3da2c7f6ba3de93e3ab89f389dbd6db14514b43cbdcbe9fe09\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5e882d3091e816f1286837eef92ae17737abf66fdeece1282b752f27ba18492b\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0xcb419cf389baad6f38de28625718f64f551d2669339c1b4e1887e11d62484469\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101406040523480156200001257600080fd5b5060405162002b2738038062002b2783398101604081905262000035916200020f565b6001600160a01b0387811660805286811660a05285811660e052841660c0526101008390526101208290526200006b3362000083565b6200007681620000d5565b5050505050505062000292565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054600490610100900460ff16158015620000f8575060005460ff8083169116105b620001605760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff831617610100178155620001876015546001600160a01b031690565b6001600160a01b031614806200019c5750303b155b15620001ad57620001ad8262000083565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b80516001600160a01b03811681146200020a57600080fd5b919050565b600080600080600080600060e0888a0312156200022b57600080fd5b6200023688620001f2565b96506200024660208901620001f2565b95506200025660408901620001f2565b94506200026660608901620001f2565b93506080880151925060a088015191506200028460c08901620001f2565b905092959891949750929550565b60805160a05160c05160e05161010051610120516127ff620003286000396000818161025e0152610d9201526000818161023701528181610d6a01526117200152600081816102dd01526112fa01526000818161017901526113960152600081816101f901526114f7015260008181610323015281816107820152818161096301528181610ae8015261177901526127ff6000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c80638b159099116100b8578063c4d66de81161007c578063c4d66de814610347578063c776adde1461035a578063ca1cc6461461036d578063e60f999f14610380578063f2fde38b14610393578063f7e420b3146103a657600080fd5b80638b159099146102a25780638da5cb5b146102ca578063918447af146102db578063af411a3014610301578063bfa665851461032157600080fd5b806346657fe91161010a57806346657fe9146101f7578063524a32481461021d57806354846d7a146102325780637000b05114610259578063715018a614610280578063754b377c1461028857600080fd5b8063063599db146101475780632254f98e14610177578063345dd9891461019d5780633800a4b9146101be5780633c4a9854146101e4575b600080fd5b61015a610155366004611bbf565b6103b9565b6040516001600160a01b0390911681526020015b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000061015a565b6101b06101ab366004611ce1565b6103d8565b60405190815260200161016e565b6101d16101cc366004611bbf565b6103f7565b60405161ffff909116815260200161016e565b6101d16101f2366004611ce1565b61040f565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61023061022b366004611d27565b61042e565b005b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b610230610494565b610290600481565b60405160ff909116815260200161016e565b6102b56102b0366004611bbf565b6104a8565b60405163ffffffff909116815260200161016e565b6015546001600160a01b031661015a565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61031461030f366004611d9f565b6104c2565b60405161016e9190611ec2565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b610230610355366004611f49565b610573565b610314610368366004611f66565b61068b565b6101d161037b366004612017565b610a46565b61031461038e366004611d9f565b610aaa565b6102306103a1366004611f49565b610bc6565b6102b56103b4366004611bbf565b610c3f565b6000818152600160205260408120546001600160a01b03165b92915050565b600080828060200190518101906103ef919061203c565b509392505050565b6000818152603e602052604081205461ffff166103d2565b60008082806020019051810190610426919061203c565b949350505050565b610436610c59565b600082815260296020908152604091829020805463ffffffff191663ffffffff8516908117909155915191825283917f893e2a4c394b497c1a2b041d18acc02d05deb2cc7ae3ea0f85d001aa93dff48b910160405180910390a25050565b61049c610c59565b6104a66000610cb3565b565b60008181526029602052604081205463ffffffff166103d2565b606060006104d1858585610d05565b905060006104df8585610e84565b9050816000815181106104f4576104f4612068565b602002602001015160a00151610528828460008151811061051757610517612068565b602002602001015160200151610a46565b60405160200161053992919061207e565b6040516020818303038152906040528260008151811061055b5761055b612068565b602090810291909101015160a0015250949350505050565b600054600490610100900460ff16158015610595575060005460ff8083169116105b6105fd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556106236015546001600160a01b031690565b6001600160a01b031614806106375750303b155b156106455761064582610cb3565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60606000856001600160401b038111156106a7576106a7611bd8565b6040519080825280602002602001820160405280156106d0578160200160208202803683370190505b5090506000866001600160401b038111156106ed576106ed611bd8565b604051908082528060200260200182016040528015610716578160200160208202803683370190505b5090506000876001600160401b0381111561073357610733611bd8565b60405190808252806020026020018201604052801561076c57816020015b610759611a9d565b8152602001906001900390816107515790505b50905060005b88811015610940576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106107c1576107c1612068565b905060200201358e6040518363ffffffff1660e01b81526004016107f89291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610815573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261083d91908101906120a4565b93509350935093508b88868151811061085857610858612068565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061088a5761088a612068565b905060200201358786815181106108a3576108a3612068565b6020026020010181815250506040518060c001604052808f8f888181106108cc576108cc612068565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061091e5761091e612068565b60200260200101819052505050505080806109389061216c565b915050610772565b5061094c818787610ea0565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061099a9086908690600401612185565b600060405180830381600087803b1580156109b457600080fd5b505af11580156109c8573d6000803e3d6000fd5b5050505060005b88811015610a39577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b828281518110610a0a57610a0a612068565b6020026020010151604051610a1f9190612209565b60405180910390a180610a318161216c565b9150506109cf565b5098975050505050505050565b600082815260016020908152604080832054603e9092528220546001600160a01b039091169061ffff168115801590610a915750836001600160a01b0316826001600160a01b031614155b1561042657610aa160018261221c565b95945050505050565b6060610ab7848484610eb9565b6000610ac48585856104c2565b9050610ad1858585610f01565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c09390610b1d908490600401611ec2565b600060405180830381600087803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b5050505060005b8151811015610bbd577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610b8e57610b8e612068565b6020026020010151604051610ba39190612209565b60405180910390a180610bb58161216c565b915050610b52565b50949350505050565b610bce610c59565b6001600160a01b038116610c335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b610c3c81610cb3565b50565b6000818152603d602052604081205463ffffffff166103d2565b6015546001600160a01b031633146104a65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105f4565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606000610d1a610d1586612242565b611057565b60408051600180825281830190925291925060009190816020015b610d3d611a9d565b815260200190600190039081610d35575050606083015151909150600090610d8e906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b90507f0000000000000000000000000000000000000000000000000000000000000000811115610dd457604051637bbf29e360e01b8152600481018290526024016105f4565b306000610de18888610e84565b90506040518060c0016040528084815260200186604001516001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff16815260200182604051602001610e4791815260200190565b60405160208183030381529060405281525084600081518110610e6c57610e6c612068565b60209081029190910101525091979650505050505050565b600080610e9383850185612439565b90506000610aa1826110dc565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ec782840184612439565b90506000610ed4826110f2565b90506000610ee4610d1587612242565b9050610ef0818361119c565b610ef9836114cd565b505050505050565b6000610f0d8383610e84565b6000818152600160205260408120549192506001600160a01b0390911690610f37610d1587612242565b90506001600160a01b03821615801590610f67575080604001516001600160a01b0316826001600160a01b031614155b1561103e576060810151516001600160801b031660009081526029602052604081205463ffffffff1690819003610fc35760608201515160405163065ef5f360e01b81526001600160801b0390911660048201526024016105f4565b610fcd848261166a565b15611029576000848152603e602052604081205461ffff16604051630d16862d60e11b8152600481018790526001600160a01b038616602482015261ffff8216604482015263ffffffff841660648201529091506084016105f4565b611033828461169a565b61103c846117e8565b505b610ef9836110526040890160208a01611f49565b61188f565b61105f611aeb565b6000826000015160008151811061107857611078612068565b6020026020010151905061108b816118ee565b600081604001518060200190518101906110a5919061251a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b602081015160009060065b602002015192915050565b6110fa611b4e565b60405180610120016040528061110f8461192e565b6001600160a01b031681526020016111268461193c565b81526020016111348461194b565b81526020016111428461195a565b8152602001611150846110dc565b815260200161115e84611969565b815260200161116c84611978565b81526020016111848460200151610120015160011490565b1515815260200161119484611987565b905292915050565b815160c0820151146111d157815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016105f4565b81606001516040015115158160e0015115150361121c57606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016105f4565b81604001516001600160a01b031681600001516001600160a01b03161461127057604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016105f4565b468160200151146112a3576020810151604051630432cec160e31b815246600482015260248101919091526044016105f4565b81602001518160a00151146112de57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016105f4565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015611349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136d9190612595565b61139257806040015160405163cbfe7bc360e01b81526004016105f491815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa1580156113f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141591906125b0565b80516101008401515191925014158061143c57506020808201516101008401519091015114155b15611486578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016105f4565b6000611491846119df565b9050808360600151146114c7576060830151604051630e6efbdd60e21b81526105f4918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946115309490939290919060040161262c565b602060405180830381865afa925050508015611569575060408051601f3d908101601f1916820190925261156691810190612595565b60015b61163f576115756126b0565b806308c379a0036115ae57506115896126cc565b8061159457506115ed565b8060405162dd577760e81b81526004016105f49190612755565b634e487b71036115ed576115c0612768565b906115cb57506115ed565b60405162dd577760e81b815260206004820152600060248201526044016105f4565b3d808015611617576040519150601f19603f3d011682016040523d82523d6000602084013e61161c565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016105f4565b806116665760405162dd577760e81b815260206004820152600060248201526044016105f4565b5050565b6000828152603d6020526040812054429061168c90849063ffffffff16612788565b63ffffffff16119392505050565b60408051600180825281830190925260009160208083019080368337505060408051600180825281830190925292935060009291506020808301908036833701905050905082826000815181106116f3576116f3612068565b6001600160a01b0390921660209283029190910190910152606084015151611744906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b8160008151811061175757611757612068565b602090810291909101015260405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af7906117b09085908590600401612185565b600060405180830381600087803b1580156117ca57600080fd5b505af11580156117de573d6000803e3d6000fd5b5050505050505050565b6000818152603d60209081526040808320805463ffffffff19164263ffffffff16179055603e909152812080546001929061182890849061ffff1661221c565b82546101009290920a61ffff8181021990931691831602179091556000838152603e60209081526040918290205491519190921681528392507f85183f8abad8891335fb845d2e6b4f84a9c7f7409f242f4e5ec138a84abffacf910160405180910390a250565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f0c5a122814a29e22d1363dacdd6f7c95345b70890f97e65eacb5565da28116ac910161067f565b60006118fd8260400151611a04565b825190915081146116665781516040516337e3d1ab60e01b81526105f4918391600401918252602082015260400190565b6020810151600090816110e7565b602081015160009060016110e7565b602081015160009060046110e7565b602081015160009060056110e7565b602081015160009060076110e7565b602081015160009060086110e7565b61198f611ba1565b604051806040016040528083602001516002600a81106119b1576119b1612068565b6020020151815260200183602001516003600a81106119d2576119d2612068565b6020020151905292915050565b6000806119fd308460600151600001516001600160801b0316611a39565b9392505050565b805160208201206000906103d2907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906127a7565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6119fd91906127a7565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b03168152602001611b49604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001611b495b60405180604001604052806002906020820280368337509192915050565b600060208284031215611bd157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b0382111715611c0d57611c0d611bd8565b60405250565b606081018181106001600160401b0382111715611c0d57611c0d611bd8565b601f8201601f191681016001600160401b0381118282101715611c5757611c57611bd8565b6040525050565b60006001600160401b03821115611c7757611c77611bd8565b50601f01601f191660200190565b600082601f830112611c9657600080fd5b8135611ca181611c5e565b604051611cae8282611c32565b828152856020848701011115611cc357600080fd5b82602086016020830137600092810160200192909252509392505050565b600060208284031215611cf357600080fd5b81356001600160401b03811115611d0957600080fd5b61042684828501611c85565b63ffffffff81168114610c3c57600080fd5b60008060408385031215611d3a57600080fd5b823591506020830135611d4c81611d15565b809150509250929050565b60008083601f840112611d6957600080fd5b5081356001600160401b03811115611d8057600080fd5b602083019150836020828501011115611d9857600080fd5b9250929050565b600080600060408486031215611db457600080fd5b83356001600160401b0380821115611dcb57600080fd5b9085019060408288031215611ddf57600080fd5b90935060208501359080821115611df557600080fd5b50611e0286828701611d57565b9497909650939450505050565b60005b83811015611e2a578181015183820152602001611e12565b838111156114c75750506000910152565b60008151808452611e53816020860160208601611e0f565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261042660c0850182611e3b565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611f1757603f19888603018452611f05858351611e67565b94509285019290850190600101611ee9565b5092979650505050505050565b6001600160a01b0381168114610c3c57600080fd5b8035611f4481611f24565b919050565b600060208284031215611f5b57600080fd5b81356119fd81611f24565b600080600080600060608688031215611f7e57600080fd5b85356001600160401b0380821115611f9557600080fd5b818801915088601f830112611fa957600080fd5b813581811115611fb857600080fd5b8960208260051b8501011115611fcd57600080fd5b60208301975080965050611fe360208901611f39565b94506040880135915080821115611ff957600080fd5b5061200688828901611d57565b969995985093965092949392505050565b6000806040838503121561202a57600080fd5b823591506020830135611d4c81611f24565b6000806040838503121561204f57600080fd5b82519150602083015161ffff81168114611d4c57600080fd5b634e487b7160e01b600052603260045260246000fd5b6040815260006120916040830185611e3b565b905061ffff831660208301529392505050565b600080600080608085870312156120ba57600080fd5b84516120c581611f24565b6020860151604087015191955093506120dd81611d15565b60608601519092506001600160401b038111156120f957600080fd5b8501601f8101871361210a57600080fd5b805161211581611c5e565b6040516121228282611c32565b82815289602084860101111561213757600080fd5b612148836020830160208701611e0f565b969995985093965050505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161217e5761217e612156565b5060010190565b604080825283519082018190526000906020906060840190828701845b828110156121c75781516001600160a01b0316845292840192908401906001016121a2565b5050508381038285015284518082528583019183019060005b818110156121fc578351835292840192918401916001016121e0565b5090979650505050505050565b6020815260006119fd6020830184611e67565b600061ffff80831681851680830382111561223957612239612156565b01949350505050565b6000604080833603121561225557600080fd5b805161226081611bee565b83356001600160401b038082111561227757600080fd5b9085019036601f83011261228a57600080fd5b813560208282111561229e5761229e611bd8565b8160051b86516122b083830182611c32565b928352848101820192828101368511156122c957600080fd5b83870192505b8483101561234d578235868111156122e75760008081fd5b8701606036829003601f19018113156123005760008081fd5b8a5161230b81611c13565b8287013581528b8301358188015290820135908882111561232c5760008081fd5b61233a368884860101611c85565b818d0152835250509183019183016122cf565b5086525061235c888201611f39565b90850152509195945050505050565b6000821982111561237e5761237e612156565b500190565b600082601f83011261239457600080fd5b6040516123a081611bee565b8060408401858111156123b257600080fd5b845b818110156123cc5780358352602092830192016123b4565b509195945050505050565b600082601f8301126123e857600080fd5b6040516101408082018281106001600160401b038211171561240c5761240c611bd8565b6040528301818582111561241f57600080fd5b845b828110156123cc578035825260209182019101612421565b600081830361024081121561244d57600080fd5b6040805161245a81611bee565b6101008084121561246a57600080fd5b8251935061247784611c13565b6124818787612383565b845286605f87011261249257600080fd5b825161249d81611bee565b8060c08801898111156124af57600080fd5b8589015b818110156124d4576124c58b82612383565b835260209092019186016124b3565b508260208801526124e58a82612383565b868801525050508382526124fb878288016123d7565b60208301525095945050505050565b80518015158114611f4457600080fd5b60006060828403121561252c57600080fd5b604051606081018181106001600160401b038211171561254e5761254e611bd8565b60405282516001600160801b038116811461256857600080fd5b8152602083015161257881611d15565b60208201526125896040840161250a565b60408201529392505050565b6000602082840312156125a757600080fd5b6119fd8261250a565b6000604082840312156125c257600080fd5b82601f8301126125d157600080fd5b6040516125dd81611bee565b8060408401858111156125ef57600080fd5b845b818110156123cc5780518352602092830192016125f1565b8060005b60028110156114c757815184526020938401939091019060010161260d565b610240810161263b8287612609565b60408083018660005b600281101561266b57612658838351612609565b9183019160209190910190600101612644565b5050505061267c60c0830185612609565b61010082018360005b600a8110156126a4578151835260209283019290910190600101612685565b50505095945050505050565b600060033d11156126c95760046000803e5060005160e01c5b90565b600060443d10156126da5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561270957505050505090565b82850191508151818111156127215750505050505090565b843d870101602082850101111561273b5750505050505090565b61274a60208286010187611c32565b509095945050505050565b6020815260006119fd6020830184611e3b565b60008060233d1115612784576020600460003e50506000516001905b9091565b600063ffffffff80831681851680830382111561223957612239612156565b6000826127c457634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220202a9a70b259c56940b27ba667618cafc46cd9a9f1eb7ea03e8803b68fee4b3964736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101425760003560e01c80638b159099116100b8578063c4d66de81161007c578063c4d66de814610347578063c776adde1461035a578063ca1cc6461461036d578063e60f999f14610380578063f2fde38b14610393578063f7e420b3146103a657600080fd5b80638b159099146102a25780638da5cb5b146102ca578063918447af146102db578063af411a3014610301578063bfa665851461032157600080fd5b806346657fe91161010a57806346657fe9146101f7578063524a32481461021d57806354846d7a146102325780637000b05114610259578063715018a614610280578063754b377c1461028857600080fd5b8063063599db146101475780632254f98e14610177578063345dd9891461019d5780633800a4b9146101be5780633c4a9854146101e4575b600080fd5b61015a610155366004611bbf565b6103b9565b6040516001600160a01b0390911681526020015b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000061015a565b6101b06101ab366004611ce1565b6103d8565b60405190815260200161016e565b6101d16101cc366004611bbf565b6103f7565b60405161ffff909116815260200161016e565b6101d16101f2366004611ce1565b61040f565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61023061022b366004611d27565b61042e565b005b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b610230610494565b610290600481565b60405160ff909116815260200161016e565b6102b56102b0366004611bbf565b6104a8565b60405163ffffffff909116815260200161016e565b6015546001600160a01b031661015a565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61031461030f366004611d9f565b6104c2565b60405161016e9190611ec2565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b610230610355366004611f49565b610573565b610314610368366004611f66565b61068b565b6101d161037b366004612017565b610a46565b61031461038e366004611d9f565b610aaa565b6102306103a1366004611f49565b610bc6565b6102b56103b4366004611bbf565b610c3f565b6000818152600160205260408120546001600160a01b03165b92915050565b600080828060200190518101906103ef919061203c565b509392505050565b6000818152603e602052604081205461ffff166103d2565b60008082806020019051810190610426919061203c565b949350505050565b610436610c59565b600082815260296020908152604091829020805463ffffffff191663ffffffff8516908117909155915191825283917f893e2a4c394b497c1a2b041d18acc02d05deb2cc7ae3ea0f85d001aa93dff48b910160405180910390a25050565b61049c610c59565b6104a66000610cb3565b565b60008181526029602052604081205463ffffffff166103d2565b606060006104d1858585610d05565b905060006104df8585610e84565b9050816000815181106104f4576104f4612068565b602002602001015160a00151610528828460008151811061051757610517612068565b602002602001015160200151610a46565b60405160200161053992919061207e565b6040516020818303038152906040528260008151811061055b5761055b612068565b602090810291909101015160a0015250949350505050565b600054600490610100900460ff16158015610595575060005460ff8083169116105b6105fd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556106236015546001600160a01b031690565b6001600160a01b031614806106375750303b155b156106455761064582610cb3565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60606000856001600160401b038111156106a7576106a7611bd8565b6040519080825280602002602001820160405280156106d0578160200160208202803683370190505b5090506000866001600160401b038111156106ed576106ed611bd8565b604051908082528060200260200182016040528015610716578160200160208202803683370190505b5090506000876001600160401b0381111561073357610733611bd8565b60405190808252806020026020018201604052801561076c57816020015b610759611a9d565b8152602001906001900390816107515790505b50905060005b88811015610940576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106107c1576107c1612068565b905060200201358e6040518363ffffffff1660e01b81526004016107f89291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610815573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261083d91908101906120a4565b93509350935093508b88868151811061085857610858612068565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061088a5761088a612068565b905060200201358786815181106108a3576108a3612068565b6020026020010181815250506040518060c001604052808f8f888181106108cc576108cc612068565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061091e5761091e612068565b60200260200101819052505050505080806109389061216c565b915050610772565b5061094c818787610ea0565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061099a9086908690600401612185565b600060405180830381600087803b1580156109b457600080fd5b505af11580156109c8573d6000803e3d6000fd5b5050505060005b88811015610a39577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b828281518110610a0a57610a0a612068565b6020026020010151604051610a1f9190612209565b60405180910390a180610a318161216c565b9150506109cf565b5098975050505050505050565b600082815260016020908152604080832054603e9092528220546001600160a01b039091169061ffff168115801590610a915750836001600160a01b0316826001600160a01b031614155b1561042657610aa160018261221c565b95945050505050565b6060610ab7848484610eb9565b6000610ac48585856104c2565b9050610ad1858585610f01565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c09390610b1d908490600401611ec2565b600060405180830381600087803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b5050505060005b8151811015610bbd577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610b8e57610b8e612068565b6020026020010151604051610ba39190612209565b60405180910390a180610bb58161216c565b915050610b52565b50949350505050565b610bce610c59565b6001600160a01b038116610c335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b610c3c81610cb3565b50565b6000818152603d602052604081205463ffffffff166103d2565b6015546001600160a01b031633146104a65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105f4565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606000610d1a610d1586612242565b611057565b60408051600180825281830190925291925060009190816020015b610d3d611a9d565b815260200190600190039081610d35575050606083015151909150600090610d8e906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b90507f0000000000000000000000000000000000000000000000000000000000000000811115610dd457604051637bbf29e360e01b8152600481018290526024016105f4565b306000610de18888610e84565b90506040518060c0016040528084815260200186604001516001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff16815260200182604051602001610e4791815260200190565b60405160208183030381529060405281525084600081518110610e6c57610e6c612068565b60209081029190910101525091979650505050505050565b600080610e9383850185612439565b90506000610aa1826110dc565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ec782840184612439565b90506000610ed4826110f2565b90506000610ee4610d1587612242565b9050610ef0818361119c565b610ef9836114cd565b505050505050565b6000610f0d8383610e84565b6000818152600160205260408120549192506001600160a01b0390911690610f37610d1587612242565b90506001600160a01b03821615801590610f67575080604001516001600160a01b0316826001600160a01b031614155b1561103e576060810151516001600160801b031660009081526029602052604081205463ffffffff1690819003610fc35760608201515160405163065ef5f360e01b81526001600160801b0390911660048201526024016105f4565b610fcd848261166a565b15611029576000848152603e602052604081205461ffff16604051630d16862d60e11b8152600481018790526001600160a01b038616602482015261ffff8216604482015263ffffffff841660648201529091506084016105f4565b611033828461169a565b61103c846117e8565b505b610ef9836110526040890160208a01611f49565b61188f565b61105f611aeb565b6000826000015160008151811061107857611078612068565b6020026020010151905061108b816118ee565b600081604001518060200190518101906110a5919061251a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b602081015160009060065b602002015192915050565b6110fa611b4e565b60405180610120016040528061110f8461192e565b6001600160a01b031681526020016111268461193c565b81526020016111348461194b565b81526020016111428461195a565b8152602001611150846110dc565b815260200161115e84611969565b815260200161116c84611978565b81526020016111848460200151610120015160011490565b1515815260200161119484611987565b905292915050565b815160c0820151146111d157815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016105f4565b81606001516040015115158160e0015115150361121c57606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016105f4565b81604001516001600160a01b031681600001516001600160a01b03161461127057604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016105f4565b468160200151146112a3576020810151604051630432cec160e31b815246600482015260248101919091526044016105f4565b81602001518160a00151146112de57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016105f4565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015611349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136d9190612595565b61139257806040015160405163cbfe7bc360e01b81526004016105f491815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa1580156113f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141591906125b0565b80516101008401515191925014158061143c57506020808201516101008401519091015114155b15611486578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016105f4565b6000611491846119df565b9050808360600151146114c7576060830151604051630e6efbdd60e21b81526105f4918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946115309490939290919060040161262c565b602060405180830381865afa925050508015611569575060408051601f3d908101601f1916820190925261156691810190612595565b60015b61163f576115756126b0565b806308c379a0036115ae57506115896126cc565b8061159457506115ed565b8060405162dd577760e81b81526004016105f49190612755565b634e487b71036115ed576115c0612768565b906115cb57506115ed565b60405162dd577760e81b815260206004820152600060248201526044016105f4565b3d808015611617576040519150601f19603f3d011682016040523d82523d6000602084013e61161c565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016105f4565b806116665760405162dd577760e81b815260206004820152600060248201526044016105f4565b5050565b6000828152603d6020526040812054429061168c90849063ffffffff16612788565b63ffffffff16119392505050565b60408051600180825281830190925260009160208083019080368337505060408051600180825281830190925292935060009291506020808301908036833701905050905082826000815181106116f3576116f3612068565b6001600160a01b0390921660209283029190910190910152606084015151611744906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b8160008151811061175757611757612068565b602090810291909101015260405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af7906117b09085908590600401612185565b600060405180830381600087803b1580156117ca57600080fd5b505af11580156117de573d6000803e3d6000fd5b5050505050505050565b6000818152603d60209081526040808320805463ffffffff19164263ffffffff16179055603e909152812080546001929061182890849061ffff1661221c565b82546101009290920a61ffff8181021990931691831602179091556000838152603e60209081526040918290205491519190921681528392507f85183f8abad8891335fb845d2e6b4f84a9c7f7409f242f4e5ec138a84abffacf910160405180910390a250565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f0c5a122814a29e22d1363dacdd6f7c95345b70890f97e65eacb5565da28116ac910161067f565b60006118fd8260400151611a04565b825190915081146116665781516040516337e3d1ab60e01b81526105f4918391600401918252602082015260400190565b6020810151600090816110e7565b602081015160009060016110e7565b602081015160009060046110e7565b602081015160009060056110e7565b602081015160009060076110e7565b602081015160009060086110e7565b61198f611ba1565b604051806040016040528083602001516002600a81106119b1576119b1612068565b6020020151815260200183602001516003600a81106119d2576119d2612068565b6020020151905292915050565b6000806119fd308460600151600001516001600160801b0316611a39565b9392505050565b805160208201206000906103d2907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906127a7565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6119fd91906127a7565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b03168152602001611b49604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001611b495b60405180604001604052806002906020820280368337509192915050565b600060208284031215611bd157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b0382111715611c0d57611c0d611bd8565b60405250565b606081018181106001600160401b0382111715611c0d57611c0d611bd8565b601f8201601f191681016001600160401b0381118282101715611c5757611c57611bd8565b6040525050565b60006001600160401b03821115611c7757611c77611bd8565b50601f01601f191660200190565b600082601f830112611c9657600080fd5b8135611ca181611c5e565b604051611cae8282611c32565b828152856020848701011115611cc357600080fd5b82602086016020830137600092810160200192909252509392505050565b600060208284031215611cf357600080fd5b81356001600160401b03811115611d0957600080fd5b61042684828501611c85565b63ffffffff81168114610c3c57600080fd5b60008060408385031215611d3a57600080fd5b823591506020830135611d4c81611d15565b809150509250929050565b60008083601f840112611d6957600080fd5b5081356001600160401b03811115611d8057600080fd5b602083019150836020828501011115611d9857600080fd5b9250929050565b600080600060408486031215611db457600080fd5b83356001600160401b0380821115611dcb57600080fd5b9085019060408288031215611ddf57600080fd5b90935060208501359080821115611df557600080fd5b50611e0286828701611d57565b9497909650939450505050565b60005b83811015611e2a578181015183820152602001611e12565b838111156114c75750506000910152565b60008151808452611e53816020860160208601611e0f565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261042660c0850182611e3b565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611f1757603f19888603018452611f05858351611e67565b94509285019290850190600101611ee9565b5092979650505050505050565b6001600160a01b0381168114610c3c57600080fd5b8035611f4481611f24565b919050565b600060208284031215611f5b57600080fd5b81356119fd81611f24565b600080600080600060608688031215611f7e57600080fd5b85356001600160401b0380821115611f9557600080fd5b818801915088601f830112611fa957600080fd5b813581811115611fb857600080fd5b8960208260051b8501011115611fcd57600080fd5b60208301975080965050611fe360208901611f39565b94506040880135915080821115611ff957600080fd5b5061200688828901611d57565b969995985093965092949392505050565b6000806040838503121561202a57600080fd5b823591506020830135611d4c81611f24565b6000806040838503121561204f57600080fd5b82519150602083015161ffff81168114611d4c57600080fd5b634e487b7160e01b600052603260045260246000fd5b6040815260006120916040830185611e3b565b905061ffff831660208301529392505050565b600080600080608085870312156120ba57600080fd5b84516120c581611f24565b6020860151604087015191955093506120dd81611d15565b60608601519092506001600160401b038111156120f957600080fd5b8501601f8101871361210a57600080fd5b805161211581611c5e565b6040516121228282611c32565b82815289602084860101111561213757600080fd5b612148836020830160208701611e0f565b969995985093965050505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161217e5761217e612156565b5060010190565b604080825283519082018190526000906020906060840190828701845b828110156121c75781516001600160a01b0316845292840192908401906001016121a2565b5050508381038285015284518082528583019183019060005b818110156121fc578351835292840192918401916001016121e0565b5090979650505050505050565b6020815260006119fd6020830184611e67565b600061ffff80831681851680830382111561223957612239612156565b01949350505050565b6000604080833603121561225557600080fd5b805161226081611bee565b83356001600160401b038082111561227757600080fd5b9085019036601f83011261228a57600080fd5b813560208282111561229e5761229e611bd8565b8160051b86516122b083830182611c32565b928352848101820192828101368511156122c957600080fd5b83870192505b8483101561234d578235868111156122e75760008081fd5b8701606036829003601f19018113156123005760008081fd5b8a5161230b81611c13565b8287013581528b8301358188015290820135908882111561232c5760008081fd5b61233a368884860101611c85565b818d0152835250509183019183016122cf565b5086525061235c888201611f39565b90850152509195945050505050565b6000821982111561237e5761237e612156565b500190565b600082601f83011261239457600080fd5b6040516123a081611bee565b8060408401858111156123b257600080fd5b845b818110156123cc5780358352602092830192016123b4565b509195945050505050565b600082601f8301126123e857600080fd5b6040516101408082018281106001600160401b038211171561240c5761240c611bd8565b6040528301818582111561241f57600080fd5b845b828110156123cc578035825260209182019101612421565b600081830361024081121561244d57600080fd5b6040805161245a81611bee565b6101008084121561246a57600080fd5b8251935061247784611c13565b6124818787612383565b845286605f87011261249257600080fd5b825161249d81611bee565b8060c08801898111156124af57600080fd5b8589015b818110156124d4576124c58b82612383565b835260209092019186016124b3565b508260208801526124e58a82612383565b868801525050508382526124fb878288016123d7565b60208301525095945050505050565b80518015158114611f4457600080fd5b60006060828403121561252c57600080fd5b604051606081018181106001600160401b038211171561254e5761254e611bd8565b60405282516001600160801b038116811461256857600080fd5b8152602083015161257881611d15565b60208201526125896040840161250a565b60408201529392505050565b6000602082840312156125a757600080fd5b6119fd8261250a565b6000604082840312156125c257600080fd5b82601f8301126125d157600080fd5b6040516125dd81611bee565b8060408401858111156125ef57600080fd5b845b818110156123cc5780518352602092830192016125f1565b8060005b60028110156114c757815184526020938401939091019060010161260d565b610240810161263b8287612609565b60408083018660005b600281101561266b57612658838351612609565b9183019160209190910190600101612644565b5050505061267c60c0830185612609565b61010082018360005b600a8110156126a4578151835260209283019290910190600101612685565b50505095945050505050565b600060033d11156126c95760046000803e5060005160e01c5b90565b600060443d10156126da5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561270957505050505090565b82850191508151818111156127215750505050505090565b843d870101602082850101111561273b5750505050505090565b61274a60208286010187611c32565b509095945050505050565b6020815260006119fd6020830184611e3b565b60008060233d1115612784576020600460003e50506000516001905b9091565b600063ffffffff80831681851680830382111561223957612239612156565b6000826127c457634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220202a9a70b259c56940b27ba667618cafc46cd9a9f1eb7ea03e8803b68fee4b3964736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "errors": { - "CollectionIdOutOfBound(uint256)": [ - { - "details": "Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST*" - } - ], - "CooldownDurationNotSetForGroupIndex(uint256)": [ - { - "details": "Error when the cooldown duration for a given groupIndex is equal to zero. The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.*" - } - ], - "NullifierOnCooldown(uint256,address,uint16,uint32)": [ - { - "details": "Error when the nullifier is on cooldown. The user have to wait the cooldownDuration before being able to change again the destination address.*" - } - ], - "NullifierUsed(uint256)": [ - { - "details": "Error when the nullifier is already used for a destination address*" - } - ] - }, - "kind": "dev", - "methods": { - "_getNextBurnCount(uint256,address)": { - "details": "returns burn count or burn count + 1 if new burn will happen", - "params": { - "claimDestination": "destination referenced in the user claim", - "nullifier": "user nullifier" - } - }, - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns the actual attestations constructed from the user request", - "params": { - "proofData": "snark public input as well as snark proof", - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "availableRootsRegistryAddress": "Registry storing the available groups for this attester (e.g roots of registry merkle trees)", - "collectionIdFirst": "Id of the first attestation collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last attestation collection in which the attester is supposed to record", - "commitmentMapperAddress": "commitment mapper's public key registry", - "hydraS1VerifierAddress": "ZK Snark Hydra-S1 Verifier contract", - "owner": "Address of attester's owner" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getAvailableRootsRegistry()": { - "details": "Getter of Roots Registry Contract" - }, - "getBurnCountFromExtraData(bytes)": { - "details": "Returns the burn count for a given extraData", - "params": { - "extraData": "bytes where the burnCount is encoded" - } - }, - "getCommitmentMapperRegistry()": { - "details": "Getter of Commitment Mapper Registry contract" - }, - "getCooldownDurationForGroupIndex(uint256)": { - "details": "Getter, get the cooldown duration of a groupIndex", - "params": { - "groupIndex": "internal collection id*" - } - }, - "getDestinationOfNullifier(uint256)": { - "details": "Getter, returns the last attestation destination of a nullifier", - "params": { - "nullifier": "nullifier used*" - } - }, - "getNullifierBurnCount(uint256)": { - "details": "Getter, returns the burnCount of a nullifier", - "params": { - "nullifier": "nullifier used*" - } - }, - "getNullifierCooldownStart(uint256)": { - "details": "Getter, returns the cooldown start of a nullifier", - "params": { - "nullifier": "nullifier used*" - } - }, - "getNullifierFromExtraData(bytes)": { - "details": "returns the nullifier for a given extraData", - "params": { - "extraData": "bytes where the nullifier is encoded" - } - }, - "getVerifier()": { - "details": "Getter of Hydra-S1 Verifier contract" - }, - "initialize(address)": { - "details": "Initialize function, to be called by the proxy delegating calls to this implementation", - "params": { - "ownerAddress": "Owner of the contract, has the right to authorize/unauthorize attestations issuers" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "setCooldownDurationForGroupIndex(uint256,uint32)": { - "details": "Setter, sets the cooldown duration of a groupIndex", - "params": { - "cooldownDuration": "cooldown duration we want to set for the groupIndex*", - "groupIndex": "internal collection id" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "title": "Hydra-S1 Accountbound Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "getCooldownDurationForGroupIndex(uint256)": { - "notice": "returns 0 when the accountbound feature is deactivated for this group" - }, - "initialize(address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - }, - "setCooldownDurationForGroupIndex(uint256,uint32)": { - "notice": "set to 0 to deactivate the accountbound feature for this group" - } - }, - "notice": "This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic. Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic. However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation. The _beforeRecordAttestations is also overriden to fit the Accountbound logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Nullified Each source account gets one nullifier per claim (i.e only one attestation per source account per claim) While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier) We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation. We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation. Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier) - Accountbound (opt-in, with cooldown period) The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group. Users can update their attestation's destination by providing a new Hydra-S1 ZK proof It means the attestation is bound to the source account, stored on an updatable destination account. When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional. A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations. - Renewable A nullifier can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8093, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_nullifiersDestinations", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_address)" - }, - { - "astId": 8097, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_placeHoldersHydraS1Simple", - "offset": 0, - "slot": "2", - "type": "t_array(t_uint256)19_storage" - }, - { - "astId": 396, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_owner", - "offset": 0, - "slot": "21", - "type": "t_address" - }, - { - "astId": 7520, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_placeHolderBeforeHydraS1Accountbound", - "offset": 0, - "slot": "22", - "type": "t_array(t_uint256)19_storage" - }, - { - "astId": 7524, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_cooldownDurations", - "offset": 0, - "slot": "41", - "type": "t_mapping(t_uint256,t_uint32)" - }, - { - "astId": 7528, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_placeHoldersHydraS1AccountboundConfig", - "offset": 0, - "slot": "42", - "type": "t_array(t_uint256)19_storage" - }, - { - "astId": 7532, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_nullifiersCooldownStart", - "offset": 0, - "slot": "61", - "type": "t_mapping(t_uint256,t_uint32)" - }, - { - "astId": 7536, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_nullifiersBurnCount", - "offset": 0, - "slot": "62", - "type": "t_mapping(t_uint256,t_uint16)" - }, - { - "astId": 7540, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_placeHoldersHydraS1AccountboundLogic", - "offset": 0, - "slot": "63", - "type": "t_array(t_uint256)18_storage" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)18_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[18]", - "numberOfBytes": "576" - }, - "t_array(t_uint256)19_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[19]", - "numberOfBytes": "608" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_address)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_mapping(t_uint256,t_uint16)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => uint16)", - "numberOfBytes": "32", - "value": "t_uint16" - }, - "t_mapping(t_uint256,t_uint32)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => uint32)", - "numberOfBytes": "32", - "value": "t_uint32" - }, - "t_uint16": { - "encoding": "inplace", - "label": "uint16", - "numberOfBytes": "2" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/HydraS1AccountboundAttesterImplem.json b/deployments/sandboxPolygon/HydraS1AccountboundAttesterImplem.json deleted file mode 100644 index da9e2bc..0000000 --- a/deployments/sandboxPolygon/HydraS1AccountboundAttesterImplem.json +++ /dev/null @@ -1,1393 +0,0 @@ -{ - "address": "0xD8837a59159614A506aeBa453952f3bbDE68Fde2", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "hydraS1VerifierAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "availableRootsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "AccountsTreeValueMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "claimLength", - "type": "uint256" - } - ], - "name": "ClaimsLengthDifferentThanOne", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentMapperPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupIndex", - "type": "uint256" - } - ], - "name": "CooldownDurationNotSetForGroupIndex", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedExternalNullifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "externalNullifier", - "type": "uint256" - } - ], - "name": "ExternalNullifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - }, - { - "internalType": "uint16", - "name": "burnCount", - "type": "uint16" - }, - { - "internalType": "uint32", - "name": "cooldownStart", - "type": "uint32" - } - ], - "name": "NullifierOnCooldown", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - } - ], - "name": "NullifierUsed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "inputRoot", - "type": "uint256" - } - ], - "name": "RegistryRootMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "groupIndex", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint32", - "name": "cooldownDuration", - "type": "uint32" - } - ], - "name": "CooldownDurationSetForGroupIndex", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "NullifierDestinationUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint16", - "name": "burnCount", - "type": "uint16" - } - ], - "name": "NullifierSetOnCooldown", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "IMPLEMENTATION_VERSION", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - }, - { - "internalType": "address", - "name": "claimDestination", - "type": "address" - } - ], - "name": "_getNextBurnCount", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAvailableRootsRegistry", - "outputs": [ - { - "internalType": "contract IAvailableRootsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "name": "getBurnCountFromExtraData", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentMapperRegistry", - "outputs": [ - { - "internalType": "contract ICommitmentMapperRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupIndex", - "type": "uint256" - } - ], - "name": "getCooldownDurationForGroupIndex", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - } - ], - "name": "getDestinationOfNullifier", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - } - ], - "name": "getNullifierBurnCount", - "outputs": [ - { - "internalType": "uint16", - "name": "", - "type": "uint16" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "nullifier", - "type": "uint256" - } - ], - "name": "getNullifierCooldownStart", - "outputs": [ - { - "internalType": "uint32", - "name": "", - "type": "uint32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "name": "getNullifierFromExtraData", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "pure", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract HydraS1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "ownerAddress", - "type": "address" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "groupIndex", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "cooldownDuration", - "type": "uint32" - } - ], - "name": "setCooldownDurationForGroupIndex", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0xd989ad0b1fd904a02441dc0d6f7ffcdd1c625b006fd79b48976be15011e0cb1c", - "receipt": { - "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0xD8837a59159614A506aeBa453952f3bbDE68Fde2", - "transactionIndex": 46, - "gasUsed": "2322582", - "logsBloom": "0x00000000000000200000000000000000002000000000000000800000000000000000000000000000000008000000000000008000000000000000000000000000000000000000000000000000000000800001000000000000000100000000000000000000020000000000000000000800000000010000000080000000000000400000000000010000000000100000000000000000000080000000000000000000200000000000800000000000000400000000000000000000000000000000004000000000000000000001800000040000000000000000000000100004000020000000000000000000000000100000000010000000000000000000000000100002", - "blockHash": "0x5aadc06fbd8d1f1fbb172022acb9b400248801921ac1594ccf14e4b476a5136e", - "transactionHash": "0xd989ad0b1fd904a02441dc0d6f7ffcdd1c625b006fd79b48976be15011e0cb1c", - "logs": [ - { - "transactionIndex": 46, - "blockNumber": 36625870, - "transactionHash": "0xd989ad0b1fd904a02441dc0d6f7ffcdd1c625b006fd79b48976be15011e0cb1c", - "address": "0xD8837a59159614A506aeBa453952f3bbDE68Fde2", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e" - ], - "data": "0x", - "logIndex": 141, - "blockHash": "0x5aadc06fbd8d1f1fbb172022acb9b400248801921ac1594ccf14e4b476a5136e" - }, - { - "transactionIndex": 46, - "blockNumber": 36625870, - "transactionHash": "0xd989ad0b1fd904a02441dc0d6f7ffcdd1c625b006fd79b48976be15011e0cb1c", - "address": "0xD8837a59159614A506aeBa453952f3bbDE68Fde2", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x000000000000000000000000aee4acd5c4bf516330ca8fe11b07206fc6709294" - ], - "data": "0x", - "logIndex": 142, - "blockHash": "0x5aadc06fbd8d1f1fbb172022acb9b400248801921ac1594ccf14e4b476a5136e" - }, - { - "transactionIndex": 46, - "blockNumber": 36625870, - "transactionHash": "0xd989ad0b1fd904a02441dc0d6f7ffcdd1c625b006fd79b48976be15011e0cb1c", - "address": "0xD8837a59159614A506aeBa453952f3bbDE68Fde2", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000004", - "logIndex": 143, - "blockHash": "0x5aadc06fbd8d1f1fbb172022acb9b400248801921ac1594ccf14e4b476a5136e" - }, - { - "transactionIndex": 46, - "blockNumber": 36625870, - "transactionHash": "0xd989ad0b1fd904a02441dc0d6f7ffcdd1c625b006fd79b48976be15011e0cb1c", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x00000000000000000000000046a3a41bd932244dd08186e4c19f1a7e48cbcdf4" - ], - "data": "0x0000000000000000000000000000000000000000000000000100c9e990f278e8000000000000000000000000000000000000000000000000bfee773d65b8548a000000000000000000000000000000000000000000000034c375888fd5c8fc20000000000000000000000000000000000000000000000000beedad53d4c5dba2000000000000000000000000000000000000000000000034c476527966bb7508", - "logIndex": 144, - "blockHash": "0x5aadc06fbd8d1f1fbb172022acb9b400248801921ac1594ccf14e4b476a5136e" - } - ], - "blockNumber": 36625870, - "cumulativeGasUsed": "7539727", - "status": 1, - "byzantium": true - }, - "args": [ - "0xC999390A856e0633f945dD851DeeCE15b533ccA3", - "0xD029177639cc29042D2E6D9De985cbE762092529", - "0xb8797eBa1048f6A6AfCbE4F08a582b4Dde69C05d", - "0xC44F46A31B752b773685be6B5ce8616fFeb97C8D", - "10000001", - "20000000", - "0xaee4acd5c4Bf516330ca8fe11B07206fC6709294" - ], - "numDeployments": 1, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"hydraS1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"availableRootsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"AccountsTreeValueMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimLength\",\"type\":\"uint256\"}],\"name\":\"ClaimsLengthDifferentThanOne\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentMapperPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"}],\"name\":\"CooldownDurationNotSetForGroupIndex\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedExternalNullifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"externalNullifier\",\"type\":\"uint256\"}],\"name\":\"ExternalNullifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint16\",\"name\":\"burnCount\",\"type\":\"uint16\"},{\"internalType\":\"uint32\",\"name\":\"cooldownStart\",\"type\":\"uint32\"}],\"name\":\"NullifierOnCooldown\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"NullifierUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inputRoot\",\"type\":\"uint256\"}],\"name\":\"RegistryRootMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint32\",\"name\":\"cooldownDuration\",\"type\":\"uint32\"}],\"name\":\"CooldownDurationSetForGroupIndex\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"NullifierDestinationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint16\",\"name\":\"burnCount\",\"type\":\"uint16\"}],\"name\":\"NullifierSetOnCooldown\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"previousOwner\",\"type\":\"address\"},{\"indexed\":true,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"OwnershipTransferred\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"IMPLEMENTATION_VERSION\",\"outputs\":[{\"internalType\":\"uint8\",\"name\":\"\",\"type\":\"uint8\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"claimDestination\",\"type\":\"address\"}],\"name\":\"_getNextBurnCount\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAvailableRootsRegistry\",\"outputs\":[{\"internalType\":\"contract IAvailableRootsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"getBurnCountFromExtraData\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentMapperRegistry\",\"outputs\":[{\"internalType\":\"contract ICommitmentMapperRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"}],\"name\":\"getCooldownDurationForGroupIndex\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfNullifier\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"getNullifierBurnCount\",\"outputs\":[{\"internalType\":\"uint16\",\"name\":\"\",\"type\":\"uint16\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"nullifier\",\"type\":\"uint256\"}],\"name\":\"getNullifierCooldownStart\",\"outputs\":[{\"internalType\":\"uint32\",\"name\":\"\",\"type\":\"uint32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"name\":\"getNullifierFromExtraData\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"pure\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract HydraS1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"ownerAddress\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"owner\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"groupIndex\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"cooldownDuration\",\"type\":\"uint32\"}],\"name\":\"setCooldownDurationForGroupIndex\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"errors\":{\"CollectionIdOutOfBound(uint256)\":[{\"details\":\"Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST*\"}],\"CooldownDurationNotSetForGroupIndex(uint256)\":[{\"details\":\"Error when the cooldown duration for a given groupIndex is equal to zero. The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.*\"}],\"NullifierOnCooldown(uint256,address,uint16,uint32)\":[{\"details\":\"Error when the nullifier is on cooldown. The user have to wait the cooldownDuration before being able to change again the destination address.*\"}],\"NullifierUsed(uint256)\":[{\"details\":\"Error when the nullifier is already used for a destination address*\"}]},\"kind\":\"dev\",\"methods\":{\"_getNextBurnCount(uint256,address)\":{\"details\":\"returns burn count or burn count + 1 if new burn will happen\",\"params\":{\"claimDestination\":\"destination referenced in the user claim\",\"nullifier\":\"user nullifier\"}},\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns the actual attestations constructed from the user request\",\"params\":{\"proofData\":\"snark public input as well as snark proof\",\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"availableRootsRegistryAddress\":\"Registry storing the available groups for this attester (e.g roots of registry merkle trees)\",\"collectionIdFirst\":\"Id of the first attestation collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last attestation collection in which the attester is supposed to record\",\"commitmentMapperAddress\":\"commitment mapper's public key registry\",\"hydraS1VerifierAddress\":\"ZK Snark Hydra-S1 Verifier contract\",\"owner\":\"Address of attester's owner\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getAvailableRootsRegistry()\":{\"details\":\"Getter of Roots Registry Contract\"},\"getBurnCountFromExtraData(bytes)\":{\"details\":\"Returns the burn count for a given extraData\",\"params\":{\"extraData\":\"bytes where the burnCount is encoded\"}},\"getCommitmentMapperRegistry()\":{\"details\":\"Getter of Commitment Mapper Registry contract\"},\"getCooldownDurationForGroupIndex(uint256)\":{\"details\":\"Getter, get the cooldown duration of a groupIndex\",\"params\":{\"groupIndex\":\"internal collection id*\"}},\"getDestinationOfNullifier(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a nullifier\",\"params\":{\"nullifier\":\"nullifier used*\"}},\"getNullifierBurnCount(uint256)\":{\"details\":\"Getter, returns the burnCount of a nullifier\",\"params\":{\"nullifier\":\"nullifier used*\"}},\"getNullifierCooldownStart(uint256)\":{\"details\":\"Getter, returns the cooldown start of a nullifier\",\"params\":{\"nullifier\":\"nullifier used*\"}},\"getNullifierFromExtraData(bytes)\":{\"details\":\"returns the nullifier for a given extraData\",\"params\":{\"extraData\":\"bytes where the nullifier is encoded\"}},\"getVerifier()\":{\"details\":\"Getter of Hydra-S1 Verifier contract\"},\"initialize(address)\":{\"details\":\"Initialize function, to be called by the proxy delegating calls to this implementation\",\"params\":{\"ownerAddress\":\"Owner of the contract, has the right to authorize/unauthorize attestations issuers\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"renounceOwnership()\":{\"details\":\"Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.\"},\"setCooldownDurationForGroupIndex(uint256,uint32)\":{\"details\":\"Setter, sets the cooldown duration of a groupIndex\",\"params\":{\"cooldownDuration\":\"cooldown duration we want to set for the groupIndex*\",\"groupIndex\":\"internal collection id\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"title\":\"Hydra-S1 Accountbound Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getCooldownDurationForGroupIndex(uint256)\":{\"notice\":\"returns 0 when the accountbound feature is deactivated for this group\"},\"initialize(address)\":{\"notice\":\"The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\"},\"setCooldownDurationForGroupIndex(uint256,uint32)\":{\"notice\":\"set to 0 to deactivate the accountbound feature for this group\"}},\"notice\":\"This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic. Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic. However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation. The _beforeRecordAttestations is also overriden to fit the Accountbound logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Nullified Each source account gets one nullifier per claim (i.e only one attestation per source account per claim) While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier) We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation. We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation. Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier) - Accountbound (opt-in, with cooldown period) The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group. Users can update their attestation's destination by providing a new Hydra-S1 ZK proof It means the attestation is bound to the source account, stored on an updatable destination account. When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional. A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations. - Renewable A nullifier can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol\":\"HydraS1AccountboundAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n _checkOwner();\\n _;\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if the sender is not the owner.\\n */\\n function _checkOwner() internal view virtual {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0xa94b34880e3c1b0b931662cb1c09e5dfa6662f31cba80e07c5ee71cd135c9673\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n * function initialize() initializer public {\\n * __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n * }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n * function initializeV2() reinitializer(2) public {\\n * __ERC20Permit_init(\\\"MyToken\\\");\\n * }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n * _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n * @custom:oz-retyped-from bool\\n */\\n uint8 private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Triggered when the contract has been initialized or reinitialized.\\n */\\n event Initialized(uint8 version);\\n\\n /**\\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n * `onlyInitializing` functions can be used to initialize parent contracts.\\n *\\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\\n * constructor.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier initializer() {\\n bool isTopLevelCall = !_initializing;\\n require(\\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\\n \\\"Initializable: contract is already initialized\\\"\\n );\\n _initialized = 1;\\n if (isTopLevelCall) {\\n _initializing = true;\\n }\\n _;\\n if (isTopLevelCall) {\\n _initializing = false;\\n emit Initialized(1);\\n }\\n }\\n\\n /**\\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n * used to initialize parent contracts.\\n *\\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\\n * are added through upgrades and that require initialization.\\n *\\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\\n * cannot be nested. If one is invoked in the context of another, execution will revert.\\n *\\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n * a contract, executing them in the right order is up to the developer or operator.\\n *\\n * WARNING: setting the version to 255 will prevent any future reinitialization.\\n *\\n * Emits an {Initialized} event.\\n */\\n modifier reinitializer(uint8 version) {\\n require(!_initializing && _initialized < version, \\\"Initializable: contract is already initialized\\\");\\n _initialized = version;\\n _initializing = true;\\n _;\\n _initializing = false;\\n emit Initialized(version);\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n /**\\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n * through proxies.\\n *\\n * Emits an {Initialized} event the first time it is successfully executed.\\n */\\n function _disableInitializers() internal virtual {\\n require(!_initializing, \\\"Initializable: contract is initializing\\\");\\n if (_initialized < type(uint8).max) {\\n _initialized = type(uint8).max;\\n emit Initialized(type(uint8).max);\\n }\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initialized`\\n */\\n function _getInitializedVersion() internal view returns (uint8) {\\n return _initialized;\\n }\\n\\n /**\\n * @dev Internal function that returns the initialized version. Returns `_initializing`\\n */\\n function _isInitializing() internal view returns (bool) {\\n return _initializing;\\n }\\n}\\n\",\"keccak256\":\"0xcee5467d5d873fb75dae6f98c01a8d25dd609f9d0374c7d39217bd5f9539a2d6\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\\n *\\n * _Available since v4.8._\\n */\\n function verifyCallResultFromTarget(\\n address target,\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n if (success) {\\n if (returndata.length == 0) {\\n // only check isContract if the call was successful and the return data is empty\\n // otherwise we already know that it was a contract\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n }\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n /**\\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason or using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n _revert(returndata, errorMessage);\\n }\\n }\\n\\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n /// @solidity memory-safe-assembly\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf96f969e24029d43d0df89e59d365f277021dac62b48e1c1e3ebe0acdd7f1ca1\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [8609986746108439658545470593166889256314951959466775818870246174320018498804,\\n 6848251127850009101372611262053374737897586140140607384018397707035108265914],\\n [21367916863936594568281095443965096905143705300114190558130516981138584550504,\\n 13327705762185115653848159709412003423932761899188342359583872691135383932883]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 19965766170734310004645394427613286415565755728797065894668054116047682895204,\\n 6952067612339183672227137101423582097916038093373585908267153974352032944482\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 13987716160490730015463796942940452666334097189904948795214986996497499925899,\\n 5336810094802209074340875836312868429276540870324469349093948627126061524544\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 14931593253473978964215343699995811275378324235306358485461293343370969283966,\\n 564306919152089917957316877787764763278299990971316475606280877961553231205\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11591267743733991434114686002448165336885445656808796470854638278338319268343,\\n 11495219763417990955889652410266075210402006084183208750635660647824890013350\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 8183184532870222270700473518157259944911700429689031755853536692005688965081,\\n 9121077094104828462137861111631978599019724423614716723152060153405564278301\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 4314095526093128699362232919686741372014146055311239687202926853002748112330,\\n 11665330391505820654128458332883010598817535082070674418723503440883598640597\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 18925967077785550270509493111690046951994174908254476036944536825999614778001,\\n 4990629719417206796668074534812314525340851981015724652256935997545282642849\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x120f0b311a61cabc9d42ef740c19e5f20b4c8ba400d9a6378e33c76dd54f5c42\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\n\\nimport {IHydraS1AccountboundAttester} from './interfaces/IHydraS1AccountboundAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from '../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra-S1\\nimport {HydraS1SimpleAttester, IAttester, HydraS1Lib, HydraS1ProofData, HydraS1Claim} from './HydraS1SimpleAttester.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic.\\n * Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic.\\n * However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation.\\n * The _beforeRecordAttestations is also overriden to fit the Accountbound logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Nullified\\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\\n * While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier)\\n * We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation.\\n * We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation.\\n * Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier)\\n\\n * - Accountbound (opt-in, with cooldown period)\\n * The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group.\\n * Users can update their attestation's destination by providing a new Hydra-S1 ZK proof \\n * It means the attestation is bound to the source account, stored on an updatable destination account.\\n * When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional.\\n * A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred\\n * One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations.\\n \\n * - Renewable\\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew or update their attestations\\n **/\\n\\ncontract HydraS1AccountboundAttester is\\n IHydraS1AccountboundAttester,\\n HydraS1SimpleAttester,\\n Ownable\\n{\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n uint8 public constant IMPLEMENTATION_VERSION = 4;\\n\\n /*******************************************************\\n Storage layout:\\n 20 slots between HydraS1SimpleAttester and HydraS1AccountboundAttester\\n 1 currently used by Ownable\\n 19 place holders\\n 2O for config\\n 1 currently used\\n 19 place holders\\n 20 for logic\\n 2 currently used\\n 18 place holders\\n *******************************************************/\\n\\n // keeping some space for future config logics\\n uint256[19] private _placeHolderBeforeHydraS1Accountbound;\\n\\n // cooldown durations for each groupIndex\\n mapping(uint256 => uint32) internal _cooldownDurations;\\n\\n // keeping some space for future config logics\\n uint256[19] private _placeHoldersHydraS1AccountboundConfig;\\n\\n mapping(uint256 => uint32) internal _nullifiersCooldownStart;\\n mapping(uint256 => uint16) internal _nullifiersBurnCount;\\n\\n // keeping some space for future config logics\\n uint256[18] private _placeHoldersHydraS1AccountboundLogic;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first attestation collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last attestation collection in which the attester is supposed to record\\n * @param owner Address of attester's owner\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n address owner\\n )\\n HydraS1SimpleAttester(\\n attestationsRegistryAddress,\\n hydraS1VerifierAddress,\\n availableRootsRegistryAddress,\\n commitmentMapperAddress,\\n collectionIdFirst,\\n collectionIdLast\\n )\\n {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Returns the actual attestations constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark public input as well as snark proof\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual override(IAttester, HydraS1SimpleAttester) returns (Attestation[] memory) {\\n Attestation[] memory attestations = super.buildAttestations(request, proofData);\\n\\n uint256 nullifier = proofData._getNullifier();\\n attestations[0].extraData = abi.encode(\\n attestations[0].extraData, // nullifier, from HydraS1 Simple\\n _getNextBurnCount(nullifier, attestations[0].owner) // BurnCount\\n );\\n\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if nullifier already used, not a renewal, and nullifier on cooldown.\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n uint256 nullifier = proofData._getNullifier();\\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\\n\\n HydraS1Claim memory claim = request._claim();\\n\\n // check if the nullifier has already been used previously, if so it may be on cooldown\\n if (\\n previousNullifierDestination != address(0) &&\\n previousNullifierDestination != claim.destination\\n ) {\\n uint32 cooldownDuration = _getCooldownDurationForGroupIndex(claim.groupProperties.groupIndex);\\n if (cooldownDuration == 0) {\\n revert CooldownDurationNotSetForGroupIndex(claim.groupProperties.groupIndex);\\n }\\n if (_isOnCooldown(nullifier, cooldownDuration)) {\\n uint16 burnCount = _getNullifierBurnCount(nullifier);\\n revert NullifierOnCooldown(\\n nullifier,\\n previousNullifierDestination,\\n burnCount,\\n cooldownDuration\\n );\\n }\\n\\n // Delete the old Attestation linked to the nullifier before recording the new one (accountbound feature)\\n _deletePreviousAttestation(claim, previousNullifierDestination);\\n\\n _setNullifierOnCooldownAndIncrementBurnCount(nullifier);\\n }\\n _setDestinationForNullifier(nullifier, request.destination);\\n }\\n\\n /*******************************************************\\n LOGIC FUNCTIONS RELATED TO ACCOUNTBOUND FEATURE\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the burnCount of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16) {\\n return _getNullifierBurnCount(nullifier);\\n }\\n\\n /**\\n * @dev Getter, returns the cooldown start of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32) {\\n return _getNullifierCooldownStart(nullifier);\\n }\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external pure override(HydraS1SimpleAttester, IHydraS1AccountboundAttester) returns (uint256) {\\n (uint256 nullifier, ) = abi.decode(extraData, (uint256, uint16));\\n\\n return nullifier;\\n }\\n\\n /**\\n * @dev Returns the burn count for a given extraData\\n * @param extraData bytes where the burnCount is encoded\\n */\\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16) {\\n (, uint16 burnCount) = abi.decode(extraData, (uint256, uint16));\\n\\n return burnCount;\\n }\\n\\n /**\\n * @dev Checks if a nullifier is on cooldown\\n * @param nullifier user nullifier\\n * @param cooldownDuration waiting time before the user can change its badge destination\\n */\\n function _isOnCooldown(uint256 nullifier, uint32 cooldownDuration) internal view returns (bool) {\\n return _getNullifierCooldownStart(nullifier) + cooldownDuration > block.timestamp;\\n }\\n\\n /**\\n * @dev Delete the previous attestation created with this nullifier\\n * @param claim user claim\\n * @param previousNullifierDestination previous destination chosen for this user nullifier\\n */\\n function _deletePreviousAttestation(\\n HydraS1Claim memory claim,\\n address previousNullifierDestination\\n ) internal {\\n address[] memory attestationOwners = new address[](1);\\n uint256[] memory attestationCollectionIds = new uint256[](1);\\n\\n attestationOwners[0] = previousNullifierDestination;\\n attestationCollectionIds[0] = AUTHORIZED_COLLECTION_ID_FIRST + claim.groupProperties.groupIndex;\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n }\\n\\n function _setNullifierOnCooldownAndIncrementBurnCount(uint256 nullifier) internal {\\n _nullifiersCooldownStart[nullifier] = uint32(block.timestamp);\\n _nullifiersBurnCount[nullifier] += 1;\\n emit NullifierSetOnCooldown(nullifier, _nullifiersBurnCount[nullifier]);\\n }\\n\\n function _getNullifierCooldownStart(uint256 nullifier) internal view returns (uint32) {\\n return _nullifiersCooldownStart[nullifier];\\n }\\n\\n function _getNullifierBurnCount(uint256 nullifier) internal view returns (uint16) {\\n return _nullifiersBurnCount[nullifier];\\n }\\n\\n /**\\n * @dev returns burn count or burn count + 1 if new burn will happen\\n * @param nullifier user nullifier\\n * @param claimDestination destination referenced in the user claim\\n */\\n function _getNextBurnCount(\\n uint256 nullifier,\\n address claimDestination\\n ) public view virtual returns (uint16) {\\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\\n uint16 burnCount = _getNullifierBurnCount(nullifier);\\n // If the attestation is minted on a new destination address\\n // the burnCount that will be encoded in the extraData of the Attestation should be incremented\\n if (\\n previousNullifierDestination != address(0) && previousNullifierDestination != claimDestination\\n ) {\\n burnCount += 1;\\n }\\n return burnCount;\\n }\\n\\n /*******************************************************\\n GROUP CONFIGURATION LOGIC\\n *******************************************************/\\n\\n /**\\n * @dev Setter, sets the cooldown duration of a groupIndex\\n * @notice set to 0 to deactivate the accountbound feature for this group\\n * @param groupIndex internal collection id\\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\\n **/\\n function setCooldownDurationForGroupIndex(\\n uint256 groupIndex,\\n uint32 cooldownDuration\\n ) external onlyOwner {\\n _cooldownDurations[groupIndex] = cooldownDuration;\\n emit CooldownDurationSetForGroupIndex(groupIndex, cooldownDuration);\\n }\\n\\n /**\\n * @dev Getter, get the cooldown duration of a groupIndex\\n * @notice returns 0 when the accountbound feature is deactivated for this group\\n * @param groupIndex internal collection id\\n **/\\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32) {\\n return _getCooldownDurationForGroupIndex(groupIndex);\\n }\\n\\n // = 0 means that the accountbound feature is deactivated for this group\\n function _getCooldownDurationForGroupIndex(uint256 groupIndex) internal view returns (uint32) {\\n return _cooldownDurations[groupIndex];\\n }\\n}\\n\",\"keccak256\":\"0x4c391f4bbfdd1b22039fdc7b43f12d7933deca89cc6ae9e5a2b5afa8c427762c\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\\nimport {IHydraS1Base} from './base/IHydraS1Base.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Nullified\\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * nullifier = hash(sourceSecret, externalNullifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - Renewable\\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew their attestations\\n **/\\n\\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n /*******************************************************\\n Storage layout:\\n 20 slots for HydraS1\\n 1 slot used\\n 19 place holders\\n *******************************************************/\\n\\n mapping(uint256 => address) internal _nullifiersDestinations;\\n\\n // keeping some space for future\\n uint256[19] private _placeHoldersHydraS1Simple;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n uint256 nullifier = proofData._getNullifier();\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n abi.encode(nullifier)\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if nullifier already used and not a renewal (e.g destination different that last)\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual override {\\n // we get the nullifier used from the snark input in the data provided\\n uint256 nullifier = proofData._getNullifier();\\n address currentDestination = _getDestinationOfNullifier(nullifier);\\n\\n if (currentDestination != address(0) && currentDestination != request.destination) {\\n revert NullifierUsed(nullifier);\\n }\\n\\n _setDestinationForNullifier(nullifier, request.destination);\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the external nullifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose externalNullifier = hash(attesterAddress, claim.GroupId)\\n * Creates one nullifier per group, per user and makes sure no collision with other attester's nullifiers\\n **/\\n function _getExternalNullifierOfClaim(\\n HydraS1Claim memory claim\\n ) internal view override returns (uint256) {\\n uint256 externalNullifier = _encodeInSnarkField(\\n address(this),\\n claim.groupProperties.groupIndex\\n );\\n return externalNullifier;\\n }\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external pure virtual override(IHydraS1Base, HydraS1Base) returns (uint256) {\\n return abi.decode(extraData, (uint256));\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getDestinationOfNullifier(uint256 nullifier) external view override returns (address) {\\n return _getDestinationOfNullifier(nullifier);\\n }\\n\\n function _setDestinationForNullifier(uint256 nullifier, address destination) internal virtual {\\n _nullifiersDestinations[nullifier] = destination;\\n emit NullifierDestinationUpdated(nullifier, destination);\\n }\\n\\n function _getDestinationOfNullifier(uint256 nullifier) internal view returns (address) {\\n return _nullifiersDestinations[nullifier];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x7bb2f154f8b33d4c536ebe7828baeb25853d9c288d85b75f0f9d4c3a8e01e735\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Attester} from '../../../core/Attester.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n *\\n */\\nabstract contract HydraS1Base is IHydraS1Base, Attester, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the nullifier from an attestation extraData\\n * @dev Getter of a nullifier encoded in extraData\\n * @notice Must be implemented by the inheriting contracts\\n * @param extraData extraData where nullifier can be encoded\\n */\\n function getNullifierFromExtraData(\\n bytes memory extraData\\n ) external view virtual returns (uint256);\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the external nullifier from a user request\\n * so it can be checked against snark input\\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n *\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of external nullifiers\\n *\\n * Do they get one external nullifier per claim?\\n * Do they get 2 external nullifiers per claim?\\n * Do they get 1 external nullifier per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getExternalNullifierOfClaim(\\n HydraS1Claim memory claim\\n ) internal view virtual returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(\\n HydraS1Claim memory claim,\\n HydraS1ProofInput memory input\\n ) internal view virtual {\\n if (input.accountsTreeValue != claim.groupId) {\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n }\\n\\n if (input.isStrict == claim.groupProperties.isScore) {\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n }\\n\\n if (input.destination != claim.destination) {\\n revert DestinationMismatch(claim.destination, input.destination);\\n }\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot)) {\\n revert RegistryRootMismatch(input.registryRoot);\\n }\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n ) {\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n }\\n\\n uint256 externalNullifier = _getExternalNullifierOfClaim(claim);\\n\\n if (input.externalNullifier != externalNullifier) {\\n revert ExternalNullifierMismatch(externalNullifier, input.externalNullifier);\\n }\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(uint256 /*errorCode*/) {\\n revert InvalidGroth16Proof('');\\n } catch (bytes memory /*lowLevelData*/) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0x8614a04a2a58649b4434fab39ca30e3ff0d94d09998355dbd9fa5bf762b3c845\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Interface\\n * @author Sismo\\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n **/\\ninterface IHydraS1Base is IAttester {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error ExternalNullifierMismatch(uint256 expectedExternalNullifier, uint256 externalNullifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n function getNullifierFromExtraData(bytes memory extraData) external view returns (uint256);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x65b9966e5cf43975edb64c742057153058ee31bea1beadf4456577e9d5dbc76d\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1AccountboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from '././IHydraS1SimpleAttester.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Interface\\n * @author Sismo\\n * @notice Interface of the HydraS1AccountboundAttester contract which inherits from the errors, events and methods specific to the HydraS1SimpleAttester interface.\\n **/\\ninterface IHydraS1AccountboundAttester is IHydraS1SimpleAttester {\\n /**\\n * @dev Event emitted when the duration of the cooldown duration for a group index (internal collection id) has been set\\n * @param groupIndex internal collection id\\n * @param cooldownDuration the duration of the cooldown period\\n **/\\n event CooldownDurationSetForGroupIndex(uint256 indexed groupIndex, uint32 cooldownDuration);\\n\\n /**\\n * @dev Event emitted when the nullifier has been set on cooldown. This happens when the\\n * attestation destination of a nullifier has been changed\\n * @param nullifier user nullifier\\n * @param burnCount the number of times the attestation destination of a nullifier has been changed\\n **/\\n event NullifierSetOnCooldown(uint256 indexed nullifier, uint16 burnCount);\\n\\n /**\\n * @dev Error when the nullifier is on cooldown. The user have to wait the cooldownDuration\\n * before being able to change again the destination address.\\n **/\\n error NullifierOnCooldown(\\n uint256 nullifier,\\n address destination,\\n uint16 burnCount,\\n uint32 cooldownStart\\n );\\n\\n /**\\n * @dev Error when the cooldown duration for a given groupIndex is equal to zero.\\n * The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.\\n **/\\n error CooldownDurationNotSetForGroupIndex(uint256 groupIndex);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev returns the nullifier for a given extraData\\n * @param extraData bytes where the nullifier is encoded\\n */\\n function getNullifierFromExtraData(bytes memory extraData) external pure returns (uint256);\\n\\n /**\\n * @dev Returns the burn count for a given extraData\\n * @param extraData bytes where the burnCount is encoded\\n */\\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16);\\n\\n /**\\n * @dev Getter, returns the cooldown start of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32);\\n\\n /**\\n * @dev Getter, returns the burnCount of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16);\\n\\n /**\\n * @dev Setter, sets the cooldown duration of a groupIndex\\n * @param groupIndex internal collection id\\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\\n **/\\n function setCooldownDurationForGroupIndex(uint256 groupIndex, uint32 cooldownDuration) external;\\n\\n /*/**\\n * @dev Getter, get the cooldown duration of a groupIndex\\n * @notice returns 0 when the accountbound feature is deactivated for this group\\n * @param groupIndex internal collection id\\n **/\\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32);\\n}\\n\",\"keccak256\":\"0x69293ce8ee200e3ce8b34478b5dde62d934e32c4f82d173314a4ed72731b3663\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Interface\\n * @author Sismo\\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\\n **/\\ninterface IHydraS1SimpleAttester is IHydraS1Base {\\n /**\\n * @dev Error when the nullifier is already used for a destination address\\n **/\\n error NullifierUsed(uint256 nullifier);\\n\\n /**\\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\\n **/\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n /**\\n * @dev Event emitted when the nullifier is associated to a destination address.\\n **/\\n event NullifierDestinationUpdated(uint256 nullifier, address newOwner);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a nullifier\\n * @param nullifier nullifier used\\n **/\\n function getDestinationOfNullifier(uint256 nullifier) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x8222c187e8314c931121c7632965316f079322b076501a5443d3102a0891a8d5\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // externalNullifier\\n // nullifier\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 externalNullifier;\\n uint256 nullifier;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getNullifier(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(\\n HydraS1ProofData memory self\\n )\\n internal\\n pure\\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[10] memory)\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(\\n HydraS1ProofData memory self\\n ) internal pure returns (uint256[2] memory) {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(\\n HydraS1ProofData memory self\\n ) internal pure returns (uint256) {\\n return self.input[5];\\n }\\n\\n function _getNullifier(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getNullifier(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 nullifier = uint256(_getNullifier(snarkProofData));\\n return nullifier;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(\\n bytes memory encodedProperties\\n ) internal pure returns (uint256) {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0xa484f046e44f6c77177ba6f165573dc3ee90680a057dff7d3de46d67a29c462a\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n address[] memory attestationOwners = new address[](collectionIds.length);\\n\\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\\n\\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n // fetch attestations from the registry\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationOwners[i] = attestationsOwner;\\n attestationCollectionIds[i] = collectionIds[i];\\n\\n attestations[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestations, proofData);\\n\\n _beforeDeleteAttestations(attestations, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n\\n _afterDeleteAttestations(attestations, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestations[i]);\\n }\\n return attestations;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) public view virtual returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {}\\n}\\n\",\"keccak256\":\"0x7743f02ed07e1b40a2ff45f5a45b5fe87d765326cce3528676cbd36c3d08ba37\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address, uint256, uint32, bytes memory);\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(\\n uint256 collectionId,\\n address owner\\n ) external view returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(\\n uint256 collectionId,\\n address owner\\n ) external view returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(\\n uint256 collectionId,\\n address owner\\n ) external view returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(\\n uint256[] memory collectionIds,\\n address[] memory owners\\n ) external view returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0x0c3af349bcfa545c959f4d9f25aacb73e3ef1ca7cfe62a2eda4a743a6835904f\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.14;\\n\\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\\n\\ninterface IAttestationsRegistryConfigLogic {\\n error AttesterNotFound(address issuer);\\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\\n error IdsMismatch(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 expectedFirstId,\\n uint256 expectedLastId,\\n uint256 FirstId,\\n uint256 lastCollectionId\\n );\\n error AttributeDoesNotExist(uint8 attributeIndex);\\n error AttributeAlreadyExists(uint8 attributeIndex);\\n error ArgsLengthDoesNotMatch();\\n\\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\\n event AttributeNameUpdated(\\n uint8 attributeIndex,\\n bytes32 newAttributeName,\\n bytes32 previousAttributeName\\n );\\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\\n\\n event AttestationsCollectionAttributeSet(\\n uint256 collectionId,\\n uint8 attributeIndex,\\n uint8 attributeValue\\n );\\n\\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\\n\\n /**\\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute. Can go from 0 to 63.\\n */\\n function attestationsCollectionHasAttribute(\\n uint256 collectionId,\\n uint8 index\\n ) external view returns (bool);\\n\\n function attestationsCollectionHasAttributes(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (bool);\\n\\n /**\\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\\n */\\n function getAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 attributeIndex\\n ) external view returns (uint8);\\n\\n function getAttributesValuesForAttestationsCollection(\\n uint256 collectionId,\\n uint8[] memory indices\\n ) external view returns (uint8[] memory);\\n\\n /**\\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n * @param index Index of the attribute (must be between 0 and 63)\\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\\n */\\n function setAttributeValueForAttestationsCollection(\\n uint256 collectionId,\\n uint8 index,\\n uint8 value\\n ) external;\\n\\n function setAttributesValuesForAttestationsCollections(\\n uint256[] memory collectionIds,\\n uint8[] memory indices,\\n uint8[] memory values\\n ) external;\\n\\n /**\\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\\n * @param collectionId Collection Id of the targeted attestationsCollection\\n */\\n function getAttributesNamesAndValuesForAttestationsCollection(\\n uint256 collectionId\\n ) external view returns (bytes32[] memory, uint8[] memory);\\n\\n /**\\n * @dev Authorize an issuer for a specific range\\n * @param issuer Issuer that will be authorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\\n */\\n function authorizeRange(\\n address issuer,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Unauthorize an issuer for a specific range\\n * @param issuer Issuer that will be unauthorized\\n * @param rangeIndex Index of the range to be unauthorized\\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\\n */\\n function unauthorizeRange(\\n address issuer,\\n uint256 rangeIndex,\\n uint256 firstCollectionId,\\n uint256 lastCollectionId\\n ) external;\\n\\n /**\\n * @dev Authorize an issuer for specific ranges\\n * @param issuer Issuer that will be authorized\\n * @param ranges Ranges for which the issuer will be authorized\\n */\\n function authorizeRanges(address issuer, Range[] memory ranges) external;\\n\\n /**\\n * @dev Unauthorize an issuer for specific ranges\\n * @param issuer Issuer that will be unauthorized\\n * @param ranges Ranges for which the issuer will be unauthorized\\n */\\n function unauthorizeRanges(\\n address issuer,\\n Range[] memory ranges,\\n uint256[] memory rangeIndexes\\n ) external;\\n\\n /**\\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\\n * @param issuer Issuer to be checked\\n * @param collectionId Collection Id for which the issuer will be checked\\n */\\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\\n\\n /**\\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\\n */\\n function pause() external;\\n\\n /**\\n * @dev Unpauses the registry\\n */\\n function unpause() external;\\n\\n /**\\n * @dev Create a new attribute.\\n * @param index Index of the attribute. Can go from 0 to 63.\\n * @param name Name in bytes32 of the attribute\\n */\\n function createNewAttribute(uint8 index, bytes32 name) external;\\n\\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Update the name of an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n * @param newName new name in bytes32 of the attribute\\n */\\n function updateAttributeName(uint8 index, bytes32 newName) external;\\n\\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\\n\\n /**\\n * @dev Delete an existing attribute\\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\\n */\\n function deleteAttribute(uint8 index) external;\\n\\n function deleteAttributes(uint8[] memory indices) external;\\n}\\n\",\"keccak256\":\"0x07a1a9e8d2caf1d810ba8fb760a35ce2a0ef60a76814d44881a5aa56162ce26b\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(\\n Request calldata request,\\n bytes calldata proofData\\n ) external view returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0x2d5faf5df56dfe1294202e89180846a1d4a5f938699619ee73b60c7314a97dfe\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/core/libs/utils/RangeLib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nstruct Range {\\n uint256 min;\\n uint256 max;\\n}\\n\\n// Range [0;3] includees 0 and 3\\nlibrary RangeUtils {\\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\\n for (uint256 i = 0; i < ranges.length; i++) {\\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\\n return true;\\n }\\n }\\n return false;\\n }\\n}\\n\",\"keccak256\":\"0x8f04a81575ba69887b302887d4ffbd8eb6f3d9d1a7be920e5478c95b30890ce1\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n }\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3467998cbdb82b0c64aa8627efc5893d2b369f73e66e5d1095305e4609593cc5\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint8 public constant IMPLEMENTATION_VERSION = 2;\\n\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param ownerAddress Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address ownerAddress,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public reinitializer(IMPLEMENTATION_VERSION) {\\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\\n if (owner() == address(0) || address(this).code.length == 0) {\\n _transferOwnership(ownerAddress);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0x1b6ab7a4ba266f3da2c7f6ba3de93e3ab89f389dbd6db14514b43cbdcbe9fe09\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x5e882d3091e816f1286837eef92ae17737abf66fdeece1282b752f27ba18492b\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0xcb419cf389baad6f38de28625718f64f551d2669339c1b4e1887e11d62484469\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101406040523480156200001257600080fd5b5060405162002b2738038062002b2783398101604081905262000035916200020f565b6001600160a01b0387811660805286811660a05285811660e052841660c0526101008390526101208290526200006b3362000083565b6200007681620000d5565b5050505050505062000292565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054600490610100900460ff16158015620000f8575060005460ff8083169116105b620001605760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b606482015260840160405180910390fd5b6000805461ffff191660ff831617610100178155620001876015546001600160a01b031690565b6001600160a01b031614806200019c5750303b155b15620001ad57620001ad8262000083565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb38474024989060200160405180910390a15050565b80516001600160a01b03811681146200020a57600080fd5b919050565b600080600080600080600060e0888a0312156200022b57600080fd5b6200023688620001f2565b96506200024660208901620001f2565b95506200025660408901620001f2565b94506200026660608901620001f2565b93506080880151925060a088015191506200028460c08901620001f2565b905092959891949750929550565b60805160a05160c05160e05161010051610120516127ff620003286000396000818161025e0152610d9201526000818161023701528181610d6a01526117200152600081816102dd01526112fa01526000818161017901526113960152600081816101f901526114f7015260008181610323015281816107820152818161096301528181610ae8015261177901526127ff6000f3fe608060405234801561001057600080fd5b50600436106101425760003560e01c80638b159099116100b8578063c4d66de81161007c578063c4d66de814610347578063c776adde1461035a578063ca1cc6461461036d578063e60f999f14610380578063f2fde38b14610393578063f7e420b3146103a657600080fd5b80638b159099146102a25780638da5cb5b146102ca578063918447af146102db578063af411a3014610301578063bfa665851461032157600080fd5b806346657fe91161010a57806346657fe9146101f7578063524a32481461021d57806354846d7a146102325780637000b05114610259578063715018a614610280578063754b377c1461028857600080fd5b8063063599db146101475780632254f98e14610177578063345dd9891461019d5780633800a4b9146101be5780633c4a9854146101e4575b600080fd5b61015a610155366004611bbf565b6103b9565b6040516001600160a01b0390911681526020015b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000061015a565b6101b06101ab366004611ce1565b6103d8565b60405190815260200161016e565b6101d16101cc366004611bbf565b6103f7565b60405161ffff909116815260200161016e565b6101d16101f2366004611ce1565b61040f565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61023061022b366004611d27565b61042e565b005b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b610230610494565b610290600481565b60405160ff909116815260200161016e565b6102b56102b0366004611bbf565b6104a8565b60405163ffffffff909116815260200161016e565b6015546001600160a01b031661015a565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61031461030f366004611d9f565b6104c2565b60405161016e9190611ec2565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b610230610355366004611f49565b610573565b610314610368366004611f66565b61068b565b6101d161037b366004612017565b610a46565b61031461038e366004611d9f565b610aaa565b6102306103a1366004611f49565b610bc6565b6102b56103b4366004611bbf565b610c3f565b6000818152600160205260408120546001600160a01b03165b92915050565b600080828060200190518101906103ef919061203c565b509392505050565b6000818152603e602052604081205461ffff166103d2565b60008082806020019051810190610426919061203c565b949350505050565b610436610c59565b600082815260296020908152604091829020805463ffffffff191663ffffffff8516908117909155915191825283917f893e2a4c394b497c1a2b041d18acc02d05deb2cc7ae3ea0f85d001aa93dff48b910160405180910390a25050565b61049c610c59565b6104a66000610cb3565b565b60008181526029602052604081205463ffffffff166103d2565b606060006104d1858585610d05565b905060006104df8585610e84565b9050816000815181106104f4576104f4612068565b602002602001015160a00151610528828460008151811061051757610517612068565b602002602001015160200151610a46565b60405160200161053992919061207e565b6040516020818303038152906040528260008151811061055b5761055b612068565b602090810291909101015160a0015250949350505050565b600054600490610100900460ff16158015610595575060005460ff8083169116105b6105fd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556106236015546001600160a01b031690565b6001600160a01b031614806106375750303b155b156106455761064582610cb3565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60606000856001600160401b038111156106a7576106a7611bd8565b6040519080825280602002602001820160405280156106d0578160200160208202803683370190505b5090506000866001600160401b038111156106ed576106ed611bd8565b604051908082528060200260200182016040528015610716578160200160208202803683370190505b5090506000876001600160401b0381111561073357610733611bd8565b60405190808252806020026020018201604052801561076c57816020015b610759611a9d565b8152602001906001900390816107515790505b50905060005b88811015610940576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106107c1576107c1612068565b905060200201358e6040518363ffffffff1660e01b81526004016107f89291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610815573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261083d91908101906120a4565b93509350935093508b88868151811061085857610858612068565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061088a5761088a612068565b905060200201358786815181106108a3576108a3612068565b6020026020010181815250506040518060c001604052808f8f888181106108cc576108cc612068565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061091e5761091e612068565b60200260200101819052505050505080806109389061216c565b915050610772565b5061094c818787610ea0565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061099a9086908690600401612185565b600060405180830381600087803b1580156109b457600080fd5b505af11580156109c8573d6000803e3d6000fd5b5050505060005b88811015610a39577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b828281518110610a0a57610a0a612068565b6020026020010151604051610a1f9190612209565b60405180910390a180610a318161216c565b9150506109cf565b5098975050505050505050565b600082815260016020908152604080832054603e9092528220546001600160a01b039091169061ffff168115801590610a915750836001600160a01b0316826001600160a01b031614155b1561042657610aa160018261221c565b95945050505050565b6060610ab7848484610eb9565b6000610ac48585856104c2565b9050610ad1858585610f01565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c09390610b1d908490600401611ec2565b600060405180830381600087803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b5050505060005b8151811015610bbd577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610b8e57610b8e612068565b6020026020010151604051610ba39190612209565b60405180910390a180610bb58161216c565b915050610b52565b50949350505050565b610bce610c59565b6001600160a01b038116610c335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b610c3c81610cb3565b50565b6000818152603d602052604081205463ffffffff166103d2565b6015546001600160a01b031633146104a65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105f4565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606000610d1a610d1586612242565b611057565b60408051600180825281830190925291925060009190816020015b610d3d611a9d565b815260200190600190039081610d35575050606083015151909150600090610d8e906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b90507f0000000000000000000000000000000000000000000000000000000000000000811115610dd457604051637bbf29e360e01b8152600481018290526024016105f4565b306000610de18888610e84565b90506040518060c0016040528084815260200186604001516001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff16815260200182604051602001610e4791815260200190565b60405160208183030381529060405281525084600081518110610e6c57610e6c612068565b60209081029190910101525091979650505050505050565b600080610e9383850185612439565b90506000610aa1826110dc565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ec782840184612439565b90506000610ed4826110f2565b90506000610ee4610d1587612242565b9050610ef0818361119c565b610ef9836114cd565b505050505050565b6000610f0d8383610e84565b6000818152600160205260408120549192506001600160a01b0390911690610f37610d1587612242565b90506001600160a01b03821615801590610f67575080604001516001600160a01b0316826001600160a01b031614155b1561103e576060810151516001600160801b031660009081526029602052604081205463ffffffff1690819003610fc35760608201515160405163065ef5f360e01b81526001600160801b0390911660048201526024016105f4565b610fcd848261166a565b15611029576000848152603e602052604081205461ffff16604051630d16862d60e11b8152600481018790526001600160a01b038616602482015261ffff8216604482015263ffffffff841660648201529091506084016105f4565b611033828461169a565b61103c846117e8565b505b610ef9836110526040890160208a01611f49565b61188f565b61105f611aeb565b6000826000015160008151811061107857611078612068565b6020026020010151905061108b816118ee565b600081604001518060200190518101906110a5919061251a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b602081015160009060065b602002015192915050565b6110fa611b4e565b60405180610120016040528061110f8461192e565b6001600160a01b031681526020016111268461193c565b81526020016111348461194b565b81526020016111428461195a565b8152602001611150846110dc565b815260200161115e84611969565b815260200161116c84611978565b81526020016111848460200151610120015160011490565b1515815260200161119484611987565b905292915050565b815160c0820151146111d157815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016105f4565b81606001516040015115158160e0015115150361121c57606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016105f4565b81604001516001600160a01b031681600001516001600160a01b03161461127057604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016105f4565b468160200151146112a3576020810151604051630432cec160e31b815246600482015260248101919091526044016105f4565b81602001518160a00151146112de57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016105f4565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015611349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136d9190612595565b61139257806040015160405163cbfe7bc360e01b81526004016105f491815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa1580156113f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141591906125b0565b80516101008401515191925014158061143c57506020808201516101008401519091015114155b15611486578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016105f4565b6000611491846119df565b9050808360600151146114c7576060830151604051630e6efbdd60e21b81526105f4918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946115309490939290919060040161262c565b602060405180830381865afa925050508015611569575060408051601f3d908101601f1916820190925261156691810190612595565b60015b61163f576115756126b0565b806308c379a0036115ae57506115896126cc565b8061159457506115ed565b8060405162dd577760e81b81526004016105f49190612755565b634e487b71036115ed576115c0612768565b906115cb57506115ed565b60405162dd577760e81b815260206004820152600060248201526044016105f4565b3d808015611617576040519150601f19603f3d011682016040523d82523d6000602084013e61161c565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016105f4565b806116665760405162dd577760e81b815260206004820152600060248201526044016105f4565b5050565b6000828152603d6020526040812054429061168c90849063ffffffff16612788565b63ffffffff16119392505050565b60408051600180825281830190925260009160208083019080368337505060408051600180825281830190925292935060009291506020808301908036833701905050905082826000815181106116f3576116f3612068565b6001600160a01b0390921660209283029190910190910152606084015151611744906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b8160008151811061175757611757612068565b602090810291909101015260405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af7906117b09085908590600401612185565b600060405180830381600087803b1580156117ca57600080fd5b505af11580156117de573d6000803e3d6000fd5b5050505050505050565b6000818152603d60209081526040808320805463ffffffff19164263ffffffff16179055603e909152812080546001929061182890849061ffff1661221c565b82546101009290920a61ffff8181021990931691831602179091556000838152603e60209081526040918290205491519190921681528392507f85183f8abad8891335fb845d2e6b4f84a9c7f7409f242f4e5ec138a84abffacf910160405180910390a250565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f0c5a122814a29e22d1363dacdd6f7c95345b70890f97e65eacb5565da28116ac910161067f565b60006118fd8260400151611a04565b825190915081146116665781516040516337e3d1ab60e01b81526105f4918391600401918252602082015260400190565b6020810151600090816110e7565b602081015160009060016110e7565b602081015160009060046110e7565b602081015160009060056110e7565b602081015160009060076110e7565b602081015160009060086110e7565b61198f611ba1565b604051806040016040528083602001516002600a81106119b1576119b1612068565b6020020151815260200183602001516003600a81106119d2576119d2612068565b6020020151905292915050565b6000806119fd308460600151600001516001600160801b0316611a39565b9392505050565b805160208201206000906103d2907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906127a7565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6119fd91906127a7565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b03168152602001611b49604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001611b495b60405180604001604052806002906020820280368337509192915050565b600060208284031215611bd157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b0382111715611c0d57611c0d611bd8565b60405250565b606081018181106001600160401b0382111715611c0d57611c0d611bd8565b601f8201601f191681016001600160401b0381118282101715611c5757611c57611bd8565b6040525050565b60006001600160401b03821115611c7757611c77611bd8565b50601f01601f191660200190565b600082601f830112611c9657600080fd5b8135611ca181611c5e565b604051611cae8282611c32565b828152856020848701011115611cc357600080fd5b82602086016020830137600092810160200192909252509392505050565b600060208284031215611cf357600080fd5b81356001600160401b03811115611d0957600080fd5b61042684828501611c85565b63ffffffff81168114610c3c57600080fd5b60008060408385031215611d3a57600080fd5b823591506020830135611d4c81611d15565b809150509250929050565b60008083601f840112611d6957600080fd5b5081356001600160401b03811115611d8057600080fd5b602083019150836020828501011115611d9857600080fd5b9250929050565b600080600060408486031215611db457600080fd5b83356001600160401b0380821115611dcb57600080fd5b9085019060408288031215611ddf57600080fd5b90935060208501359080821115611df557600080fd5b50611e0286828701611d57565b9497909650939450505050565b60005b83811015611e2a578181015183820152602001611e12565b838111156114c75750506000910152565b60008151808452611e53816020860160208601611e0f565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261042660c0850182611e3b565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611f1757603f19888603018452611f05858351611e67565b94509285019290850190600101611ee9565b5092979650505050505050565b6001600160a01b0381168114610c3c57600080fd5b8035611f4481611f24565b919050565b600060208284031215611f5b57600080fd5b81356119fd81611f24565b600080600080600060608688031215611f7e57600080fd5b85356001600160401b0380821115611f9557600080fd5b818801915088601f830112611fa957600080fd5b813581811115611fb857600080fd5b8960208260051b8501011115611fcd57600080fd5b60208301975080965050611fe360208901611f39565b94506040880135915080821115611ff957600080fd5b5061200688828901611d57565b969995985093965092949392505050565b6000806040838503121561202a57600080fd5b823591506020830135611d4c81611f24565b6000806040838503121561204f57600080fd5b82519150602083015161ffff81168114611d4c57600080fd5b634e487b7160e01b600052603260045260246000fd5b6040815260006120916040830185611e3b565b905061ffff831660208301529392505050565b600080600080608085870312156120ba57600080fd5b84516120c581611f24565b6020860151604087015191955093506120dd81611d15565b60608601519092506001600160401b038111156120f957600080fd5b8501601f8101871361210a57600080fd5b805161211581611c5e565b6040516121228282611c32565b82815289602084860101111561213757600080fd5b612148836020830160208701611e0f565b969995985093965050505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161217e5761217e612156565b5060010190565b604080825283519082018190526000906020906060840190828701845b828110156121c75781516001600160a01b0316845292840192908401906001016121a2565b5050508381038285015284518082528583019183019060005b818110156121fc578351835292840192918401916001016121e0565b5090979650505050505050565b6020815260006119fd6020830184611e67565b600061ffff80831681851680830382111561223957612239612156565b01949350505050565b6000604080833603121561225557600080fd5b805161226081611bee565b83356001600160401b038082111561227757600080fd5b9085019036601f83011261228a57600080fd5b813560208282111561229e5761229e611bd8565b8160051b86516122b083830182611c32565b928352848101820192828101368511156122c957600080fd5b83870192505b8483101561234d578235868111156122e75760008081fd5b8701606036829003601f19018113156123005760008081fd5b8a5161230b81611c13565b8287013581528b8301358188015290820135908882111561232c5760008081fd5b61233a368884860101611c85565b818d0152835250509183019183016122cf565b5086525061235c888201611f39565b90850152509195945050505050565b6000821982111561237e5761237e612156565b500190565b600082601f83011261239457600080fd5b6040516123a081611bee565b8060408401858111156123b257600080fd5b845b818110156123cc5780358352602092830192016123b4565b509195945050505050565b600082601f8301126123e857600080fd5b6040516101408082018281106001600160401b038211171561240c5761240c611bd8565b6040528301818582111561241f57600080fd5b845b828110156123cc578035825260209182019101612421565b600081830361024081121561244d57600080fd5b6040805161245a81611bee565b6101008084121561246a57600080fd5b8251935061247784611c13565b6124818787612383565b845286605f87011261249257600080fd5b825161249d81611bee565b8060c08801898111156124af57600080fd5b8589015b818110156124d4576124c58b82612383565b835260209092019186016124b3565b508260208801526124e58a82612383565b868801525050508382526124fb878288016123d7565b60208301525095945050505050565b80518015158114611f4457600080fd5b60006060828403121561252c57600080fd5b604051606081018181106001600160401b038211171561254e5761254e611bd8565b60405282516001600160801b038116811461256857600080fd5b8152602083015161257881611d15565b60208201526125896040840161250a565b60408201529392505050565b6000602082840312156125a757600080fd5b6119fd8261250a565b6000604082840312156125c257600080fd5b82601f8301126125d157600080fd5b6040516125dd81611bee565b8060408401858111156125ef57600080fd5b845b818110156123cc5780518352602092830192016125f1565b8060005b60028110156114c757815184526020938401939091019060010161260d565b610240810161263b8287612609565b60408083018660005b600281101561266b57612658838351612609565b9183019160209190910190600101612644565b5050505061267c60c0830185612609565b61010082018360005b600a8110156126a4578151835260209283019290910190600101612685565b50505095945050505050565b600060033d11156126c95760046000803e5060005160e01c5b90565b600060443d10156126da5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561270957505050505090565b82850191508151818111156127215750505050505090565b843d870101602082850101111561273b5750505050505090565b61274a60208286010187611c32565b509095945050505050565b6020815260006119fd6020830184611e3b565b60008060233d1115612784576020600460003e50506000516001905b9091565b600063ffffffff80831681851680830382111561223957612239612156565b6000826127c457634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220202a9a70b259c56940b27ba667618cafc46cd9a9f1eb7ea03e8803b68fee4b3964736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106101425760003560e01c80638b159099116100b8578063c4d66de81161007c578063c4d66de814610347578063c776adde1461035a578063ca1cc6461461036d578063e60f999f14610380578063f2fde38b14610393578063f7e420b3146103a657600080fd5b80638b159099146102a25780638da5cb5b146102ca578063918447af146102db578063af411a3014610301578063bfa665851461032157600080fd5b806346657fe91161010a57806346657fe9146101f7578063524a32481461021d57806354846d7a146102325780637000b05114610259578063715018a614610280578063754b377c1461028857600080fd5b8063063599db146101475780632254f98e14610177578063345dd9891461019d5780633800a4b9146101be5780633c4a9854146101e4575b600080fd5b61015a610155366004611bbf565b6103b9565b6040516001600160a01b0390911681526020015b60405180910390f35b7f000000000000000000000000000000000000000000000000000000000000000061015a565b6101b06101ab366004611ce1565b6103d8565b60405190815260200161016e565b6101d16101cc366004611bbf565b6103f7565b60405161ffff909116815260200161016e565b6101d16101f2366004611ce1565b61040f565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61023061022b366004611d27565b61042e565b005b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b6101b07f000000000000000000000000000000000000000000000000000000000000000081565b610230610494565b610290600481565b60405160ff909116815260200161016e565b6102b56102b0366004611bbf565b6104a8565b60405163ffffffff909116815260200161016e565b6015546001600160a01b031661015a565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b61031461030f366004611d9f565b6104c2565b60405161016e9190611ec2565b7f000000000000000000000000000000000000000000000000000000000000000061015a565b610230610355366004611f49565b610573565b610314610368366004611f66565b61068b565b6101d161037b366004612017565b610a46565b61031461038e366004611d9f565b610aaa565b6102306103a1366004611f49565b610bc6565b6102b56103b4366004611bbf565b610c3f565b6000818152600160205260408120546001600160a01b03165b92915050565b600080828060200190518101906103ef919061203c565b509392505050565b6000818152603e602052604081205461ffff166103d2565b60008082806020019051810190610426919061203c565b949350505050565b610436610c59565b600082815260296020908152604091829020805463ffffffff191663ffffffff8516908117909155915191825283917f893e2a4c394b497c1a2b041d18acc02d05deb2cc7ae3ea0f85d001aa93dff48b910160405180910390a25050565b61049c610c59565b6104a66000610cb3565b565b60008181526029602052604081205463ffffffff166103d2565b606060006104d1858585610d05565b905060006104df8585610e84565b9050816000815181106104f4576104f4612068565b602002602001015160a00151610528828460008151811061051757610517612068565b602002602001015160200151610a46565b60405160200161053992919061207e565b6040516020818303038152906040528260008151811061055b5761055b612068565b602090810291909101015160a0015250949350505050565b600054600490610100900460ff16158015610595575060005460ff8083169116105b6105fd5760405162461bcd60e51b815260206004820152602e60248201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160448201526d191e481a5b9a5d1a585b1a5e995960921b60648201526084015b60405180910390fd5b6000805461ffff191660ff8316176101001781556106236015546001600160a01b031690565b6001600160a01b031614806106375750303b155b156106455761064582610cb3565b6000805461ff001916905560405160ff821681527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15050565b60606000856001600160401b038111156106a7576106a7611bd8565b6040519080825280602002602001820160405280156106d0578160200160208202803683370190505b5090506000866001600160401b038111156106ed576106ed611bd8565b604051908082528060200260200182016040528015610716578160200160208202803683370190505b5090506000876001600160401b0381111561073357610733611bd8565b60405190808252806020026020018201604052801561076c57816020015b610759611a9d565b8152602001906001900390816107515790505b50905060005b88811015610940576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106107c1576107c1612068565b905060200201358e6040518363ffffffff1660e01b81526004016107f89291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610815573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261083d91908101906120a4565b93509350935093508b88868151811061085857610858612068565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061088a5761088a612068565b905060200201358786815181106108a3576108a3612068565b6020026020010181815250506040518060c001604052808f8f888181106108cc576108cc612068565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061091e5761091e612068565b60200260200101819052505050505080806109389061216c565b915050610772565b5061094c818787610ea0565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061099a9086908690600401612185565b600060405180830381600087803b1580156109b457600080fd5b505af11580156109c8573d6000803e3d6000fd5b5050505060005b88811015610a39577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b828281518110610a0a57610a0a612068565b6020026020010151604051610a1f9190612209565b60405180910390a180610a318161216c565b9150506109cf565b5098975050505050505050565b600082815260016020908152604080832054603e9092528220546001600160a01b039091169061ffff168115801590610a915750836001600160a01b0316826001600160a01b031614155b1561042657610aa160018261221c565b95945050505050565b6060610ab7848484610eb9565b6000610ac48585856104c2565b9050610ad1858585610f01565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c09390610b1d908490600401611ec2565b600060405180830381600087803b158015610b3757600080fd5b505af1158015610b4b573d6000803e3d6000fd5b5050505060005b8151811015610bbd577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc828281518110610b8e57610b8e612068565b6020026020010151604051610ba39190612209565b60405180910390a180610bb58161216c565b915050610b52565b50949350505050565b610bce610c59565b6001600160a01b038116610c335760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b60648201526084016105f4565b610c3c81610cb3565b50565b6000818152603d602052604081205463ffffffff166103d2565b6015546001600160a01b031633146104a65760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064016105f4565b601580546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b60606000610d1a610d1586612242565b611057565b60408051600180825281830190925291925060009190816020015b610d3d611a9d565b815260200190600190039081610d35575050606083015151909150600090610d8e906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b90507f0000000000000000000000000000000000000000000000000000000000000000811115610dd457604051637bbf29e360e01b8152600481018290526024016105f4565b306000610de18888610e84565b90506040518060c0016040528084815260200186604001516001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff16815260200182604051602001610e4791815260200190565b60405160208183030381529060405281525084600081518110610e6c57610e6c612068565b60209081029190910101525091979650505050505050565b600080610e9383850185612439565b90506000610aa1826110dc565b604051630d5cd8d960e11b815260040160405180910390fd5b6000610ec782840184612439565b90506000610ed4826110f2565b90506000610ee4610d1587612242565b9050610ef0818361119c565b610ef9836114cd565b505050505050565b6000610f0d8383610e84565b6000818152600160205260408120549192506001600160a01b0390911690610f37610d1587612242565b90506001600160a01b03821615801590610f67575080604001516001600160a01b0316826001600160a01b031614155b1561103e576060810151516001600160801b031660009081526029602052604081205463ffffffff1690819003610fc35760608201515160405163065ef5f360e01b81526001600160801b0390911660048201526024016105f4565b610fcd848261166a565b15611029576000848152603e602052604081205461ffff16604051630d16862d60e11b8152600481018790526001600160a01b038616602482015261ffff8216604482015263ffffffff841660648201529091506084016105f4565b611033828461169a565b61103c846117e8565b505b610ef9836110526040890160208a01611f49565b61188f565b61105f611aeb565b6000826000015160008151811061107857611078612068565b6020026020010151905061108b816118ee565b600081604001518060200190518101906110a5919061251a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b602081015160009060065b602002015192915050565b6110fa611b4e565b60405180610120016040528061110f8461192e565b6001600160a01b031681526020016111268461193c565b81526020016111348461194b565b81526020016111428461195a565b8152602001611150846110dc565b815260200161115e84611969565b815260200161116c84611978565b81526020016111848460200151610120015160011490565b1515815260200161119484611987565b905292915050565b815160c0820151146111d157815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016105f4565b81606001516040015115158160e0015115150361121c57606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016105f4565b81604001516001600160a01b031681600001516001600160a01b03161461127057604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016105f4565b468160200151146112a3576020810151604051630432cec160e31b815246600482015260248101919091526044016105f4565b81602001518160a00151146112de57602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016105f4565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015611349573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061136d9190612595565b61139257806040015160405163cbfe7bc360e01b81526004016105f491815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa1580156113f1573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061141591906125b0565b80516101008401515191925014158061143c57506020808201516101008401519091015114155b15611486578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016105f4565b6000611491846119df565b9050808360600151146114c7576060830151604051630e6efbdd60e21b81526105f4918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946115309490939290919060040161262c565b602060405180830381865afa925050508015611569575060408051601f3d908101601f1916820190925261156691810190612595565b60015b61163f576115756126b0565b806308c379a0036115ae57506115896126cc565b8061159457506115ed565b8060405162dd577760e81b81526004016105f49190612755565b634e487b71036115ed576115c0612768565b906115cb57506115ed565b60405162dd577760e81b815260206004820152600060248201526044016105f4565b3d808015611617576040519150601f19603f3d011682016040523d82523d6000602084013e61161c565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016105f4565b806116665760405162dd577760e81b815260206004820152600060248201526044016105f4565b5050565b6000828152603d6020526040812054429061168c90849063ffffffff16612788565b63ffffffff16119392505050565b60408051600180825281830190925260009160208083019080368337505060408051600180825281830190925292935060009291506020808301908036833701905050905082826000815181106116f3576116f3612068565b6001600160a01b0390921660209283029190910190910152606084015151611744906001600160801b03167f000000000000000000000000000000000000000000000000000000000000000061236b565b8160008151811061175757611757612068565b602090810291909101015260405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af7906117b09085908590600401612185565b600060405180830381600087803b1580156117ca57600080fd5b505af11580156117de573d6000803e3d6000fd5b5050505050505050565b6000818152603d60209081526040808320805463ffffffff19164263ffffffff16179055603e909152812080546001929061182890849061ffff1661221c565b82546101009290920a61ffff8181021990931691831602179091556000838152603e60209081526040918290205491519190921681528392507f85183f8abad8891335fb845d2e6b4f84a9c7f7409f242f4e5ec138a84abffacf910160405180910390a250565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f0c5a122814a29e22d1363dacdd6f7c95345b70890f97e65eacb5565da28116ac910161067f565b60006118fd8260400151611a04565b825190915081146116665781516040516337e3d1ab60e01b81526105f4918391600401918252602082015260400190565b6020810151600090816110e7565b602081015160009060016110e7565b602081015160009060046110e7565b602081015160009060056110e7565b602081015160009060076110e7565b602081015160009060086110e7565b61198f611ba1565b604051806040016040528083602001516002600a81106119b1576119b1612068565b6020020151815260200183602001516003600a81106119d2576119d2612068565b6020020151905292915050565b6000806119fd308460600151600001516001600160801b0316611a39565b9392505050565b805160208201206000906103d2907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906127a7565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6119fd91906127a7565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b03168152602001611b49604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b03168152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600015158152602001611b495b60405180604001604052806002906020820280368337509192915050565b600060208284031215611bd157600080fd5b5035919050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b0382111715611c0d57611c0d611bd8565b60405250565b606081018181106001600160401b0382111715611c0d57611c0d611bd8565b601f8201601f191681016001600160401b0381118282101715611c5757611c57611bd8565b6040525050565b60006001600160401b03821115611c7757611c77611bd8565b50601f01601f191660200190565b600082601f830112611c9657600080fd5b8135611ca181611c5e565b604051611cae8282611c32565b828152856020848701011115611cc357600080fd5b82602086016020830137600092810160200192909252509392505050565b600060208284031215611cf357600080fd5b81356001600160401b03811115611d0957600080fd5b61042684828501611c85565b63ffffffff81168114610c3c57600080fd5b60008060408385031215611d3a57600080fd5b823591506020830135611d4c81611d15565b809150509250929050565b60008083601f840112611d6957600080fd5b5081356001600160401b03811115611d8057600080fd5b602083019150836020828501011115611d9857600080fd5b9250929050565b600080600060408486031215611db457600080fd5b83356001600160401b0380821115611dcb57600080fd5b9085019060408288031215611ddf57600080fd5b90935060208501359080821115611df557600080fd5b50611e0286828701611d57565b9497909650939450505050565b60005b83811015611e2a578181015183820152602001611e12565b838111156114c75750506000910152565b60008151808452611e53816020860160208601611e0f565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261042660c0850182611e3b565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b82811015611f1757603f19888603018452611f05858351611e67565b94509285019290850190600101611ee9565b5092979650505050505050565b6001600160a01b0381168114610c3c57600080fd5b8035611f4481611f24565b919050565b600060208284031215611f5b57600080fd5b81356119fd81611f24565b600080600080600060608688031215611f7e57600080fd5b85356001600160401b0380821115611f9557600080fd5b818801915088601f830112611fa957600080fd5b813581811115611fb857600080fd5b8960208260051b8501011115611fcd57600080fd5b60208301975080965050611fe360208901611f39565b94506040880135915080821115611ff957600080fd5b5061200688828901611d57565b969995985093965092949392505050565b6000806040838503121561202a57600080fd5b823591506020830135611d4c81611f24565b6000806040838503121561204f57600080fd5b82519150602083015161ffff81168114611d4c57600080fd5b634e487b7160e01b600052603260045260246000fd5b6040815260006120916040830185611e3b565b905061ffff831660208301529392505050565b600080600080608085870312156120ba57600080fd5b84516120c581611f24565b6020860151604087015191955093506120dd81611d15565b60608601519092506001600160401b038111156120f957600080fd5b8501601f8101871361210a57600080fd5b805161211581611c5e565b6040516121228282611c32565b82815289602084860101111561213757600080fd5b612148836020830160208701611e0f565b969995985093965050505050565b634e487b7160e01b600052601160045260246000fd5b60006001820161217e5761217e612156565b5060010190565b604080825283519082018190526000906020906060840190828701845b828110156121c75781516001600160a01b0316845292840192908401906001016121a2565b5050508381038285015284518082528583019183019060005b818110156121fc578351835292840192918401916001016121e0565b5090979650505050505050565b6020815260006119fd6020830184611e67565b600061ffff80831681851680830382111561223957612239612156565b01949350505050565b6000604080833603121561225557600080fd5b805161226081611bee565b83356001600160401b038082111561227757600080fd5b9085019036601f83011261228a57600080fd5b813560208282111561229e5761229e611bd8565b8160051b86516122b083830182611c32565b928352848101820192828101368511156122c957600080fd5b83870192505b8483101561234d578235868111156122e75760008081fd5b8701606036829003601f19018113156123005760008081fd5b8a5161230b81611c13565b8287013581528b8301358188015290820135908882111561232c5760008081fd5b61233a368884860101611c85565b818d0152835250509183019183016122cf565b5086525061235c888201611f39565b90850152509195945050505050565b6000821982111561237e5761237e612156565b500190565b600082601f83011261239457600080fd5b6040516123a081611bee565b8060408401858111156123b257600080fd5b845b818110156123cc5780358352602092830192016123b4565b509195945050505050565b600082601f8301126123e857600080fd5b6040516101408082018281106001600160401b038211171561240c5761240c611bd8565b6040528301818582111561241f57600080fd5b845b828110156123cc578035825260209182019101612421565b600081830361024081121561244d57600080fd5b6040805161245a81611bee565b6101008084121561246a57600080fd5b8251935061247784611c13565b6124818787612383565b845286605f87011261249257600080fd5b825161249d81611bee565b8060c08801898111156124af57600080fd5b8589015b818110156124d4576124c58b82612383565b835260209092019186016124b3565b508260208801526124e58a82612383565b868801525050508382526124fb878288016123d7565b60208301525095945050505050565b80518015158114611f4457600080fd5b60006060828403121561252c57600080fd5b604051606081018181106001600160401b038211171561254e5761254e611bd8565b60405282516001600160801b038116811461256857600080fd5b8152602083015161257881611d15565b60208201526125896040840161250a565b60408201529392505050565b6000602082840312156125a757600080fd5b6119fd8261250a565b6000604082840312156125c257600080fd5b82601f8301126125d157600080fd5b6040516125dd81611bee565b8060408401858111156125ef57600080fd5b845b818110156123cc5780518352602092830192016125f1565b8060005b60028110156114c757815184526020938401939091019060010161260d565b610240810161263b8287612609565b60408083018660005b600281101561266b57612658838351612609565b9183019160209190910190600101612644565b5050505061267c60c0830185612609565b61010082018360005b600a8110156126a4578151835260209283019290910190600101612685565b50505095945050505050565b600060033d11156126c95760046000803e5060005160e01c5b90565b600060443d10156126da5790565b6040516003193d81016004833e81513d6001600160401b03816024840111818411171561270957505050505090565b82850191508151818111156127215750505050505090565b843d870101602082850101111561273b5750505050505090565b61274a60208286010187611c32565b509095945050505050565b6020815260006119fd6020830184611e3b565b60008060233d1115612784576020600460003e50506000516001905b9091565b600063ffffffff80831681851680830382111561223957612239612156565b6000826127c457634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220202a9a70b259c56940b27ba667618cafc46cd9a9f1eb7ea03e8803b68fee4b3964736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "errors": { - "CollectionIdOutOfBound(uint256)": [ - { - "details": "Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST*" - } - ], - "CooldownDurationNotSetForGroupIndex(uint256)": [ - { - "details": "Error when the cooldown duration for a given groupIndex is equal to zero. The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.*" - } - ], - "NullifierOnCooldown(uint256,address,uint16,uint32)": [ - { - "details": "Error when the nullifier is on cooldown. The user have to wait the cooldownDuration before being able to change again the destination address.*" - } - ], - "NullifierUsed(uint256)": [ - { - "details": "Error when the nullifier is already used for a destination address*" - } - ] - }, - "kind": "dev", - "methods": { - "_getNextBurnCount(uint256,address)": { - "details": "returns burn count or burn count + 1 if new burn will happen", - "params": { - "claimDestination": "destination referenced in the user claim", - "nullifier": "user nullifier" - } - }, - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns the actual attestations constructed from the user request", - "params": { - "proofData": "snark public input as well as snark proof", - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "availableRootsRegistryAddress": "Registry storing the available groups for this attester (e.g roots of registry merkle trees)", - "collectionIdFirst": "Id of the first attestation collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last attestation collection in which the attester is supposed to record", - "commitmentMapperAddress": "commitment mapper's public key registry", - "hydraS1VerifierAddress": "ZK Snark Hydra-S1 Verifier contract", - "owner": "Address of attester's owner" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getAvailableRootsRegistry()": { - "details": "Getter of Roots Registry Contract" - }, - "getBurnCountFromExtraData(bytes)": { - "details": "Returns the burn count for a given extraData", - "params": { - "extraData": "bytes where the burnCount is encoded" - } - }, - "getCommitmentMapperRegistry()": { - "details": "Getter of Commitment Mapper Registry contract" - }, - "getCooldownDurationForGroupIndex(uint256)": { - "details": "Getter, get the cooldown duration of a groupIndex", - "params": { - "groupIndex": "internal collection id*" - } - }, - "getDestinationOfNullifier(uint256)": { - "details": "Getter, returns the last attestation destination of a nullifier", - "params": { - "nullifier": "nullifier used*" - } - }, - "getNullifierBurnCount(uint256)": { - "details": "Getter, returns the burnCount of a nullifier", - "params": { - "nullifier": "nullifier used*" - } - }, - "getNullifierCooldownStart(uint256)": { - "details": "Getter, returns the cooldown start of a nullifier", - "params": { - "nullifier": "nullifier used*" - } - }, - "getNullifierFromExtraData(bytes)": { - "details": "returns the nullifier for a given extraData", - "params": { - "extraData": "bytes where the nullifier is encoded" - } - }, - "getVerifier()": { - "details": "Getter of Hydra-S1 Verifier contract" - }, - "initialize(address)": { - "details": "Initialize function, to be called by the proxy delegating calls to this implementation", - "params": { - "ownerAddress": "Owner of the contract, has the right to authorize/unauthorize attestations issuers" - } - }, - "owner()": { - "details": "Returns the address of the current owner." - }, - "renounceOwnership()": { - "details": "Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner." - }, - "setCooldownDurationForGroupIndex(uint256,uint32)": { - "details": "Setter, sets the cooldown duration of a groupIndex", - "params": { - "cooldownDuration": "cooldown duration we want to set for the groupIndex*", - "groupIndex": "internal collection id" - } - }, - "transferOwnership(address)": { - "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner." - } - }, - "title": "Hydra-S1 Accountbound Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": { - "getCooldownDurationForGroupIndex(uint256)": { - "notice": "returns 0 when the accountbound feature is deactivated for this group" - }, - "initialize(address)": { - "notice": "The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization." - }, - "setCooldownDurationForGroupIndex(uint256,uint32)": { - "notice": "set to 0 to deactivate the accountbound feature for this group" - } - }, - "notice": "This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic. Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic. However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation. The _beforeRecordAttestations is also overriden to fit the Accountbound logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Nullified Each source account gets one nullifier per claim (i.e only one attestation per source account per claim) While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier) We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation. We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation. Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier) - Accountbound (opt-in, with cooldown period) The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group. Users can update their attestation's destination by providing a new Hydra-S1 ZK proof It means the attestation is bound to the source account, stored on an updatable destination account. When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional. A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations. - Renewable A nullifier can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 935, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_uint8" - }, - { - "astId": 938, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 8093, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_nullifiersDestinations", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_address)" - }, - { - "astId": 8097, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_placeHoldersHydraS1Simple", - "offset": 0, - "slot": "2", - "type": "t_array(t_uint256)19_storage" - }, - { - "astId": 396, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_owner", - "offset": 0, - "slot": "21", - "type": "t_address" - }, - { - "astId": 7520, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_placeHolderBeforeHydraS1Accountbound", - "offset": 0, - "slot": "22", - "type": "t_array(t_uint256)19_storage" - }, - { - "astId": 7524, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_cooldownDurations", - "offset": 0, - "slot": "41", - "type": "t_mapping(t_uint256,t_uint32)" - }, - { - "astId": 7528, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_placeHoldersHydraS1AccountboundConfig", - "offset": 0, - "slot": "42", - "type": "t_array(t_uint256)19_storage" - }, - { - "astId": 7532, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_nullifiersCooldownStart", - "offset": 0, - "slot": "61", - "type": "t_mapping(t_uint256,t_uint32)" - }, - { - "astId": 7536, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_nullifiersBurnCount", - "offset": 0, - "slot": "62", - "type": "t_mapping(t_uint256,t_uint16)" - }, - { - "astId": 7540, - "contract": "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol:HydraS1AccountboundAttester", - "label": "_placeHoldersHydraS1AccountboundLogic", - "offset": 0, - "slot": "63", - "type": "t_array(t_uint256)18_storage" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_array(t_uint256)18_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[18]", - "numberOfBytes": "576" - }, - "t_array(t_uint256)19_storage": { - "base": "t_uint256", - "encoding": "inplace", - "label": "uint256[19]", - "numberOfBytes": "608" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_address)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_mapping(t_uint256,t_uint16)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => uint16)", - "numberOfBytes": "32", - "value": "t_uint16" - }, - "t_mapping(t_uint256,t_uint32)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => uint32)", - "numberOfBytes": "32", - "value": "t_uint32" - }, - "t_uint16": { - "encoding": "inplace", - "label": "uint16", - "numberOfBytes": "2" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - }, - "t_uint8": { - "encoding": "inplace", - "label": "uint8", - "numberOfBytes": "1" - } - } - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/HydraS1SimpleAttester.json b/deployments/sandboxPolygon/HydraS1SimpleAttester.json deleted file mode 100644 index a59bb6c..0000000 --- a/deployments/sandboxPolygon/HydraS1SimpleAttester.json +++ /dev/null @@ -1,866 +0,0 @@ -{ - "address": "0x0AB188c7260666146B300aD3ad5b2AB99eb91D45", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "hydraS1VerifierAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "availableRootsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "AccountsTreeValueMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "claimLength", - "type": "uint256" - } - ], - "name": "ClaimsLengthDifferentThanOne", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentMapperPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "inputRoot", - "type": "uint256" - } - ], - "name": "RegistryRootMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedTicketIdentifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ticketIdentifier", - "type": "uint256" - } - ], - "name": "TicketIdentifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "TicketUsed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "TicketDestinationUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAvailableRootsRegistry", - "outputs": [ - { - "internalType": "contract IAvailableRootsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentMapperRegistry", - "outputs": [ - { - "internalType": "contract ICommitmentMapperRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getDestinationOfTicket", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract HydraS1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xf5f71ec0ed011c0cd0bc7662ee9c5cb8399baadc1235fbcc631ff60b4b56cf2b", - "receipt": { - "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0xd8Cd0482E0e33AaE01EEaE3BDDa731694454fe24", - "transactionIndex": 23, - "gasUsed": "1708910", - "logsBloom": "0x00000000000000200000000000000000000000000000000000000000000000000000000000008000000000000000000000008000000000000000000000000000000080000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000100000000000000000000000000000000000080000200000000000000000000000000000000000000000000000000000000000004000000000000000000001000000000000000000000000000000100004000000000000000000000000000000000000000000000000000000000000000000100000", - "blockHash": "0xf8bac89de41ab28216b1a3e4358679538e6233580c9403c68f37097c5125620c", - "transactionHash": "0xf5f71ec0ed011c0cd0bc7662ee9c5cb8399baadc1235fbcc631ff60b4b56cf2b", - "logs": [ - { - "transactionIndex": 23, - "blockNumber": 34792312, - "transactionHash": "0xf5f71ec0ed011c0cd0bc7662ee9c5cb8399baadc1235fbcc631ff60b4b56cf2b", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x000000000000000000000000f0245f6251bef9447a08766b9da2b07b28ad80b0" - ], - "data": "0x00000000000000000000000000000000000000000000000001ec9cf2aa32168a000000000000000000000000000000000000000000000000f73859019959505000000000000000000000000000000000000000000000035c0cf9aee3aa576c9f000000000000000000000000000000000000000000000000f54bbc0eef2739c600000000000000000000000000000000000000000000035c0ee64bd654898329", - "logIndex": 115, - "blockHash": "0xf8bac89de41ab28216b1a3e4358679538e6233580c9403c68f37097c5125620c" - } - ], - "blockNumber": 34792312, - "cumulativeGasUsed": "6373205", - "status": 1, - "byzantium": true - }, - "args": [ - "0xC999390A856e0633f945dD851DeeCE15b533ccA3", - "0xbcE0921E2502898384167414c2F116f7f7B240BC", - "0xb8797eBa1048f6A6AfCbE4F08a582b4Dde69C05d", - "0xC44F46A31B752b773685be6B5ce8616fFeb97C8D", - "10000001", - "20000000" - ], - "numDeployments": 4, - "solcInputHash": "c7c67c4a1ddf53de4ef76f8a114dfc39", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"hydraS1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"availableRootsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"AccountsTreeValueMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimLength\",\"type\":\"uint256\"}],\"name\":\"ClaimsLengthDifferentThanOne\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentMapperPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inputRoot\",\"type\":\"uint256\"}],\"name\":\"RegistryRootMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"TicketUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAvailableRootsRegistry\",\"outputs\":[{\"internalType\":\"contract IAvailableRootsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentMapperRegistry\",\"outputs\":[{\"internalType\":\"contract ICommitmentMapperRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract HydraS1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"errors\":{\"CollectionIdOutOfBound(uint256)\":[{\"details\":\"Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST*\"}],\"TicketUsed(uint256)\":[{\"details\":\"Error when the userTicket (or nullifierHash) is already used for a destination address*\"}]},\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns attestations that will be recorded, constructed from the user request\",\"params\":{\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"availableRootsRegistryAddress\":\"Registry storing the available groups for this attester (e.g roots of registry merkle trees)\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentMapperAddress\":\"commitment mapper's public key registry\",\"hydraS1VerifierAddress\":\"ZK Snark Hydra-S1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getAvailableRootsRegistry()\":{\"details\":\"Getter of Roots Registry Contract\"},\"getCommitmentMapperRegistry()\":{\"details\":\"Getter of Commitment Mapper Registry contract\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Hydra-S1 Verifier contract\"}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"}},\"title\":\"Hydra-S1 Simple Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew their attestations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":\"HydraS1SimpleAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() initializer {}\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\\n // contract may have been reentered.\\n require(_initializing ? _isConstructor() : !_initialized, \\\"Initializable: contract is already initialized\\\");\\n\\n bool isTopLevelCall = !_initializing;\\n if (isTopLevelCall) {\\n _initializing = true;\\n _initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n _initializing = false;\\n }\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} modifier, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n function _isConstructor() private view returns (bool) {\\n return !Address.isContract(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x4823752b07b8ea4ca971b217e39457930e7cb103c2c91e2a29729e5ca907e4f0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\\n 546002182798634190282541153661423157791776194062719045593389981526666716416\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x70c0b7d96ff1b90538938a4cb2d8086b3aabb4febf1e36cb3f470bfe0b4a9e89\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - Renewable\\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew their attestations\\n **/\\n\\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base, Attester {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n mapping(uint256 => address) internal _ticketsDestinations;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(Request calldata request, bytes calldata)\\n public\\n view\\n virtual\\n override(IAttester, Attester)\\n returns (Attestation[] memory)\\n {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n ''\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used and not a renewal (e.g destination different that last)\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n // we get the ticket used from the snark input in the data provided\\n uint256 userTicket = proofData._getTicket();\\n address currentDestination = _getDestinationOfTicket(userTicket);\\n\\n if (currentDestination != address(0) && currentDestination != request.destination) {\\n revert TicketUsed(userTicket);\\n }\\n\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n override\\n returns (uint256)\\n {\\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\\n return ticketIdentifier;\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _ticketsDestinations[userTicket] = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _ticketsDestinations[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x4e58a7c2e28a705f0a4af77ec4145f504aa68cdbc263ac077ebc4c50b9086f11\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n **/\\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n virtual\\n returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\\n internal\\n view\\n virtual\\n {\\n if (input.accountsTreeValue != claim.groupId)\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\\n revert RegistryRootMismatch(input.registryRoot);\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n )\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(\\n uint256 /*errorCode*/\\n ) {\\n revert InvalidGroth16Proof('');\\n } catch (\\n bytes memory /*lowLevelData*/\\n ) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0xdcc036e3178c26e71c5dfdb601f09139ce8919db220acdbb2ad2bad6cc5c4857\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Interface\\n * @author Sismo\\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\\n * We invite readers to refer to the following:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n **/\\ninterface IHydraS1Base {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x33e77f2249293295d1ef95a4d979cad95719bacb216c467f685bdc0b08908bea\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Accountbound Interface\\n * @author Sismo\\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\\n **/\\ninterface IHydraS1SimpleAttester is IHydraS1Base, IAttester {\\n /**\\n * @dev Error when the userTicket (or nullifierHash) is already used for a destination address\\n **/\\n error TicketUsed(uint256 userTicket);\\n\\n /**\\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\\n **/\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n /**\\n * @dev Event emitted when the userTicket (or nullifierHash) is associated to a destination address.\\n **/\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xc8bc2a17b743f7cc8b71d0c1c08cc7973639eb7d1593a14b1cd67b41eb78a632\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // ticketIdentifier\\n // ticket\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (\\n uint256[2] memory,\\n uint256[2][2] memory,\\n uint256[2] memory,\\n uint256[10] memory\\n )\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256[2] memory)\\n {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256)\\n {\\n return self.input[5];\\n }\\n\\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\\n internal\\n pure\\n returns (uint256)\\n {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x596225970aabbc4edb989ee640867c76944e797bfafe5e06dcf37b973480b957\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n override\\n returns (Attestation[] memory)\\n {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n address[] memory attestationOwners = new address[](collectionIds.length);\\n\\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\\n\\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n // fetch attestations from the registry\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationOwners[i] = attestationsOwner;\\n attestationCollectionIds[i] = collectionIds[i];\\n\\n attestations[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestations, proofData);\\n\\n _beforeDeleteAttestations(attestations, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\\n\\n _afterDeleteAttestations(attestations, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestations[i]);\\n }\\n return attestations;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n}\\n\",\"keccak256\":\"0xcab4865f46f442ae11ea0689f63eb7fa0763fcfe86522aa67521a548171cb8e0\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param owners The owners of the attestations to be deleted\\n * @param collectionIds The collection ids of the attestations to be deleted\\n */\\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xcf79a817ec578f5b4d8f23853dd8df0e3b1acfbff2b5a01601fd9a7315862ec9\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) public initializer {\\n _transferOwnership(owner);\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9329ecaf60ffe978c8ab4360e0a8f9bd36e2549e89d672dd39ae80f9a562f9a9\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public initializer {\\n _transferOwnership(owner);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0xacb5347ee1a0e8dc25a1ce3e6fbb427db646e833ff8508909454cad7950418d4\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x87f5035b58936a8458a22f3cf1b3865bd798813310d86af41af74680978c97c8\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0x8d6298b442dde99ee5a9cc989ada6ea808383a08b1e9bb1d4c2b58adc01eec69\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101406040523480156200001257600080fd5b5060405162001f6038038062001f60833981016040819052620000359162000081565b6001600160a01b0394851660805292841660c05290831660a0529190921660e0526101005261012052620000f0565b80516001600160a01b03811681146200007c57600080fd5b919050565b60008060008060008060c087890312156200009b57600080fd5b620000a68762000064565b9550620000b66020880162000064565b9450620000c66040880162000064565b9350620000d66060880162000064565b92506080870151915060a087015190509295509295509295565b60805160a05160c05160e0516101005161012051611dea620001766000396000818161015501526102b501526000818161010d015261028d0152600081816101bf015281816104860152818161066701526107880152600081816101790152610c3301526000818160a50152610ccf01526000818160e40152610e300152611dea6000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063918447af11610066578063918447af14610177578063af411a301461019d578063bfa66585146101bd578063c776adde146101e3578063e60f999f146101f657600080fd5b80632254f98e146100a357806346657fe9146100e257806354846d7a1461010857806363e4afc21461013d5780637000b05114610150575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100d9565b6100c561014b3660046112d1565b610209565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101ab366004611332565b610228565b6040516100d9919061145d565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101f13660046114e4565b61038f565b6101b0610204366004611332565b61074a565b6000818152600160205260408120546001600160a01b03165b92915050565b6060600061023d61023886611642565b610866565b60408051600180825281830190925291925060009190816020015b6102606111af565b8152602001906001900390816102585750506060830151519091506000906102b1906001600160801b03167f00000000000000000000000000000000000000000000000000000000000000006117d1565b90507f00000000000000000000000000000000000000000000000000000000000000008111156102fc57604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b031681526020018560200151815260200185606001516020015163ffffffff1681526020016040518060200160405280600081525081525083600081518110610378576103786117e9565b602090810291909101015250909695505050505050565b60606000856001600160401b038111156103ab576103ab611595565b6040519080825280602002602001820160405280156103d4578160200160208202803683370190505b5090506000866001600160401b038111156103f1576103f1611595565b60405190808252806020026020018201604052801561041a578160200160208202803683370190505b5090506000876001600160401b0381111561043757610437611595565b60405190808252806020026020018201604052801561047057816020015b61045d6111af565b8152602001906001900390816104555790505b50905060005b88811015610644576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106104c5576104c56117e9565b905060200201358e6040518363ffffffff1660e01b81526004016104fc9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610519573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105419190810190611813565b93509350935093508b88868151811061055c5761055c6117e9565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061058e5761058e6117e9565b905060200201358786815181106105a7576105a76117e9565b6020026020010181815250506040518060c001604052808f8f888181106105d0576105d06117e9565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff16815260200182815250868681518110610622576106226117e9565b602002602001018190525050505050808061063c906118c2565b915050610476565b506106508187876108eb565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061069e90869086906004016118db565b600060405180830381600087803b1580156106b857600080fd5b505af11580156106cc573d6000803e3d6000fd5b5050505060005b8881101561073d577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070e5761070e6117e9565b6020026020010151604051610723919061195f565b60405180910390a180610735816118c2565b9150506106d3565b5098975050505050505050565b6060610757848484610904565b6000610764858585610228565b905061077185858561094c565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107bd90849060040161145d565b600060405180830381600087803b1580156107d757600080fd5b505af11580156107eb573d6000803e3d6000fd5b5050505060005b815181101561085d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061082e5761082e6117e9565b6020026020010151604051610843919061195f565b60405180910390a180610855816118c2565b9150506107f2565b50949350505050565b61086e6111fd565b60008260000151600081518110610887576108876117e9565b6020026020010151905061089a816109e7565b600081604001518060200190518101906108b49190611982565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b600061091282840184611ab1565b9050600061091f82610a2b565b9050600061092f61023887611642565b905061093b8183610ad5565b61094483610e06565b505050505050565b60006109588383610f9f565b6000818152600160205260409020549091506001600160a01b031680158015906109a3575061098d6040860160208701611b82565b6001600160a01b0316816001600160a01b031614155b156109c457604051631f5d53e360e01b8152600481018390526024016102f3565b6109dd826109d86040880160208901611b82565b610fc4565b5050505050565b50565b60006109f6826040015161102a565b82519091508114610a275781516040516337e3d1ab60e01b81526102f3918391600401918252602082015260400190565b5050565b610a33611260565b604051806101200160405280610a488461105f565b6001600160a01b03168152602001610a5f84611074565b8152602001610a6d84611083565b8152602001610a7b84611092565b8152602001610a89846110a1565b8152602001610a97846110b0565b8152602001610aa5846110bf565b8152602001610abd8460200151610120015160011490565b15158152602001610acd846110ce565b905292915050565b815160c082015114610b0a57815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016102f3565b81606001516040015115158160e00151151503610b5557606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016102f3565b81604001516001600160a01b031681600001516001600160a01b031614610ba957604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016102f3565b46816020015114610bdc576020810151604051630432cec160e31b815246600482015260248101919091526044016102f3565b81602001518160a0015114610c1757602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016102f3565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610c82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca69190611b9f565b610ccb57806040015160405163cbfe7bc360e01b81526004016102f391815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610d2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4e9190611bba565b805161010084015151919250141580610d7557506020808201516101008401519091015114155b15610dbf578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016102f3565b6000610dca84611126565b905080836060015114610e005760608301516040516377bb6d2760e11b81526102f3918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f694610e6994909392909190600401611c36565b602060405180830381865afa925050508015610ea2575060408051601f3d908101601f19168201909252610e9f91810190611b9f565b60015b610f7857610eae611cba565b806308c379a003610ee75750610ec2611cd6565b80610ecd5750610f26565b8060405162dd577760e81b81526004016102f39190611d5f565b634e487b7103610f2657610ef9611d72565b90610f045750610f26565b60405162dd577760e81b815260206004820152600060248201526044016102f3565b3d808015610f50576040519150601f19603f3d011682016040523d82523d6000602084013e610f55565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016102f3565b80610a275760405162dd577760e81b815260206004820152600060248201526044016102f3565b600080610fae83850185611ab1565b90506000610fbb826110a1565b95945050505050565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b80516020820120600090610222907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611d92565b6020810151600090815b602002015192915050565b60208101516000906001611069565b60208101516000906004611069565b60208101516000906005611069565b60208101516000906006611069565b60208101516000906007611069565b60208101516000906008611069565b6110d66112b3565b604051806040016040528083602001516002600a81106110f8576110f86117e9565b6020020151815260200183602001516003600a8110611119576111196117e9565b6020020151905292915050565b600080611144308460600151600001516001600160801b031661114b565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6111449190611d92565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b0316815260200161125b604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815260200161125b5b60405180604001604052806002906020820280368337509192915050565b6000602082840312156112e357600080fd5b5035919050565b60008083601f8401126112fc57600080fd5b5081356001600160401b0381111561131357600080fd5b60208301915083602082850101111561132b57600080fd5b9250929050565b60008060006040848603121561134757600080fd5b83356001600160401b038082111561135e57600080fd5b908501906040828803121561137257600080fd5b9093506020850135908082111561138857600080fd5b50611395868287016112ea565b9497909650939450505050565b60005b838110156113bd5781810151838201526020016113a5565b83811115610e005750506000910152565b600081518084526113e68160208601602086016113a2565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261145560c08501826113ce565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156114b257603f198886030184526114a08583516113fa565b94509285019290850190600101611484565b5092979650505050505050565b6001600160a01b03811681146109e457600080fd5b80356114df816114bf565b919050565b6000806000806000606086880312156114fc57600080fd5b85356001600160401b038082111561151357600080fd5b818801915088601f83011261152757600080fd5b81358181111561153657600080fd5b8960208260051b850101111561154b57600080fd5b60208301975080965050611561602089016114d4565b9450604088013591508082111561157757600080fd5b50611584888289016112ea565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b03821117156115ca576115ca611595565b60405250565b606081018181106001600160401b03821117156115ca576115ca611595565b601f8201601f191681016001600160401b038111828210171561161457611614611595565b6040525050565b60006001600160401b0382111561163457611634611595565b50601f01601f191660200190565b6000604080833603121561165557600080fd5b8051611660816115ab565b83356001600160401b038082111561167757600080fd5b9085019036601f83011261168a57600080fd5b813560208282111561169e5761169e611595565b8160051b86516116b0838301826115ef565b928352848101820192828101368511156116c957600080fd5b83870192505b8483101561179d578235868111156116e75760008081fd5b8701606036829003601f19018113156117005760008081fd5b8a5161170b816115d0565b8287013581528b8301358188015290820135908882111561172c5760008081fd5b9181019136603f84011261174257600091508182fd5b8683013591506117518261161b565b8c5161175d82826115ef565b838152368e85870101111561177457600091508182fd5b838e86018a830137600093810189019390935250808c01919091528252509183019183016116cf565b508652506117ac8882016114d4565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b600082198211156117e4576117e46117bb565b500190565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff811681146114df57600080fd5b6000806000806080858703121561182957600080fd5b8451611834816114bf565b6020860151909450925061184a604086016117ff565b915060608501516001600160401b0381111561186557600080fd5b8501601f8101871361187657600080fd5b80516118818161161b565b60405161188e82826115ef565b8281528960208486010111156118a357600080fd5b6118b48360208301602087016113a2565b969995985093965050505050565b6000600182016118d4576118d46117bb565b5060010190565b604080825283519082018190526000906020906060840190828701845b8281101561191d5781516001600160a01b0316845292840192908401906001016118f8565b5050508381038285015284518082528583019183019060005b8181101561195257835183529284019291840191600101611936565b5090979650505050505050565b60208152600061114460208301846113fa565b805180151581146114df57600080fd5b60006060828403121561199457600080fd5b604051606081018181106001600160401b03821117156119b6576119b6611595565b60405282516001600160801b03811681146119d057600080fd5b81526119de602084016117ff565b60208201526119ef60408401611972565b60408201529392505050565b600082601f830112611a0c57600080fd5b604051611a18816115ab565b806040840185811115611a2a57600080fd5b845b81811015611a44578035835260209283019201611a2c565b509195945050505050565b600082601f830112611a6057600080fd5b6040516101408082018281106001600160401b0382111715611a8457611a84611595565b60405283018185821115611a9757600080fd5b845b82811015611a44578035825260209182019101611a99565b6000818303610240811215611ac557600080fd5b60408051611ad2816115ab565b61010080841215611ae257600080fd5b82519350611aef846115d0565b611af987876119fb565b845286605f870112611b0a57600080fd5b8251611b15816115ab565b8060c0880189811115611b2757600080fd5b8589015b81811015611b4c57611b3d8b826119fb565b83526020909201918601611b2b565b50826020880152611b5d8a826119fb565b86880152505050838252611b7387828801611a4f565b60208301525095945050505050565b600060208284031215611b9457600080fd5b8135611144816114bf565b600060208284031215611bb157600080fd5b61114482611972565b600060408284031215611bcc57600080fd5b82601f830112611bdb57600080fd5b604051611be7816115ab565b806040840185811115611bf957600080fd5b845b81811015611a44578051835260209283019201611bfb565b8060005b6002811015610e00578151845260209384019390910190600101611c17565b6102408101611c458287611c13565b60408083018660005b6002811015611c7557611c62838351611c13565b9183019160209190910190600101611c4e565b50505050611c8660c0830185611c13565b61010082018360005b600a811015611cae578151835260209283019290910190600101611c8f565b50505095945050505050565b600060033d1115611cd35760046000803e5060005160e01c5b90565b600060443d1015611ce45790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611d1357505050505090565b8285019150815181811115611d2b5750505050505090565b843d8701016020828501011115611d455750505050505090565b611d54602082860101876115ef565b509095945050505050565b60208152600061114460208301846113ce565b60008060233d1115611d8e576020600460003e50506000516001905b9091565b600082611daf57634e487b7160e01b600052601260045260246000fd5b50069056fea26469706673582212206f25f22d1700579027a3b154c953a64f2dd7c5743b363da74b5173ab9c3e655764736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063918447af11610066578063918447af14610177578063af411a301461019d578063bfa66585146101bd578063c776adde146101e3578063e60f999f146101f657600080fd5b80632254f98e146100a357806346657fe9146100e257806354846d7a1461010857806363e4afc21461013d5780637000b05114610150575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100d9565b6100c561014b3660046112d1565b610209565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101ab366004611332565b610228565b6040516100d9919061145d565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101f13660046114e4565b61038f565b6101b0610204366004611332565b61074a565b6000818152600160205260408120546001600160a01b03165b92915050565b6060600061023d61023886611642565b610866565b60408051600180825281830190925291925060009190816020015b6102606111af565b8152602001906001900390816102585750506060830151519091506000906102b1906001600160801b03167f00000000000000000000000000000000000000000000000000000000000000006117d1565b90507f00000000000000000000000000000000000000000000000000000000000000008111156102fc57604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b031681526020018560200151815260200185606001516020015163ffffffff1681526020016040518060200160405280600081525081525083600081518110610378576103786117e9565b602090810291909101015250909695505050505050565b60606000856001600160401b038111156103ab576103ab611595565b6040519080825280602002602001820160405280156103d4578160200160208202803683370190505b5090506000866001600160401b038111156103f1576103f1611595565b60405190808252806020026020018201604052801561041a578160200160208202803683370190505b5090506000876001600160401b0381111561043757610437611595565b60405190808252806020026020018201604052801561047057816020015b61045d6111af565b8152602001906001900390816104555790505b50905060005b88811015610644576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78f8f888181106104c5576104c56117e9565b905060200201358e6040518363ffffffff1660e01b81526004016104fc9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610519573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526105419190810190611813565b93509350935093508b88868151811061055c5761055c6117e9565b60200260200101906001600160a01b031690816001600160a01b0316815250508d8d8681811061058e5761058e6117e9565b905060200201358786815181106105a7576105a76117e9565b6020026020010181815250506040518060c001604052808f8f888181106105d0576105d06117e9565b9050602002013581526020018d6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff16815260200182815250868681518110610622576106226117e9565b602002602001018190525050505050808061063c906118c2565b915050610476565b506106508187876108eb565b60405163811a6af760e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063811a6af79061069e90869086906004016118db565b600060405180830381600087803b1580156106b857600080fd5b505af11580156106cc573d6000803e3d6000fd5b5050505060005b8881101561073d577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070e5761070e6117e9565b6020026020010151604051610723919061195f565b60405180910390a180610735816118c2565b9150506106d3565b5098975050505050505050565b6060610757848484610904565b6000610764858585610228565b905061077185858561094c565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107bd90849060040161145d565b600060405180830381600087803b1580156107d757600080fd5b505af11580156107eb573d6000803e3d6000fd5b5050505060005b815181101561085d577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061082e5761082e6117e9565b6020026020010151604051610843919061195f565b60405180910390a180610855816118c2565b9150506107f2565b50949350505050565b61086e6111fd565b60008260000151600081518110610887576108876117e9565b6020026020010151905061089a816109e7565b600081604001518060200190518101906108b49190611982565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b600061091282840184611ab1565b9050600061091f82610a2b565b9050600061092f61023887611642565b905061093b8183610ad5565b61094483610e06565b505050505050565b60006109588383610f9f565b6000818152600160205260409020549091506001600160a01b031680158015906109a3575061098d6040860160208701611b82565b6001600160a01b0316816001600160a01b031614155b156109c457604051631f5d53e360e01b8152600481018390526024016102f3565b6109dd826109d86040880160208901611b82565b610fc4565b5050505050565b50565b60006109f6826040015161102a565b82519091508114610a275781516040516337e3d1ab60e01b81526102f3918391600401918252602082015260400190565b5050565b610a33611260565b604051806101200160405280610a488461105f565b6001600160a01b03168152602001610a5f84611074565b8152602001610a6d84611083565b8152602001610a7b84611092565b8152602001610a89846110a1565b8152602001610a97846110b0565b8152602001610aa5846110bf565b8152602001610abd8460200151610120015160011490565b15158152602001610acd846110ce565b905292915050565b815160c082015114610b0a57815160c082015160405163fe405c7760e01b8152600481019290925260248201526044016102f3565b81606001516040015115158160e00151151503610b5557606082015160409081015160e08301519151634629f1b560e11b8152901515600482015290151560248201526044016102f3565b81604001516001600160a01b031681600001516001600160a01b031614610ba957604082810151825191516370a8d99b60e11b81526001600160a01b039182166004820152911660248201526044016102f3565b46816020015114610bdc576020810151604051630432cec160e31b815246600482015260248101919091526044016102f3565b81602001518160a0015114610c1757602082015160a0820151604051630626ade360e41b8152600481019290925260248201526044016102f3565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610c82573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca69190611b9f565b610ccb57806040015160405163cbfe7bc360e01b81526004016102f391815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610d2a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d4e9190611bba565b805161010084015151919250141580610d7557506020808201516101008401519091015114155b15610dbf578051602080830151610100850151805192015160405163318d812b60e01b815260048101949094526024840191909152604483019190915260648201526084016102f3565b6000610dca84611126565b905080836060015114610e005760608301516040516377bb6d2760e11b81526102f3918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f694610e6994909392909190600401611c36565b602060405180830381865afa925050508015610ea2575060408051601f3d908101601f19168201909252610e9f91810190611b9f565b60015b610f7857610eae611cba565b806308c379a003610ee75750610ec2611cd6565b80610ecd5750610f26565b8060405162dd577760e81b81526004016102f39190611d5f565b634e487b7103610f2657610ef9611d72565b90610f045750610f26565b60405162dd577760e81b815260206004820152600060248201526044016102f3565b3d808015610f50576040519150601f19603f3d011682016040523d82523d6000602084013e610f55565b606091505b5060405162dd577760e81b815260206004820152600060248201526044016102f3565b80610a275760405162dd577760e81b815260206004820152600060248201526044016102f3565b600080610fae83850185611ab1565b90506000610fbb826110a1565b95945050505050565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b80516020820120600090610222907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611d92565b6020810151600090815b602002015192915050565b60208101516000906001611069565b60208101516000906004611069565b60208101516000906005611069565b60208101516000906006611069565b60208101516000906007611069565b60208101516000906008611069565b6110d66112b3565b604051806040016040528083602001516002600a81106110f8576110f86117e9565b6020020151815260200183602001516003600a8110611119576111196117e9565b6020020151905292915050565b600080611144308460600151600001516001600160801b031661114b565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6111449190611d92565b6040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b6040518060800160405280600081526020016000815260200160006001600160a01b0316815260200161125b604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b0316815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160001515815260200161125b5b60405180604001604052806002906020820280368337509192915050565b6000602082840312156112e357600080fd5b5035919050565b60008083601f8401126112fc57600080fd5b5081356001600160401b0381111561131357600080fd5b60208301915083602082850101111561132b57600080fd5b9250929050565b60008060006040848603121561134757600080fd5b83356001600160401b038082111561135e57600080fd5b908501906040828803121561137257600080fd5b9093506020850135908082111561138857600080fd5b50611395868287016112ea565b9497909650939450505050565b60005b838110156113bd5781810151838201526020016113a5565b83811115610e005750506000910152565b600081518084526113e68160208601602086016113a2565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261145560c08501826113ce565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b828110156114b257603f198886030184526114a08583516113fa565b94509285019290850190600101611484565b5092979650505050505050565b6001600160a01b03811681146109e457600080fd5b80356114df816114bf565b919050565b6000806000806000606086880312156114fc57600080fd5b85356001600160401b038082111561151357600080fd5b818801915088601f83011261152757600080fd5b81358181111561153657600080fd5b8960208260051b850101111561154b57600080fd5b60208301975080965050611561602089016114d4565b9450604088013591508082111561157757600080fd5b50611584888289016112ea565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b604081018181106001600160401b03821117156115ca576115ca611595565b60405250565b606081018181106001600160401b03821117156115ca576115ca611595565b601f8201601f191681016001600160401b038111828210171561161457611614611595565b6040525050565b60006001600160401b0382111561163457611634611595565b50601f01601f191660200190565b6000604080833603121561165557600080fd5b8051611660816115ab565b83356001600160401b038082111561167757600080fd5b9085019036601f83011261168a57600080fd5b813560208282111561169e5761169e611595565b8160051b86516116b0838301826115ef565b928352848101820192828101368511156116c957600080fd5b83870192505b8483101561179d578235868111156116e75760008081fd5b8701606036829003601f19018113156117005760008081fd5b8a5161170b816115d0565b8287013581528b8301358188015290820135908882111561172c5760008081fd5b9181019136603f84011261174257600091508182fd5b8683013591506117518261161b565b8c5161175d82826115ef565b838152368e85870101111561177457600091508182fd5b838e86018a830137600093810189019390935250808c01919091528252509183019183016116cf565b508652506117ac8882016114d4565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b600082198211156117e4576117e46117bb565b500190565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff811681146114df57600080fd5b6000806000806080858703121561182957600080fd5b8451611834816114bf565b6020860151909450925061184a604086016117ff565b915060608501516001600160401b0381111561186557600080fd5b8501601f8101871361187657600080fd5b80516118818161161b565b60405161188e82826115ef565b8281528960208486010111156118a357600080fd5b6118b48360208301602087016113a2565b969995985093965050505050565b6000600182016118d4576118d46117bb565b5060010190565b604080825283519082018190526000906020906060840190828701845b8281101561191d5781516001600160a01b0316845292840192908401906001016118f8565b5050508381038285015284518082528583019183019060005b8181101561195257835183529284019291840191600101611936565b5090979650505050505050565b60208152600061114460208301846113fa565b805180151581146114df57600080fd5b60006060828403121561199457600080fd5b604051606081018181106001600160401b03821117156119b6576119b6611595565b60405282516001600160801b03811681146119d057600080fd5b81526119de602084016117ff565b60208201526119ef60408401611972565b60408201529392505050565b600082601f830112611a0c57600080fd5b604051611a18816115ab565b806040840185811115611a2a57600080fd5b845b81811015611a44578035835260209283019201611a2c565b509195945050505050565b600082601f830112611a6057600080fd5b6040516101408082018281106001600160401b0382111715611a8457611a84611595565b60405283018185821115611a9757600080fd5b845b82811015611a44578035825260209182019101611a99565b6000818303610240811215611ac557600080fd5b60408051611ad2816115ab565b61010080841215611ae257600080fd5b82519350611aef846115d0565b611af987876119fb565b845286605f870112611b0a57600080fd5b8251611b15816115ab565b8060c0880189811115611b2757600080fd5b8589015b81811015611b4c57611b3d8b826119fb565b83526020909201918601611b2b565b50826020880152611b5d8a826119fb565b86880152505050838252611b7387828801611a4f565b60208301525095945050505050565b600060208284031215611b9457600080fd5b8135611144816114bf565b600060208284031215611bb157600080fd5b61114482611972565b600060408284031215611bcc57600080fd5b82601f830112611bdb57600080fd5b604051611be7816115ab565b806040840185811115611bf957600080fd5b845b81811015611a44578051835260209283019201611bfb565b8060005b6002811015610e00578151845260209384019390910190600101611c17565b6102408101611c458287611c13565b60408083018660005b6002811015611c7557611c62838351611c13565b9183019160209190910190600101611c4e565b50505050611c8660c0830185611c13565b61010082018360005b600a811015611cae578151835260209283019290910190600101611c8f565b50505095945050505050565b600060033d1115611cd35760046000803e5060005160e01c5b90565b600060443d1015611ce45790565b6040516003193d81016004833e81513d6001600160401b038160248401118184111715611d1357505050505090565b8285019150815181811115611d2b5750505050505090565b843d8701016020828501011115611d455750505050505090565b611d54602082860101876115ef565b509095945050505050565b60208152600061114460208301846113ce565b60008060233d1115611d8e576020600460003e50506000516001905b9091565b600082611daf57634e487b7160e01b600052601260045260246000fd5b50069056fea26469706673582212206f25f22d1700579027a3b154c953a64f2dd7c5743b363da74b5173ab9c3e655764736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "errors": { - "CollectionIdOutOfBound(uint256)": [ - { - "details": "Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST*" - } - ], - "TicketUsed(uint256)": [ - { - "details": "Error when the userTicket (or nullifierHash) is already used for a destination address*" - } - ] - }, - "kind": "dev", - "methods": { - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns attestations that will be recorded, constructed from the user request", - "params": { - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "availableRootsRegistryAddress": "Registry storing the available groups for this attester (e.g roots of registry merkle trees)", - "collectionIdFirst": "Id of the first collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last collection in which the attester is supposed to record", - "commitmentMapperAddress": "commitment mapper's public key registry", - "hydraS1VerifierAddress": "ZK Snark Hydra-S1 Verifier contract" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getAvailableRootsRegistry()": { - "details": "Getter of Roots Registry Contract" - }, - "getCommitmentMapperRegistry()": { - "details": "Getter of Commitment Mapper Registry contract" - }, - "getDestinationOfTicket(uint256)": { - "details": "Getter, returns the last attestation destination of a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getVerifier()": { - "details": "Getter of Hydra-S1 Verifier contract" - } - }, - "stateVariables": { - "AUTHORIZED_COLLECTION_ID_FIRST": { - "details": "Getter returns of the first collection in which the attester is supposed to record*" - }, - "AUTHORIZED_COLLECTION_ID_LAST": { - "details": "Getter returns of the last collection in which the attester is supposed to record*" - } - }, - "title": "Hydra-S1 Simple Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew their attestations*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 936, - "contract": "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol:HydraS1SimpleAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 939, - "contract": "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol:HydraS1SimpleAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 6335, - "contract": "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol:HydraS1SimpleAttester", - "label": "_ticketsDestinations", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_address)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_address)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/HydraS1SimpleAttesterImplem.json b/deployments/sandboxPolygon/HydraS1SimpleAttesterImplem.json deleted file mode 100644 index 1905432..0000000 --- a/deployments/sandboxPolygon/HydraS1SimpleAttesterImplem.json +++ /dev/null @@ -1,854 +0,0 @@ -{ - "address": "0x8dA93984a9A84d5A719c0B9F91532BcCE705CC19", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "hydraS1VerifierAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "availableRootsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "AccountsTreeValueMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "claimLength", - "type": "uint256" - } - ], - "name": "ClaimsLengthDifferentThanOne", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentMapperPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "inputRoot", - "type": "uint256" - } - ], - "name": "RegistryRootMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedTicketIdentifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ticketIdentifier", - "type": "uint256" - } - ], - "name": "TicketIdentifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "TicketUsed", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "TicketDestinationUpdated", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAvailableRootsRegistry", - "outputs": [ - { - "internalType": "contract IAvailableRootsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentMapperRegistry", - "outputs": [ - { - "internalType": "contract ICommitmentMapperRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getDestinationOfTicket", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract HydraS1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xd09867d63e57107ffd78ff96b3c786194438f26def8bd21d01fea7eedeb56072", - "receipt": { - "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0x8dA93984a9A84d5A719c0B9F91532BcCE705CC19", - "transactionIndex": 88, - "gasUsed": "1609554", - "logsBloom": "0x00000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000100000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000004000800000000000000001000000008000000000000000000000100004000000000000020000000000000000000000000000000000000000000000000000100000", - "blockHash": "0x4a8bba863907d76bf0086073fdd0191237ec8b06297b5475956ac03de7f26620", - "transactionHash": "0xd09867d63e57107ffd78ff96b3c786194438f26def8bd21d01fea7eedeb56072", - "logs": [ - { - "transactionIndex": 88, - "blockNumber": 32513188, - "transactionHash": "0xd09867d63e57107ffd78ff96b3c786194438f26def8bd21d01fea7eedeb56072", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x00000000000000000000000067b94473d81d0cd00849d563c94d0432ac988b49" - ], - "data": "0x000000000000000000000000000000000000000000000000015acce36c11d2280000000000000000000000000000000000000000000000002668645b81392df7000000000000000000000000000000000000000000000202515a25a2f471a3f6000000000000000000000000000000000000000000000000250d977815275bcf00000000000000000000000000000000000000000000020252b4f2866083761e", - "logIndex": 330, - "blockHash": "0x4a8bba863907d76bf0086073fdd0191237ec8b06297b5475956ac03de7f26620" - } - ], - "blockNumber": 32513188, - "cumulativeGasUsed": "15614779", - "status": 1, - "byzantium": true - }, - "args": [ - "0xC999390A856e0633f945dD851DeeCE15b533ccA3", - "0xbcE0921E2502898384167414c2F116f7f7B240BC", - "0xb8797eBa1048f6A6AfCbE4F08a582b4Dde69C05d", - "0xC44F46A31B752b773685be6B5ce8616fFeb97C8D", - "10000001", - "20000000" - ], - "numDeployments": 1, - "solcInputHash": "c872f238f220b3571ef309821a459203", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"hydraS1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"availableRootsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"AccountsTreeValueMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimLength\",\"type\":\"uint256\"}],\"name\":\"ClaimsLengthDifferentThanOne\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentMapperPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inputRoot\",\"type\":\"uint256\"}],\"name\":\"RegistryRootMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"TicketUsed\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAvailableRootsRegistry\",\"outputs\":[{\"internalType\":\"contract IAvailableRootsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentMapperRegistry\",\"outputs\":[{\"internalType\":\"contract ICommitmentMapperRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract HydraS1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns attestations that will be recorded, constructed from the user request\",\"params\":{\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"availableRootsRegistryAddress\":\"Registry storing the available groups for this attester (e.g roots of registry merkle trees)\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentMapperAddress\":\"commitment mapper's public key registry\",\"hydraS1VerifierAddress\":\"ZK Snark Hydra-S1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getAvailableRootsRegistry()\":{\"details\":\"Getter of Roots Registry Contract\"},\"getCommitmentMapperRegistry()\":{\"details\":\"Getter of Commitment Mapper Registry contract\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Hydra-S1 Verifier contract\"}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"}},\"title\":\"Hydra-S1 Simple Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew their attestations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":\"HydraS1SimpleAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() initializer {}\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\\n // contract may have been reentered.\\n require(_initializing ? _isConstructor() : !_initialized, \\\"Initializable: contract is already initialized\\\");\\n\\n bool isTopLevelCall = !_initializing;\\n if (isTopLevelCall) {\\n _initializing = true;\\n _initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n _initializing = false;\\n }\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} modifier, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n function _isConstructor() private view returns (bool) {\\n return !Address.isContract(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x4823752b07b8ea4ca971b217e39457930e7cb103c2c91e2a29729e5ca907e4f0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\\n 546002182798634190282541153661423157791776194062719045593389981526666716416\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x70c0b7d96ff1b90538938a4cb2d8086b3aabb4febf1e36cb3f470bfe0b4a9e89\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Simple Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - Renewable\\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew their attestations\\n **/\\n\\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base, Attester {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n\\n mapping(uint256 => address) internal _ticketsDestinations;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user request is invalid when verified against\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Returns attestations that will be recorded, constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n */\\n function buildAttestations(Request calldata request, bytes calldata)\\n public\\n view\\n virtual\\n override(IAttester, Attester)\\n returns (Attestation[] memory)\\n {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n address issuer = address(this);\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n claim.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n ''\\n );\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used and not a renewal (e.g destination different that last)\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n // we get the ticket used from the snark input in the data provided\\n uint256 userTicket = proofData._getTicket();\\n address currentDestination = _getDestinationOfTicket(userTicket);\\n\\n if (currentDestination != address(0) && currentDestination != request.destination) {\\n revert TicketUsed(userTicket);\\n }\\n\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n override\\n returns (uint256)\\n {\\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\\n return ticketIdentifier;\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _ticketsDestinations[userTicket] = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _ticketsDestinations[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0x4e58a7c2e28a705f0a4af77ec4145f504aa68cdbc263ac077ebc4c50b9086f11\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n \\n \\n **/\\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n virtual\\n returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\\n internal\\n view\\n virtual\\n {\\n if (input.accountsTreeValue != claim.groupId)\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\\n revert RegistryRootMismatch(input.registryRoot);\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n )\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(\\n uint256 /*errorCode*/\\n ) {\\n revert InvalidGroth16Proof('');\\n } catch (\\n bytes memory /*lowLevelData*/\\n ) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0x02708884237382835cd3d3514fdc3603409ce5ea1dc7255a7ceea07dff417c34\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n// todo: explain well what is specific to this attester\\ninterface IHydraS1Base {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x73cff4dcd9c30857859721ea2897be8bb7087c0122f4587acdaa79d8ec0a728d\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n// todo: explain well what is specific to this attester\\ninterface IHydraS1SimpleAttester is IHydraS1Base, IAttester {\\n error TicketUsed(uint256 userTicket);\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xa773e565f9a9ae1b6139779f80e04bf8391ee40e7f2673c785814d1317894259\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // ticketIdentifier\\n // ticket\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (\\n uint256[2] memory,\\n uint256[2][2] memory,\\n uint256[2] memory,\\n uint256[10] memory\\n )\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256[2] memory)\\n {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256)\\n {\\n return self.input[5];\\n }\\n\\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\\n internal\\n pure\\n returns (uint256)\\n {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x596225970aabbc4edb989ee640867c76944e797bfafe5e06dcf37b973480b957\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n override\\n returns (Attestation[] memory)\\n {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // fetch attestations from the registry\\n Attestation[] memory attestationsToDelete;\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationsToDelete[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestationsToDelete, proofData);\\n\\n _beforeDeleteAttestations(attestationsToDelete, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationsToDelete);\\n\\n _afterDeleteAttestations(attestationsToDelete, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestationsToDelete[i]);\\n }\\n return attestationsToDelete;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n}\\n\",\"keccak256\":\"0x37683c6752d4dc911459084eb191c1045f3bf34e2143f3db3d298a66c971a106\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param attestations Attestations to be deleted\\n */\\n function deleteAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xb5e25bd7e0372c9973e582fb7fe96318c145831a5452d8c79eb848a7464b0297\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) public initializer {\\n _transferOwnership(owner);\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9329ecaf60ffe978c8ab4360e0a8f9bd36e2549e89d672dd39ae80f9a562f9a9\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public initializer {\\n _transferOwnership(owner);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0xacb5347ee1a0e8dc25a1ce3e6fbb427db646e833ff8508909454cad7950418d4\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x87f5035b58936a8458a22f3cf1b3865bd798813310d86af41af74680978c97c8\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0x8d6298b442dde99ee5a9cc989ada6ea808383a08b1e9bb1d4c2b58adc01eec69\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101406040523480156200001257600080fd5b5060405162001d9438038062001d94833981016040819052620000359162000081565b6001600160a01b0394851660805292841660c05290831660a0529190921660e0526101005261012052620000f0565b80516001600160a01b03811681146200007c57600080fd5b919050565b60008060008060008060c087890312156200009b57600080fd5b620000a68762000064565b9550620000b66020880162000064565b9450620000c66040880162000064565b9350620000d66060880162000064565b92506080870151915060a087015190509295509295509295565b60805160a05160c05160e0516101005161012051611c1e620001766000396000818161015501526102fe01526000818161010d01526102d60152600081816101bf015281816103ee0152818161056501526106820152600081816101790152610b2d01526000818160a50152610bc901526000818160e40152610d2a0152611c1e6000f3fe608060405234801561001057600080fd5b506004361061009e5760003560e01c8063918447af11610066578063918447af14610177578063af411a301461019d578063bfa66585146101bd578063c776adde146101e3578063e60f999f146101f657600080fd5b80632254f98e146100a357806346657fe9146100e257806354846d7a1461010857806363e4afc21461013d5780637000b05114610150575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100d9565b6100c561014b36600461117d565b610209565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101ab3660046111df565b610228565b6040516100d9919061130b565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101f1366004611392565b6103d8565b6101b06102043660046111df565b610644565b6000818152600160205260408120546001600160a01b03165b92915050565b6060600061023d610238866114f5565b610760565b60408051600180825281830190925291925060009190816020015b6102a96040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816102585750506060830151519091506000906102fa906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611685565b90507f000000000000000000000000000000000000000000000000000000000000000081111561034557604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b031681526020018560200151815260200185606001516020015163ffffffff16815260200160405180602001604052806000815250815250836000815181106103c1576103c161169d565b602090810291909101015250909695505050505050565b60608060005b86811015610542576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78d8d8881811061042d5761042d61169d565b905060200201358c6040518363ffffffff1660e01b81526004016104649291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610481573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104a991908101906116c7565b93509350935093506040518060c001604052808d8d888181106104ce576104ce61169d565b9050602002013581526020018b6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff168152602001828152508686815181106105205761052061169d565b602002602001018190525050505050808061053a90611777565b9150506103de565b5061054e8185856107e5565b6040516373e4ca1b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e7c994369061059a90849060040161130b565b600060405180830381600087803b1580156105b457600080fd5b505af11580156105c8573d6000803e3d6000fd5b5050505060005b86811015610639577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061060a5761060a61169d565b602002602001015160405161061f9190611790565b60405180910390a18061063181611777565b9150506105cf565b509695505050505050565b60606106518484846107fe565b600061065e858585610228565b905061066b858585610846565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106b790849060040161130b565b600060405180830381600087803b1580156106d157600080fd5b505af11580156106e5573d6000803e3d6000fd5b5050505060005b8151811015610757577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc8282815181106107285761072861169d565b602002602001015160405161073d9190611790565b60405180910390a18061074f81611777565b9150506106ec565b50949350505050565b6107686110a9565b600082600001516000815181106107815761078161169d565b60200260200101519050610794816108e1565b600081604001518060200190518101906107ae91906117b3565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b600061080c828401846118e4565b9050600061081982610925565b90506000610829610238876114f5565b905061083581836109cf565b61083e83610d00565b505050505050565b60006108528383610e99565b6000818152600160205260409020549091506001600160a01b0316801580159061089d575061088760408601602087016119b5565b6001600160a01b0316816001600160a01b031614155b156108be57604051631f5d53e360e01b81526004810183905260240161033c565b6108d7826108d260408801602089016119b5565b610ebe565b5050505050565b50565b60006108f08260400151610f24565b825190915081146109215781516040516337e3d1ab60e01b815261033c918391600401918252602082015260400190565b5050565b61092d61110c565b60405180610120016040528061094284610f59565b6001600160a01b0316815260200161095984610f6e565b815260200161096784610f7d565b815260200161097584610f8c565b815260200161098384610f9b565b815260200161099184610faa565b815260200161099f84610fb9565b81526020016109b78460200151610120015160011490565b151581526020016109c784610fc8565b905292915050565b815160c082015114610a0457815160c082015160405163fe405c7760e01b81526004810192909252602482015260440161033c565b81606001516040015115158160e00151151503610a4f57606082015160409081015160e08301519151634629f1b560e11b81529015156004820152901515602482015260440161033c565b81604001516001600160a01b031681600001516001600160a01b031614610aa357604082810151825191516370a8d99b60e11b81526001600160a01b0391821660048201529116602482015260440161033c565b46816020015114610ad6576020810151604051630432cec160e31b8152466004820152602481019190915260440161033c565b81602001518160a0015114610b1157602082015160a0820151604051630626ade360e41b81526004810192909252602482015260440161033c565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610b7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba091906119d2565b610bc557806040015160405163cbfe7bc360e01b815260040161033c91815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610c24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4891906119ed565b805161010084015151919250141580610c6f57506020808201516101008401519091015114155b15610cb9578051602080830151610100850151805192015160405163318d812b60e01b8152600481019490945260248401919091526044830191909152606482015260840161033c565b6000610cc484611020565b905080836060015114610cfa5760608301516040516377bb6d2760e11b815261033c918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f694610d6394909392909190600401611a69565b602060405180830381865afa925050508015610d9c575060408051601f3d908101601f19168201909252610d99918101906119d2565b60015b610e7257610da8611aed565b806308c379a003610de15750610dbc611b09565b80610dc75750610e20565b8060405162dd577760e81b815260040161033c9190611b93565b634e487b7103610e2057610df3611ba6565b90610dfe5750610e20565b60405162dd577760e81b8152602060048201526000602482015260440161033c565b3d808015610e4a576040519150601f19603f3d011682016040523d82523d6000602084013e610e4f565b606091505b5060405162dd577760e81b8152602060048201526000602482015260440161033c565b806109215760405162dd577760e81b8152602060048201526000602482015260440161033c565b600080610ea8838501856118e4565b90506000610eb582610f9b565b95945050505050565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b80516020820120600090610222907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611bc6565b6020810151600090815b602002015192915050565b60208101516000906001610f63565b60208101516000906004610f63565b60208101516000906005610f63565b60208101516000906006610f63565b60208101516000906007610f63565b60208101516000906008610f63565b610fd061115f565b604051806040016040528083602001516002600a8110610ff257610ff261169d565b6020020151815260200183602001516003600a81106110135761101361169d565b6020020151905292915050565b60008061103e308460600151600001516001600160801b0316611045565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c61103e9190611bc6565b6040518060800160405280600081526020016000815260200160006001600160a01b03168152602001611107604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016111075b60405180604001604052806002906020820280368337509192915050565b60006020828403121561118f57600080fd5b5035919050565b60008083601f8401126111a857600080fd5b50813567ffffffffffffffff8111156111c057600080fd5b6020830191508360208285010111156111d857600080fd5b9250929050565b6000806000604084860312156111f457600080fd5b833567ffffffffffffffff8082111561120c57600080fd5b908501906040828803121561122057600080fd5b9093506020850135908082111561123657600080fd5b5061124386828701611196565b9497909650939450505050565b60005b8381101561126b578181015183820152602001611253565b83811115610cfa5750506000910152565b60008151808452611294816020860160208601611250565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261130360c085018261127c565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561136057603f1988860301845261134e8583516112a8565b94509285019290850190600101611332565b5092979650505050505050565b6001600160a01b03811681146108de57600080fd5b803561138d8161136d565b919050565b6000806000806000606086880312156113aa57600080fd5b853567ffffffffffffffff808211156113c257600080fd5b818801915088601f8301126113d657600080fd5b8135818111156113e557600080fd5b8960208260051b85010111156113fa57600080fd5b6020830197508096505061141060208901611382565b9450604088013591508082111561142657600080fd5b5061143388828901611196565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b6040810181811067ffffffffffffffff8211171561147a5761147a611444565b60405250565b6060810181811067ffffffffffffffff8211171561147a5761147a611444565b601f8201601f1916810167ffffffffffffffff811182821017156114c6576114c6611444565b6040525050565b600067ffffffffffffffff8211156114e7576114e7611444565b50601f01601f191660200190565b6000604080833603121561150857600080fd5b80516115138161145a565b833567ffffffffffffffff8082111561152b57600080fd5b9085019036601f83011261153e57600080fd5b813560208282111561155257611552611444565b8160051b8651611564838301826114a0565b9283528481018201928281013685111561157d57600080fd5b83870192505b848310156116515782358681111561159b5760008081fd5b8701606036829003601f19018113156115b45760008081fd5b8a516115bf81611480565b8287013581528b830135818801529082013590888211156115e05760008081fd5b9181019136603f8401126115f657600091508182fd5b868301359150611605826114cd565b8c5161161182826114a0565b838152368e85870101111561162857600091508182fd5b838e86018a830137600093810189019390935250808c0191909152825250918301918301611583565b50865250611660888201611382565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b600082198211156116985761169861166f565b500190565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff8116811461138d57600080fd5b600080600080608085870312156116dd57600080fd5b84516116e88161136d565b602086015190945092506116fe604086016116b3565b9150606085015167ffffffffffffffff81111561171a57600080fd5b8501601f8101871361172b57600080fd5b8051611736816114cd565b60405161174382826114a0565b82815289602084860101111561175857600080fd5b611769836020830160208701611250565b969995985093965050505050565b6000600182016117895761178961166f565b5060010190565b60208152600061103e60208301846112a8565b8051801515811461138d57600080fd5b6000606082840312156117c557600080fd5b6040516060810181811067ffffffffffffffff821117156117e8576117e8611444565b60405282516001600160801b038116811461180257600080fd5b8152611810602084016116b3565b6020820152611821604084016117a3565b60408201529392505050565b600082601f83011261183e57600080fd5b60405161184a8161145a565b80604084018581111561185c57600080fd5b845b8181101561187657803583526020928301920161185e565b509195945050505050565b600082601f83011261189257600080fd5b60405161014080820182811067ffffffffffffffff821117156118b7576118b7611444565b604052830181858211156118ca57600080fd5b845b828110156118765780358252602091820191016118cc565b60008183036102408112156118f857600080fd5b604080516119058161145a565b6101008084121561191557600080fd5b8251935061192284611480565b61192c878761182d565b845286605f87011261193d57600080fd5b82516119488161145a565b8060c088018981111561195a57600080fd5b8589015b8181101561197f576119708b8261182d565b8352602090920191860161195e565b508260208801526119908a8261182d565b868801525050508382526119a687828801611881565b60208301525095945050505050565b6000602082840312156119c757600080fd5b813561103e8161136d565b6000602082840312156119e457600080fd5b61103e826117a3565b6000604082840312156119ff57600080fd5b82601f830112611a0e57600080fd5b604051611a1a8161145a565b806040840185811115611a2c57600080fd5b845b81811015611876578051835260209283019201611a2e565b8060005b6002811015610cfa578151845260209384019390910190600101611a4a565b6102408101611a788287611a46565b60408083018660005b6002811015611aa857611a95838351611a46565b9183019160209190910190600101611a81565b50505050611ab960c0830185611a46565b61010082018360005b600a811015611ae1578151835260209283019290910190600101611ac2565b50505095945050505050565b600060033d1115611b065760046000803e5060005160e01c5b90565b600060443d1015611b175790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611b4757505050505090565b8285019150815181811115611b5f5750505050505090565b843d8701016020828501011115611b795750505050505090565b611b88602082860101876114a0565b509095945050505050565b60208152600061103e602083018461127c565b60008060233d1115611bc2576020600460003e50506000516001905b9091565b600082611be357634e487b7160e01b600052601260045260246000fd5b50069056fea26469706673582212200880771dc9a12d1ab8ee0aef209d3ee36ccccf3e7ad67d67ca8565a13c73569a64736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061009e5760003560e01c8063918447af11610066578063918447af14610177578063af411a301461019d578063bfa66585146101bd578063c776adde146101e3578063e60f999f146101f657600080fd5b80632254f98e146100a357806346657fe9146100e257806354846d7a1461010857806363e4afc21461013d5780637000b05114610150575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020016100d9565b6100c561014b36600461117d565b610209565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101ab3660046111df565b610228565b6040516100d9919061130b565b7f00000000000000000000000000000000000000000000000000000000000000006100c5565b6101b06101f1366004611392565b6103d8565b6101b06102043660046111df565b610644565b6000818152600160205260408120546001600160a01b03165b92915050565b6060600061023d610238866114f5565b610760565b60408051600180825281830190925291925060009190816020015b6102a96040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816102585750506060830151519091506000906102fa906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611685565b90507f000000000000000000000000000000000000000000000000000000000000000081111561034557604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b60003090506040518060c0016040528083815260200185604001516001600160a01b03168152602001826001600160a01b031681526020018560200151815260200185606001516020015163ffffffff16815260200160405180602001604052806000815250815250836000815181106103c1576103c161169d565b602090810291909101015250909695505050505050565b60608060005b86811015610542576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78d8d8881811061042d5761042d61169d565b905060200201358c6040518363ffffffff1660e01b81526004016104649291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610481573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f191682016040526104a991908101906116c7565b93509350935093506040518060c001604052808d8d888181106104ce576104ce61169d565b9050602002013581526020018b6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff168152602001828152508686815181106105205761052061169d565b602002602001018190525050505050808061053a90611777565b9150506103de565b5061054e8185856107e5565b6040516373e4ca1b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e7c994369061059a90849060040161130b565b600060405180830381600087803b1580156105b457600080fd5b505af11580156105c8573d6000803e3d6000fd5b5050505060005b86811015610639577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061060a5761060a61169d565b602002602001015160405161061f9190611790565b60405180910390a18061063181611777565b9150506105cf565b509695505050505050565b60606106518484846107fe565b600061065e858585610228565b905061066b858585610846565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906106b790849060040161130b565b600060405180830381600087803b1580156106d157600080fd5b505af11580156106e5573d6000803e3d6000fd5b5050505060005b8151811015610757577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc8282815181106107285761072861169d565b602002602001015160405161073d9190611790565b60405180910390a18061074f81611777565b9150506106ec565b50949350505050565b6107686110a9565b600082600001516000815181106107815761078161169d565b60200260200101519050610794816108e1565b600081604001518060200190518101906107ae91906117b3565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b604051630d5cd8d960e11b815260040160405180910390fd5b600061080c828401846118e4565b9050600061081982610925565b90506000610829610238876114f5565b905061083581836109cf565b61083e83610d00565b505050505050565b60006108528383610e99565b6000818152600160205260409020549091506001600160a01b0316801580159061089d575061088760408601602087016119b5565b6001600160a01b0316816001600160a01b031614155b156108be57604051631f5d53e360e01b81526004810183905260240161033c565b6108d7826108d260408801602089016119b5565b610ebe565b5050505050565b50565b60006108f08260400151610f24565b825190915081146109215781516040516337e3d1ab60e01b815261033c918391600401918252602082015260400190565b5050565b61092d61110c565b60405180610120016040528061094284610f59565b6001600160a01b0316815260200161095984610f6e565b815260200161096784610f7d565b815260200161097584610f8c565b815260200161098384610f9b565b815260200161099184610faa565b815260200161099f84610fb9565b81526020016109b78460200151610120015160011490565b151581526020016109c784610fc8565b905292915050565b815160c082015114610a0457815160c082015160405163fe405c7760e01b81526004810192909252602482015260440161033c565b81606001516040015115158160e00151151503610a4f57606082015160409081015160e08301519151634629f1b560e11b81529015156004820152901515602482015260440161033c565b81604001516001600160a01b031681600001516001600160a01b031614610aa357604082810151825191516370a8d99b60e11b81526001600160a01b0391821660048201529116602482015260440161033c565b46816020015114610ad6576020810151604051630432cec160e31b8152466004820152602481019190915260440161033c565b81602001518160a0015114610b1157602082015160a0820151604051630626ade360e41b81526004810192909252602482015260440161033c565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610b7c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba091906119d2565b610bc557806040015160405163cbfe7bc360e01b815260040161033c91815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610c24573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c4891906119ed565b805161010084015151919250141580610c6f57506020808201516101008401519091015114155b15610cb9578051602080830151610100850151805192015160405163318d812b60e01b8152600481019490945260248401919091526044830191909152606482015260840161033c565b6000610cc484611020565b905080836060015114610cfa5760608301516040516377bb6d2760e11b815261033c918391600401918252602082015260400190565b50505050565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f694610d6394909392909190600401611a69565b602060405180830381865afa925050508015610d9c575060408051601f3d908101601f19168201909252610d99918101906119d2565b60015b610e7257610da8611aed565b806308c379a003610de15750610dbc611b09565b80610dc75750610e20565b8060405162dd577760e81b815260040161033c9190611b93565b634e487b7103610e2057610df3611ba6565b90610dfe5750610e20565b60405162dd577760e81b8152602060048201526000602482015260440161033c565b3d808015610e4a576040519150601f19603f3d011682016040523d82523d6000602084013e610e4f565b606091505b5060405162dd577760e81b8152602060048201526000602482015260440161033c565b806109215760405162dd577760e81b8152602060048201526000602482015260440161033c565b600080610ea8838501856118e4565b90506000610eb582610f9b565b95945050505050565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b80516020820120600090610222907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611bc6565b6020810151600090815b602002015192915050565b60208101516000906001610f63565b60208101516000906004610f63565b60208101516000906005610f63565b60208101516000906006610f63565b60208101516000906007610f63565b60208101516000906008610f63565b610fd061115f565b604051806040016040528083602001516002600a8110610ff257610ff261169d565b6020020151815260200183602001516003600a81106110135761101361169d565b6020020151905292915050565b60008061103e308460600151600001516001600160801b0316611045565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c61103e9190611bc6565b6040518060800160405280600081526020016000815260200160006001600160a01b03168152602001611107604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016111075b60405180604001604052806002906020820280368337509192915050565b60006020828403121561118f57600080fd5b5035919050565b60008083601f8401126111a857600080fd5b50813567ffffffffffffffff8111156111c057600080fd5b6020830191508360208285010111156111d857600080fd5b9250929050565b6000806000604084860312156111f457600080fd5b833567ffffffffffffffff8082111561120c57600080fd5b908501906040828803121561122057600080fd5b9093506020850135908082111561123657600080fd5b5061124386828701611196565b9497909650939450505050565b60005b8381101561126b578181015183820152602001611253565b83811115610cfa5750506000910152565b60008151808452611294816020860160208601611250565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a085015261130360c085018261127c565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561136057603f1988860301845261134e8583516112a8565b94509285019290850190600101611332565b5092979650505050505050565b6001600160a01b03811681146108de57600080fd5b803561138d8161136d565b919050565b6000806000806000606086880312156113aa57600080fd5b853567ffffffffffffffff808211156113c257600080fd5b818801915088601f8301126113d657600080fd5b8135818111156113e557600080fd5b8960208260051b85010111156113fa57600080fd5b6020830197508096505061141060208901611382565b9450604088013591508082111561142657600080fd5b5061143388828901611196565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b6040810181811067ffffffffffffffff8211171561147a5761147a611444565b60405250565b6060810181811067ffffffffffffffff8211171561147a5761147a611444565b601f8201601f1916810167ffffffffffffffff811182821017156114c6576114c6611444565b6040525050565b600067ffffffffffffffff8211156114e7576114e7611444565b50601f01601f191660200190565b6000604080833603121561150857600080fd5b80516115138161145a565b833567ffffffffffffffff8082111561152b57600080fd5b9085019036601f83011261153e57600080fd5b813560208282111561155257611552611444565b8160051b8651611564838301826114a0565b9283528481018201928281013685111561157d57600080fd5b83870192505b848310156116515782358681111561159b5760008081fd5b8701606036829003601f19018113156115b45760008081fd5b8a516115bf81611480565b8287013581528b830135818801529082013590888211156115e05760008081fd5b9181019136603f8401126115f657600091508182fd5b868301359150611605826114cd565b8c5161161182826114a0565b838152368e85870101111561162857600091508182fd5b838e86018a830137600093810189019390935250808c0191909152825250918301918301611583565b50865250611660888201611382565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b600082198211156116985761169861166f565b500190565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff8116811461138d57600080fd5b600080600080608085870312156116dd57600080fd5b84516116e88161136d565b602086015190945092506116fe604086016116b3565b9150606085015167ffffffffffffffff81111561171a57600080fd5b8501601f8101871361172b57600080fd5b8051611736816114cd565b60405161174382826114a0565b82815289602084860101111561175857600080fd5b611769836020830160208701611250565b969995985093965050505050565b6000600182016117895761178961166f565b5060010190565b60208152600061103e60208301846112a8565b8051801515811461138d57600080fd5b6000606082840312156117c557600080fd5b6040516060810181811067ffffffffffffffff821117156117e8576117e8611444565b60405282516001600160801b038116811461180257600080fd5b8152611810602084016116b3565b6020820152611821604084016117a3565b60408201529392505050565b600082601f83011261183e57600080fd5b60405161184a8161145a565b80604084018581111561185c57600080fd5b845b8181101561187657803583526020928301920161185e565b509195945050505050565b600082601f83011261189257600080fd5b60405161014080820182811067ffffffffffffffff821117156118b7576118b7611444565b604052830181858211156118ca57600080fd5b845b828110156118765780358252602091820191016118cc565b60008183036102408112156118f857600080fd5b604080516119058161145a565b6101008084121561191557600080fd5b8251935061192284611480565b61192c878761182d565b845286605f87011261193d57600080fd5b82516119488161145a565b8060c088018981111561195a57600080fd5b8589015b8181101561197f576119708b8261182d565b8352602090920191860161195e565b508260208801526119908a8261182d565b868801525050508382526119a687828801611881565b60208301525095945050505050565b6000602082840312156119c757600080fd5b813561103e8161136d565b6000602082840312156119e457600080fd5b61103e826117a3565b6000604082840312156119ff57600080fd5b82601f830112611a0e57600080fd5b604051611a1a8161145a565b806040840185811115611a2c57600080fd5b845b81811015611876578051835260209283019201611a2e565b8060005b6002811015610cfa578151845260209384019390910190600101611a4a565b6102408101611a788287611a46565b60408083018660005b6002811015611aa857611a95838351611a46565b9183019160209190910190600101611a81565b50505050611ab960c0830185611a46565b61010082018360005b600a811015611ae1578151835260209283019290910190600101611ac2565b50505095945050505050565b600060033d1115611b065760046000803e5060005160e01c5b90565b600060443d1015611b175790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611b4757505050505090565b8285019150815181811115611b5f5750505050505090565b843d8701016020828501011115611b795750505050505090565b611b88602082860101876114a0565b509095945050505050565b60208152600061103e602083018461127c565b60008060233d1115611bc2576020600460003e50506000516001905b9091565b600082611be357634e487b7160e01b600052601260045260246000fd5b50069056fea26469706673582212200880771dc9a12d1ab8ee0aef209d3ee36ccccf3e7ad67d67ca8565a13c73569a64736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns attestations that will be recorded, constructed from the user request", - "params": { - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "availableRootsRegistryAddress": "Registry storing the available groups for this attester (e.g roots of registry merkle trees)", - "collectionIdFirst": "Id of the first collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last collection in which the attester is supposed to record", - "commitmentMapperAddress": "commitment mapper's public key registry", - "hydraS1VerifierAddress": "ZK Snark Hydra-S1 Verifier contract" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getAvailableRootsRegistry()": { - "details": "Getter of Roots Registry Contract" - }, - "getCommitmentMapperRegistry()": { - "details": "Getter of Commitment Mapper Registry contract" - }, - "getDestinationOfTicket(uint256)": { - "details": "Getter, returns the last attestation destination of a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getVerifier()": { - "details": "Getter of Hydra-S1 Verifier contract" - } - }, - "stateVariables": { - "AUTHORIZED_COLLECTION_ID_FIRST": { - "details": "Getter returns of the first collection in which the attester is supposed to record*" - }, - "AUTHORIZED_COLLECTION_ID_LAST": { - "details": "Getter returns of the last collection in which the attester is supposed to record*" - } - }, - "title": "Hydra-S1 Simple Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew their attestations*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 936, - "contract": "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol:HydraS1SimpleAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 939, - "contract": "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol:HydraS1SimpleAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 5226, - "contract": "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol:HydraS1SimpleAttester", - "label": "_ticketsDestinations", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_address)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_address)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => address)", - "numberOfBytes": "32", - "value": "t_address" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - } - } - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/HydraS1SimpleAttesterProxy.json b/deployments/sandboxPolygon/HydraS1SimpleAttesterProxy.json deleted file mode 100644 index 13657eb..0000000 --- a/deployments/sandboxPolygon/HydraS1SimpleAttesterProxy.json +++ /dev/null @@ -1,250 +0,0 @@ -{ - "address": "0x0AB188c7260666146B300aD3ad5b2AB99eb91D45", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x720e25603ae3febd052012b4a8af2d7aa0bcbd350ed66307951346ffb774efc1", - "receipt": { - "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0x0AB188c7260666146B300aD3ad5b2AB99eb91D45", - "transactionIndex": 39, - "gasUsed": "583372", - "logsBloom": "0x00000000000000200000000000000000408000000000000000000000000000000000000000000000000000000000000000108000000000000000000000000000200000000000000000000000000002800000000000000000000100000000000000000000000000000000000000000000000000800000000080000000000000000000000000000000000000100000000000400000000000000002000000800000200000000000000000000000000000000000000000000000000000000000004010800020000000000001000000008000000000000400000000100004000000000000020000000000000000000000000000000000000000000000000000100000", - "blockHash": "0xddb6e947117c1b2b88eb4464a252325eed75ac3e21b1a6708e59bde2114679b0", - "transactionHash": "0x720e25603ae3febd052012b4a8af2d7aa0bcbd350ed66307951346ffb774efc1", - "logs": [ - { - "transactionIndex": 39, - "blockNumber": 32513208, - "transactionHash": "0x720e25603ae3febd052012b4a8af2d7aa0bcbd350ed66307951346ffb774efc1", - "address": "0x0AB188c7260666146B300aD3ad5b2AB99eb91D45", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x0000000000000000000000008da93984a9a84d5a719c0b9f91532bcce705cc19" - ], - "data": "0x", - "logIndex": 165, - "blockHash": "0xddb6e947117c1b2b88eb4464a252325eed75ac3e21b1a6708e59bde2114679b0" - }, - { - "transactionIndex": 39, - "blockNumber": 32513208, - "transactionHash": "0x720e25603ae3febd052012b4a8af2d7aa0bcbd350ed66307951346ffb774efc1", - "address": "0x0AB188c7260666146B300aD3ad5b2AB99eb91D45", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002110475dfbb8d331b300178a867372991ff35fa3", - "logIndex": 166, - "blockHash": "0xddb6e947117c1b2b88eb4464a252325eed75ac3e21b1a6708e59bde2114679b0" - }, - { - "transactionIndex": 39, - "blockNumber": 32513208, - "transactionHash": "0x720e25603ae3febd052012b4a8af2d7aa0bcbd350ed66307951346ffb774efc1", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x00000000000000000000000067b94473d81d0cd00849d563c94d0432ac988b49" - ], - "data": "0x0000000000000000000000000000000000000000000000000042e87116c150d40000000000000000000000000000000000000000000000002478070c5ac5614f000000000000000000000000000000000000000000000203a6997fb6e826309400000000000000000000000000000000000000000000000024351e9b4404107b000000000000000000000000000000000000000000000203a6dc6827fee78168", - "logIndex": 167, - "blockHash": "0xddb6e947117c1b2b88eb4464a252325eed75ac3e21b1a6708e59bde2114679b0" - } - ], - "blockNumber": 32513208, - "cumulativeGasUsed": "7776788", - "status": 1, - "byzantium": true - }, - "args": [ - "0x8dA93984a9A84d5A719c0B9F91532BcCE705CC19", - "0x2110475dfbB8d331b300178A867372991ff35fA3", - "0x" - ], - "numDeployments": 1, - "solcInputHash": "c872f238f220b3571ef309821a459203", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/HydraS1SoulboundAttester.json b/deployments/sandboxPolygon/HydraS1SoulboundAttester.json deleted file mode 100644 index f6bb76b..0000000 --- a/deployments/sandboxPolygon/HydraS1SoulboundAttester.json +++ /dev/null @@ -1,1019 +0,0 @@ -{ - "address": "0x66331568ca321e333aB25a74BCF0c2623730bd4B", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "hydraS1VerifierAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "availableRootsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "soulboundCooldownDuration", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "AccountsTreeValueMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "claimLength", - "type": "uint256" - } - ], - "name": "ClaimsLengthDifferentThanOne", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentMapperPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "NotAttestationOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "inputRoot", - "type": "uint256" - } - ], - "name": "RegistryRootMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "ticketData", - "type": "uint256" - } - ], - "name": "TicketFrozen", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedTicketIdentifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ticketIdentifier", - "type": "uint256" - } - ], - "name": "TicketIdentifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "destination", - "type": "address" - }, - { - "internalType": "uint32", - "name": "cooldownStart", - "type": "uint32" - } - ], - "internalType": "struct IHydraS1SoulboundAttester.TicketData", - "name": "ticketData", - "type": "tuple" - } - ], - "name": "TicketUsedAndOnCooldown", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "TicketDestinationUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - } - ], - "name": "TicketSetOnCooldown", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "SOULBOUND_COOLDOWN_DURATION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAvailableRootsRegistry", - "outputs": [ - { - "internalType": "contract IAvailableRootsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentMapperRegistry", - "outputs": [ - { - "internalType": "contract ICommitmentMapperRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getDestinationOfTicket", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getTicketData", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "destination", - "type": "address" - }, - { - "internalType": "uint32", - "name": "cooldownStart", - "type": "uint32" - } - ], - "internalType": "struct IHydraS1SoulboundAttester.TicketData", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract HydraS1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "isTicketOnCooldown", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xdf7704e959c1f3d6d69e0a54b3408657ac6a667b4c16ff9c901beb91d7bbae8a", - "receipt": { - "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0xAA393C9ad1aaBeEEceDF2a166335B7d30885EAbA", - "transactionIndex": 111, - "gasUsed": "1821131", - "logsBloom": "0x00000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000040000000040000000000100000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000004000000000000000000001000000000000000000000000000000120004000000000000000000000000000000000000000000000000000000000000000000100000", - "blockHash": "0x4c936a51c881fc1434d1565277ff701051ff22e14adfb70511967465c36ad588", - "transactionHash": "0xdf7704e959c1f3d6d69e0a54b3408657ac6a667b4c16ff9c901beb91d7bbae8a", - "logs": [ - { - "transactionIndex": 111, - "blockNumber": 32513216, - "transactionHash": "0xdf7704e959c1f3d6d69e0a54b3408657ac6a667b4c16ff9c901beb91d7bbae8a", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x0000000000000000000000009ead03f7136fc6b4bdb0780b00a1c14ae5a8b6d0" - ], - "data": "0x00000000000000000000000000000000000000000000000000cbde4ce4783452000000000000000000000000000000000000000000000000242ee8f74f14cea30000000000000000000000000000000000000000000011f662ba5f157700da9900000000000000000000000000000000000000000000000023630aaa6a9c9a510000000000000000000000000000000000000000000011f663863d625b790eeb", - "logIndex": 463, - "blockHash": "0x4c936a51c881fc1434d1565277ff701051ff22e14adfb70511967465c36ad588" - } - ], - "blockNumber": 32513216, - "cumulativeGasUsed": "28176793", - "status": 1, - "byzantium": true - }, - "args": [ - "0xC999390A856e0633f945dD851DeeCE15b533ccA3", - "0xbcE0921E2502898384167414c2F116f7f7B240BC", - "0xb8797eBa1048f6A6AfCbE4F08a582b4Dde69C05d", - "0xC44F46A31B752b773685be6B5ce8616fFeb97C8D", - "20000001", - "30000000", - "295200" - ], - "numDeployments": 2, - "solcInputHash": "c872f238f220b3571ef309821a459203", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"hydraS1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"availableRootsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"soulboundCooldownDuration\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"AccountsTreeValueMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimLength\",\"type\":\"uint256\"}],\"name\":\"ClaimsLengthDifferentThanOne\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentMapperPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"NotAttestationOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inputRoot\",\"type\":\"uint256\"}],\"name\":\"RegistryRootMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"ticketData\",\"type\":\"uint256\"}],\"name\":\"TicketFrozen\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"cooldownStart\",\"type\":\"uint32\"}],\"internalType\":\"struct IHydraS1SoulboundAttester.TicketData\",\"name\":\"ticketData\",\"type\":\"tuple\"}],\"name\":\"TicketUsedAndOnCooldown\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"}],\"name\":\"TicketSetOnCooldown\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SOULBOUND_COOLDOWN_DURATION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAvailableRootsRegistry\",\"outputs\":[{\"internalType\":\"contract IAvailableRootsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentMapperRegistry\",\"outputs\":[{\"internalType\":\"contract ICommitmentMapperRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getTicketData\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"cooldownStart\",\"type\":\"uint32\"}],\"internalType\":\"struct IHydraS1SoulboundAttester.TicketData\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract HydraS1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"isTicketOnCooldown\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns the actual attestations constructed from the user request\",\"params\":{\"proofData\":\"snark public input as well as snark proof\",\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"availableRootsRegistryAddress\":\"Registry storing the available groups for this attester (e.g roots of registry merkle trees)\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentMapperAddress\":\"commitment mapper's public key registry\",\"hydraS1VerifierAddress\":\"ZK Snark Hydra-S1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getAvailableRootsRegistry()\":{\"details\":\"Getter of Roots Registry Contract\"},\"getCommitmentMapperRegistry()\":{\"details\":\"Getter of Commitment Mapper Registry contract\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getTicketData(uint256)\":{\"details\":\"Getter, returns the data linked to a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Hydra-S1 Verifier contract\"},\"isTicketOnCooldown(uint256)\":{\"details\":\"returns whether a ticket is on cooldown or not\",\"params\":{\"userTicket\":\"ticket used*\"}}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"},\"SOULBOUND_COOLDOWN_DURATION\":{\"details\":\"Getter returns of the duration of the cooldown period after having used a ticket*\"}},\"title\":\"Hydra-S1 Soulbound Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - SoulBound (with cooldown period) A user can chose to delete attestations or generate attestation to a new destination. When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional User will need to wait until the end of the cooldown period before being able to delete or switch destination again One can however know that the former and the new destinations were created using the same userTicket - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol\":\"HydraS1SoulboundAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() initializer {}\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\\n // contract may have been reentered.\\n require(_initializing ? _isConstructor() : !_initialized, \\\"Initializable: contract is already initialized\\\");\\n\\n bool isTopLevelCall = !_initializing;\\n if (isTopLevelCall) {\\n _initializing = true;\\n _initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n _initializing = false;\\n }\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} modifier, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n function _isConstructor() private view returns (bool) {\\n return !Address.isContract(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x4823752b07b8ea4ca971b217e39457930e7cb103c2c91e2a29729e5ca907e4f0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\\n 546002182798634190282541153661423157791776194062719045593389981526666716416\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x70c0b7d96ff1b90538938a4cb2d8086b3aabb4febf1e36cb3f470bfe0b4a9e89\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n \\n \\n **/\\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n virtual\\n returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\\n internal\\n view\\n virtual\\n {\\n if (input.accountsTreeValue != claim.groupId)\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\\n revert RegistryRootMismatch(input.registryRoot);\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n )\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(\\n uint256 /*errorCode*/\\n ) {\\n revert InvalidGroth16Proof('');\\n } catch (\\n bytes memory /*lowLevelData*/\\n ) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0x02708884237382835cd3d3514fdc3603409ce5ea1dc7255a7ceea07dff417c34\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n// todo: explain well what is specific to this attester\\ninterface IHydraS1Base {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x73cff4dcd9c30857859721ea2897be8bb7087c0122f4587acdaa79d8ec0a728d\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SoulboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n// todo: explain well what is specific to this attester\\ninterface IHydraS1SoulboundAttester is IHydraS1Base, IAttester {\\n struct TicketData {\\n address destination;\\n uint32 cooldownStart;\\n }\\n error NotAttestationOwner(uint256 ticket, address sender);\\n error TicketFrozen(uint256 ticketData);\\n error TicketUsedAndOnCooldown(TicketData ticketData);\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n event TicketSetOnCooldown(uint256 ticket);\\n\\n /**\\n * @dev returns whether a ticket is on cooldown or not\\n * @param userTicket ticket used\\n **/\\n function isTicketOnCooldown(uint256 userTicket) external view returns (bool);\\n\\n /**\\n * @dev Getter, returns the data linked to a ticket\\n * @param userTicket ticket used\\n **/\\n function getTicketData(uint256 userTicket) external view returns (TicketData memory);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the duration of the cooldown period after having used a ticket\\n **/\\n function SOULBOUND_COOLDOWN_DURATION() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x253a424fda33fca3de3fabd731e4a4f5d48af14bcd9d7c66302113268fd3a9f5\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // ticketIdentifier\\n // ticket\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (\\n uint256[2] memory,\\n uint256[2][2] memory,\\n uint256[2] memory,\\n uint256[10] memory\\n )\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256[2] memory)\\n {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256)\\n {\\n return self.input[5];\\n }\\n\\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\\n internal\\n pure\\n returns (uint256)\\n {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x596225970aabbc4edb989ee640867c76944e797bfafe5e06dcf37b973480b957\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SoulboundAttester} from '../interfaces/IHydraS1SoulboundAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from '../../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from '../base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Soulbound Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - SoulBound (with cooldown period)\\n * A user can chose to delete attestations or generate attestation to a new destination.\\n * When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional\\n * User will need to wait until the end of the cooldown period before being able to delete or switch destination again\\n * One can however know that the former and the new destinations were created using the same userTicket\\n \\n * - Renewable\\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew or update their attestations\\n **/\\ncontract HydraS1SoulboundAttester is IHydraS1SoulboundAttester, HydraS1Base, Attester {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n uint256 public immutable SOULBOUND_COOLDOWN_DURATION;\\n\\n mapping(uint256 => TicketData) internal _userTicketsData;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n uint256 soulboundCooldownDuration\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n SOULBOUND_COOLDOWN_DURATION = soulboundCooldownDuration;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user attestations request is invalid\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark proof backing the claim\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Throws if user attestations deletion request is not made by its owner\\n * @param attestations attestations to delete\\n */\\n function _verifyAttestationsDeletionRequest(Attestation[] memory attestations, bytes calldata)\\n internal\\n view\\n override\\n {\\n for (uint256 i = 0; i < attestations.length; i++) {\\n uint256 userTicket = abi.decode(attestations[0].extraData, (uint256));\\n if (_userTicketsData[userTicket].destination != msg.sender)\\n revert NotAttestationOwner(userTicket, msg.sender);\\n }\\n }\\n\\n /**\\n * @dev Returns the actual attestations constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark public input as well as snark proof\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n override(IAttester, Attester)\\n returns (Attestation[] memory)\\n {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n // The issuer of attestations is the attester\\n address issuer = address(this);\\n // user sends the ticket as input in the data\\n uint256 userTicket = proofData._getTicket();\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n request.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n abi.encode(userTicket)\\n );\\n\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used, not a renewal, and ticket on cooldown.\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n uint256 userTicket = proofData._getTicket();\\n TicketData memory userTicketData = _userTicketsData[userTicket];\\n\\n if (\\n userTicketData.destination != address(0) && userTicketData.destination != request.destination\\n ) {\\n if (_isOnCooldown(userTicketData)) revert TicketUsedAndOnCooldown(userTicketData);\\n _setTicketOnCooldown(userTicket);\\n }\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n override\\n {\\n // we retrieve the ticketUsed from attestations extraData\\n for (uint256 i = 0; i < attestations.length; i++) {\\n uint256 userTicket = abi.decode(attestations[i].extraData, (uint256));\\n if (_isOnCooldown(_userTicketsData[userTicket]) == true) revert TicketFrozen(userTicket);\\n _userTicketsData[userTicket].destination = address(0);\\n }\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n override\\n returns (uint256)\\n {\\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\\n return ticketIdentifier;\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n /**\\n * @dev Getter, returns the data linked to a ticket\\n * @param userTicket ticket used\\n **/\\n function getTicketData(uint256 userTicket) external view override returns (TicketData memory) {\\n return _getTicketData(userTicket);\\n }\\n\\n /**\\n * @dev returns whether a ticket is on cooldown or not\\n * @param userTicket ticket used\\n **/\\n function isTicketOnCooldown(uint256 userTicket) external view override returns (bool) {\\n return _isOnCooldown(_getTicketData(userTicket));\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _userTicketsData[userTicket].destination = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _setTicketOnCooldown(uint256 userTicket) internal {\\n _userTicketsData[userTicket].cooldownStart = uint32(block.timestamp);\\n emit TicketSetOnCooldown(userTicket);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _userTicketsData[userTicket].destination;\\n }\\n\\n function _isOnCooldown(TicketData memory userTicketData) internal view returns (bool) {\\n return userTicketData.cooldownStart + SOULBOUND_COOLDOWN_DURATION < block.timestamp;\\n }\\n\\n function _getTicketData(uint256 userTicket) internal view returns (TicketData memory) {\\n return _userTicketsData[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0xe72642edf2eecc2886aae203d09ac63f5515a1e51f0ad85b9da410aa59db6261\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n override\\n returns (Attestation[] memory)\\n {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // fetch attestations from the registry\\n Attestation[] memory attestationsToDelete;\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationsToDelete[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestationsToDelete, proofData);\\n\\n _beforeDeleteAttestations(attestationsToDelete, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationsToDelete);\\n\\n _afterDeleteAttestations(attestationsToDelete, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestationsToDelete[i]);\\n }\\n return attestationsToDelete;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n}\\n\",\"keccak256\":\"0x37683c6752d4dc911459084eb191c1045f3bf34e2143f3db3d298a66c971a106\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param attestations Attestations to be deleted\\n */\\n function deleteAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xb5e25bd7e0372c9973e582fb7fe96318c145831a5452d8c79eb848a7464b0297\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) public initializer {\\n _transferOwnership(owner);\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9329ecaf60ffe978c8ab4360e0a8f9bd36e2549e89d672dd39ae80f9a562f9a9\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public initializer {\\n _transferOwnership(owner);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0xacb5347ee1a0e8dc25a1ce3e6fbb427db646e833ff8508909454cad7950418d4\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x87f5035b58936a8458a22f3cf1b3865bd798813310d86af41af74680978c97c8\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0x8d6298b442dde99ee5a9cc989ada6ea808383a08b1e9bb1d4c2b58adc01eec69\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101606040523480156200001257600080fd5b506040516200218c3803806200218c833981016040819052620000359162000088565b6001600160a01b0395861660805293851660c05291841660a0529390921660e05261010092909252610120526101405262000102565b80516001600160a01b03811681146200008357600080fd5b919050565b600080600080600080600060e0888a031215620000a457600080fd5b620000af886200006b565b9650620000bf602089016200006b565b9550620000cf604089016200006b565b9450620000df606089016200006b565b93506080880151925060a0880151915060c0880151905092959891949750929550565b60805160a05160c05160e051610100516101205161014051611ff16200019b6000396000818161013e01526108d30152600081816101ad01526103c901526000818161017301526103a101526000818161023a015281816104e40152818161066601526107a00152600081816101d10152610ec701526000818160d60152610f6301526000818161011501526110be0152611ff16000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063918447af1161008c578063bfa6658511610066578063bfa6658514610238578063c776adde1461025e578063d9895e6a14610271578063e60f999f146102ae57600080fd5b8063918447af146101cf57806392cf369d146101f5578063af411a301461021857600080fd5b80632254f98e146100d457806346657fe9146101135780634e5cf9331461013957806354846d7a1461016e57806363e4afc2146101955780637000b051146101a8575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161010a565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b6100f66101a3366004611537565b6102c1565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b610208610203366004611537565b6102e0565b604051901515815260200161010a565b61022b610226366004611599565b6102f3565b60405161010a91906116c5565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b61022b61026c36600461174c565b6104ce565b61028461027f366004611537565b610745565b6040805182516001600160a01b0316815260209283015163ffffffff16928101929092520161010a565b61022b6102bc366004611599565b610762565b6000818152600160205260408120546001600160a01b03165b92915050565b60006102da6102ee8361087e565b6108ce565b60606000610308610303866118af565b61090e565b60408051600180825281830190925291925060009190816020015b6103746040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816103235750506060830151519091506000906103c5906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611a3f565b90507f000000000000000000000000000000000000000000000000000000000000000081111561041057604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b30600061041d8888610993565b90506040518060c001604052808481526020018a60200160208101906104439190611a57565b6001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff1681526020018260405160200161049191815260200190565b604051602081830303815290604052815250846000815181106104b6576104b6611a74565b60209081029190910101525091979650505050505050565b60608060005b86811015610638576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78d8d8881811061052357610523611a74565b905060200201358c6040518363ffffffff1660e01b815260040161055a9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610577573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261059f9190810190611a9e565b93509350935093506040518060c001604052808d8d888181106105c4576105c4611a74565b9050602002013581526020018b6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061061657610616611a74565b602002602001018190525050505050808061063090611b4e565b9150506104d4565b506106448185856109b8565b61064f818585610a53565b6040516373e4ca1b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e7c994369061069b9084906004016116c5565b600060405180830381600087803b1580156106b557600080fd5b505af11580156106c9573d6000803e3d6000fd5b5050505060005b8681101561073a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070b5761070b611a74565b60200260200101516040516107209190611b67565b60405180910390a18061073281611b4e565b9150506106d0565b509695505050505050565b60408051808201909152600080825260208201526102da8261087e565b606061076f848484610b29565b600061077c8585856102f3565b9050610789858585610b71565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107d59084906004016116c5565b600060405180830381600087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b5050505060005b8151811015610875577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061084657610846611a74565b602002602001015160405161085b9190611b67565b60405180910390a18061086d81611b4e565b91505061080a565b50949350505050565b6040805180820190915260008082526020820152506000908152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff169082015290565b6000427f0000000000000000000000000000000000000000000000000000000000000000836020015163ffffffff166109079190611a3f565b1092915050565b610916611463565b6000826000015160008151811061092f5761092f611a74565b6020026020010151905061094281610c65565b6000816040015180602001905181019061095c9190611b8a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b6000806109a283850185611cbb565b905060006109af82610ca9565b95945050505050565b60005b8351811015610a4d576000846000815181106109d9576109d9611a74565b602002602001015160a001518060200190518101906109f89190611d8c565b6000818152600160205260409020549091506001600160a01b03163314610a3a5760405162f8a2bf60e81b815260048101829052336024820152604401610407565b5080610a4581611b4e565b9150506109bb565b50505050565b60005b8351811015610a4d576000848281518110610a7357610a73611a74565b602002602001015160a00151806020019051810190610a929190611d8c565b6000818152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff1690820152909150610ad6906108ce565b1515600103610afb57604051632fcfdde360e11b815260048101829052602401610407565b600090815260016020526040902080546001600160a01b031916905580610b2181611b4e565b915050610a56565b6000610b3782840184611cbb565b90506000610b4482610cbf565b90506000610b54610303876118af565b9050610b608183610d69565b610b6983611094565b505050505050565b6000610b7d8383610993565b6000818152600160209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910463ffffffff16918301919091529192509015801590610bf15750610bd76040860160208701611a57565b6001600160a01b031681600001516001600160a01b031614155b15610c4257610bff816108ce565b15610c3957604051633f8ffaa560e01b815281516001600160a01b03166004820152602082015163ffffffff166024820152604401610407565b610c428261122d565b610c5b82610c566040880160208901611a57565b61128e565b5050505050565b50565b6000610c7482604001516112f4565b82519091508114610ca55781516040516337e3d1ab60e01b8152610407918391600401918252602082015260400190565b5050565b602081015160009060065b602002015192915050565b610cc76114c6565b604051806101200160405280610cdc84611329565b6001600160a01b03168152602001610cf384611337565b8152602001610d0184611346565b8152602001610d0f84611355565b8152602001610d1d84610ca9565b8152602001610d2b84611364565b8152602001610d3984611373565b8152602001610d518460200151610120015160011490565b15158152602001610d6184611382565b905292915050565b815160c082015114610d9e57815160c082015160405163fe405c7760e01b815260048101929092526024820152604401610407565b81606001516040015115158160e00151151503610de957606082015160409081015160e08301519151634629f1b560e11b815290151560048201529015156024820152604401610407565b81604001516001600160a01b031681600001516001600160a01b031614610e3d57604082810151825191516370a8d99b60e11b81526001600160a01b03918216600482015291166024820152604401610407565b46816020015114610e70576020810151604051630432cec160e31b81524660048201526024810191909152604401610407565b81602001518160a0015114610eab57602082015160a0820151604051630626ade360e41b815260048101929092526024820152604401610407565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a9190611da5565b610f5f57806040015160405163cbfe7bc360e01b815260040161040791815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe29190611dc0565b80516101008401515191925014158061100957506020808201516101008401519091015114155b15611053578051602080830151610100850151805192015160405163318d812b60e01b81526004810194909452602484019190915260448301919091526064820152608401610407565b600061105e846113da565b905080836060015114610a4d5760608301516040516377bb6d2760e11b8152610407918391600401918252602082015260400190565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946110f794909392909190600401611e3c565b602060405180830381865afa925050508015611130575060408051601f3d908101601f1916820190925261112d91810190611da5565b60015b6112065761113c611ec0565b806308c379a0036111755750611150611edc565b8061115b57506111b4565b8060405162dd577760e81b81526004016104079190611f66565b634e487b71036111b457611187611f79565b9061119257506111b4565b60405162dd577760e81b81526020600482015260006024820152604401610407565b3d8080156111de576040519150601f19603f3d011682016040523d82523d6000602084013e6111e3565b606091505b5060405162dd577760e81b81526020600482015260006024820152604401610407565b80610ca55760405162dd577760e81b81526020600482015260006024820152604401610407565b600081815260016020908152604091829020805463ffffffff60a01b1916600160a01b4263ffffffff160217905590518281527f49ab97b1dc68eafe79e6e7f8ff996d00259888e84cb401cf9ec8d39adf7ab196910160405180910390a150565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102da907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611f99565b602081015160009081610cb4565b60208101516000906001610cb4565b60208101516000906004610cb4565b60208101516000906005610cb4565b60208101516000906007610cb4565b60208101516000906008610cb4565b61138a611519565b604051806040016040528083602001516002600a81106113ac576113ac611a74565b6020020151815260200183602001516003600a81106113cd576113cd611a74565b6020020151905292915050565b6000806113f8308460600151600001516001600160801b03166113ff565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113f89190611f99565b6040518060800160405280600081526020016000815260200160006001600160a01b031681526020016114c1604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114c15b60405180604001604052806002906020820280368337509192915050565b60006020828403121561154957600080fd5b5035919050565b60008083601f84011261156257600080fd5b50813567ffffffffffffffff81111561157a57600080fd5b60208301915083602082850101111561159257600080fd5b9250929050565b6000806000604084860312156115ae57600080fd5b833567ffffffffffffffff808211156115c657600080fd5b90850190604082880312156115da57600080fd5b909350602085013590808211156115f057600080fd5b506115fd86828701611550565b9497909650939450505050565b60005b8381101561162557818101518382015260200161160d565b83811115610a4d5750506000910152565b6000815180845261164e81602086016020860161160a565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a08501526116bd60c0850182611636565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561171a57603f19888603018452611708858351611662565b945092850192908501906001016116ec565b5092979650505050505050565b6001600160a01b0381168114610c6257600080fd5b803561174781611727565b919050565b60008060008060006060868803121561176457600080fd5b853567ffffffffffffffff8082111561177c57600080fd5b818801915088601f83011261179057600080fd5b81358181111561179f57600080fd5b8960208260051b85010111156117b457600080fd5b602083019750809650506117ca6020890161173c565b945060408801359150808211156117e057600080fd5b506117ed88828901611550565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b6040810181811067ffffffffffffffff82111715611834576118346117fe565b60405250565b6060810181811067ffffffffffffffff82111715611834576118346117fe565b601f8201601f1916810167ffffffffffffffff81118282101715611880576118806117fe565b6040525050565b600067ffffffffffffffff8211156118a1576118a16117fe565b50601f01601f191660200190565b600060408083360312156118c257600080fd5b80516118cd81611814565b833567ffffffffffffffff808211156118e557600080fd5b9085019036601f8301126118f857600080fd5b813560208282111561190c5761190c6117fe565b8160051b865161191e8383018261185a565b9283528481018201928281013685111561193757600080fd5b83870192505b84831015611a0b578235868111156119555760008081fd5b8701606036829003601f190181131561196e5760008081fd5b8a516119798161183a565b8287013581528b8301358188015290820135908882111561199a5760008081fd5b9181019136603f8401126119b057600091508182fd5b8683013591506119bf82611887565b8c516119cb828261185a565b838152368e8587010111156119e257600091508182fd5b838e86018a830137600093810189019390935250808c019190915282525091830191830161193d565b50865250611a1a88820161173c565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611a5257611a52611a29565b500190565b600060208284031215611a6957600080fd5b81356113f881611727565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff8116811461174757600080fd5b60008060008060808587031215611ab457600080fd5b8451611abf81611727565b60208601519094509250611ad560408601611a8a565b9150606085015167ffffffffffffffff811115611af157600080fd5b8501601f81018713611b0257600080fd5b8051611b0d81611887565b604051611b1a828261185a565b828152896020848601011115611b2f57600080fd5b611b4083602083016020870161160a565b969995985093965050505050565b600060018201611b6057611b60611a29565b5060010190565b6020815260006113f86020830184611662565b8051801515811461174757600080fd5b600060608284031215611b9c57600080fd5b6040516060810181811067ffffffffffffffff82111715611bbf57611bbf6117fe565b60405282516001600160801b0381168114611bd957600080fd5b8152611be760208401611a8a565b6020820152611bf860408401611b7a565b60408201529392505050565b600082601f830112611c1557600080fd5b604051611c2181611814565b806040840185811115611c3357600080fd5b845b81811015611c4d578035835260209283019201611c35565b509195945050505050565b600082601f830112611c6957600080fd5b60405161014080820182811067ffffffffffffffff82111715611c8e57611c8e6117fe565b60405283018185821115611ca157600080fd5b845b82811015611c4d578035825260209182019101611ca3565b6000818303610240811215611ccf57600080fd5b60408051611cdc81611814565b61010080841215611cec57600080fd5b82519350611cf98461183a565b611d038787611c04565b845286605f870112611d1457600080fd5b8251611d1f81611814565b8060c0880189811115611d3157600080fd5b8589015b81811015611d5657611d478b82611c04565b83526020909201918601611d35565b50826020880152611d678a82611c04565b86880152505050838252611d7d87828801611c58565b60208301525095945050505050565b600060208284031215611d9e57600080fd5b5051919050565b600060208284031215611db757600080fd5b6113f882611b7a565b600060408284031215611dd257600080fd5b82601f830112611de157600080fd5b604051611ded81611814565b806040840185811115611dff57600080fd5b845b81811015611c4d578051835260209283019201611e01565b8060005b6002811015610a4d578151845260209384019390910190600101611e1d565b6102408101611e4b8287611e19565b60408083018660005b6002811015611e7b57611e68838351611e19565b9183019160209190910190600101611e54565b50505050611e8c60c0830185611e19565b61010082018360005b600a811015611eb4578151835260209283019290910190600101611e95565b50505095945050505050565b600060033d1115611ed95760046000803e5060005160e01c5b90565b600060443d1015611eea5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611f1a57505050505090565b8285019150815181811115611f325750505050505090565b843d8701016020828501011115611f4c5750505050505090565b611f5b6020828601018761185a565b509095945050505050565b6020815260006113f86020830184611636565b60008060233d1115611f95576020600460003e50506000516001905b9091565b600082611fb657634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220f1374674d2143dc1e1f8e0666c58769f2e4bc209220c094f513f5b717a358ad464736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063918447af1161008c578063bfa6658511610066578063bfa6658514610238578063c776adde1461025e578063d9895e6a14610271578063e60f999f146102ae57600080fd5b8063918447af146101cf57806392cf369d146101f5578063af411a301461021857600080fd5b80632254f98e146100d457806346657fe9146101135780634e5cf9331461013957806354846d7a1461016e57806363e4afc2146101955780637000b051146101a8575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161010a565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b6100f66101a3366004611537565b6102c1565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b610208610203366004611537565b6102e0565b604051901515815260200161010a565b61022b610226366004611599565b6102f3565b60405161010a91906116c5565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b61022b61026c36600461174c565b6104ce565b61028461027f366004611537565b610745565b6040805182516001600160a01b0316815260209283015163ffffffff16928101929092520161010a565b61022b6102bc366004611599565b610762565b6000818152600160205260408120546001600160a01b03165b92915050565b60006102da6102ee8361087e565b6108ce565b60606000610308610303866118af565b61090e565b60408051600180825281830190925291925060009190816020015b6103746040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816103235750506060830151519091506000906103c5906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611a3f565b90507f000000000000000000000000000000000000000000000000000000000000000081111561041057604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b30600061041d8888610993565b90506040518060c001604052808481526020018a60200160208101906104439190611a57565b6001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff1681526020018260405160200161049191815260200190565b604051602081830303815290604052815250846000815181106104b6576104b6611a74565b60209081029190910101525091979650505050505050565b60608060005b86811015610638576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78d8d8881811061052357610523611a74565b905060200201358c6040518363ffffffff1660e01b815260040161055a9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610577573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261059f9190810190611a9e565b93509350935093506040518060c001604052808d8d888181106105c4576105c4611a74565b9050602002013581526020018b6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061061657610616611a74565b602002602001018190525050505050808061063090611b4e565b9150506104d4565b506106448185856109b8565b61064f818585610a53565b6040516373e4ca1b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e7c994369061069b9084906004016116c5565b600060405180830381600087803b1580156106b557600080fd5b505af11580156106c9573d6000803e3d6000fd5b5050505060005b8681101561073a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070b5761070b611a74565b60200260200101516040516107209190611b67565b60405180910390a18061073281611b4e565b9150506106d0565b509695505050505050565b60408051808201909152600080825260208201526102da8261087e565b606061076f848484610b29565b600061077c8585856102f3565b9050610789858585610b71565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107d59084906004016116c5565b600060405180830381600087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b5050505060005b8151811015610875577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061084657610846611a74565b602002602001015160405161085b9190611b67565b60405180910390a18061086d81611b4e565b91505061080a565b50949350505050565b6040805180820190915260008082526020820152506000908152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff169082015290565b6000427f0000000000000000000000000000000000000000000000000000000000000000836020015163ffffffff166109079190611a3f565b1092915050565b610916611463565b6000826000015160008151811061092f5761092f611a74565b6020026020010151905061094281610c65565b6000816040015180602001905181019061095c9190611b8a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b6000806109a283850185611cbb565b905060006109af82610ca9565b95945050505050565b60005b8351811015610a4d576000846000815181106109d9576109d9611a74565b602002602001015160a001518060200190518101906109f89190611d8c565b6000818152600160205260409020549091506001600160a01b03163314610a3a5760405162f8a2bf60e81b815260048101829052336024820152604401610407565b5080610a4581611b4e565b9150506109bb565b50505050565b60005b8351811015610a4d576000848281518110610a7357610a73611a74565b602002602001015160a00151806020019051810190610a929190611d8c565b6000818152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff1690820152909150610ad6906108ce565b1515600103610afb57604051632fcfdde360e11b815260048101829052602401610407565b600090815260016020526040902080546001600160a01b031916905580610b2181611b4e565b915050610a56565b6000610b3782840184611cbb565b90506000610b4482610cbf565b90506000610b54610303876118af565b9050610b608183610d69565b610b6983611094565b505050505050565b6000610b7d8383610993565b6000818152600160209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910463ffffffff16918301919091529192509015801590610bf15750610bd76040860160208701611a57565b6001600160a01b031681600001516001600160a01b031614155b15610c4257610bff816108ce565b15610c3957604051633f8ffaa560e01b815281516001600160a01b03166004820152602082015163ffffffff166024820152604401610407565b610c428261122d565b610c5b82610c566040880160208901611a57565b61128e565b5050505050565b50565b6000610c7482604001516112f4565b82519091508114610ca55781516040516337e3d1ab60e01b8152610407918391600401918252602082015260400190565b5050565b602081015160009060065b602002015192915050565b610cc76114c6565b604051806101200160405280610cdc84611329565b6001600160a01b03168152602001610cf384611337565b8152602001610d0184611346565b8152602001610d0f84611355565b8152602001610d1d84610ca9565b8152602001610d2b84611364565b8152602001610d3984611373565b8152602001610d518460200151610120015160011490565b15158152602001610d6184611382565b905292915050565b815160c082015114610d9e57815160c082015160405163fe405c7760e01b815260048101929092526024820152604401610407565b81606001516040015115158160e00151151503610de957606082015160409081015160e08301519151634629f1b560e11b815290151560048201529015156024820152604401610407565b81604001516001600160a01b031681600001516001600160a01b031614610e3d57604082810151825191516370a8d99b60e11b81526001600160a01b03918216600482015291166024820152604401610407565b46816020015114610e70576020810151604051630432cec160e31b81524660048201526024810191909152604401610407565b81602001518160a0015114610eab57602082015160a0820151604051630626ade360e41b815260048101929092526024820152604401610407565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a9190611da5565b610f5f57806040015160405163cbfe7bc360e01b815260040161040791815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe29190611dc0565b80516101008401515191925014158061100957506020808201516101008401519091015114155b15611053578051602080830151610100850151805192015160405163318d812b60e01b81526004810194909452602484019190915260448301919091526064820152608401610407565b600061105e846113da565b905080836060015114610a4d5760608301516040516377bb6d2760e11b8152610407918391600401918252602082015260400190565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946110f794909392909190600401611e3c565b602060405180830381865afa925050508015611130575060408051601f3d908101601f1916820190925261112d91810190611da5565b60015b6112065761113c611ec0565b806308c379a0036111755750611150611edc565b8061115b57506111b4565b8060405162dd577760e81b81526004016104079190611f66565b634e487b71036111b457611187611f79565b9061119257506111b4565b60405162dd577760e81b81526020600482015260006024820152604401610407565b3d8080156111de576040519150601f19603f3d011682016040523d82523d6000602084013e6111e3565b606091505b5060405162dd577760e81b81526020600482015260006024820152604401610407565b80610ca55760405162dd577760e81b81526020600482015260006024820152604401610407565b600081815260016020908152604091829020805463ffffffff60a01b1916600160a01b4263ffffffff160217905590518281527f49ab97b1dc68eafe79e6e7f8ff996d00259888e84cb401cf9ec8d39adf7ab196910160405180910390a150565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102da907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611f99565b602081015160009081610cb4565b60208101516000906001610cb4565b60208101516000906004610cb4565b60208101516000906005610cb4565b60208101516000906007610cb4565b60208101516000906008610cb4565b61138a611519565b604051806040016040528083602001516002600a81106113ac576113ac611a74565b6020020151815260200183602001516003600a81106113cd576113cd611a74565b6020020151905292915050565b6000806113f8308460600151600001516001600160801b03166113ff565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113f89190611f99565b6040518060800160405280600081526020016000815260200160006001600160a01b031681526020016114c1604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114c15b60405180604001604052806002906020820280368337509192915050565b60006020828403121561154957600080fd5b5035919050565b60008083601f84011261156257600080fd5b50813567ffffffffffffffff81111561157a57600080fd5b60208301915083602082850101111561159257600080fd5b9250929050565b6000806000604084860312156115ae57600080fd5b833567ffffffffffffffff808211156115c657600080fd5b90850190604082880312156115da57600080fd5b909350602085013590808211156115f057600080fd5b506115fd86828701611550565b9497909650939450505050565b60005b8381101561162557818101518382015260200161160d565b83811115610a4d5750506000910152565b6000815180845261164e81602086016020860161160a565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a08501526116bd60c0850182611636565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561171a57603f19888603018452611708858351611662565b945092850192908501906001016116ec565b5092979650505050505050565b6001600160a01b0381168114610c6257600080fd5b803561174781611727565b919050565b60008060008060006060868803121561176457600080fd5b853567ffffffffffffffff8082111561177c57600080fd5b818801915088601f83011261179057600080fd5b81358181111561179f57600080fd5b8960208260051b85010111156117b457600080fd5b602083019750809650506117ca6020890161173c565b945060408801359150808211156117e057600080fd5b506117ed88828901611550565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b6040810181811067ffffffffffffffff82111715611834576118346117fe565b60405250565b6060810181811067ffffffffffffffff82111715611834576118346117fe565b601f8201601f1916810167ffffffffffffffff81118282101715611880576118806117fe565b6040525050565b600067ffffffffffffffff8211156118a1576118a16117fe565b50601f01601f191660200190565b600060408083360312156118c257600080fd5b80516118cd81611814565b833567ffffffffffffffff808211156118e557600080fd5b9085019036601f8301126118f857600080fd5b813560208282111561190c5761190c6117fe565b8160051b865161191e8383018261185a565b9283528481018201928281013685111561193757600080fd5b83870192505b84831015611a0b578235868111156119555760008081fd5b8701606036829003601f190181131561196e5760008081fd5b8a516119798161183a565b8287013581528b8301358188015290820135908882111561199a5760008081fd5b9181019136603f8401126119b057600091508182fd5b8683013591506119bf82611887565b8c516119cb828261185a565b838152368e8587010111156119e257600091508182fd5b838e86018a830137600093810189019390935250808c019190915282525091830191830161193d565b50865250611a1a88820161173c565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611a5257611a52611a29565b500190565b600060208284031215611a6957600080fd5b81356113f881611727565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff8116811461174757600080fd5b60008060008060808587031215611ab457600080fd5b8451611abf81611727565b60208601519094509250611ad560408601611a8a565b9150606085015167ffffffffffffffff811115611af157600080fd5b8501601f81018713611b0257600080fd5b8051611b0d81611887565b604051611b1a828261185a565b828152896020848601011115611b2f57600080fd5b611b4083602083016020870161160a565b969995985093965050505050565b600060018201611b6057611b60611a29565b5060010190565b6020815260006113f86020830184611662565b8051801515811461174757600080fd5b600060608284031215611b9c57600080fd5b6040516060810181811067ffffffffffffffff82111715611bbf57611bbf6117fe565b60405282516001600160801b0381168114611bd957600080fd5b8152611be760208401611a8a565b6020820152611bf860408401611b7a565b60408201529392505050565b600082601f830112611c1557600080fd5b604051611c2181611814565b806040840185811115611c3357600080fd5b845b81811015611c4d578035835260209283019201611c35565b509195945050505050565b600082601f830112611c6957600080fd5b60405161014080820182811067ffffffffffffffff82111715611c8e57611c8e6117fe565b60405283018185821115611ca157600080fd5b845b82811015611c4d578035825260209182019101611ca3565b6000818303610240811215611ccf57600080fd5b60408051611cdc81611814565b61010080841215611cec57600080fd5b82519350611cf98461183a565b611d038787611c04565b845286605f870112611d1457600080fd5b8251611d1f81611814565b8060c0880189811115611d3157600080fd5b8589015b81811015611d5657611d478b82611c04565b83526020909201918601611d35565b50826020880152611d678a82611c04565b86880152505050838252611d7d87828801611c58565b60208301525095945050505050565b600060208284031215611d9e57600080fd5b5051919050565b600060208284031215611db757600080fd5b6113f882611b7a565b600060408284031215611dd257600080fd5b82601f830112611de157600080fd5b604051611ded81611814565b806040840185811115611dff57600080fd5b845b81811015611c4d578051835260209283019201611e01565b8060005b6002811015610a4d578151845260209384019390910190600101611e1d565b6102408101611e4b8287611e19565b60408083018660005b6002811015611e7b57611e68838351611e19565b9183019160209190910190600101611e54565b50505050611e8c60c0830185611e19565b61010082018360005b600a811015611eb4578151835260209283019290910190600101611e95565b50505095945050505050565b600060033d1115611ed95760046000803e5060005160e01c5b90565b600060443d1015611eea5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611f1a57505050505090565b8285019150815181811115611f325750505050505090565b843d8701016020828501011115611f4c5750505050505090565b611f5b6020828601018761185a565b509095945050505050565b6020815260006113f86020830184611636565b60008060233d1115611f95576020600460003e50506000516001905b9091565b600082611fb657634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220f1374674d2143dc1e1f8e0666c58769f2e4bc209220c094f513f5b717a358ad464736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns the actual attestations constructed from the user request", - "params": { - "proofData": "snark public input as well as snark proof", - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "availableRootsRegistryAddress": "Registry storing the available groups for this attester (e.g roots of registry merkle trees)", - "collectionIdFirst": "Id of the first collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last collection in which the attester is supposed to record", - "commitmentMapperAddress": "commitment mapper's public key registry", - "hydraS1VerifierAddress": "ZK Snark Hydra-S1 Verifier contract" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getAvailableRootsRegistry()": { - "details": "Getter of Roots Registry Contract" - }, - "getCommitmentMapperRegistry()": { - "details": "Getter of Commitment Mapper Registry contract" - }, - "getDestinationOfTicket(uint256)": { - "details": "Getter, returns the last attestation destination of a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getTicketData(uint256)": { - "details": "Getter, returns the data linked to a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getVerifier()": { - "details": "Getter of Hydra-S1 Verifier contract" - }, - "isTicketOnCooldown(uint256)": { - "details": "returns whether a ticket is on cooldown or not", - "params": { - "userTicket": "ticket used*" - } - } - }, - "stateVariables": { - "AUTHORIZED_COLLECTION_ID_FIRST": { - "details": "Getter returns of the first collection in which the attester is supposed to record*" - }, - "AUTHORIZED_COLLECTION_ID_LAST": { - "details": "Getter returns of the last collection in which the attester is supposed to record*" - }, - "SOULBOUND_COOLDOWN_DURATION": { - "details": "Getter returns of the duration of the cooldown period after having used a ticket*" - } - }, - "title": "Hydra-S1 Soulbound Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - SoulBound (with cooldown period) A user can chose to delete attestations or generate attestation to a new destination. When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional User will need to wait until the end of the cooldown period before being able to delete or switch destination again One can however know that the former and the new destinations were created using the same userTicket - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 936, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 939, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 6592, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "_userTicketsData", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_struct(TicketData)6019_storage)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_struct(TicketData)6019_storage)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => struct IHydraS1SoulboundAttester.TicketData)", - "numberOfBytes": "32", - "value": "t_struct(TicketData)6019_storage" - }, - "t_struct(TicketData)6019_storage": { - "encoding": "inplace", - "label": "struct IHydraS1SoulboundAttester.TicketData", - "members": [ - { - "astId": 6016, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "destination", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 6018, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "cooldownStart", - "offset": 20, - "slot": "0", - "type": "t_uint32" - } - ], - "numberOfBytes": "32" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/HydraS1SoulboundAttesterImplem.json b/deployments/sandboxPolygon/HydraS1SoulboundAttesterImplem.json deleted file mode 100644 index b7ece48..0000000 --- a/deployments/sandboxPolygon/HydraS1SoulboundAttesterImplem.json +++ /dev/null @@ -1,1019 +0,0 @@ -{ - "address": "0xAA393C9ad1aaBeEEceDF2a166335B7d30885EAbA", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "attestationsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "hydraS1VerifierAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "availableRootsRegistryAddress", - "type": "address" - }, - { - "internalType": "address", - "name": "commitmentMapperAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "collectionIdFirst", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "collectionIdLast", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "soulboundCooldownDuration", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedAccountsTreeValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputAccountsTreeValue", - "type": "uint256" - } - ], - "name": "AccountsTreeValueMismatch", - "type": "error" - }, - { - "inputs": [], - "name": "AttestationDeletionNotImplemented", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedChainId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "chainId", - "type": "uint256" - } - ], - "name": "ChainIdMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "claimLength", - "type": "uint256" - } - ], - "name": "ClaimsLengthDifferentThanOne", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - } - ], - "name": "CollectionIdOutOfBound", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "expectedY", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputX", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputY", - "type": "uint256" - } - ], - "name": "CommitmentMapperPubKeyMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "expectedDestination", - "type": "address" - }, - { - "internalType": "address", - "name": "inputDestination", - "type": "address" - } - ], - "name": "DestinationMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedGroupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - } - ], - "name": "GroupIdAndPropertiesMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "reason", - "type": "string" - } - ], - "name": "InvalidGroth16Proof", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "bool", - "name": "expectedStrictness", - "type": "bool" - }, - { - "internalType": "bool", - "name": "strictNess", - "type": "bool" - } - ], - "name": "IsStrictMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "NotAttestationOwner", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "inputRoot", - "type": "uint256" - } - ], - "name": "RegistryRootMismatch", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "ticketData", - "type": "uint256" - } - ], - "name": "TicketFrozen", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedTicketIdentifier", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "ticketIdentifier", - "type": "uint256" - } - ], - "name": "TicketIdentifierMismatch", - "type": "error" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "destination", - "type": "address" - }, - { - "internalType": "uint32", - "name": "cooldownStart", - "type": "uint32" - } - ], - "internalType": "struct IHydraS1SoulboundAttester.TicketData", - "name": "ticketData", - "type": "tuple" - } - ], - "name": "TicketUsedAndOnCooldown", - "type": "error" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "expectedValue", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "inputValue", - "type": "uint256" - } - ], - "name": "ValueMismatch", - "type": "error" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationDeleted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "indexed": false, - "internalType": "struct Attestation", - "name": "attestation", - "type": "tuple" - } - ], - "name": "AttestationGenerated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "TicketDestinationUpdated", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "ticket", - "type": "uint256" - } - ], - "name": "TicketSetOnCooldown", - "type": "event" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_FIRST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "AUTHORIZED_COLLECTION_ID_LAST", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "SOULBOUND_COOLDOWN_DURATION", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "buildAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256[]", - "name": "collectionIds", - "type": "uint256[]" - }, - { - "internalType": "address", - "name": "attestationsOwner", - "type": "address" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "deleteAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "components": [ - { - "internalType": "uint256", - "name": "groupId", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "claimedValue", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Claim[]", - "name": "claims", - "type": "tuple[]" - }, - { - "internalType": "address", - "name": "destination", - "type": "address" - } - ], - "internalType": "struct Request", - "name": "request", - "type": "tuple" - }, - { - "internalType": "bytes", - "name": "proofData", - "type": "bytes" - } - ], - "name": "generateAttestations", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "collectionId", - "type": "uint256" - }, - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "issuer", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint32", - "name": "timestamp", - "type": "uint32" - }, - { - "internalType": "bytes", - "name": "extraData", - "type": "bytes" - } - ], - "internalType": "struct Attestation[]", - "name": "", - "type": "tuple[]" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getAttestationRegistry", - "outputs": [ - { - "internalType": "contract IAttestationsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getAvailableRootsRegistry", - "outputs": [ - { - "internalType": "contract IAvailableRootsRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getCommitmentMapperRegistry", - "outputs": [ - { - "internalType": "contract ICommitmentMapperRegistry", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getDestinationOfTicket", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "getTicketData", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "destination", - "type": "address" - }, - { - "internalType": "uint32", - "name": "cooldownStart", - "type": "uint32" - } - ], - "internalType": "struct IHydraS1SoulboundAttester.TicketData", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getVerifier", - "outputs": [ - { - "internalType": "contract HydraS1Verifier", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "userTicket", - "type": "uint256" - } - ], - "name": "isTicketOnCooldown", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xdf7704e959c1f3d6d69e0a54b3408657ac6a667b4c16ff9c901beb91d7bbae8a", - "receipt": { - "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0xAA393C9ad1aaBeEEceDF2a166335B7d30885EAbA", - "transactionIndex": 111, - "gasUsed": "1821131", - "logsBloom": "0x00000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000000000000000040000000040000000000100000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000004000000000000000000001000000000000000000000000000000120004000000000000000000000000000000000000000000000000000000000000000000100000", - "blockHash": "0x4c936a51c881fc1434d1565277ff701051ff22e14adfb70511967465c36ad588", - "transactionHash": "0xdf7704e959c1f3d6d69e0a54b3408657ac6a667b4c16ff9c901beb91d7bbae8a", - "logs": [ - { - "transactionIndex": 111, - "blockNumber": 32513216, - "transactionHash": "0xdf7704e959c1f3d6d69e0a54b3408657ac6a667b4c16ff9c901beb91d7bbae8a", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x0000000000000000000000009ead03f7136fc6b4bdb0780b00a1c14ae5a8b6d0" - ], - "data": "0x00000000000000000000000000000000000000000000000000cbde4ce4783452000000000000000000000000000000000000000000000000242ee8f74f14cea30000000000000000000000000000000000000000000011f662ba5f157700da9900000000000000000000000000000000000000000000000023630aaa6a9c9a510000000000000000000000000000000000000000000011f663863d625b790eeb", - "logIndex": 463, - "blockHash": "0x4c936a51c881fc1434d1565277ff701051ff22e14adfb70511967465c36ad588" - } - ], - "blockNumber": 32513216, - "cumulativeGasUsed": "28176793", - "status": 1, - "byzantium": true - }, - "args": [ - "0xC999390A856e0633f945dD851DeeCE15b533ccA3", - "0xbcE0921E2502898384167414c2F116f7f7B240BC", - "0xb8797eBa1048f6A6AfCbE4F08a582b4Dde69C05d", - "0xC44F46A31B752b773685be6B5ce8616fFeb97C8D", - "20000001", - "30000000", - "295200" - ], - "numDeployments": 1, - "solcInputHash": "c872f238f220b3571ef309821a459203", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"attestationsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"hydraS1VerifierAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"availableRootsRegistryAddress\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"commitmentMapperAddress\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdFirst\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"collectionIdLast\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"soulboundCooldownDuration\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedAccountsTreeValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputAccountsTreeValue\",\"type\":\"uint256\"}],\"name\":\"AccountsTreeValueMismatch\",\"type\":\"error\"},{\"inputs\":[],\"name\":\"AttestationDeletionNotImplemented\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedChainId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"chainId\",\"type\":\"uint256\"}],\"name\":\"ChainIdMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"claimLength\",\"type\":\"uint256\"}],\"name\":\"ClaimsLengthDifferentThanOne\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"}],\"name\":\"CollectionIdOutOfBound\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"expectedY\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputX\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputY\",\"type\":\"uint256\"}],\"name\":\"CommitmentMapperPubKeyMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"expectedDestination\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"inputDestination\",\"type\":\"address\"}],\"name\":\"DestinationMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedGroupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"}],\"name\":\"GroupIdAndPropertiesMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"string\",\"name\":\"reason\",\"type\":\"string\"}],\"name\":\"InvalidGroth16Proof\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"bool\",\"name\":\"expectedStrictness\",\"type\":\"bool\"},{\"internalType\":\"bool\",\"name\":\"strictNess\",\"type\":\"bool\"}],\"name\":\"IsStrictMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"sender\",\"type\":\"address\"}],\"name\":\"NotAttestationOwner\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"inputRoot\",\"type\":\"uint256\"}],\"name\":\"RegistryRootMismatch\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"ticketData\",\"type\":\"uint256\"}],\"name\":\"TicketFrozen\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedTicketIdentifier\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"ticketIdentifier\",\"type\":\"uint256\"}],\"name\":\"TicketIdentifierMismatch\",\"type\":\"error\"},{\"inputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"cooldownStart\",\"type\":\"uint32\"}],\"internalType\":\"struct IHydraS1SoulboundAttester.TicketData\",\"name\":\"ticketData\",\"type\":\"tuple\"}],\"name\":\"TicketUsedAndOnCooldown\",\"type\":\"error\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"expectedValue\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"inputValue\",\"type\":\"uint256\"}],\"name\":\"ValueMismatch\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationDeleted\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"indexed\":false,\"internalType\":\"struct Attestation\",\"name\":\"attestation\",\"type\":\"tuple\"}],\"name\":\"AttestationGenerated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"TicketDestinationUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"ticket\",\"type\":\"uint256\"}],\"name\":\"TicketSetOnCooldown\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_FIRST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"AUTHORIZED_COLLECTION_ID_LAST\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SOULBOUND_COOLDOWN_DURATION\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"buildAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256[]\",\"name\":\"collectionIds\",\"type\":\"uint256[]\"},{\"internalType\":\"address\",\"name\":\"attestationsOwner\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"deleteAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"components\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"groupId\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"claimedValue\",\"type\":\"uint256\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Claim[]\",\"name\":\"claims\",\"type\":\"tuple[]\"},{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"}],\"internalType\":\"struct Request\",\"name\":\"request\",\"type\":\"tuple\"},{\"internalType\":\"bytes\",\"name\":\"proofData\",\"type\":\"bytes\"}],\"name\":\"generateAttestations\",\"outputs\":[{\"components\":[{\"internalType\":\"uint256\",\"name\":\"collectionId\",\"type\":\"uint256\"},{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"issuer\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"},{\"internalType\":\"uint32\",\"name\":\"timestamp\",\"type\":\"uint32\"},{\"internalType\":\"bytes\",\"name\":\"extraData\",\"type\":\"bytes\"}],\"internalType\":\"struct Attestation[]\",\"name\":\"\",\"type\":\"tuple[]\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAttestationRegistry\",\"outputs\":[{\"internalType\":\"contract IAttestationsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getAvailableRootsRegistry\",\"outputs\":[{\"internalType\":\"contract IAvailableRootsRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getCommitmentMapperRegistry\",\"outputs\":[{\"internalType\":\"contract ICommitmentMapperRegistry\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getDestinationOfTicket\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"getTicketData\",\"outputs\":[{\"components\":[{\"internalType\":\"address\",\"name\":\"destination\",\"type\":\"address\"},{\"internalType\":\"uint32\",\"name\":\"cooldownStart\",\"type\":\"uint32\"}],\"internalType\":\"struct IHydraS1SoulboundAttester.TicketData\",\"name\":\"\",\"type\":\"tuple\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getVerifier\",\"outputs\":[{\"internalType\":\"contract HydraS1Verifier\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"userTicket\",\"type\":\"uint256\"}],\"name\":\"isTicketOnCooldown\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Sismo\",\"kind\":\"dev\",\"methods\":{\"buildAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Returns the actual attestations constructed from the user request\",\"params\":{\"proofData\":\"snark public input as well as snark proof\",\"request\":\"users request. Claim of having an account part of a group of accounts\"}},\"constructor\":{\"details\":\"Constructor. Initializes the contract\",\"params\":{\"attestationsRegistryAddress\":\"Attestations Registry contract on which the attester will write attestations\",\"availableRootsRegistryAddress\":\"Registry storing the available groups for this attester (e.g roots of registry merkle trees)\",\"collectionIdFirst\":\"Id of the first collection in which the attester is supposed to record\",\"collectionIdLast\":\"Id of the last collection in which the attester is supposed to record\",\"commitmentMapperAddress\":\"commitment mapper's public key registry\",\"hydraS1VerifierAddress\":\"ZK Snark Hydra-S1 Verifier contract\"}},\"deleteAttestations(uint256[],address,bytes)\":{\"details\":\"External facing function. Allows to delete attestations by submitting proof\",\"params\":{\"attestationsOwner\":\"Owner of attestations to delete\",\"collectionIds\":\"Collection identifier of attestations to delete\",\"proofData\":\"Data sent along the deletion request to prove its validity\"},\"returns\":{\"_0\":\"attestations Attestations that were deleted\"}},\"generateAttestations(((uint256,uint256,bytes)[],address),bytes)\":{\"details\":\"Main external function. Allows to generate attestations by making a request and submitting proof\",\"params\":{\"proofData\":\"Data sent along the request to prove its validity\",\"request\":\"User request\"},\"returns\":{\"_0\":\"attestations Attestations that has been recorded\"}},\"getAttestationRegistry()\":{\"details\":\"Attestation registry getter\",\"returns\":{\"_0\":\"attestationRegistry\"}},\"getAvailableRootsRegistry()\":{\"details\":\"Getter of Roots Registry Contract\"},\"getCommitmentMapperRegistry()\":{\"details\":\"Getter of Commitment Mapper Registry contract\"},\"getDestinationOfTicket(uint256)\":{\"details\":\"Getter, returns the last attestation destination of a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getTicketData(uint256)\":{\"details\":\"Getter, returns the data linked to a ticket\",\"params\":{\"userTicket\":\"ticket used*\"}},\"getVerifier()\":{\"details\":\"Getter of Hydra-S1 Verifier contract\"},\"isTicketOnCooldown(uint256)\":{\"details\":\"returns whether a ticket is on cooldown or not\",\"params\":{\"userTicket\":\"ticket used*\"}}},\"stateVariables\":{\"AUTHORIZED_COLLECTION_ID_FIRST\":{\"details\":\"Getter returns of the first collection in which the attester is supposed to record*\"},\"AUTHORIZED_COLLECTION_ID_LAST\":{\"details\":\"Getter returns of the last collection in which the attester is supposed to record*\"},\"SOULBOUND_COOLDOWN_DURATION\":{\"details\":\"Getter returns of the duration of the cooldown period after having used a ticket*\"}},\"title\":\"Hydra-S1 Soulbound Attester\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"notice\":\"This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - SoulBound (with cooldown period) A user can chose to delete attestations or generate attestation to a new destination. When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional User will need to wait until the end of the cooldown period before being able to delete or switch destination again One can however know that the former and the new destinations were created using the same userTicket - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol\":\"HydraS1SoulboundAttester\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/access/Ownable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/Context.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract Ownable is Context {\\n address private _owner;\\n\\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n /**\\n * @dev Initializes the contract setting the deployer as the initial owner.\\n */\\n constructor() {\\n _transferOwnership(_msgSender());\\n }\\n\\n /**\\n * @dev Returns the address of the current owner.\\n */\\n function owner() public view virtual returns (address) {\\n return _owner;\\n }\\n\\n /**\\n * @dev Throws if called by any account other than the owner.\\n */\\n modifier onlyOwner() {\\n require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n _;\\n }\\n\\n /**\\n * @dev Leaves the contract without owner. It will not be possible to call\\n * `onlyOwner` functions anymore. Can only be called by the current owner.\\n *\\n * NOTE: Renouncing ownership will leave the contract without an owner,\\n * thereby removing any functionality that is only available to the owner.\\n */\\n function renounceOwnership() public virtual onlyOwner {\\n _transferOwnership(address(0));\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Can only be called by the current owner.\\n */\\n function transferOwnership(address newOwner) public virtual onlyOwner {\\n require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n _transferOwnership(newOwner);\\n }\\n\\n /**\\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n * Internal function without access restriction.\\n */\\n function _transferOwnership(address newOwner) internal virtual {\\n address oldOwner = _owner;\\n _owner = newOwner;\\n emit OwnershipTransferred(oldOwner, newOwner);\\n }\\n}\\n\",\"keccak256\":\"0x24e0364e503a9bbde94c715d26573a76f14cd2a202d45f96f52134ab806b67b9\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../../utils/Address.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() initializer {}\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n /**\\n * @dev Indicates that the contract has been initialized.\\n */\\n bool private _initialized;\\n\\n /**\\n * @dev Indicates that the contract is in the process of being initialized.\\n */\\n bool private _initializing;\\n\\n /**\\n * @dev Modifier to protect an initializer function from being invoked twice.\\n */\\n modifier initializer() {\\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\\n // contract may have been reentered.\\n require(_initializing ? _isConstructor() : !_initialized, \\\"Initializable: contract is already initialized\\\");\\n\\n bool isTopLevelCall = !_initializing;\\n if (isTopLevelCall) {\\n _initializing = true;\\n _initialized = true;\\n }\\n\\n _;\\n\\n if (isTopLevelCall) {\\n _initializing = false;\\n }\\n }\\n\\n /**\\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n * {initializer} modifier, directly or indirectly.\\n */\\n modifier onlyInitializing() {\\n require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n _;\\n }\\n\\n function _isConstructor() private view returns (bool) {\\n return !Address.isContract(address(this));\\n }\\n}\\n\",\"keccak256\":\"0x4823752b07b8ea4ca971b217e39457930e7cb103c2c91e2a29729e5ca907e4f0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Context.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract Context {\\n function _msgSender() internal view virtual returns (address) {\\n return msg.sender;\\n }\\n\\n function _msgData() internal view virtual returns (bytes calldata) {\\n return msg.data;\\n }\\n}\\n\",\"keccak256\":\"0xe2e337e6dde9ef6b680e07338c493ebea1b5fd09b43424112868e9cc1706bca7\",\"license\":\"MIT\"},\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\\n 546002182798634190282541153661423157791776194062719045593389981526666716416\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x70c0b7d96ff1b90538938a4cb2d8086b3aabb4febf1e36cb3f470bfe0b4a9e89\",\"license\":\"GPL-3.0\"},\"contracts/attesters/hydra-s1/base/HydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1Base} from './IHydraS1Base.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n// Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\n\\n// Imports related to Hydra S1 ZK Proving Scheme\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n/**\\n * @title Hydra-S1 Base Attester\\n * @author Sismo\\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\\n * It is inherited by the family of Hydra-S1 attesters.\\n * It contains the user input checking and the ZK-SNARK proof verification.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n \\n \\n **/\\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\\n using HydraS1Lib for HydraS1ProofData;\\n\\n // ZK-SNARK Verifier\\n HydraS1Verifier immutable VERIFIER;\\n // Registry storing the Commitment Mapper EdDSA Public key\\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\\n * @param commitmentMapperAddress Commitment mapper's public key registry\\n */\\n constructor(\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress\\n ) {\\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier) {\\n return VERIFIER;\\n }\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\\n return COMMITMENT_MAPPER_REGISTRY;\\n }\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\\n return AVAILABLE_ROOTS_REGISTRY;\\n }\\n\\n /*******************************************************\\n Hydra-S1 SPECIFIC FUNCTIONS\\n *******************************************************/\\n\\n /**\\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\\n * so it can be checked against snark input\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input which guarantees privacy\\n\\n * This function MUST be implemented by Hydra-S1 attesters.\\n * This is the core function that implements the logic of tickets\\n\\n * Do they get one ticket per claim?\\n * Do they get 2 tickets per claim?\\n * Do they get 1 ticket per claim, every month?\\n * Take a look at Hydra-S1 Simple Attester for an example\\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\\n */\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n virtual\\n returns (uint256);\\n\\n /**\\n * @dev Checks whether the user claim and the snark public input are a match\\n * @param claim user claim\\n * @param input snark public input\\n */\\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\\n internal\\n view\\n virtual\\n {\\n if (input.accountsTreeValue != claim.groupId)\\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\\n\\n if (input.isStrict == claim.groupProperties.isScore)\\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\\n\\n if (input.destination != claim.destination)\\n revert DestinationMismatch(claim.destination, input.destination);\\n\\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\\n\\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\\n\\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\\n revert RegistryRootMismatch(input.registryRoot);\\n\\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\\n if (\\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\\n )\\n revert CommitmentMapperPubKeyMismatch(\\n commitmentMapperPubKey[0],\\n commitmentMapperPubKey[1],\\n input.commitmentMapperPubKey[0],\\n input.commitmentMapperPubKey[1]\\n );\\n\\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\\n\\n if (input.ticketIdentifier != ticketIdentifier)\\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\\n }\\n\\n /**\\n * @dev verify the groth16 mathematical proof\\n * @param proofData snark public input\\n */\\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\\n try\\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\\n returns (bool success) {\\n if (!success) revert InvalidGroth16Proof('');\\n } catch Error(string memory reason) {\\n revert InvalidGroth16Proof(reason);\\n } catch Panic(\\n uint256 /*errorCode*/\\n ) {\\n revert InvalidGroth16Proof('');\\n } catch (\\n bytes memory /*lowLevelData*/\\n ) {\\n revert InvalidGroth16Proof('');\\n }\\n }\\n}\\n\",\"keccak256\":\"0x02708884237382835cd3d3514fdc3603409ce5ea1dc7255a7ceea07dff417c34\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/base/IHydraS1Base.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\n\\n// todo: explain well what is specific to this attester\\ninterface IHydraS1Base {\\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\\n error RegistryRootMismatch(uint256 inputRoot);\\n error DestinationMismatch(address expectedDestination, address inputDestination);\\n error CommitmentMapperPubKeyMismatch(\\n uint256 expectedX,\\n uint256 expectedY,\\n uint256 inputX,\\n uint256 inputY\\n );\\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\\n error AccountsTreeValueMismatch(\\n uint256 expectedAccountsTreeValue,\\n uint256 inputAccountsTreeValue\\n );\\n error InvalidGroth16Proof(string reason);\\n\\n /**\\n * @dev Getter of Hydra-S1 Verifier contract\\n */\\n function getVerifier() external view returns (HydraS1Verifier);\\n\\n /**\\n * @dev Getter of Commitment Mapper Registry contract\\n */\\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\\n\\n /**\\n * @dev Getter of Roots Registry Contract\\n */\\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\\n}\\n\",\"keccak256\":\"0x73cff4dcd9c30857859721ea2897be8bb7087c0122f4587acdaa79d8ec0a728d\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/interfaces/IHydraS1SoulboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {Attestation} from '../../../core/libs/Structs.sol';\\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\\n\\n// todo: explain well what is specific to this attester\\ninterface IHydraS1SoulboundAttester is IHydraS1Base, IAttester {\\n struct TicketData {\\n address destination;\\n uint32 cooldownStart;\\n }\\n error NotAttestationOwner(uint256 ticket, address sender);\\n error TicketFrozen(uint256 ticketData);\\n error TicketUsedAndOnCooldown(TicketData ticketData);\\n error CollectionIdOutOfBound(uint256 collectionId);\\n\\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\\n event TicketSetOnCooldown(uint256 ticket);\\n\\n /**\\n * @dev returns whether a ticket is on cooldown or not\\n * @param userTicket ticket used\\n **/\\n function isTicketOnCooldown(uint256 userTicket) external view returns (bool);\\n\\n /**\\n * @dev Getter, returns the data linked to a ticket\\n * @param userTicket ticket used\\n **/\\n function getTicketData(uint256 userTicket) external view returns (TicketData memory);\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\\n\\n /**\\n * @dev Getter\\n * returns of the first collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the last collection in which the attester is supposed to record\\n **/\\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\\n\\n /**\\n * @dev Getter\\n * returns of the duration of the cooldown period after having used a ticket\\n **/\\n function SOULBOUND_COOLDOWN_DURATION() external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x253a424fda33fca3de3fabd731e4a4f5d48af14bcd9d7c66302113268fd3a9f5\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/libs/HydraS1Lib.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\\n\\n// user Hydra-S1 claim retrieved form his request\\nstruct HydraS1Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n address destination; // user claims to own this destination[]\\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\\n}\\n\\nstruct HydraS1GroupProperties {\\n uint128 groupIndex;\\n uint32 generationTimestamp;\\n bool isScore;\\n}\\n\\nstruct HydraS1CircomSnarkProof {\\n uint256[2] a;\\n uint256[2][2] b;\\n uint256[2] c;\\n}\\n\\nstruct HydraS1ProofData {\\n HydraS1CircomSnarkProof proof;\\n uint256[10] input;\\n // destination\\n // chainId\\n // commitmentMapperPubKey.x\\n // commitmentMapperPubKey.y\\n // registryTreeRoot\\n // ticketIdentifier\\n // ticket\\n // claimedValue\\n // accountsTreeValue\\n // isStrict\\n}\\n\\nstruct HydraS1ProofInput {\\n address destination;\\n uint256 chainId;\\n uint256 registryRoot;\\n uint256 ticketIdentifier;\\n uint256 ticket;\\n uint256 value;\\n uint256 accountsTreeValue;\\n bool isStrict;\\n uint256[2] commitmentMapperPubKey;\\n}\\n\\nlibrary HydraS1Lib {\\n uint256 constant SNARK_FIELD =\\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n\\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\\n\\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\\n return\\n HydraS1ProofInput(\\n _getDestination(self),\\n _getChainId(self),\\n _getRegistryRoot(self),\\n _getExpectedExternalNullifier(self),\\n _getTicket(self),\\n _getValue(self),\\n _getAccountsTreeValue(self),\\n _getIsStrict(self),\\n _getCommitmentMapperPubKey(self)\\n );\\n }\\n\\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\\n Claim memory claim = self.claims[0];\\n _validateClaim(claim);\\n\\n HydraS1GroupProperties memory groupProperties = abi.decode(\\n claim.extraData,\\n (HydraS1GroupProperties)\\n );\\n\\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\\n }\\n\\n function _toCircomFormat(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (\\n uint256[2] memory,\\n uint256[2][2] memory,\\n uint256[2] memory,\\n uint256[10] memory\\n )\\n {\\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\\n }\\n\\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\\n return address(uint160(self.input[0]));\\n }\\n\\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[1];\\n }\\n\\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256[2] memory)\\n {\\n return [self.input[2], self.input[3]];\\n }\\n\\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[4];\\n }\\n\\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\\n internal\\n pure\\n returns (uint256)\\n {\\n return self.input[5];\\n }\\n\\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[6];\\n }\\n\\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[7];\\n }\\n\\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\\n return self.input[8];\\n }\\n\\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\\n return self.input[9] == 1;\\n }\\n\\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\\n uint256 userTicket = uint256(_getTicket(snarkProofData));\\n return userTicket;\\n }\\n\\n function _generateGroupIdFromProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (uint256) {\\n return\\n _generateGroupIdFromEncodedProperties(\\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\\n );\\n }\\n\\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\\n internal\\n pure\\n returns (uint256)\\n {\\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\\n }\\n\\n function _encodeGroupProperties(\\n uint128 groupIndex,\\n uint32 generationTimestamp,\\n bool isScore\\n ) internal pure returns (bytes memory) {\\n return abi.encode(groupIndex, generationTimestamp, isScore);\\n }\\n\\n function _validateClaim(Claim memory claim) internal pure {\\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\\n if (claim.groupId != expectedGroupId)\\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\\n }\\n}\\n\",\"keccak256\":\"0x596225970aabbc4edb989ee640867c76944e797bfafe5e06dcf37b973480b957\",\"license\":\"MIT\"},\"contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\npragma experimental ABIEncoderV2;\\n\\nimport {IHydraS1SoulboundAttester} from '../interfaces/IHydraS1SoulboundAttester.sol';\\n\\n// Core protocol Protocol imports\\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\\nimport {Attester, IAttester, IAttestationsRegistry} from '../../../core/Attester.sol';\\n\\n// Imports related to HydraS1 Proving Scheme\\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from '../base/HydraS1Base.sol';\\n\\n/**\\n * @title Hydra-S1 Soulbound Attester\\n * @author Sismo\\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\\n * We invite readers to refer to:\\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\\n\\n * This specific attester has the following characteristics:\\n\\n * - Zero Knowledge\\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\\n\\n * - Non Strict (scores)\\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\\n * This attester generate attestations of scores\\n\\n * - Ticketed\\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\\n * For people used to semaphore/ tornado cash people:\\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\\n \\n * - SoulBound (with cooldown period)\\n * A user can chose to delete attestations or generate attestation to a new destination.\\n * When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional\\n * User will need to wait until the end of the cooldown period before being able to delete or switch destination again\\n * One can however know that the former and the new destinations were created using the same userTicket\\n \\n * - Renewable\\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\\n * It enables users to renew or update their attestations\\n **/\\ncontract HydraS1SoulboundAttester is IHydraS1SoulboundAttester, HydraS1Base, Attester {\\n using HydraS1Lib for HydraS1ProofData;\\n using HydraS1Lib for bytes;\\n using HydraS1Lib for Request;\\n\\n // The deployed contract will need to be authorized to write into the Attestation registry\\n // It should get write access on collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\\n uint256 public immutable SOULBOUND_COOLDOWN_DURATION;\\n\\n mapping(uint256 => TicketData) internal _userTicketsData;\\n\\n /*******************************************************\\n INITIALIZATION FUNCTIONS \\n *******************************************************/\\n /**\\n * @dev Constructor. Initializes the contract\\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\\n * @param commitmentMapperAddress commitment mapper's public key registry\\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\\n */\\n constructor(\\n address attestationsRegistryAddress,\\n address hydraS1VerifierAddress,\\n address availableRootsRegistryAddress,\\n address commitmentMapperAddress,\\n uint256 collectionIdFirst,\\n uint256 collectionIdLast,\\n uint256 soulboundCooldownDuration\\n )\\n Attester(attestationsRegistryAddress)\\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\\n {\\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\\n SOULBOUND_COOLDOWN_DURATION = soulboundCooldownDuration;\\n }\\n\\n /*******************************************************\\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\\n *******************************************************/\\n\\n /**\\n * @dev Throws if user attestations request is invalid\\n * Look into HydraS1Base for more details\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark proof backing the claim\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\\n HydraS1ProofInput memory snarkInput = snarkProof._input();\\n HydraS1Claim memory claim = request._claim();\\n\\n // verifies that the proof corresponds to the claim\\n _validateInput(claim, snarkInput);\\n // verifies the proof validity\\n _verifyProof(snarkProof);\\n }\\n\\n /**\\n * @dev Throws if user attestations deletion request is not made by its owner\\n * @param attestations attestations to delete\\n */\\n function _verifyAttestationsDeletionRequest(Attestation[] memory attestations, bytes calldata)\\n internal\\n view\\n override\\n {\\n for (uint256 i = 0; i < attestations.length; i++) {\\n uint256 userTicket = abi.decode(attestations[0].extraData, (uint256));\\n if (_userTicketsData[userTicket].destination != msg.sender)\\n revert NotAttestationOwner(userTicket, msg.sender);\\n }\\n }\\n\\n /**\\n * @dev Returns the actual attestations constructed from the user request\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData snark public input as well as snark proof\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n override(IAttester, Attester)\\n returns (Attestation[] memory)\\n {\\n HydraS1Claim memory claim = request._claim();\\n\\n Attestation[] memory attestations = new Attestation[](1);\\n\\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\\n claim.groupProperties.groupIndex;\\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\\n revert CollectionIdOutOfBound(attestationCollectionId);\\n\\n // The issuer of attestations is the attester\\n address issuer = address(this);\\n // user sends the ticket as input in the data\\n uint256 userTicket = proofData._getTicket();\\n\\n attestations[0] = Attestation(\\n attestationCollectionId,\\n request.destination,\\n issuer,\\n claim.claimedValue,\\n claim.groupProperties.generationTimestamp,\\n abi.encode(userTicket)\\n );\\n\\n return (attestations);\\n }\\n\\n /*******************************************************\\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\\n *******************************************************/\\n /**\\n * @dev Hook run before recording the attestation.\\n * Throws if ticket already used, not a renewal, and ticket on cooldown.\\n * @param request users request. Claim of having an account part of a group of accounts\\n * @param proofData provided to back the request. snark input and snark proof\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n override\\n {\\n uint256 userTicket = proofData._getTicket();\\n TicketData memory userTicketData = _userTicketsData[userTicket];\\n\\n if (\\n userTicketData.destination != address(0) && userTicketData.destination != request.destination\\n ) {\\n if (_isOnCooldown(userTicketData)) revert TicketUsedAndOnCooldown(userTicketData);\\n _setTicketOnCooldown(userTicket);\\n }\\n _setDestinationForTicket(userTicket, request.destination);\\n }\\n\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n override\\n {\\n // we retrieve the ticketUsed from attestations extraData\\n for (uint256 i = 0; i < attestations.length; i++) {\\n uint256 userTicket = abi.decode(attestations[i].extraData, (uint256));\\n if (_isOnCooldown(_userTicketsData[userTicket]) == true) revert TicketFrozen(userTicket);\\n _userTicketsData[userTicket].destination = address(0);\\n }\\n }\\n\\n /*******************************************************\\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\\n *******************************************************/\\n\\n /**\\n * @dev Returns the ticket identifier from a user claim\\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\\n * users bring sourceSecretHash as private input in snark which guarantees privacy\\n \\n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\\n **/\\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\\n internal\\n view\\n override\\n returns (uint256)\\n {\\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\\n return ticketIdentifier;\\n }\\n\\n /*******************************************************\\n Hydra-S1 Attester Specific Functions\\n *******************************************************/\\n\\n /**\\n * @dev Getter, returns the last attestation destination of a ticket\\n * @param userTicket ticket used\\n **/\\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\\n return _getDestinationOfTicket(userTicket);\\n }\\n\\n /**\\n * @dev Getter, returns the data linked to a ticket\\n * @param userTicket ticket used\\n **/\\n function getTicketData(uint256 userTicket) external view override returns (TicketData memory) {\\n return _getTicketData(userTicket);\\n }\\n\\n /**\\n * @dev returns whether a ticket is on cooldown or not\\n * @param userTicket ticket used\\n **/\\n function isTicketOnCooldown(uint256 userTicket) external view override returns (bool) {\\n return _isOnCooldown(_getTicketData(userTicket));\\n }\\n\\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\\n _userTicketsData[userTicket].destination = destination;\\n emit TicketDestinationUpdated(userTicket, destination);\\n }\\n\\n function _setTicketOnCooldown(uint256 userTicket) internal {\\n _userTicketsData[userTicket].cooldownStart = uint32(block.timestamp);\\n emit TicketSetOnCooldown(userTicket);\\n }\\n\\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\\n return _userTicketsData[userTicket].destination;\\n }\\n\\n function _isOnCooldown(TicketData memory userTicketData) internal view returns (bool) {\\n return userTicketData.cooldownStart + SOULBOUND_COOLDOWN_DURATION < block.timestamp;\\n }\\n\\n function _getTicketData(uint256 userTicket) internal view returns (TicketData memory) {\\n return _userTicketsData[userTicket];\\n }\\n\\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\\n }\\n}\\n\",\"keccak256\":\"0xe72642edf2eecc2886aae203d09ac63f5515a1e51f0ad85b9da410aa59db6261\",\"license\":\"MIT\"},\"contracts/core/Attester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\nimport {IAttester} from './interfaces/IAttester.sol';\\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\\n\\n/**\\n * @title Attester Abstract Contract\\n * @author Sismo\\n * @notice Contract to be inherited by Attesters\\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\\n * are recommended to implemented this abstract contract\\n\\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\\n *\\n * This contracts is built around two main external standard functions.\\n * They must NOT be override them, unless your really know what you are doing\\n \\n * - generateAttestations(request, proof) => will write attestations in the registry\\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\\n\\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\\n\\n * For more information: https://attesters.docs.sismo.io\\n **/\\nabstract contract Attester is IAttester {\\n // Registry where all attestations are stored\\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\\n\\n /**\\n * @dev Constructor\\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\\n */\\n constructor(address attestationsRegistryAddress) {\\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\\n }\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n override\\n returns (Attestation[] memory)\\n {\\n // Verify if request is valid by verifying against proof\\n _verifyRequest(request, proofData);\\n\\n // Generate the actual attestations from user request\\n Attestation[] memory attestations = buildAttestations(request, proofData);\\n\\n _beforeRecordAttestations(request, proofData);\\n\\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\\n\\n _afterRecordAttestations(attestations);\\n\\n for (uint256 i = 0; i < attestations.length; i++) {\\n emit AttestationGenerated(attestations[i]);\\n }\\n\\n return attestations;\\n }\\n\\n /**\\n * @dev External facing function. Allows to delete attestations by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that were deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external override returns (Attestation[] memory) {\\n // fetch attestations from the registry\\n Attestation[] memory attestationsToDelete;\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n (\\n address issuer,\\n uint256 attestationValue,\\n uint32 timestamp,\\n bytes memory extraData\\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\\n\\n attestationsToDelete[i] = (\\n Attestation(\\n collectionIds[i],\\n attestationsOwner,\\n issuer,\\n attestationValue,\\n timestamp,\\n extraData\\n )\\n );\\n }\\n\\n _verifyAttestationsDeletionRequest(attestationsToDelete, proofData);\\n\\n _beforeDeleteAttestations(attestationsToDelete, proofData);\\n\\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationsToDelete);\\n\\n _afterDeleteAttestations(attestationsToDelete, proofData);\\n\\n for (uint256 i = 0; i < collectionIds.length; i++) {\\n emit AttestationDeleted(attestationsToDelete[i]);\\n }\\n return attestationsToDelete;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n public\\n view\\n virtual\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry getter\\n * @return attestationRegistry\\n */\\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\\n return ATTESTATIONS_REGISTRY;\\n }\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should verify the user request is valid\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\\n\\n /**\\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\\n * Default behavior: throws\\n * It should verify attestations deletion request is valid\\n * @param attestations Attestations that will be deleted\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _verifyAttestationsDeletionRequest(\\n Attestation[] memory attestations,\\n bytes calldata proofData\\n ) internal virtual {\\n revert AttestationDeletionNotImplemented();\\n }\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before recording attestations in the registry\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n */\\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev (Optional) Can be overridden in attesters inheriting this contract\\n * Will be called after recording an attestation\\n * @param attestations Recorded attestations\\n */\\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called before deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n\\n /**\\n * @dev Optional: Hook, can be overridden in attesters\\n * Will be called after deleting attestations from the registry\\n * @param attestations Attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n */\\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\\n internal\\n virtual\\n {}\\n}\\n\",\"keccak256\":\"0x37683c6752d4dc911459084eb191c1045f3bf34e2143f3db3d298a66c971a106\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttestationsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\\n\\n/**\\n * @title IAttestationsRegistry\\n * @author Sismo\\n * @notice This is the interface of the AttestationRegistry\\n */\\ninterface IAttestationsRegistry {\\n event AttestationRecorded(Attestation attestation);\\n event AttestationDeleted(Attestation attestation);\\n\\n /**\\n * @dev Main function to be called by authorized issuers\\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\\n */\\n function recordAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Delete function to be called by authorized issuers\\n * @param attestations Attestations to be deleted\\n */\\n function deleteAttestations(Attestation[] calldata attestations) external;\\n\\n /**\\n * @dev Returns whether a user has an attestation from a collection\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\\n\\n /**\\n * @dev Getter of the data of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationData(uint256 collectionId, address owner)\\n external\\n view\\n returns (AttestationData memory);\\n\\n /**\\n * @dev Getter of the value of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\\n\\n /**\\n * @dev Getter of the data of a specific attestation as tuple\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationDataTuple(uint256 collectionId, address owner)\\n external\\n view\\n returns (\\n address,\\n uint256,\\n uint32,\\n bytes memory\\n );\\n\\n /**\\n * @dev Getter of the extraData of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationExtraData(uint256 collectionId, address owner)\\n external\\n view\\n returns (bytes memory);\\n\\n /**\\n * @dev Getter of the issuer of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationIssuer(uint256 collectionId, address owner)\\n external\\n view\\n returns (address);\\n\\n /**\\n * @dev Getter of the timestamp of a specific attestation\\n * @param collectionId Collection identifier of the targeted attestation\\n * @param owner Owner of the targeted attestation\\n */\\n function getAttestationTimestamp(uint256 collectionId, address owner)\\n external\\n view\\n returns (uint32);\\n\\n /**\\n * @dev Getter of the data of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (AttestationData[] memory);\\n\\n /**\\n * @dev Getter of the values of specific attestations\\n * @param collectionIds Collection identifiers of the targeted attestations\\n * @param owners Owners of the targeted attestations\\n */\\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\\n external\\n view\\n returns (uint256[] memory);\\n}\\n\",\"keccak256\":\"0xb5e25bd7e0372c9973e582fb7fe96318c145831a5452d8c79eb848a7464b0297\",\"license\":\"MIT\"},\"contracts/core/interfaces/IAttester.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Request, Attestation} from '../libs/Structs.sol';\\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\\n\\n/**\\n * @title IAttester\\n * @author Sismo\\n * @notice This is the interface for the attesters in Sismo Protocol\\n */\\ninterface IAttester {\\n event AttestationGenerated(Attestation attestation);\\n\\n event AttestationDeleted(Attestation attestation);\\n\\n error AttestationDeletionNotImplemented();\\n\\n /**\\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that has been recorded\\n */\\n function generateAttestations(Request calldata request, bytes calldata proofData)\\n external\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev External facing function. Allows to delete an attestation by submitting proof\\n * @param collectionIds Collection identifier of attestations to delete\\n * @param attestationsOwner Owner of attestations to delete\\n * @param proofData Data sent along the deletion request to prove its validity\\n * @return attestations Attestations that was deleted\\n */\\n function deleteAttestations(\\n uint256[] calldata collectionIds,\\n address attestationsOwner,\\n bytes calldata proofData\\n ) external returns (Attestation[] memory);\\n\\n /**\\n * @dev MANDATORY: must be implemented in attesters\\n * It should build attestations from the user request and the proof\\n * @param request User request\\n * @param proofData Data sent along the request to prove its validity\\n * @return attestations Attestations that will be recorded\\n */\\n function buildAttestations(Request calldata request, bytes calldata proofData)\\n external\\n view\\n returns (Attestation[] memory);\\n\\n /**\\n * @dev Attestation registry address getter\\n * @return attestationRegistry Address of the registry\\n */\\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\\n}\\n\",\"keccak256\":\"0xafe9c1a742d7570033c8d74cee203e09ee9b7461eaed6d2ca77697449e2ce95d\",\"license\":\"MIT\"},\"contracts/core/libs/Structs.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title Attestations Registry State\\n * @author Sismo\\n * @notice This contract holds all of the storage variables and data\\n * structures used by the AttestationsRegistry and parent\\n * contracts.\\n */\\n\\n// User Attestation Request, can be made by any user\\n// The context of an Attestation Request is a specific attester contract\\n// Each attester has groups of accounts in its available data\\n// eg: for a specific attester:\\n// group 1 <=> accounts that sent txs on mainnet\\n// group 2 <=> accounts that sent txs on polygon\\n// eg: for another attester:\\n// group 1 <=> accounts that sent eth txs in 2022\\n// group 2 <=> accounts sent eth txs in 2021\\nstruct Request {\\n // implicit address attester;\\n // implicit uint256 chainId;\\n Claim[] claims;\\n address destination; // destination that will receive the end attestation\\n}\\n\\nstruct Claim {\\n uint256 groupId; // user claims to have an account in this group\\n uint256 claimedValue; // user claims this value for its account in the group\\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\\n}\\n\\n/**\\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\\n * @param collectionId Attestation collection\\n * @param owner Attestation collection\\n * @param issuer Attestation collection\\n * @param value Attestation collection\\n * @param timestamp Attestation collection\\n * @param extraData Attestation collection\\n */\\nstruct Attestation {\\n // implicit uint256 chainId;\\n uint256 collectionId; // Id of the attestation collection (in the registry)\\n address owner; // Owner of the attestation\\n address issuer; // Contract that created or last updated the record.\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\\n // it is different from the recording timestamp (date when the attestation was recorded)\\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\\n// Attestation Data, stored in the registry\\n// The context is a specific owner of a specific collection\\nstruct AttestationData {\\n // implicit uint256 chainId\\n // implicit uint256 collectionId - from context\\n // implicit owner\\n address issuer; // Address of the contract that recorded the attestation\\n uint256 value; // Value of the attestation\\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\\n bytes extraData; // arbitrary data that can be added by the attester\\n}\\n\",\"keccak256\":\"0x893d9a10429878dd4077388ff4da954c20b86a3c172a7bbdd10a01eb5d39b6a0\",\"license\":\"MIT\"},\"contracts/periphery/utils/AvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\n\\n/**\\n * @title Attesters Groups Registry\\n * @author Sismo\\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\\n * For more information: https://available-roots-registry.docs.sismo.io\\n *\\n **/\\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\\n mapping(address => mapping(uint256 => bool)) public _roots;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can register/ unregister roots\\n */\\n constructor(address owner) {\\n initialize(owner);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) public initializer {\\n _transferOwnership(owner);\\n }\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\\n _registerRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\\n _unregisterRootForAttester(attester, root);\\n }\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external onlyOwner {\\n _registerRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external onlyOwner {\\n _unregisterRootForAttester(address(0), root);\\n }\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\\n return _roots[_msgSender()][root] || _roots[address(0)][root];\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\\n return _roots[attester][root] || _roots[address(0)][root];\\n }\\n\\n function _registerRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = true;\\n if (attester == address(0)) {\\n emit RegisteredRootForAll(root);\\n } else {\\n emit RegisteredRootForAttester(attester, root);\\n }\\n }\\n\\n function _unregisterRootForAttester(address attester, uint256 root) internal {\\n _roots[attester][root] = false;\\n if (attester == address(0)) {\\n emit UnregisteredRootForAll(root);\\n } else {\\n emit UnregisteredRootForAttester(attester, root);\\n }\\n }\\n}\\n\",\"keccak256\":\"0x9329ecaf60ffe978c8ab4360e0a8f9bd36e2549e89d672dd39ae80f9a562f9a9\",\"license\":\"MIT\"},\"contracts/periphery/utils/CommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\\n\\n/**\\n * @title Commitment Mapper Registry Contract\\n * @author Sismo\\n * @notice This contract stores information about the commitment mapper.\\n * Its ethereum address and its EdDSA public key\\n * For more information: https://commitment-mapper.docs.sismo.io\\n *\\n **/\\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\\n uint256[2] internal _commitmentMapperPubKey;\\n address _commitmentMapperAddress;\\n\\n /**\\n * @dev Constructor\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n constructor(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) {\\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) public initializer {\\n _transferOwnership(owner);\\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\\n _updateCommitmentMapperAddress(commitmentMapperAddress);\\n }\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\\n }\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\\n _updateCommitmentMapperAddress(newAddress);\\n }\\n\\n /**\\n * @dev Getter of the EdDSA public key of the commitment mapper\\n */\\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\\n return _commitmentMapperPubKey;\\n }\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view override returns (address) {\\n return _commitmentMapperAddress;\\n }\\n\\n function _updateCommitmentMapperAddress(address newAddress) internal {\\n _commitmentMapperAddress = newAddress;\\n emit UpdatedCommitmentMapperAddress(newAddress);\\n }\\n\\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\\n _commitmentMapperPubKey = pubKey;\\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\\n }\\n}\\n\",\"keccak256\":\"0xacb5347ee1a0e8dc25a1ce3e6fbb427db646e833ff8508909454cad7950418d4\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity ^0.8.14;\\n\\n/**\\n * @title IAvailableRootsRegistry\\n * @author Sismo\\n * @notice Interface for (Merkle) Roots Registry\\n */\\ninterface IAvailableRootsRegistry {\\n event RegisteredRootForAttester(address attester, uint256 root);\\n event RegisteredRootForAll(uint256 root);\\n event UnregisteredRootForAttester(address attester, uint256 root);\\n event UnregisteredRootForAll(uint256 root);\\n\\n error CannotRegisterForZeroAddress();\\n error CannotUnregisterForZeroAddress();\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n */\\n function initialize(address owner) external;\\n\\n /**\\n * @dev Register a root available for an attester\\n * @param attester Attester which will have the root available\\n * @param root Root to register\\n */\\n function registerRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Unregister a root for an attester\\n * @param attester Attester which will no longer have the root available\\n * @param root Root to unregister\\n */\\n function unregisterRootForAttester(address attester, uint256 root) external;\\n\\n /**\\n * @dev Registers a root, available for all contracts\\n * @param root Root to register\\n */\\n function registerRootForAll(uint256 root) external;\\n\\n /**\\n * @dev Unregister a root, available for all contracts\\n * @param root Root to unregister\\n */\\n function unregisterRootForAll(uint256 root) external;\\n\\n /**\\n * @dev returns whether a root is available for a caller (msg.sender)\\n * @param root root to check whether it is registered for me or not\\n */\\n function isRootAvailableForMe(uint256 root) external view returns (bool);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param attester Owner of the contract, can update public key and address\\n * @param root Owner of the contract, can update public key and address\\n */\\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x87f5035b58936a8458a22f3cf1b3865bd798813310d86af41af74680978c97c8\",\"license\":\"MIT\"},\"contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity ^0.8.14;\\n\\ninterface ICommitmentMapperRegistry {\\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\\n event UpdatedCommitmentMapperAddress(address newAddress);\\n error PubKeyNotValid(uint256[2] pubKey);\\n\\n /**\\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\\n * @param owner Owner of the contract, can update public key and address\\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\\n * @param commitmentMapperAddress Address of the commitment mapper\\n */\\n function initialize(\\n address owner,\\n uint256[2] memory commitmentMapperEdDSAPubKey,\\n address commitmentMapperAddress\\n ) external;\\n\\n /**\\n * @dev Updates the EdDSA public key\\n * @param newEdDSAPubKey new EdDSA pubic key\\n */\\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\\n\\n /**\\n * @dev Updates the address\\n * @param newAddress new address\\n */\\n function updateCommitmentMapperAddress(address newAddress) external;\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getEdDSAPubKey() external view returns (uint256[2] memory);\\n\\n /**\\n * @dev Getter of the address of the commitment mapper\\n */\\n function getAddress() external view returns (address);\\n}\\n\",\"keccak256\":\"0x8d6298b442dde99ee5a9cc989ada6ea808383a08b1e9bb1d4c2b58adc01eec69\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x6101606040523480156200001257600080fd5b506040516200218c3803806200218c833981016040819052620000359162000088565b6001600160a01b0395861660805293851660c05291841660a0529390921660e05261010092909252610120526101405262000102565b80516001600160a01b03811681146200008357600080fd5b919050565b600080600080600080600060e0888a031215620000a457600080fd5b620000af886200006b565b9650620000bf602089016200006b565b9550620000cf604089016200006b565b9450620000df606089016200006b565b93506080880151925060a0880151915060c0880151905092959891949750929550565b60805160a05160c05160e051610100516101205161014051611ff16200019b6000396000818161013e01526108d30152600081816101ad01526103c901526000818161017301526103a101526000818161023a015281816104e40152818161066601526107a00152600081816101d10152610ec701526000818160d60152610f6301526000818161011501526110be0152611ff16000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063918447af1161008c578063bfa6658511610066578063bfa6658514610238578063c776adde1461025e578063d9895e6a14610271578063e60f999f146102ae57600080fd5b8063918447af146101cf57806392cf369d146101f5578063af411a301461021857600080fd5b80632254f98e146100d457806346657fe9146101135780634e5cf9331461013957806354846d7a1461016e57806363e4afc2146101955780637000b051146101a8575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161010a565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b6100f66101a3366004611537565b6102c1565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b610208610203366004611537565b6102e0565b604051901515815260200161010a565b61022b610226366004611599565b6102f3565b60405161010a91906116c5565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b61022b61026c36600461174c565b6104ce565b61028461027f366004611537565b610745565b6040805182516001600160a01b0316815260209283015163ffffffff16928101929092520161010a565b61022b6102bc366004611599565b610762565b6000818152600160205260408120546001600160a01b03165b92915050565b60006102da6102ee8361087e565b6108ce565b60606000610308610303866118af565b61090e565b60408051600180825281830190925291925060009190816020015b6103746040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816103235750506060830151519091506000906103c5906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611a3f565b90507f000000000000000000000000000000000000000000000000000000000000000081111561041057604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b30600061041d8888610993565b90506040518060c001604052808481526020018a60200160208101906104439190611a57565b6001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff1681526020018260405160200161049191815260200190565b604051602081830303815290604052815250846000815181106104b6576104b6611a74565b60209081029190910101525091979650505050505050565b60608060005b86811015610638576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78d8d8881811061052357610523611a74565b905060200201358c6040518363ffffffff1660e01b815260040161055a9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610577573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261059f9190810190611a9e565b93509350935093506040518060c001604052808d8d888181106105c4576105c4611a74565b9050602002013581526020018b6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061061657610616611a74565b602002602001018190525050505050808061063090611b4e565b9150506104d4565b506106448185856109b8565b61064f818585610a53565b6040516373e4ca1b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e7c994369061069b9084906004016116c5565b600060405180830381600087803b1580156106b557600080fd5b505af11580156106c9573d6000803e3d6000fd5b5050505060005b8681101561073a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070b5761070b611a74565b60200260200101516040516107209190611b67565b60405180910390a18061073281611b4e565b9150506106d0565b509695505050505050565b60408051808201909152600080825260208201526102da8261087e565b606061076f848484610b29565b600061077c8585856102f3565b9050610789858585610b71565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107d59084906004016116c5565b600060405180830381600087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b5050505060005b8151811015610875577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061084657610846611a74565b602002602001015160405161085b9190611b67565b60405180910390a18061086d81611b4e565b91505061080a565b50949350505050565b6040805180820190915260008082526020820152506000908152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff169082015290565b6000427f0000000000000000000000000000000000000000000000000000000000000000836020015163ffffffff166109079190611a3f565b1092915050565b610916611463565b6000826000015160008151811061092f5761092f611a74565b6020026020010151905061094281610c65565b6000816040015180602001905181019061095c9190611b8a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b6000806109a283850185611cbb565b905060006109af82610ca9565b95945050505050565b60005b8351811015610a4d576000846000815181106109d9576109d9611a74565b602002602001015160a001518060200190518101906109f89190611d8c565b6000818152600160205260409020549091506001600160a01b03163314610a3a5760405162f8a2bf60e81b815260048101829052336024820152604401610407565b5080610a4581611b4e565b9150506109bb565b50505050565b60005b8351811015610a4d576000848281518110610a7357610a73611a74565b602002602001015160a00151806020019051810190610a929190611d8c565b6000818152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff1690820152909150610ad6906108ce565b1515600103610afb57604051632fcfdde360e11b815260048101829052602401610407565b600090815260016020526040902080546001600160a01b031916905580610b2181611b4e565b915050610a56565b6000610b3782840184611cbb565b90506000610b4482610cbf565b90506000610b54610303876118af565b9050610b608183610d69565b610b6983611094565b505050505050565b6000610b7d8383610993565b6000818152600160209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910463ffffffff16918301919091529192509015801590610bf15750610bd76040860160208701611a57565b6001600160a01b031681600001516001600160a01b031614155b15610c4257610bff816108ce565b15610c3957604051633f8ffaa560e01b815281516001600160a01b03166004820152602082015163ffffffff166024820152604401610407565b610c428261122d565b610c5b82610c566040880160208901611a57565b61128e565b5050505050565b50565b6000610c7482604001516112f4565b82519091508114610ca55781516040516337e3d1ab60e01b8152610407918391600401918252602082015260400190565b5050565b602081015160009060065b602002015192915050565b610cc76114c6565b604051806101200160405280610cdc84611329565b6001600160a01b03168152602001610cf384611337565b8152602001610d0184611346565b8152602001610d0f84611355565b8152602001610d1d84610ca9565b8152602001610d2b84611364565b8152602001610d3984611373565b8152602001610d518460200151610120015160011490565b15158152602001610d6184611382565b905292915050565b815160c082015114610d9e57815160c082015160405163fe405c7760e01b815260048101929092526024820152604401610407565b81606001516040015115158160e00151151503610de957606082015160409081015160e08301519151634629f1b560e11b815290151560048201529015156024820152604401610407565b81604001516001600160a01b031681600001516001600160a01b031614610e3d57604082810151825191516370a8d99b60e11b81526001600160a01b03918216600482015291166024820152604401610407565b46816020015114610e70576020810151604051630432cec160e31b81524660048201526024810191909152604401610407565b81602001518160a0015114610eab57602082015160a0820151604051630626ade360e41b815260048101929092526024820152604401610407565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a9190611da5565b610f5f57806040015160405163cbfe7bc360e01b815260040161040791815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe29190611dc0565b80516101008401515191925014158061100957506020808201516101008401519091015114155b15611053578051602080830151610100850151805192015160405163318d812b60e01b81526004810194909452602484019190915260448301919091526064820152608401610407565b600061105e846113da565b905080836060015114610a4d5760608301516040516377bb6d2760e11b8152610407918391600401918252602082015260400190565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946110f794909392909190600401611e3c565b602060405180830381865afa925050508015611130575060408051601f3d908101601f1916820190925261112d91810190611da5565b60015b6112065761113c611ec0565b806308c379a0036111755750611150611edc565b8061115b57506111b4565b8060405162dd577760e81b81526004016104079190611f66565b634e487b71036111b457611187611f79565b9061119257506111b4565b60405162dd577760e81b81526020600482015260006024820152604401610407565b3d8080156111de576040519150601f19603f3d011682016040523d82523d6000602084013e6111e3565b606091505b5060405162dd577760e81b81526020600482015260006024820152604401610407565b80610ca55760405162dd577760e81b81526020600482015260006024820152604401610407565b600081815260016020908152604091829020805463ffffffff60a01b1916600160a01b4263ffffffff160217905590518281527f49ab97b1dc68eafe79e6e7f8ff996d00259888e84cb401cf9ec8d39adf7ab196910160405180910390a150565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102da907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611f99565b602081015160009081610cb4565b60208101516000906001610cb4565b60208101516000906004610cb4565b60208101516000906005610cb4565b60208101516000906007610cb4565b60208101516000906008610cb4565b61138a611519565b604051806040016040528083602001516002600a81106113ac576113ac611a74565b6020020151815260200183602001516003600a81106113cd576113cd611a74565b6020020151905292915050565b6000806113f8308460600151600001516001600160801b03166113ff565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113f89190611f99565b6040518060800160405280600081526020016000815260200160006001600160a01b031681526020016114c1604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114c15b60405180604001604052806002906020820280368337509192915050565b60006020828403121561154957600080fd5b5035919050565b60008083601f84011261156257600080fd5b50813567ffffffffffffffff81111561157a57600080fd5b60208301915083602082850101111561159257600080fd5b9250929050565b6000806000604084860312156115ae57600080fd5b833567ffffffffffffffff808211156115c657600080fd5b90850190604082880312156115da57600080fd5b909350602085013590808211156115f057600080fd5b506115fd86828701611550565b9497909650939450505050565b60005b8381101561162557818101518382015260200161160d565b83811115610a4d5750506000910152565b6000815180845261164e81602086016020860161160a565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a08501526116bd60c0850182611636565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561171a57603f19888603018452611708858351611662565b945092850192908501906001016116ec565b5092979650505050505050565b6001600160a01b0381168114610c6257600080fd5b803561174781611727565b919050565b60008060008060006060868803121561176457600080fd5b853567ffffffffffffffff8082111561177c57600080fd5b818801915088601f83011261179057600080fd5b81358181111561179f57600080fd5b8960208260051b85010111156117b457600080fd5b602083019750809650506117ca6020890161173c565b945060408801359150808211156117e057600080fd5b506117ed88828901611550565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b6040810181811067ffffffffffffffff82111715611834576118346117fe565b60405250565b6060810181811067ffffffffffffffff82111715611834576118346117fe565b601f8201601f1916810167ffffffffffffffff81118282101715611880576118806117fe565b6040525050565b600067ffffffffffffffff8211156118a1576118a16117fe565b50601f01601f191660200190565b600060408083360312156118c257600080fd5b80516118cd81611814565b833567ffffffffffffffff808211156118e557600080fd5b9085019036601f8301126118f857600080fd5b813560208282111561190c5761190c6117fe565b8160051b865161191e8383018261185a565b9283528481018201928281013685111561193757600080fd5b83870192505b84831015611a0b578235868111156119555760008081fd5b8701606036829003601f190181131561196e5760008081fd5b8a516119798161183a565b8287013581528b8301358188015290820135908882111561199a5760008081fd5b9181019136603f8401126119b057600091508182fd5b8683013591506119bf82611887565b8c516119cb828261185a565b838152368e8587010111156119e257600091508182fd5b838e86018a830137600093810189019390935250808c019190915282525091830191830161193d565b50865250611a1a88820161173c565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611a5257611a52611a29565b500190565b600060208284031215611a6957600080fd5b81356113f881611727565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff8116811461174757600080fd5b60008060008060808587031215611ab457600080fd5b8451611abf81611727565b60208601519094509250611ad560408601611a8a565b9150606085015167ffffffffffffffff811115611af157600080fd5b8501601f81018713611b0257600080fd5b8051611b0d81611887565b604051611b1a828261185a565b828152896020848601011115611b2f57600080fd5b611b4083602083016020870161160a565b969995985093965050505050565b600060018201611b6057611b60611a29565b5060010190565b6020815260006113f86020830184611662565b8051801515811461174757600080fd5b600060608284031215611b9c57600080fd5b6040516060810181811067ffffffffffffffff82111715611bbf57611bbf6117fe565b60405282516001600160801b0381168114611bd957600080fd5b8152611be760208401611a8a565b6020820152611bf860408401611b7a565b60408201529392505050565b600082601f830112611c1557600080fd5b604051611c2181611814565b806040840185811115611c3357600080fd5b845b81811015611c4d578035835260209283019201611c35565b509195945050505050565b600082601f830112611c6957600080fd5b60405161014080820182811067ffffffffffffffff82111715611c8e57611c8e6117fe565b60405283018185821115611ca157600080fd5b845b82811015611c4d578035825260209182019101611ca3565b6000818303610240811215611ccf57600080fd5b60408051611cdc81611814565b61010080841215611cec57600080fd5b82519350611cf98461183a565b611d038787611c04565b845286605f870112611d1457600080fd5b8251611d1f81611814565b8060c0880189811115611d3157600080fd5b8589015b81811015611d5657611d478b82611c04565b83526020909201918601611d35565b50826020880152611d678a82611c04565b86880152505050838252611d7d87828801611c58565b60208301525095945050505050565b600060208284031215611d9e57600080fd5b5051919050565b600060208284031215611db757600080fd5b6113f882611b7a565b600060408284031215611dd257600080fd5b82601f830112611de157600080fd5b604051611ded81611814565b806040840185811115611dff57600080fd5b845b81811015611c4d578051835260209283019201611e01565b8060005b6002811015610a4d578151845260209384019390910190600101611e1d565b6102408101611e4b8287611e19565b60408083018660005b6002811015611e7b57611e68838351611e19565b9183019160209190910190600101611e54565b50505050611e8c60c0830185611e19565b61010082018360005b600a811015611eb4578151835260209283019290910190600101611e95565b50505095945050505050565b600060033d1115611ed95760046000803e5060005160e01c5b90565b600060443d1015611eea5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611f1a57505050505090565b8285019150815181811115611f325750505050505090565b843d8701016020828501011115611f4c5750505050505090565b611f5b6020828601018761185a565b509095945050505050565b6020815260006113f86020830184611636565b60008060233d1115611f95576020600460003e50506000516001905b9091565b600082611fb657634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220f1374674d2143dc1e1f8e0666c58769f2e4bc209220c094f513f5b717a358ad464736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063918447af1161008c578063bfa6658511610066578063bfa6658514610238578063c776adde1461025e578063d9895e6a14610271578063e60f999f146102ae57600080fd5b8063918447af146101cf57806392cf369d146101f5578063af411a301461021857600080fd5b80632254f98e146100d457806346657fe9146101135780634e5cf9331461013957806354846d7a1461016e57806363e4afc2146101955780637000b051146101a8575b600080fd5b7f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b0390911681526020015b60405180910390f35b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b60405190815260200161010a565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b6100f66101a3366004611537565b6102c1565b6101607f000000000000000000000000000000000000000000000000000000000000000081565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b610208610203366004611537565b6102e0565b604051901515815260200161010a565b61022b610226366004611599565b6102f3565b60405161010a91906116c5565b7f00000000000000000000000000000000000000000000000000000000000000006100f6565b61022b61026c36600461174c565b6104ce565b61028461027f366004611537565b610745565b6040805182516001600160a01b0316815260209283015163ffffffff16928101929092520161010a565b61022b6102bc366004611599565b610762565b6000818152600160205260408120546001600160a01b03165b92915050565b60006102da6102ee8361087e565b6108ce565b60606000610308610303866118af565b61090e565b60408051600180825281830190925291925060009190816020015b6103746040518060c001604052806000815260200160006001600160a01b0316815260200160006001600160a01b0316815260200160008152602001600063ffffffff168152602001606081525090565b8152602001906001900390816103235750506060830151519091506000906103c5906001600160801b03167f0000000000000000000000000000000000000000000000000000000000000000611a3f565b90507f000000000000000000000000000000000000000000000000000000000000000081111561041057604051637bbf29e360e01b8152600481018290526024015b60405180910390fd5b30600061041d8888610993565b90506040518060c001604052808481526020018a60200160208101906104439190611a57565b6001600160a01b03168152602001836001600160a01b031681526020018660200151815260200186606001516020015163ffffffff1681526020018260405160200161049191815260200190565b604051602081830303815290604052815250846000815181106104b6576104b6611a74565b60209081029190910101525091979650505050505050565b60608060005b86811015610638576000806000807f00000000000000000000000000000000000000000000000000000000000000006001600160a01b0316633be1ced78d8d8881811061052357610523611a74565b905060200201358c6040518363ffffffff1660e01b815260040161055a9291909182526001600160a01b0316602082015260400190565b600060405180830381865afa158015610577573d6000803e3d6000fd5b505050506040513d6000823e601f3d908101601f1916820160405261059f9190810190611a9e565b93509350935093506040518060c001604052808d8d888181106105c4576105c4611a74565b9050602002013581526020018b6001600160a01b03168152602001856001600160a01b031681526020018481526020018363ffffffff1681526020018281525086868151811061061657610616611a74565b602002602001018190525050505050808061063090611b4e565b9150506104d4565b506106448185856109b8565b61064f818585610a53565b6040516373e4ca1b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063e7c994369061069b9084906004016116c5565b600060405180830381600087803b1580156106b557600080fd5b505af11580156106c9573d6000803e3d6000fd5b5050505060005b8681101561073a577f01cba57fa881d11e8be5640b6abefb9709f2dd45f776051b2cf5cb8ea23fa56b82828151811061070b5761070b611a74565b60200260200101516040516107209190611b67565b60405180910390a18061073281611b4e565b9150506106d0565b509695505050505050565b60408051808201909152600080825260208201526102da8261087e565b606061076f848484610b29565b600061077c8585856102f3565b9050610789858585610b71565b60405163ebc5c09360e01b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063ebc5c093906107d59084906004016116c5565b600060405180830381600087803b1580156107ef57600080fd5b505af1158015610803573d6000803e3d6000fd5b5050505060005b8151811015610875577f336e708b72b2b4a27a0c25e8cce7f97512e7f1e8dcaf800b100075e62c1eb1fc82828151811061084657610846611a74565b602002602001015160405161085b9190611b67565b60405180910390a18061086d81611b4e565b91505061080a565b50949350505050565b6040805180820190915260008082526020820152506000908152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff169082015290565b6000427f0000000000000000000000000000000000000000000000000000000000000000836020015163ffffffff166109079190611a3f565b1092915050565b610916611463565b6000826000015160008151811061092f5761092f611a74565b6020026020010151905061094281610c65565b6000816040015180602001905181019061095c9190611b8a565b60408051608081018252845181526020948501518582015295909301516001600160a01b0316928501929092525060608301525090565b6000806109a283850185611cbb565b905060006109af82610ca9565b95945050505050565b60005b8351811015610a4d576000846000815181106109d9576109d9611a74565b602002602001015160a001518060200190518101906109f89190611d8c565b6000818152600160205260409020549091506001600160a01b03163314610a3a5760405162f8a2bf60e81b815260048101829052336024820152604401610407565b5080610a4581611b4e565b9150506109bb565b50505050565b60005b8351811015610a4d576000848281518110610a7357610a73611a74565b602002602001015160a00151806020019051810190610a929190611d8c565b6000818152600160209081526040918290208251808401909352546001600160a01b0381168352600160a01b900463ffffffff1690820152909150610ad6906108ce565b1515600103610afb57604051632fcfdde360e11b815260048101829052602401610407565b600090815260016020526040902080546001600160a01b031916905580610b2181611b4e565b915050610a56565b6000610b3782840184611cbb565b90506000610b4482610cbf565b90506000610b54610303876118af565b9050610b608183610d69565b610b6983611094565b505050505050565b6000610b7d8383610993565b6000818152600160209081526040918290208251808401909352546001600160a01b038116808452600160a01b90910463ffffffff16918301919091529192509015801590610bf15750610bd76040860160208701611a57565b6001600160a01b031681600001516001600160a01b031614155b15610c4257610bff816108ce565b15610c3957604051633f8ffaa560e01b815281516001600160a01b03166004820152602082015163ffffffff166024820152604401610407565b610c428261122d565b610c5b82610c566040880160208901611a57565b61128e565b5050505050565b50565b6000610c7482604001516112f4565b82519091508114610ca55781516040516337e3d1ab60e01b8152610407918391600401918252602082015260400190565b5050565b602081015160009060065b602002015192915050565b610cc76114c6565b604051806101200160405280610cdc84611329565b6001600160a01b03168152602001610cf384611337565b8152602001610d0184611346565b8152602001610d0f84611355565b8152602001610d1d84610ca9565b8152602001610d2b84611364565b8152602001610d3984611373565b8152602001610d518460200151610120015160011490565b15158152602001610d6184611382565b905292915050565b815160c082015114610d9e57815160c082015160405163fe405c7760e01b815260048101929092526024820152604401610407565b81606001516040015115158160e00151151503610de957606082015160409081015160e08301519151634629f1b560e11b815290151560048201529015156024820152604401610407565b81604001516001600160a01b031681600001516001600160a01b031614610e3d57604082810151825191516370a8d99b60e11b81526001600160a01b03918216600482015291166024820152604401610407565b46816020015114610e70576020810151604051630432cec160e31b81524660048201526024810191909152604401610407565b81602001518160a0015114610eab57602082015160a0820151604051630626ade360e41b815260048101929092526024820152604401610407565b604081810151905163072f23bd60e51b815260048101919091527f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03169063e5e477a090602401602060405180830381865afa158015610f16573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f3a9190611da5565b610f5f57806040015160405163cbfe7bc360e01b815260040161040791815260200190565b60007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03166359a80d0d6040518163ffffffff1660e01b81526004016040805180830381865afa158015610fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe29190611dc0565b80516101008401515191925014158061100957506020808201516101008401519091015114155b15611053578051602080830151610100850151805192015160405163318d812b60e01b81526004810194909452602484019190915260448301919091526064820152608401610407565b600061105e846113da565b905080836060015114610a4d5760608301516040516377bb6d2760e11b8152610407918391600401918252602082015260400190565b805180516020808301516040938401519185015193516379ddb87b60e11b81526001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169463f3bb70f6946110f794909392909190600401611e3c565b602060405180830381865afa925050508015611130575060408051601f3d908101601f1916820190925261112d91810190611da5565b60015b6112065761113c611ec0565b806308c379a0036111755750611150611edc565b8061115b57506111b4565b8060405162dd577760e81b81526004016104079190611f66565b634e487b71036111b457611187611f79565b9061119257506111b4565b60405162dd577760e81b81526020600482015260006024820152604401610407565b3d8080156111de576040519150601f19603f3d011682016040523d82523d6000602084013e6111e3565b606091505b5060405162dd577760e81b81526020600482015260006024820152604401610407565b80610ca55760405162dd577760e81b81526020600482015260006024820152604401610407565b600081815260016020908152604091829020805463ffffffff60a01b1916600160a01b4263ffffffff160217905590518281527f49ab97b1dc68eafe79e6e7f8ff996d00259888e84cb401cf9ec8d39adf7ab196910160405180910390a150565b60008281526001602090815260409182902080546001600160a01b0319166001600160a01b0385169081179091558251858152918201527f38ff70eda64ebd48cbf0a5a4e1be5c5d509a7cdb60258e5a9210c1c0508dcbef910160405180910390a15050565b805160208201206000906102da907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f000000190611f99565b602081015160009081610cb4565b60208101516000906001610cb4565b60208101516000906004610cb4565b60208101516000906005610cb4565b60208101516000906007610cb4565b60208101516000906008610cb4565b61138a611519565b604051806040016040528083602001516002600a81106113ac576113ac611a74565b6020020151815260200183602001516003600a81106113cd576113cd611a74565b6020020151905292915050565b6000806113f8308460600151600001516001600160801b03166113ff565b9392505050565b604080516001600160a01b03841660208201529081018290526000907f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f0000001906060016040516020818303038152906040528051906020012060001c6113f89190611f99565b6040518060800160405280600081526020016000815260200160006001600160a01b031681526020016114c1604051806060016040528060006001600160801b03168152602001600063ffffffff1681526020016000151581525090565b905290565b60405180610120016040528060006001600160a01b031681526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016000151581526020016114c15b60405180604001604052806002906020820280368337509192915050565b60006020828403121561154957600080fd5b5035919050565b60008083601f84011261156257600080fd5b50813567ffffffffffffffff81111561157a57600080fd5b60208301915083602082850101111561159257600080fd5b9250929050565b6000806000604084860312156115ae57600080fd5b833567ffffffffffffffff808211156115c657600080fd5b90850190604082880312156115da57600080fd5b909350602085013590808211156115f057600080fd5b506115fd86828701611550565b9497909650939450505050565b60005b8381101561162557818101518382015260200161160d565b83811115610a4d5750506000910152565b6000815180845261164e81602086016020860161160a565b601f01601f19169290920160200192915050565b805182526000602082015160018060a01b03808216602086015280604085015116604086015250506060820151606084015263ffffffff608083015116608084015260a082015160c060a08501526116bd60c0850182611636565b949350505050565b6000602080830181845280855180835260408601915060408160051b870101925083870160005b8281101561171a57603f19888603018452611708858351611662565b945092850192908501906001016116ec565b5092979650505050505050565b6001600160a01b0381168114610c6257600080fd5b803561174781611727565b919050565b60008060008060006060868803121561176457600080fd5b853567ffffffffffffffff8082111561177c57600080fd5b818801915088601f83011261179057600080fd5b81358181111561179f57600080fd5b8960208260051b85010111156117b457600080fd5b602083019750809650506117ca6020890161173c565b945060408801359150808211156117e057600080fd5b506117ed88828901611550565b969995985093965092949392505050565b634e487b7160e01b600052604160045260246000fd5b6040810181811067ffffffffffffffff82111715611834576118346117fe565b60405250565b6060810181811067ffffffffffffffff82111715611834576118346117fe565b601f8201601f1916810167ffffffffffffffff81118282101715611880576118806117fe565b6040525050565b600067ffffffffffffffff8211156118a1576118a16117fe565b50601f01601f191660200190565b600060408083360312156118c257600080fd5b80516118cd81611814565b833567ffffffffffffffff808211156118e557600080fd5b9085019036601f8301126118f857600080fd5b813560208282111561190c5761190c6117fe565b8160051b865161191e8383018261185a565b9283528481018201928281013685111561193757600080fd5b83870192505b84831015611a0b578235868111156119555760008081fd5b8701606036829003601f190181131561196e5760008081fd5b8a516119798161183a565b8287013581528b8301358188015290820135908882111561199a5760008081fd5b9181019136603f8401126119b057600091508182fd5b8683013591506119bf82611887565b8c516119cb828261185a565b838152368e8587010111156119e257600091508182fd5b838e86018a830137600093810189019390935250808c019190915282525091830191830161193d565b50865250611a1a88820161173c565b90850152509195945050505050565b634e487b7160e01b600052601160045260246000fd5b60008219821115611a5257611a52611a29565b500190565b600060208284031215611a6957600080fd5b81356113f881611727565b634e487b7160e01b600052603260045260246000fd5b805163ffffffff8116811461174757600080fd5b60008060008060808587031215611ab457600080fd5b8451611abf81611727565b60208601519094509250611ad560408601611a8a565b9150606085015167ffffffffffffffff811115611af157600080fd5b8501601f81018713611b0257600080fd5b8051611b0d81611887565b604051611b1a828261185a565b828152896020848601011115611b2f57600080fd5b611b4083602083016020870161160a565b969995985093965050505050565b600060018201611b6057611b60611a29565b5060010190565b6020815260006113f86020830184611662565b8051801515811461174757600080fd5b600060608284031215611b9c57600080fd5b6040516060810181811067ffffffffffffffff82111715611bbf57611bbf6117fe565b60405282516001600160801b0381168114611bd957600080fd5b8152611be760208401611a8a565b6020820152611bf860408401611b7a565b60408201529392505050565b600082601f830112611c1557600080fd5b604051611c2181611814565b806040840185811115611c3357600080fd5b845b81811015611c4d578035835260209283019201611c35565b509195945050505050565b600082601f830112611c6957600080fd5b60405161014080820182811067ffffffffffffffff82111715611c8e57611c8e6117fe565b60405283018185821115611ca157600080fd5b845b82811015611c4d578035825260209182019101611ca3565b6000818303610240811215611ccf57600080fd5b60408051611cdc81611814565b61010080841215611cec57600080fd5b82519350611cf98461183a565b611d038787611c04565b845286605f870112611d1457600080fd5b8251611d1f81611814565b8060c0880189811115611d3157600080fd5b8589015b81811015611d5657611d478b82611c04565b83526020909201918601611d35565b50826020880152611d678a82611c04565b86880152505050838252611d7d87828801611c58565b60208301525095945050505050565b600060208284031215611d9e57600080fd5b5051919050565b600060208284031215611db757600080fd5b6113f882611b7a565b600060408284031215611dd257600080fd5b82601f830112611de157600080fd5b604051611ded81611814565b806040840185811115611dff57600080fd5b845b81811015611c4d578051835260209283019201611e01565b8060005b6002811015610a4d578151845260209384019390910190600101611e1d565b6102408101611e4b8287611e19565b60408083018660005b6002811015611e7b57611e68838351611e19565b9183019160209190910190600101611e54565b50505050611e8c60c0830185611e19565b61010082018360005b600a811015611eb4578151835260209283019290910190600101611e95565b50505095945050505050565b600060033d1115611ed95760046000803e5060005160e01c5b90565b600060443d1015611eea5790565b6040516003193d81016004833e81513d67ffffffffffffffff8160248401118184111715611f1a57505050505090565b8285019150815181811115611f325750505050505090565b843d8701016020828501011115611f4c5750505050505090565b611f5b6020828601018761185a565b509095945050505050565b6020815260006113f86020830184611636565b60008060233d1115611f95576020600460003e50506000516001905b9091565b600082611fb657634e487b7160e01b600052601260045260246000fd5b50069056fea2646970667358221220f1374674d2143dc1e1f8e0666c58769f2e4bc209220c094f513f5b717a358ad464736f6c634300080e0033", - "devdoc": { - "author": "Sismo", - "kind": "dev", - "methods": { - "buildAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Returns the actual attestations constructed from the user request", - "params": { - "proofData": "snark public input as well as snark proof", - "request": "users request. Claim of having an account part of a group of accounts" - } - }, - "constructor": { - "details": "Constructor. Initializes the contract", - "params": { - "attestationsRegistryAddress": "Attestations Registry contract on which the attester will write attestations", - "availableRootsRegistryAddress": "Registry storing the available groups for this attester (e.g roots of registry merkle trees)", - "collectionIdFirst": "Id of the first collection in which the attester is supposed to record", - "collectionIdLast": "Id of the last collection in which the attester is supposed to record", - "commitmentMapperAddress": "commitment mapper's public key registry", - "hydraS1VerifierAddress": "ZK Snark Hydra-S1 Verifier contract" - } - }, - "deleteAttestations(uint256[],address,bytes)": { - "details": "External facing function. Allows to delete attestations by submitting proof", - "params": { - "attestationsOwner": "Owner of attestations to delete", - "collectionIds": "Collection identifier of attestations to delete", - "proofData": "Data sent along the deletion request to prove its validity" - }, - "returns": { - "_0": "attestations Attestations that were deleted" - } - }, - "generateAttestations(((uint256,uint256,bytes)[],address),bytes)": { - "details": "Main external function. Allows to generate attestations by making a request and submitting proof", - "params": { - "proofData": "Data sent along the request to prove its validity", - "request": "User request" - }, - "returns": { - "_0": "attestations Attestations that has been recorded" - } - }, - "getAttestationRegistry()": { - "details": "Attestation registry getter", - "returns": { - "_0": "attestationRegistry" - } - }, - "getAvailableRootsRegistry()": { - "details": "Getter of Roots Registry Contract" - }, - "getCommitmentMapperRegistry()": { - "details": "Getter of Commitment Mapper Registry contract" - }, - "getDestinationOfTicket(uint256)": { - "details": "Getter, returns the last attestation destination of a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getTicketData(uint256)": { - "details": "Getter, returns the data linked to a ticket", - "params": { - "userTicket": "ticket used*" - } - }, - "getVerifier()": { - "details": "Getter of Hydra-S1 Verifier contract" - }, - "isTicketOnCooldown(uint256)": { - "details": "returns whether a ticket is on cooldown or not", - "params": { - "userTicket": "ticket used*" - } - } - }, - "stateVariables": { - "AUTHORIZED_COLLECTION_ID_FIRST": { - "details": "Getter returns of the first collection in which the attester is supposed to record*" - }, - "AUTHORIZED_COLLECTION_ID_LAST": { - "details": "Getter returns of the last collection in which the attester is supposed to record*" - }, - "SOULBOUND_COOLDOWN_DURATION": { - "details": "Getter returns of the duration of the cooldown period after having used a ticket*" - } - }, - "title": "Hydra-S1 Soulbound Attester", - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "notice": "This attester is part of the family of the Hydra-S1 Attesters. Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way. The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic. We invite readers to refer to: - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1 This specific attester has the following characteristics: - Zero Knowledge One cannot deduct from an attestation what source account was used to generate the underlying proof - Non Strict (scores) If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100. This attester generate attestations of scores - Ticketed Each source account gets one userTicket per claim (i.e only one attestation per source account per claim) For people used to semaphore/ tornado cash people: userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier) - SoulBound (with cooldown period) A user can chose to delete attestations or generate attestation to a new destination. When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional User will need to wait until the end of the cooldown period before being able to delete or switch destination again One can however know that the former and the new destinations were created using the same userTicket - Renewable A userTicket can actually be reused as long as the destination of the attestation remains the same It enables users to renew or update their attestations*", - "version": 1 - }, - "storageLayout": { - "storage": [ - { - "astId": 936, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "_initialized", - "offset": 0, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 939, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "_initializing", - "offset": 1, - "slot": "0", - "type": "t_bool" - }, - { - "astId": 6592, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "_userTicketsData", - "offset": 0, - "slot": "1", - "type": "t_mapping(t_uint256,t_struct(TicketData)6019_storage)" - } - ], - "types": { - "t_address": { - "encoding": "inplace", - "label": "address", - "numberOfBytes": "20" - }, - "t_bool": { - "encoding": "inplace", - "label": "bool", - "numberOfBytes": "1" - }, - "t_mapping(t_uint256,t_struct(TicketData)6019_storage)": { - "encoding": "mapping", - "key": "t_uint256", - "label": "mapping(uint256 => struct IHydraS1SoulboundAttester.TicketData)", - "numberOfBytes": "32", - "value": "t_struct(TicketData)6019_storage" - }, - "t_struct(TicketData)6019_storage": { - "encoding": "inplace", - "label": "struct IHydraS1SoulboundAttester.TicketData", - "members": [ - { - "astId": 6016, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "destination", - "offset": 0, - "slot": "0", - "type": "t_address" - }, - { - "astId": 6018, - "contract": "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol:HydraS1SoulboundAttester", - "label": "cooldownStart", - "offset": 20, - "slot": "0", - "type": "t_uint32" - } - ], - "numberOfBytes": "32" - }, - "t_uint256": { - "encoding": "inplace", - "label": "uint256", - "numberOfBytes": "32" - }, - "t_uint32": { - "encoding": "inplace", - "label": "uint32", - "numberOfBytes": "4" - } - } - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/HydraS1SoulboundAttesterProxy.json b/deployments/sandboxPolygon/HydraS1SoulboundAttesterProxy.json deleted file mode 100644 index 7069717..0000000 --- a/deployments/sandboxPolygon/HydraS1SoulboundAttesterProxy.json +++ /dev/null @@ -1,250 +0,0 @@ -{ - "address": "0x66331568ca321e333aB25a74BCF0c2623730bd4B", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0x20e4d9e13e5ab03542d67fb14659f8ce349f08d80d535b280f2b9d880159bbcb", - "receipt": { - "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0x66331568ca321e333aB25a74BCF0c2623730bd4B", - "transactionIndex": 50, - "gasUsed": "583372", - "logsBloom": "0x00000000000000200000000000000000400000000000000000008000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000002800000000000000000000100000000000000000000000000000004000000000000000000800000000080000000000000000040000000040800000000100000000000000000000000000000000000800000200000000000000000000000000000000000001000000000000000000000004000000020000000000001000000000000000000000400000000120004000000000000000000000000000000000000000000200000000000000000008000100000", - "blockHash": "0x0164de92c1a4bbec885b996246a0382ab1fbea7f50187e3a32718b317371e948", - "transactionHash": "0x20e4d9e13e5ab03542d67fb14659f8ce349f08d80d535b280f2b9d880159bbcb", - "logs": [ - { - "transactionIndex": 50, - "blockNumber": 32513243, - "transactionHash": "0x20e4d9e13e5ab03542d67fb14659f8ce349f08d80d535b280f2b9d880159bbcb", - "address": "0x66331568ca321e333aB25a74BCF0c2623730bd4B", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x000000000000000000000000aa393c9ad1aabeeecedf2a166335b7d30885eaba" - ], - "data": "0x", - "logIndex": 266, - "blockHash": "0x0164de92c1a4bbec885b996246a0382ab1fbea7f50187e3a32718b317371e948" - }, - { - "transactionIndex": 50, - "blockNumber": 32513243, - "transactionHash": "0x20e4d9e13e5ab03542d67fb14659f8ce349f08d80d535b280f2b9d880159bbcb", - "address": "0x66331568ca321e333aB25a74BCF0c2623730bd4B", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002110475dfbb8d331b300178a867372991ff35fa3", - "logIndex": 267, - "blockHash": "0x0164de92c1a4bbec885b996246a0382ab1fbea7f50187e3a32718b317371e948" - }, - { - "transactionIndex": 50, - "blockNumber": 32513243, - "transactionHash": "0x20e4d9e13e5ab03542d67fb14659f8ce349f08d80d535b280f2b9d880159bbcb", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x0000000000000000000000009ead03f7136fc6b4bdb0780b00a1c14ae5a8b6d0" - ], - "data": "0x000000000000000000000000000000000000000000000000003e2f346e1c36d000000000000000000000000000000000000000000000000022fc07535ac9a6af0000000000000000000000000000000000000000000011f81400cec823ec37af00000000000000000000000000000000000000000000000022bdd81eecad6fdf0000000000000000000000000000000000000000000011f8143efdfc92086e7f", - "logIndex": 268, - "blockHash": "0x0164de92c1a4bbec885b996246a0382ab1fbea7f50187e3a32718b317371e948" - } - ], - "blockNumber": 32513243, - "cumulativeGasUsed": "18055740", - "status": 1, - "byzantium": true - }, - "args": [ - "0xAA393C9ad1aaBeEEceDF2a166335B7d30885EAbA", - "0x2110475dfbB8d331b300178A867372991ff35fA3", - "0x" - ], - "numDeployments": 1, - "solcInputHash": "c872f238f220b3571ef309821a459203", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/HydraS1Verifier.json b/deployments/sandboxPolygon/HydraS1Verifier.json deleted file mode 100644 index 2182012..0000000 --- a/deployments/sandboxPolygon/HydraS1Verifier.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "address": "0xD029177639cc29042D2E6D9De985cbE762092529", - "abi": [ - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "a", - "type": "uint256[2]" - }, - { - "internalType": "uint256[2][2]", - "name": "b", - "type": "uint256[2][2]" - }, - { - "internalType": "uint256[2]", - "name": "c", - "type": "uint256[2]" - }, - { - "internalType": "uint256[10]", - "name": "input", - "type": "uint256[10]" - } - ], - "name": "verifyProof", - "outputs": [ - { - "internalType": "bool", - "name": "r", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0xd3ae37fc2ab5b3eed4fbee9d312880ce603af7dfaf7e20af5443b89c47550f16", - "receipt": { - "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0xD029177639cc29042D2E6D9De985cbE762092529", - "transactionIndex": 80, - "gasUsed": "1247435", - "logsBloom": "0x00000000000000200000000000000000000000000000000001000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000004000000000000000000000000000000100000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000004000000000000000000001000000000000000000000000000000100004000000000000000000040000000000000000000000000000000000000000000000100000", - "blockHash": "0x143e409212750475df875d9a9292ca38a5cd088b025ee7f43c0b1bcd4e347118", - "transactionHash": "0xd3ae37fc2ab5b3eed4fbee9d312880ce603af7dfaf7e20af5443b89c47550f16", - "logs": [ - { - "transactionIndex": 80, - "blockNumber": 36625851, - "transactionHash": "0xd3ae37fc2ab5b3eed4fbee9d312880ce603af7dfaf7e20af5443b89c47550f16", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x000000000000000000000000bdbd4347b082d9d6bdf2da4555a37ce52a2e2120" - ], - "data": "0x000000000000000000000000000000000000000000000000008550f7761a405c000000000000000000000000000000000000000000000000c113a98b3dcddc2300000000000000000000000000000000000000000000129cc7a47d3bbc8c2a66000000000000000000000000000000000000000000000000c08e5893c7b39bc700000000000000000000000000000000000000000000129cc829ce3332a66ac2", - "logIndex": 384, - "blockHash": "0x143e409212750475df875d9a9292ca38a5cd088b025ee7f43c0b1bcd4e347118" - } - ], - "blockNumber": 36625851, - "cumulativeGasUsed": "25031202", - "status": 1, - "byzantium": true - }, - "args": [], - "numDeployments": 2, - "solcInputHash": "6edb98fea2bf424a369954d0e80655f6", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"a\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2][2]\",\"name\":\"b\",\"type\":\"uint256[2][2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"c\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[10]\",\"name\":\"input\",\"type\":\"uint256[10]\"}],\"name\":\"verifyProof\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"r\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"verifyProof(uint256[2],uint256[2][2],uint256[2],uint256[10])\":{\"returns\":{\"r\":\" bool true if proof is valid\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":\"HydraS1Verifier\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract HydraS1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [8609986746108439658545470593166889256314951959466775818870246174320018498804,\\n 6848251127850009101372611262053374737897586140140607384018397707035108265914],\\n [21367916863936594568281095443965096905143705300114190558130516981138584550504,\\n 13327705762185115653848159709412003423932761899188342359583872691135383932883]\\n );\\n vk.IC = new Pairing.G1Point[](11);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 19965766170734310004645394427613286415565755728797065894668054116047682895204,\\n 6952067612339183672227137101423582097916038093373585908267153974352032944482\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 13987716160490730015463796942940452666334097189904948795214986996497499925899,\\n 5336810094802209074340875836312868429276540870324469349093948627126061524544\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 14931593253473978964215343699995811275378324235306358485461293343370969283966,\\n 564306919152089917957316877787764763278299990971316475606280877961553231205\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11591267743733991434114686002448165336885445656808796470854638278338319268343,\\n 11495219763417990955889652410266075210402006084183208750635660647824890013350\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 8183184532870222270700473518157259944911700429689031755853536692005688965081,\\n 9121077094104828462137861111631978599019724423614716723152060153405564278301\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 4314095526093128699362232919686741372014146055311239687202926853002748112330,\\n 11665330391505820654128458332883010598817535082070674418723503440883598640597\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\\n 181057165072599074288983745076121344893296348827576905983079816835912241514\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 18925967077785550270509493111690046951994174908254476036944536825999614778001,\\n 4990629719417206796668074534812314525340851981015724652256935997545282642849\\n ); \\n \\n vk.IC[10] = Pairing.G1Point( \\n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[10] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x120f0b311a61cabc9d42ef740c19e5f20b4c8ba400d9a6378e33c76dd54f5c42\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b50611597806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f3bb70f614610030575b600080fd5b61004361003e3660046113ce565b610057565b604051901515815260200160405180910390f35b60006100616111e1565b604080518082018252875181526020808901518183015290835281516080810183528751518184019081528851830151606083015281528251808401845288830180515182525183015181840152818301528382015281518083018352865181528682015181830152838301528151600a8082526101608201909352600092909182016101408036833701905050905060005b600a811015610143578481600a811061010f5761010f6114ac565b6020020151828281518110610126576101266114ac565b60209081029190910101528061013b816114d8565b9150506100f4565b5061014e818361016f565b60000361016057600192505050610167565b6000925050505b949350505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018161019b610366565b9050806080015151855160016101b191906114f1565b146101f85760405162461bcd60e51b81526020600482015260126024820152711d995c9a599a595c8b5898590b5a5b9c1d5d60721b60448201526064015b60405180910390fd5b604080518082019091526000808252602082018190525b86518110156102e9578387828151811061022b5761022b6114ac565b6020026020010151106102805760405162461bcd60e51b815260206004820152601f60248201527f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c640060448201526064016101ef565b6102d5826102d0856080015184600161029991906114f1565b815181106102a9576102a96114ac565b60200260200101518a85815181106102c3576102c36114ac565b6020026020010151610b30565b610bc6565b9150806102e1816114d8565b91505061020f565b50610312818360800151600081518110610305576103056114ac565b6020026020010151610bc6565b90506103486103248660000151610c5f565b8660200151846000015185602001518587604001518b604001518960600151610cfe565b6103585760019350505050610360565b600093505050505b92915050565b61036e611232565b6040805180820182527f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e281527f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d19266020808301919091529083528151608080820184527f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c8285019081527f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab606080850191909152908352845180860186527f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a781527f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec8818601528385015285840192909252835180820185527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28186019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed828501528152845180860186527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa818601528185015285850152835190810184527f1309146df5c443e5db6a7a6e809d782667e59deebf9e8a8e6e622196119ea4f48185019081527f0f23f9080c79c8259f4b3d2442e88c6c1f5a3721f82c1bd3cf33912f4c554fba828401528152835180850185527f2f3dcff69745f046c2bfa13f9c4c81083c41a209f287fa0afb44391b5070bc6881527f1d7736d1e061cab0da0b28c319361de25abd329672d1bec1e29f6fdc604d0fd38185015281840152908401528151600b8082526101808201909352919082015b60408051808201909152600080825260208201528152602001906001900390816105ea57505060808201908152604080518082019091527f2c243922d634f38b0cfa04897932397d47699289aed9b414760d4e729b797d6481527f0f5ebb177a11bce83029d6c7ca0aa97d4f6085fc0fffbc63127ba724e33dd16260208201529051805160009061067d5761067d6114ac565b602002602001018190525060405180604001604052807f084d1b300a1ecc4c0d892345551e790b2d49fe22a1b71fbcd94d0be8931871bb81526020017f24861196b6282d728048cae2ec60fbc8496829a8dfbb4273f731b2b726b0f62881525081608001516001815181106106f4576106f46114ac565b602002602001018190525060405180604001604052807f209369983ced02fe1bdfed53e6c88a12bd3efd860515daa6a398aa73bbb09c7181526020017f28e41e5609c0e714afa30a906663b8ee61baecd274f9d30fd36f9c426ff9e593815250816080015160028151811061076b5761076b6114ac565b602002602001018190525060405180604001604052807f1eecc44c2a661c3f66ae217ec542b70f38b6313e8be081e2a8f95f64c881ad8b81526020017f0bcc87084972fb8309ff46ca4afa1b2934755fb38cff3bdf374c4ab7bda6664081525081608001516003815181106107e2576107e26114ac565b602002602001018190525060405180604001604052807f2102fb775a7dfc364bf6a014da09f86e9144e3239534ab25d3bbd48e4a0afd7e81526020017f013f62eaf435acc457bd2a3d8315dab277c802f0bda44517845768371935bd658152508160800151600481518110610859576108596114ac565b602002602001018190525060405180604001604052807f19a06cd017ddcf6192f42073758c82a6eda2adc572c9be2901c15d6e54b0b9f781526020017f196a10567feeb5a9a1903009034de556585c8ea06b30a73e9b4e88da620026a681525081608001516005815181106108d0576108d06114ac565b602002602001018190525060405180604001604052807f121784b003ec4655b1f312d2011a2117a113d4051e94ce94db805d3d99f5f7d981526020017f142a58c0955ecd67ea19afbcbd0347632d515e9979fcb7d6818de26dbff0561d8152508160800151600681518110610947576109476114ac565b602002602001018190525060405180604001604052807f0989b10899b251f5f04f11415d3d4521b5153f7f4a6d4ac9891d95669f162dca81526020017f19ca57d06136d58c9da48f9bb1aa31eea7d60b19dccdd80b224dd9900afa45d581525081608001516007815181106109be576109be6114ac565b602002602001018190525060405180604001604052807f2b567a1e26a932fa728a650315371e9f9df455a5b0c1c0886bd80d6060a9908981526020017e66798780cd5512ad9f5a2373f1fb64535a8e3c4ad8c33ddc8bd18fc441116a8152508160800151600881518110610a3457610a346114ac565b602002602001018190525060405180604001604052807f29d7b7beed21dea04e4e86841f7ecae70b9af771dd1a05fd97c28240207b9a9181526020017f0b0898a882ba7215368d58cb476b23aa95278245216c92c1823fd2ab7cb5a3a18152508160800151600981518110610aab57610aab6114ac565b602002602001018190525060405180604001604052807f102f5e9ec24f58ddf1d39e018b5367ef9ea173301e98cdd899627bd14762ee6981526020017f068105d1e3d4238ec4274b68a5177670d700a905e46fd5c6779ef83d6916c4f18152508160800151600a81518110610b2257610b226114ac565b602002602001018190525090565b6040805180820190915260008082526020820152610b4c611283565b835181526020808501519082015260408101839052600060608360808460076107d05a03fa90508080610b7b57fe5b5080610bbe5760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5b5d5b0b59985a5b195960721b60448201526064016101ef565b505092915050565b6040805180820190915260008082526020820152610be26112a1565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa90508080610c1c57fe5b5080610bbe5760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5859190b59985a5b195960721b60448201526064016101ef565b604080518082019091526000808252602082015281517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4790158015610ca657506020830151155b15610cc65750506040805180820190915260008082526020820152919050565b604051806040016040528084600001518152602001828560200151610ceb9190611509565b610cf5908461152b565b90529392505050565b60408051600480825260a08201909252600091829190816020015b6040805180820190915260008082526020820152815260200190600190039081610d1957505060408051600480825260a0820190925291925060009190602082015b610d636112bf565b815260200190600190039081610d5b5790505090508a82600081518110610d8c57610d8c6114ac565b60200260200101819052508882600181518110610dab57610dab6114ac565b60200260200101819052508682600281518110610dca57610dca6114ac565b60200260200101819052508482600381518110610de957610de96114ac565b60200260200101819052508981600081518110610e0857610e086114ac565b60200260200101819052508781600181518110610e2757610e276114ac565b60200260200101819052508581600281518110610e4657610e466114ac565b60200260200101819052508381600381518110610e6557610e656114ac565b6020026020010181905250610e7a8282610e89565b9b9a5050505050505050505050565b60008151835114610ed55760405162461bcd60e51b81526020600482015260166024820152751c185a5c9a5b99cb5b195b99dd1a1ccb59985a5b195960521b60448201526064016101ef565b82516000610ee4826006611542565b905060008167ffffffffffffffff811115610f0157610f0161131b565b604051908082528060200260200182016040528015610f2a578160200160208202803683370190505b50905060005b8381101561116557868181518110610f4a57610f4a6114ac565b60200260200101516000015182826006610f649190611542565b610f6f9060006114f1565b81518110610f7f57610f7f6114ac565b602002602001018181525050868181518110610f9d57610f9d6114ac565b60200260200101516020015182826006610fb79190611542565b610fc29060016114f1565b81518110610fd257610fd26114ac565b602002602001018181525050858181518110610ff057610ff06114ac565b6020908102919091010151515182611009836006611542565b6110149060026114f1565b81518110611024576110246114ac565b602002602001018181525050858181518110611042576110426114ac565b6020908102919091018101515101518261105d836006611542565b6110689060036114f1565b81518110611078576110786114ac565b602002602001018181525050858181518110611096576110966114ac565b6020026020010151602001516000600281106110b4576110b46114ac565b6020020151826110c5836006611542565b6110d09060046114f1565b815181106110e0576110e06114ac565b6020026020010181815250508581815181106110fe576110fe6114ac565b60200260200101516020015160016002811061111c5761111c6114ac565b60200201518261112d836006611542565b6111389060056114f1565b81518110611148576111486114ac565b60209081029190910101528061115d816114d8565b915050610f30565b5061116e6112df565b6000602082602086026020860160086107d05a03fa9050808061118d57fe5b50806111d35760405162461bcd60e51b81526020600482015260156024820152741c185a5c9a5b99cb5bdc18dbd9194b59985a5b1959605a1b60448201526064016101ef565b505115159695505050505050565b6040805160a08101909152600060608201818152608083019190915281526020810161120b6112bf565b815260200161122d604051806040016040528060008152602001600081525090565b905290565b6040805160e08101909152600060a0820181815260c083019190915281526020810161125c6112bf565b81526020016112696112bf565b81526020016112766112bf565b8152602001606081525090565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b60405180604001604052806112d26112fd565b815260200161122d6112fd565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156113545761135461131b565b60405290565b604051610140810167ffffffffffffffff811182821017156113545761135461131b565b600082601f83011261138f57600080fd5b611397611331565b8060408401858111156113a957600080fd5b845b818110156113c35780358452602093840193016113ab565b509095945050505050565b6000806000806102408086880312156113e657600080fd5b6113f0878761137e565b9450604087605f88011261140357600080fd5b61140b611331565b8060c089018a81111561141d57600080fd5b838a015b81811015611442576114338c8261137e565b84526020909301928401611421565b508197506114508b8261137e565b9650505050508661011f87011261146657600080fd5b61146e61135a565b90860190808883111561148057600080fd5b61010088015b8381101561149e578035835260209283019201611486565b509598949750929550505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016114ea576114ea6114c2565b5060010190565b60008219821115611504576115046114c2565b500190565b60008261152657634e487b7160e01b600052601260045260246000fd5b500690565b60008282101561153d5761153d6114c2565b500390565b600081600019048311821515161561155c5761155c6114c2565b50029056fea264697066735822122032bcacece0452dcb73e92b9569837e33c48751c237fdb79a212c6dfad1fb31b364736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063f3bb70f614610030575b600080fd5b61004361003e3660046113ce565b610057565b604051901515815260200160405180910390f35b60006100616111e1565b604080518082018252875181526020808901518183015290835281516080810183528751518184019081528851830151606083015281528251808401845288830180515182525183015181840152818301528382015281518083018352865181528682015181830152838301528151600a8082526101608201909352600092909182016101408036833701905050905060005b600a811015610143578481600a811061010f5761010f6114ac565b6020020151828281518110610126576101266114ac565b60209081029190910101528061013b816114d8565b9150506100f4565b5061014e818361016f565b60000361016057600192505050610167565b6000925050505b949350505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018161019b610366565b9050806080015151855160016101b191906114f1565b146101f85760405162461bcd60e51b81526020600482015260126024820152711d995c9a599a595c8b5898590b5a5b9c1d5d60721b60448201526064015b60405180910390fd5b604080518082019091526000808252602082018190525b86518110156102e9578387828151811061022b5761022b6114ac565b6020026020010151106102805760405162461bcd60e51b815260206004820152601f60248201527f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c640060448201526064016101ef565b6102d5826102d0856080015184600161029991906114f1565b815181106102a9576102a96114ac565b60200260200101518a85815181106102c3576102c36114ac565b6020026020010151610b30565b610bc6565b9150806102e1816114d8565b91505061020f565b50610312818360800151600081518110610305576103056114ac565b6020026020010151610bc6565b90506103486103248660000151610c5f565b8660200151846000015185602001518587604001518b604001518960600151610cfe565b6103585760019350505050610360565b600093505050505b92915050565b61036e611232565b6040805180820182527f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e281527f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d19266020808301919091529083528151608080820184527f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c8285019081527f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab606080850191909152908352845180860186527f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a781527f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec8818601528385015285840192909252835180820185527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28186019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed828501528152845180860186527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa818601528185015285850152835190810184527f1309146df5c443e5db6a7a6e809d782667e59deebf9e8a8e6e622196119ea4f48185019081527f0f23f9080c79c8259f4b3d2442e88c6c1f5a3721f82c1bd3cf33912f4c554fba828401528152835180850185527f2f3dcff69745f046c2bfa13f9c4c81083c41a209f287fa0afb44391b5070bc6881527f1d7736d1e061cab0da0b28c319361de25abd329672d1bec1e29f6fdc604d0fd38185015281840152908401528151600b8082526101808201909352919082015b60408051808201909152600080825260208201528152602001906001900390816105ea57505060808201908152604080518082019091527f2c243922d634f38b0cfa04897932397d47699289aed9b414760d4e729b797d6481527f0f5ebb177a11bce83029d6c7ca0aa97d4f6085fc0fffbc63127ba724e33dd16260208201529051805160009061067d5761067d6114ac565b602002602001018190525060405180604001604052807f084d1b300a1ecc4c0d892345551e790b2d49fe22a1b71fbcd94d0be8931871bb81526020017f24861196b6282d728048cae2ec60fbc8496829a8dfbb4273f731b2b726b0f62881525081608001516001815181106106f4576106f46114ac565b602002602001018190525060405180604001604052807f209369983ced02fe1bdfed53e6c88a12bd3efd860515daa6a398aa73bbb09c7181526020017f28e41e5609c0e714afa30a906663b8ee61baecd274f9d30fd36f9c426ff9e593815250816080015160028151811061076b5761076b6114ac565b602002602001018190525060405180604001604052807f1eecc44c2a661c3f66ae217ec542b70f38b6313e8be081e2a8f95f64c881ad8b81526020017f0bcc87084972fb8309ff46ca4afa1b2934755fb38cff3bdf374c4ab7bda6664081525081608001516003815181106107e2576107e26114ac565b602002602001018190525060405180604001604052807f2102fb775a7dfc364bf6a014da09f86e9144e3239534ab25d3bbd48e4a0afd7e81526020017f013f62eaf435acc457bd2a3d8315dab277c802f0bda44517845768371935bd658152508160800151600481518110610859576108596114ac565b602002602001018190525060405180604001604052807f19a06cd017ddcf6192f42073758c82a6eda2adc572c9be2901c15d6e54b0b9f781526020017f196a10567feeb5a9a1903009034de556585c8ea06b30a73e9b4e88da620026a681525081608001516005815181106108d0576108d06114ac565b602002602001018190525060405180604001604052807f121784b003ec4655b1f312d2011a2117a113d4051e94ce94db805d3d99f5f7d981526020017f142a58c0955ecd67ea19afbcbd0347632d515e9979fcb7d6818de26dbff0561d8152508160800151600681518110610947576109476114ac565b602002602001018190525060405180604001604052807f0989b10899b251f5f04f11415d3d4521b5153f7f4a6d4ac9891d95669f162dca81526020017f19ca57d06136d58c9da48f9bb1aa31eea7d60b19dccdd80b224dd9900afa45d581525081608001516007815181106109be576109be6114ac565b602002602001018190525060405180604001604052807f2b567a1e26a932fa728a650315371e9f9df455a5b0c1c0886bd80d6060a9908981526020017e66798780cd5512ad9f5a2373f1fb64535a8e3c4ad8c33ddc8bd18fc441116a8152508160800151600881518110610a3457610a346114ac565b602002602001018190525060405180604001604052807f29d7b7beed21dea04e4e86841f7ecae70b9af771dd1a05fd97c28240207b9a9181526020017f0b0898a882ba7215368d58cb476b23aa95278245216c92c1823fd2ab7cb5a3a18152508160800151600981518110610aab57610aab6114ac565b602002602001018190525060405180604001604052807f102f5e9ec24f58ddf1d39e018b5367ef9ea173301e98cdd899627bd14762ee6981526020017f068105d1e3d4238ec4274b68a5177670d700a905e46fd5c6779ef83d6916c4f18152508160800151600a81518110610b2257610b226114ac565b602002602001018190525090565b6040805180820190915260008082526020820152610b4c611283565b835181526020808501519082015260408101839052600060608360808460076107d05a03fa90508080610b7b57fe5b5080610bbe5760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5b5d5b0b59985a5b195960721b60448201526064016101ef565b505092915050565b6040805180820190915260008082526020820152610be26112a1565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa90508080610c1c57fe5b5080610bbe5760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5859190b59985a5b195960721b60448201526064016101ef565b604080518082019091526000808252602082015281517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4790158015610ca657506020830151155b15610cc65750506040805180820190915260008082526020820152919050565b604051806040016040528084600001518152602001828560200151610ceb9190611509565b610cf5908461152b565b90529392505050565b60408051600480825260a08201909252600091829190816020015b6040805180820190915260008082526020820152815260200190600190039081610d1957505060408051600480825260a0820190925291925060009190602082015b610d636112bf565b815260200190600190039081610d5b5790505090508a82600081518110610d8c57610d8c6114ac565b60200260200101819052508882600181518110610dab57610dab6114ac565b60200260200101819052508682600281518110610dca57610dca6114ac565b60200260200101819052508482600381518110610de957610de96114ac565b60200260200101819052508981600081518110610e0857610e086114ac565b60200260200101819052508781600181518110610e2757610e276114ac565b60200260200101819052508581600281518110610e4657610e466114ac565b60200260200101819052508381600381518110610e6557610e656114ac565b6020026020010181905250610e7a8282610e89565b9b9a5050505050505050505050565b60008151835114610ed55760405162461bcd60e51b81526020600482015260166024820152751c185a5c9a5b99cb5b195b99dd1a1ccb59985a5b195960521b60448201526064016101ef565b82516000610ee4826006611542565b905060008167ffffffffffffffff811115610f0157610f0161131b565b604051908082528060200260200182016040528015610f2a578160200160208202803683370190505b50905060005b8381101561116557868181518110610f4a57610f4a6114ac565b60200260200101516000015182826006610f649190611542565b610f6f9060006114f1565b81518110610f7f57610f7f6114ac565b602002602001018181525050868181518110610f9d57610f9d6114ac565b60200260200101516020015182826006610fb79190611542565b610fc29060016114f1565b81518110610fd257610fd26114ac565b602002602001018181525050858181518110610ff057610ff06114ac565b6020908102919091010151515182611009836006611542565b6110149060026114f1565b81518110611024576110246114ac565b602002602001018181525050858181518110611042576110426114ac565b6020908102919091018101515101518261105d836006611542565b6110689060036114f1565b81518110611078576110786114ac565b602002602001018181525050858181518110611096576110966114ac565b6020026020010151602001516000600281106110b4576110b46114ac565b6020020151826110c5836006611542565b6110d09060046114f1565b815181106110e0576110e06114ac565b6020026020010181815250508581815181106110fe576110fe6114ac565b60200260200101516020015160016002811061111c5761111c6114ac565b60200201518261112d836006611542565b6111389060056114f1565b81518110611148576111486114ac565b60209081029190910101528061115d816114d8565b915050610f30565b5061116e6112df565b6000602082602086026020860160086107d05a03fa9050808061118d57fe5b50806111d35760405162461bcd60e51b81526020600482015260156024820152741c185a5c9a5b99cb5bdc18dbd9194b59985a5b1959605a1b60448201526064016101ef565b505115159695505050505050565b6040805160a08101909152600060608201818152608083019190915281526020810161120b6112bf565b815260200161122d604051806040016040528060008152602001600081525090565b905290565b6040805160e08101909152600060a0820181815260c083019190915281526020810161125c6112bf565b81526020016112696112bf565b81526020016112766112bf565b8152602001606081525090565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b60405180604001604052806112d26112fd565b815260200161122d6112fd565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156113545761135461131b565b60405290565b604051610140810167ffffffffffffffff811182821017156113545761135461131b565b600082601f83011261138f57600080fd5b611397611331565b8060408401858111156113a957600080fd5b845b818110156113c35780358452602093840193016113ab565b509095945050505050565b6000806000806102408086880312156113e657600080fd5b6113f0878761137e565b9450604087605f88011261140357600080fd5b61140b611331565b8060c089018a81111561141d57600080fd5b838a015b81811015611442576114338c8261137e565b84526020909301928401611421565b508197506114508b8261137e565b9650505050508661011f87011261146657600080fd5b61146e61135a565b90860190808883111561148057600080fd5b61010088015b8381101561149e578035835260209283019201611486565b509598949750929550505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016114ea576114ea6114c2565b5060010190565b60008219821115611504576115046114c2565b500190565b60008261152657634e487b7160e01b600052601260045260246000fd5b500690565b60008282101561153d5761153d6114c2565b500390565b600081600019048311821515161561155c5761155c6114c2565b50029056fea264697066735822122032bcacece0452dcb73e92b9569837e33c48751c237fdb79a212c6dfad1fb31b364736f6c634300080e0033", - "devdoc": { - "kind": "dev", - "methods": { - "verifyProof(uint256[2],uint256[2][2],uint256[2],uint256[10])": { - "returns": { - "r": " bool true if proof is valid" - } - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/Pythia1SimpleAttesterProxy.json b/deployments/sandboxPolygon/Pythia1SimpleAttesterProxy.json deleted file mode 100644 index 20b012a..0000000 --- a/deployments/sandboxPolygon/Pythia1SimpleAttesterProxy.json +++ /dev/null @@ -1,276 +0,0 @@ -{ - "address": "0x5ee338769C0205c19c0Bf21C35A42b1645B89998", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "address", - "name": "admin_", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "inputs": [], - "name": "admin", - "outputs": [ - { - "internalType": "address", - "name": "admin_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "changeAdmin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "implementation", - "outputs": [ - { - "internalType": "address", - "name": "implementation_", - "type": "address" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - } - ], - "name": "upgradeTo", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newImplementation", - "type": "address" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "upgradeToAndCall", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "transactionHash": "0xef2cdd69043b65d8ab5fc79eb617795d00e9d38e8c740d3309527ebcebbfcb56", - "receipt": { - "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0x5ee338769C0205c19c0Bf21C35A42b1645B89998", - "transactionIndex": 22, - "gasUsed": "657789", - "logsBloom": "0x00000000000000200000000000000000400000000000000000800000000000000000000000000000000000000000000000008000020040002000000000000000000000000000000000000000000002800001000000000020000100000000000000000000020000000000000000000800000000800000000080000000000000400000000000000000000000101000000000000000000000000000000000800000200000000000000000200000000000000000000000000000000000000000004000800020000000000001000000008000000000000400000000100004000020000000020000000000000000000000000000000200080000000000008000100000", - "blockHash": "0xf795132580f78557fafde89fc11869b450b09869b7611871651ed07afbd8776a", - "transactionHash": "0xef2cdd69043b65d8ab5fc79eb617795d00e9d38e8c740d3309527ebcebbfcb56", - "logs": [ - { - "transactionIndex": 22, - "blockNumber": 32525896, - "transactionHash": "0xef2cdd69043b65d8ab5fc79eb617795d00e9d38e8c740d3309527ebcebbfcb56", - "address": "0x5ee338769C0205c19c0Bf21C35A42b1645B89998", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x0000000000000000000000009e7075c4eeedeb67c56028c1ecc4fc96d30b6d36" - ], - "data": "0x", - "logIndex": 72, - "blockHash": "0xf795132580f78557fafde89fc11869b450b09869b7611871651ed07afbd8776a" - }, - { - "transactionIndex": 22, - "blockNumber": 32525896, - "transactionHash": "0xef2cdd69043b65d8ab5fc79eb617795d00e9d38e8c740d3309527ebcebbfcb56", - "address": "0x5ee338769C0205c19c0Bf21C35A42b1645B89998", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e" - ], - "data": "0x", - "logIndex": 73, - "blockHash": "0xf795132580f78557fafde89fc11869b450b09869b7611871651ed07afbd8776a" - }, - { - "transactionIndex": 22, - "blockNumber": 32525896, - "transactionHash": "0xef2cdd69043b65d8ab5fc79eb617795d00e9d38e8c740d3309527ebcebbfcb56", - "address": "0x5ee338769C0205c19c0Bf21C35A42b1645B89998", - "topics": [ - "0xda2ca1df50078dd7395bf2d1fe6c66f2133d7b56d4d1e671f564010981f204df" - ], - "data": "0x2f8eeb980ebc1342070a35514e1f42fa96381de8f080d3713e80fe99c883d4e9018683c5d2f1f71d7e8b65ab0990635c019de9183359db7e80543c485426e490", - "logIndex": 74, - "blockHash": "0xf795132580f78557fafde89fc11869b450b09869b7611871651ed07afbd8776a" - }, - { - "transactionIndex": 22, - "blockNumber": 32525896, - "transactionHash": "0xef2cdd69043b65d8ab5fc79eb617795d00e9d38e8c740d3309527ebcebbfcb56", - "address": "0x5ee338769C0205c19c0Bf21C35A42b1645B89998", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000002110475dfbb8d331b300178a867372991ff35fa3", - "logIndex": 75, - "blockHash": "0xf795132580f78557fafde89fc11869b450b09869b7611871651ed07afbd8776a" - }, - { - "transactionIndex": 22, - "blockNumber": 32525896, - "transactionHash": "0xef2cdd69043b65d8ab5fc79eb617795d00e9d38e8c740d3309527ebcebbfcb56", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x00000000000000000000000067b94473d81d0cd00849d563c94d0432ac988b49" - ], - "data": "0x00000000000000000000000000000000000000000000000000728286606d020000000000000000000000000000000000000000000000000020336556c368a5c500000000000000000000000000000000000000000000036478323044d67858fd0000000000000000000000000000000000000000000000001fc0e2d062fba3c500000000000000000000000000000000000000000000036478a4b2cb36e55afd", - "logIndex": 76, - "blockHash": "0xf795132580f78557fafde89fc11869b450b09869b7611871651ed07afbd8776a" - } - ], - "blockNumber": 32525896, - "cumulativeGasUsed": "4216779", - "status": 1, - "byzantium": true - }, - "args": [ - "0x9e7075C4eEedEb67C56028c1ecC4FC96d30B6D36", - "0x2110475dfbB8d331b300178A867372991ff35fA3", - "0xc9cdef042f8eeb980ebc1342070a35514e1f42fa96381de8f080d3713e80fe99c883d4e9018683c5d2f1f71d7e8b65ab0990635c019de9183359db7e80543c485426e490000000000000000000000000597660c921af06523a458d2596680db1d631732e" - ], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"stateMutability\":\"payable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"previousAdmin\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"AdminChanged\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"beacon\",\"type\":\"address\"}],\"name\":\"BeaconUpgraded\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":true,\"internalType\":\"address\",\"name\":\"implementation\",\"type\":\"address\"}],\"name\":\"Upgraded\",\"type\":\"event\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"admin\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"admin_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newAdmin\",\"type\":\"address\"}],\"name\":\"changeAdmin\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"implementation\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"implementation_\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"}],\"name\":\"upgradeTo\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newImplementation\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"upgradeToAndCall\",\"outputs\":[],\"stateMutability\":\"payable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"details\":\"This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \\\"admin cannot fallback to proxy target\\\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\",\"kind\":\"dev\",\"methods\":{\"admin()\":{\"details\":\"Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\"},\"changeAdmin(address)\":{\"details\":\"Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\"},\"constructor\":{\"details\":\"Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\"},\"implementation()\":{\"details\":\"Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\"},\"upgradeTo(address)\":{\"details\":\"Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\"},\"upgradeToAndCall(address,bytes)\":{\"details\":\"Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":\"TransparentUpgradeableProxy\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts/interfaces/draft-IERC1822.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\\n * proxy whose upgrades are fully controlled by the current implementation.\\n */\\ninterface IERC1822Proxiable {\\n /**\\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\\n * address.\\n *\\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\\n * function revert if invoked through a proxy.\\n */\\n function proxiableUUID() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x1d4afe6cb24200cc4545eed814ecf5847277dfe5d613a1707aad5fceecebcfff\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../Proxy.sol\\\";\\nimport \\\"./ERC1967Upgrade.sol\\\";\\n\\n/**\\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\\n * implementation address that can be changed. This address is stored in storage in the location specified by\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\\n * implementation behind the proxy.\\n */\\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\\n /**\\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\\n *\\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\\n */\\n constructor(address _logic, bytes memory _data) payable {\\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\\\"eip1967.proxy.implementation\\\")) - 1));\\n _upgradeToAndCall(_logic, _data, false);\\n }\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _implementation() internal view virtual override returns (address impl) {\\n return ERC1967Upgrade._getImplementation();\\n }\\n}\\n\",\"keccak256\":\"0x6309f9f39dc6f4f45a24f296543867aa358e32946cd6b2874627a996d606b3a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../beacon/IBeacon.sol\\\";\\nimport \\\"../../interfaces/draft-IERC1822.sol\\\";\\nimport \\\"../../utils/Address.sol\\\";\\nimport \\\"../../utils/StorageSlot.sol\\\";\\n\\n/**\\n * @dev This abstract contract provides getters and event emitting update functions for\\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\\n *\\n * _Available since v4.1._\\n *\\n * @custom:oz-upgrades-unsafe-allow delegatecall\\n */\\nabstract contract ERC1967Upgrade {\\n // This is the keccak-256 hash of \\\"eip1967.proxy.rollback\\\" subtracted by 1\\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\\n\\n /**\\n * @dev Storage slot with the address of the current implementation.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.implementation\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n\\n /**\\n * @dev Emitted when the implementation is upgraded.\\n */\\n event Upgraded(address indexed implementation);\\n\\n /**\\n * @dev Returns the current implementation address.\\n */\\n function _getImplementation() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 implementation slot.\\n */\\n function _setImplementation(address newImplementation) private {\\n require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n }\\n\\n /**\\n * @dev Perform implementation upgrade\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeTo(address newImplementation) internal {\\n _setImplementation(newImplementation);\\n emit Upgraded(newImplementation);\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCall(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _upgradeTo(newImplementation);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(newImplementation, data);\\n }\\n }\\n\\n /**\\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\\n *\\n * Emits an {Upgraded} event.\\n */\\n function _upgradeToAndCallUUPS(\\n address newImplementation,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n // Upgrades from old implementations will perform a rollback test. This test requires the new\\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\\n // this special case will break upgrade paths from old UUPS implementation to new ones.\\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\\n _setImplementation(newImplementation);\\n } else {\\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\\n require(slot == _IMPLEMENTATION_SLOT, \\\"ERC1967Upgrade: unsupported proxiableUUID\\\");\\n } catch {\\n revert(\\\"ERC1967Upgrade: new implementation is not UUPS\\\");\\n }\\n _upgradeToAndCall(newImplementation, data, forceCall);\\n }\\n }\\n\\n /**\\n * @dev Storage slot with the admin of the contract.\\n * This is the keccak-256 hash of \\\"eip1967.proxy.admin\\\" subtracted by 1, and is\\n * validated in the constructor.\\n */\\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\\n\\n /**\\n * @dev Emitted when the admin account has changed.\\n */\\n event AdminChanged(address previousAdmin, address newAdmin);\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _getAdmin() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new address in the EIP1967 admin slot.\\n */\\n function _setAdmin(address newAdmin) private {\\n require(newAdmin != address(0), \\\"ERC1967: new admin is the zero address\\\");\\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n */\\n function _changeAdmin(address newAdmin) internal {\\n emit AdminChanged(_getAdmin(), newAdmin);\\n _setAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\\n */\\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\\n\\n /**\\n * @dev Emitted when the beacon is upgraded.\\n */\\n event BeaconUpgraded(address indexed beacon);\\n\\n /**\\n * @dev Returns the current beacon.\\n */\\n function _getBeacon() internal view returns (address) {\\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\\n }\\n\\n /**\\n * @dev Stores a new beacon in the EIP1967 beacon slot.\\n */\\n function _setBeacon(address newBeacon) private {\\n require(Address.isContract(newBeacon), \\\"ERC1967: new beacon is not a contract\\\");\\n require(\\n Address.isContract(IBeacon(newBeacon).implementation()),\\n \\\"ERC1967: beacon implementation is not a contract\\\"\\n );\\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\\n }\\n\\n /**\\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\\n *\\n * Emits a {BeaconUpgraded} event.\\n */\\n function _upgradeBeaconToAndCall(\\n address newBeacon,\\n bytes memory data,\\n bool forceCall\\n ) internal {\\n _setBeacon(newBeacon);\\n emit BeaconUpgraded(newBeacon);\\n if (data.length > 0 || forceCall) {\\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\\n }\\n }\\n}\\n\",\"keccak256\":\"0xabf3f59bc0e5423eae45e459dbe92e7052c6983628d39008590edc852a62f94a\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/Proxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\\n * be specified by overriding the virtual {_implementation} function.\\n *\\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\\n * different contract through the {_delegate} function.\\n *\\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\\n */\\nabstract contract Proxy {\\n /**\\n * @dev Delegates the current call to `implementation`.\\n *\\n * This function does not return to its internal call site, it will return directly to the external caller.\\n */\\n function _delegate(address implementation) internal virtual {\\n assembly {\\n // Copy msg.data. We take full control of memory in this inline assembly\\n // block because it will not return to Solidity code. We overwrite the\\n // Solidity scratch pad at memory position 0.\\n calldatacopy(0, 0, calldatasize())\\n\\n // Call the implementation.\\n // out and outsize are 0 because we don't know the size yet.\\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\\n\\n // Copy the returned data.\\n returndatacopy(0, 0, returndatasize())\\n\\n switch result\\n // delegatecall returns 0 on error.\\n case 0 {\\n revert(0, returndatasize())\\n }\\n default {\\n return(0, returndatasize())\\n }\\n }\\n }\\n\\n /**\\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\\n * and {_fallback} should delegate.\\n */\\n function _implementation() internal view virtual returns (address);\\n\\n /**\\n * @dev Delegates the current call to the address returned by `_implementation()`.\\n *\\n * This function does not return to its internall call site, it will return directly to the external caller.\\n */\\n function _fallback() internal virtual {\\n _beforeFallback();\\n _delegate(_implementation());\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\\n * function in the contract matches the call data.\\n */\\n fallback() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\\n * is empty.\\n */\\n receive() external payable virtual {\\n _fallback();\\n }\\n\\n /**\\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\\n * call, or as part of the Solidity `fallback` or `receive` functions.\\n *\\n * If overriden should call `super._beforeFallback()`.\\n */\\n function _beforeFallback() internal virtual {}\\n}\\n\",\"keccak256\":\"0x0edeb16b9821ae2b16e9d69c383b38d3ad2fbb3e0c06cf809a0786d96e602551\",\"license\":\"MIT\"},\"@openzeppelin/contracts/proxy/beacon/IBeacon.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\\n */\\ninterface IBeacon {\\n /**\\n * @dev Must return an address that can be used as a delegate call target.\\n *\\n * {BeaconProxy} will check that this address is a contract.\\n */\\n function implementation() external view returns (address);\\n}\\n\",\"keccak256\":\"0xd50a3421ac379ccb1be435fa646d66a65c986b4924f0849839f08692f39dde61\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/Address.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary Address {\\n /**\\n * @dev Returns true if `account` is a contract.\\n *\\n * [IMPORTANT]\\n * ====\\n * It is unsafe to assume that an address for which this function returns\\n * false is an externally-owned account (EOA) and not a contract.\\n *\\n * Among others, `isContract` will return false for the following\\n * types of addresses:\\n *\\n * - an externally-owned account\\n * - a contract in construction\\n * - an address where a contract will be created\\n * - an address where a contract lived, but was destroyed\\n * ====\\n *\\n * [IMPORTANT]\\n * ====\\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n *\\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n * constructor.\\n * ====\\n */\\n function isContract(address account) internal view returns (bool) {\\n // This method relies on extcodesize/address.code.length, which returns 0\\n // for contracts in construction, since the code is only stored at the end\\n // of the constructor execution.\\n\\n return account.code.length > 0;\\n }\\n\\n /**\\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n * `recipient`, forwarding all available gas and reverting on errors.\\n *\\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n * imposed by `transfer`, making them unable to receive funds via\\n * `transfer`. {sendValue} removes this limitation.\\n *\\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n *\\n * IMPORTANT: because control is transferred to `recipient`, care must be\\n * taken to not create reentrancy vulnerabilities. Consider using\\n * {ReentrancyGuard} or the\\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n */\\n function sendValue(address payable recipient, uint256 amount) internal {\\n require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n }\\n\\n /**\\n * @dev Performs a Solidity function call using a low level `call`. A\\n * plain `call` is an unsafe replacement for a function call: use this\\n * function instead.\\n *\\n * If `target` reverts with a revert reason, it is bubbled up by this\\n * function (like regular Solidity function calls).\\n *\\n * Returns the raw returned data. To convert to the expected return value,\\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n *\\n * Requirements:\\n *\\n * - `target` must be a contract.\\n * - calling `target` with `data` must not revert.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n * `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, 0, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but also transferring `value` wei to `target`.\\n *\\n * Requirements:\\n *\\n * - the calling contract must have an ETH balance of at least `value`.\\n * - the called Solidity function must be `payable`.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value\\n ) internal returns (bytes memory) {\\n return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n * with `errorMessage` as a fallback revert reason when `target` reverts.\\n *\\n * _Available since v3.1._\\n */\\n function functionCallWithValue(\\n address target,\\n bytes memory data,\\n uint256 value,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.call{value: value}(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a static call.\\n *\\n * _Available since v3.3._\\n */\\n function functionStaticCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal view returns (bytes memory) {\\n require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.staticcall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\\n return functionDelegateCall(target, data, \\\"Address: low-level delegate call failed\\\");\\n }\\n\\n /**\\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n * but performing a delegate call.\\n *\\n * _Available since v3.4._\\n */\\n function functionDelegateCall(\\n address target,\\n bytes memory data,\\n string memory errorMessage\\n ) internal returns (bytes memory) {\\n require(isContract(target), \\\"Address: delegate call to non-contract\\\");\\n\\n (bool success, bytes memory returndata) = target.delegatecall(data);\\n return verifyCallResult(success, returndata, errorMessage);\\n }\\n\\n /**\\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n * revert reason using the provided one.\\n *\\n * _Available since v4.3._\\n */\\n function verifyCallResult(\\n bool success,\\n bytes memory returndata,\\n string memory errorMessage\\n ) internal pure returns (bytes memory) {\\n if (success) {\\n return returndata;\\n } else {\\n // Look for revert reason and bubble it up if present\\n if (returndata.length > 0) {\\n // The easiest way to bubble the revert reason is using memory via assembly\\n\\n assembly {\\n let returndata_size := mload(returndata)\\n revert(add(32, returndata), returndata_size)\\n }\\n } else {\\n revert(errorMessage);\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0x2ccf9d2313a313d41a791505f2b5abfdc62191b5d4334f7f7a82691c088a1c87\",\"license\":\"MIT\"},\"@openzeppelin/contracts/utils/StorageSlot.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Library for reading and writing primitive types to specific storage slots.\\n *\\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\\n * This library helps with reading and writing to such slots without the need for inline assembly.\\n *\\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\\n *\\n * Example usage to set ERC1967 implementation slot:\\n * ```\\n * contract ERC1967 {\\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\\n *\\n * function _getImplementation() internal view returns (address) {\\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\\n * }\\n *\\n * function _setImplementation(address newImplementation) internal {\\n * require(Address.isContract(newImplementation), \\\"ERC1967: new implementation is not a contract\\\");\\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\\n * }\\n * }\\n * ```\\n *\\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\\n */\\nlibrary StorageSlot {\\n struct AddressSlot {\\n address value;\\n }\\n\\n struct BooleanSlot {\\n bool value;\\n }\\n\\n struct Bytes32Slot {\\n bytes32 value;\\n }\\n\\n struct Uint256Slot {\\n uint256 value;\\n }\\n\\n /**\\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\\n */\\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\\n */\\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\\n */\\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n\\n /**\\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\\n */\\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\\n assembly {\\n r.slot := slot\\n }\\n }\\n}\\n\",\"keccak256\":\"0xfe1b7a9aa2a530a9e705b220e26cd584e2fbdc9602a3a1066032b12816b46aca\",\"license\":\"MIT\"},\"contracts/periphery/utils/TransparentUpgradeableProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\\n// Note: we just copied so that we can see the contract used\\npragma solidity ^0.8.14;\\n\\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\\n\\n/**\\n * @dev This contract implements a proxy that is upgradeable by an admin.\\n *\\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\\n * clashing], which can potentially be used in an attack, this contract uses the\\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\\n * things that go hand in hand:\\n *\\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\\n * that call matches one of the admin functions exposed by the proxy itself.\\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\\n * \\\"admin cannot fallback to proxy target\\\".\\n *\\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\\n * to sudden errors when trying to call a function from the proxy implementation.\\n *\\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\\n */\\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\\n /**\\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\\n */\\n constructor(\\n address _logic,\\n address admin_,\\n bytes memory _data\\n ) payable ERC1967Proxy(_logic, _data) {\\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\\n _changeAdmin(admin_);\\n }\\n\\n /**\\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\\n */\\n modifier ifAdmin() {\\n if (msg.sender == _getAdmin()) {\\n _;\\n } else {\\n _fallback();\\n }\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\\n */\\n function admin() external ifAdmin returns (address admin_) {\\n admin_ = _getAdmin();\\n }\\n\\n /**\\n * @dev Returns the current implementation.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\\n *\\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\\n */\\n function implementation() external ifAdmin returns (address implementation_) {\\n implementation_ = _implementation();\\n }\\n\\n /**\\n * @dev Changes the admin of the proxy.\\n *\\n * Emits an {AdminChanged} event.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\\n */\\n function changeAdmin(address newAdmin) external virtual ifAdmin {\\n _changeAdmin(newAdmin);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\\n */\\n function upgradeTo(address newImplementation) external ifAdmin {\\n _upgradeToAndCall(newImplementation, bytes(''), false);\\n }\\n\\n /**\\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\\n * proxied contract.\\n *\\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\\n */\\n function upgradeToAndCall(address newImplementation, bytes calldata data)\\n external\\n payable\\n ifAdmin\\n {\\n _upgradeToAndCall(newImplementation, data, true);\\n }\\n\\n /**\\n * @dev Returns the current admin.\\n */\\n function _admin() internal view virtual returns (address) {\\n return _getAdmin();\\n }\\n\\n /**\\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\\n */\\n function _beforeFallback() internal virtual override {\\n require(\\n msg.sender != _getAdmin(),\\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\\n );\\n super._beforeFallback();\\n }\\n}\\n\",\"keccak256\":\"0x0d943fb8814617343a244f762e791c664bb647e32d484ba94fe1958bac85f6dc\",\"license\":\"MIT\"}},\"version\":1}", - "bytecode": "0x608060405260405162000f2a38038062000f2a833981016040819052620000269162000519565b82816200005560017f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbd620005f9565b60008051602062000ee3833981519152146200007557620000756200061f565b6200008382826000620000e7565b50620000b3905060017fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6104620005f9565b60008051602062000ec383398151915214620000d357620000d36200061f565b620000de8262000124565b50505062000688565b620000f2836200017f565b600082511180620001005750805b156200011f576200011d8383620001c160201b6200022e1760201c565b505b505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6200014f620001f0565b604080516001600160a01b03928316815291841660208301520160405180910390a16200017c8162000229565b50565b6200018a81620002de565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6060620001e9838360405180606001604052806027815260200162000f036027913962000381565b9392505050565b60006200021a60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b546001600160a01b0316919050565b6001600160a01b038116620002945760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084015b60405180910390fd5b80620002bd60008051602062000ec383398151915260001b6200046760201b620001ea1760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b620002f4816200046a60201b6200025a1760201c565b620003585760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016200028b565b80620002bd60008051602062000ee383398151915260001b6200046760201b620001ea1760201c565b60606001600160a01b0384163b620003eb5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016200028b565b600080856001600160a01b03168560405162000408919062000635565b600060405180830381855af49150503d806000811462000445576040519150601f19603f3d011682016040523d82523d6000602084013e6200044a565b606091505b5090925090506200045d82828662000479565b9695505050505050565b90565b6001600160a01b03163b151590565b606083156200048a575081620001e9565b8251156200049b5782518084602001fd5b8160405162461bcd60e51b81526004016200028b919062000653565b80516001600160a01b0381168114620004cf57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000507578181015183820152602001620004ed565b838111156200011d5750506000910152565b6000806000606084860312156200052f57600080fd5b6200053a84620004b7565b92506200054a60208501620004b7565b60408501519092506001600160401b03808211156200056857600080fd5b818601915086601f8301126200057d57600080fd5b815181811115620005925762000592620004d4565b604051601f8201601f19908116603f01168101908382118183101715620005bd57620005bd620004d4565b81604052828152896020848701011115620005d757600080fd5b620005ea836020830160208801620004ea565b80955050505050509250925092565b6000828210156200061a57634e487b7160e01b600052601160045260246000fd5b500390565b634e487b7160e01b600052600160045260246000fd5b6000825162000649818460208701620004ea565b9190910192915050565b602081526000825180602084015262000674816040850160208701620004ea565b601f01601f19169190910160400192915050565b61082b80620006986000396000f3fe60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033b53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "deployedBytecode": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100985780638f283970146100c9578063f851a440146100e95761005d565b3661005d5761005b6100fe565b005b61005b6100fe565b34801561007157600080fd5b5061005b6100803660046106b5565b610118565b61005b6100933660046106d0565b610155565b3480156100a457600080fd5b506100ad6101bc565b6040516001600160a01b03909116815260200160405180910390f35b3480156100d557600080fd5b5061005b6100e43660046106b5565b6101ed565b3480156100f557600080fd5b506100ad61020d565b610106610269565b6101166101116102fe565b610308565b565b61012061032c565b6001600160a01b0316330361014d5761014a8160405180602001604052806000815250600061035f565b50565b61014a6100fe565b61015d61032c565b6001600160a01b031633036101b4576101af8383838080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152506001925061035f915050565b505050565b6101af6100fe565b60006101c661032c565b6001600160a01b031633036101e2576101dd6102fe565b905090565b6101ea6100fe565b90565b6101f561032c565b6001600160a01b0316330361014d5761014a8161038a565b600061021761032c565b6001600160a01b031633036101e2576101dd61032c565b606061025383836040518060600160405280602781526020016107cf602791396103de565b9392505050565b6001600160a01b03163b151590565b61027161032c565b6001600160a01b031633036101165760405162461bcd60e51b815260206004820152604260248201527f5472616e73706172656e745570677261646561626c6550726f78793a2061646d60448201527f696e2063616e6e6f742066616c6c6261636b20746f2070726f78792074617267606482015261195d60f21b608482015260a4015b60405180910390fd5b60006101dd6104bb565b3660008037600080366000845af43d6000803e808015610327573d6000f35b3d6000fd5b60007fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b546001600160a01b0316919050565b610368836104e3565b6000825111806103755750805b156101af57610384838361022e565b50505050565b7f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f6103b361032c565b604080516001600160a01b03928316815291841660208301520160405180910390a161014a81610523565b60606001600160a01b0384163b6104465760405162461bcd60e51b815260206004820152602660248201527f416464726573733a2064656c65676174652063616c6c20746f206e6f6e2d636f6044820152651b9d1c9858dd60d21b60648201526084016102f5565b600080856001600160a01b031685604051610461919061077f565b600060405180830381855af49150503d806000811461049c576040519150601f19603f3d011682016040523d82523d6000602084013e6104a1565b606091505b50915091506104b18282866105cc565b9695505050505050565b60007f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc610350565b6104ec81610605565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b6001600160a01b0381166105885760405162461bcd60e51b815260206004820152602660248201527f455243313936373a206e65772061646d696e20697320746865207a65726f206160448201526564647265737360d01b60648201526084016102f5565b807fb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d61035b80546001600160a01b0319166001600160a01b039290921691909117905550565b606083156105db575081610253565b8251156105eb5782518084602001fd5b8160405162461bcd60e51b81526004016102f5919061079b565b6001600160a01b0381163b6106725760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084016102f5565b807f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc6105ab565b80356001600160a01b03811681146106b057600080fd5b919050565b6000602082840312156106c757600080fd5b61025382610699565b6000806000604084860312156106e557600080fd5b6106ee84610699565b9250602084013567ffffffffffffffff8082111561070b57600080fd5b818601915086601f83011261071f57600080fd5b81358181111561072e57600080fd5b87602082850101111561074057600080fd5b6020830194508093505050509250925092565b60005b8381101561076e578181015183820152602001610756565b838111156103845750506000910152565b60008251610791818460208701610753565b9190910192915050565b60208152600082518060208401526107ba816040850160208701610753565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212200396e81b41a53c52a5f2bff0f6a830a500e30d67dcfc4c47e029fb4021c6775064736f6c634300080e0033", - "devdoc": { - "details": "This contract implements a proxy that is upgradeable by an admin. To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector clashing], which can potentially be used in an attack, this contract uses the https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two things that go hand in hand: 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if that call matches one of the admin functions exposed by the proxy itself. 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the implementation. If the admin tries to call a function on the implementation it will fail with an error that says \"admin cannot fallback to proxy target\". These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due to sudden errors when trying to call a function from the proxy implementation. Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way, you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.", - "kind": "dev", - "methods": { - "admin()": { - "details": "Returns the current admin. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`" - }, - "changeAdmin(address)": { - "details": "Changes the admin of the proxy. Emits an {AdminChanged} event. NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}." - }, - "constructor": { - "details": "Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}." - }, - "implementation()": { - "details": "Returns the current implementation. NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}. TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call. `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`" - }, - "upgradeTo(address)": { - "details": "Upgrade the implementation of the proxy. NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}." - }, - "upgradeToAndCall(address,bytes)": { - "details": "Upgrade the implementation of the proxy, and then call a function from the new implementation as specified by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the proxied contract. NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}." - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/Pythia1Verifier.json b/deployments/sandboxPolygon/Pythia1Verifier.json deleted file mode 100644 index 96098af..0000000 --- a/deployments/sandboxPolygon/Pythia1Verifier.json +++ /dev/null @@ -1,97 +0,0 @@ -{ - "address": "0xb7b327Eb974706B548F8c18Ec0Eb35f0f0c655ef", - "abi": [ - { - "inputs": [ - { - "internalType": "uint256[2]", - "name": "a", - "type": "uint256[2]" - }, - { - "internalType": "uint256[2][2]", - "name": "b", - "type": "uint256[2][2]" - }, - { - "internalType": "uint256[2]", - "name": "c", - "type": "uint256[2]" - }, - { - "internalType": "uint256[9]", - "name": "input", - "type": "uint256[9]" - } - ], - "name": "verifyProof", - "outputs": [ - { - "internalType": "bool", - "name": "r", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "transactionHash": "0x32ce4c0b934da0b9cb9570eaa2217ca7bfd5578be2bdaad0e3c6760ebd2d9410", - "receipt": { - "to": null, - "from": "0x597660c921Af06523a458D2596680db1d631732e", - "contractAddress": "0xb7b327Eb974706B548F8c18Ec0Eb35f0f0c655ef", - "transactionIndex": 27, - "gasUsed": "1221464", - "logsBloom": "0x00000000000000200000000000000000000000000000000001000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000000000000000000000000000000000080000004000000000000000000000000000000100000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000004000000000000000000001000000000000000000000000000000100004000000000000000000040000000000000000000000000000000000000000000000100000", - "blockHash": "0xbf398f92244677915776c8103b1b2a6c589e209b81a60f3494d5a6f5d0809b2f", - "transactionHash": "0x32ce4c0b934da0b9cb9570eaa2217ca7bfd5578be2bdaad0e3c6760ebd2d9410", - "logs": [ - { - "transactionIndex": 27, - "blockNumber": 32525849, - "transactionHash": "0x32ce4c0b934da0b9cb9570eaa2217ca7bfd5578be2bdaad0e3c6760ebd2d9410", - "address": "0x0000000000000000000000000000000000001010", - "topics": [ - "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63", - "0x0000000000000000000000000000000000000000000000000000000000001010", - "0x000000000000000000000000597660c921af06523a458d2596680db1d631732e", - "0x000000000000000000000000bdbd4347b082d9d6bdf2da4555a37ce52a2e2120" - ], - "data": "0x00000000000000000000000000000000000000000000000000d4a2d6378b135800000000000000000000000000000000000000000000000022413ca1ca9d0180000000000000000000000000000000000000000000002877c13a969786477fc7000000000000000000000000000000000000000000000000216c99cb9311ee28000000000000000000000000000000000000000000002877c20f396dbdd2931f", - "logIndex": 101, - "blockHash": "0xbf398f92244677915776c8103b1b2a6c589e209b81a60f3494d5a6f5d0809b2f" - } - ], - "blockNumber": 32525849, - "cumulativeGasUsed": "5109210", - "status": 1, - "byzantium": true - }, - "args": [], - "numDeployments": 1, - "solcInputHash": "70d5ec851bd4311fac67c09b114b9c0c", - "metadata": "{\"compiler\":{\"version\":\"0.8.14+commit.80d49f37\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"uint256[2]\",\"name\":\"a\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[2][2]\",\"name\":\"b\",\"type\":\"uint256[2][2]\"},{\"internalType\":\"uint256[2]\",\"name\":\"c\",\"type\":\"uint256[2]\"},{\"internalType\":\"uint256[9]\",\"name\":\"input\",\"type\":\"uint256[9]\"}],\"name\":\"verifyProof\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"r\",\"type\":\"bool\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"verifyProof(uint256[2],uint256[2][2],uint256[2],uint256[9])\":{\"returns\":{\"r\":\" bool true if proof is valid\"}}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"@sismo-core/pythia-1/contracts/Pythia1Verifier.sol\":\"Pythia1Verifier\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@sismo-core/pythia-1/contracts/Pythia1Verifier.sol\":{\"content\":\"//\\n// Copyright 2017 Christian Reitwiessner\\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \\\"Software\\\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\\n// THE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\\n//\\n// 2019 OKIMS\\n// ported to solidity 0.6\\n// fixed linter warnings\\n// added requiere error messages\\n//\\n//\\n// SPDX-License-Identifier: GPL-3.0\\npragma solidity ^0.8.0;\\nlibrary Pairing {\\n struct G1Point {\\n uint X;\\n uint Y;\\n }\\n // Encoding of field elements is: X[0] * z + X[1]\\n struct G2Point {\\n uint[2] X;\\n uint[2] Y;\\n }\\n /// @return the generator of G1\\n function P1() internal pure returns (G1Point memory) {\\n return G1Point(1, 2);\\n }\\n /// @return the generator of G2\\n function P2() internal pure returns (G2Point memory) {\\n // Original code point\\n return G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n\\n/*\\n // Changed by Jordi point\\n return G2Point(\\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\\n );\\n*/\\n }\\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\\n // The prime q in the base field F_q for G1\\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\\n if (p.X == 0 && p.Y == 0)\\n return G1Point(0, 0);\\n return G1Point(p.X, q - (p.Y % q));\\n }\\n /// @return r the sum of two points of G1\\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\\n uint[4] memory input;\\n input[0] = p1.X;\\n input[1] = p1.Y;\\n input[2] = p2.X;\\n input[3] = p2.Y;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-add-failed\\\");\\n }\\n /// @return r the product of a point on G1 and a scalar, i.e.\\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\\n uint[3] memory input;\\n input[0] = p.X;\\n input[1] = p.Y;\\n input[2] = s;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require (success,\\\"pairing-mul-failed\\\");\\n }\\n /// @return the result of computing the pairing check\\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\\n /// return true.\\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\\n require(p1.length == p2.length,\\\"pairing-lengths-failed\\\");\\n uint elements = p1.length;\\n uint inputSize = elements * 6;\\n uint[] memory input = new uint[](inputSize);\\n for (uint i = 0; i < elements; i++)\\n {\\n input[i * 6 + 0] = p1[i].X;\\n input[i * 6 + 1] = p1[i].Y;\\n input[i * 6 + 2] = p2[i].X[0];\\n input[i * 6 + 3] = p2[i].X[1];\\n input[i * 6 + 4] = p2[i].Y[0];\\n input[i * 6 + 5] = p2[i].Y[1];\\n }\\n uint[1] memory out;\\n bool success;\\n // solium-disable-next-line security/no-inline-assembly\\n assembly {\\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\\n // Use \\\"invalid\\\" to make gas estimation work\\n switch success case 0 { invalid() }\\n }\\n require(success,\\\"pairing-opcode-failed\\\");\\n return out[0] != 0;\\n }\\n /// Convenience method for a pairing check for two pairs.\\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](2);\\n G2Point[] memory p2 = new G2Point[](2);\\n p1[0] = a1;\\n p1[1] = b1;\\n p2[0] = a2;\\n p2[1] = b2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for three pairs.\\n function pairingProd3(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](3);\\n G2Point[] memory p2 = new G2Point[](3);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n return pairing(p1, p2);\\n }\\n /// Convenience method for a pairing check for four pairs.\\n function pairingProd4(\\n G1Point memory a1, G2Point memory a2,\\n G1Point memory b1, G2Point memory b2,\\n G1Point memory c1, G2Point memory c2,\\n G1Point memory d1, G2Point memory d2\\n ) internal view returns (bool) {\\n G1Point[] memory p1 = new G1Point[](4);\\n G2Point[] memory p2 = new G2Point[](4);\\n p1[0] = a1;\\n p1[1] = b1;\\n p1[2] = c1;\\n p1[3] = d1;\\n p2[0] = a2;\\n p2[1] = b2;\\n p2[2] = c2;\\n p2[3] = d2;\\n return pairing(p1, p2);\\n }\\n}\\ncontract Pythia1Verifier {\\n using Pairing for *;\\n struct VerifyingKey {\\n Pairing.G1Point alfa1;\\n Pairing.G2Point beta2;\\n Pairing.G2Point gamma2;\\n Pairing.G2Point delta2;\\n Pairing.G1Point[] IC;\\n }\\n struct Proof {\\n Pairing.G1Point A;\\n Pairing.G2Point B;\\n Pairing.G1Point C;\\n }\\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\\n vk.alfa1 = Pairing.G1Point(\\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\\n );\\n\\n vk.beta2 = Pairing.G2Point(\\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\\n );\\n vk.gamma2 = Pairing.G2Point(\\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\\n );\\n vk.delta2 = Pairing.G2Point(\\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\\n );\\n vk.IC = new Pairing.G1Point[](10);\\n \\n vk.IC[0] = Pairing.G1Point( \\n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\\n ); \\n \\n vk.IC[1] = Pairing.G1Point( \\n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\\n ); \\n \\n vk.IC[2] = Pairing.G1Point( \\n 104028078850975554065172701281783302003220555203883119831575537681421753151,\\n 19148240629904598794948591359118971959790791697910953160820265703277306346\\n ); \\n \\n vk.IC[3] = Pairing.G1Point( \\n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\\n ); \\n \\n vk.IC[4] = Pairing.G1Point( \\n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\\n ); \\n \\n vk.IC[5] = Pairing.G1Point( \\n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\\n ); \\n \\n vk.IC[6] = Pairing.G1Point( \\n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\\n ); \\n \\n vk.IC[7] = Pairing.G1Point( \\n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\\n ); \\n \\n vk.IC[8] = Pairing.G1Point( \\n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\\n ); \\n \\n vk.IC[9] = Pairing.G1Point( \\n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\\n ); \\n \\n }\\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\\n VerifyingKey memory vk = verifyingKey();\\n require(input.length + 1 == vk.IC.length,\\\"verifier-bad-input\\\");\\n // Compute the linear combination vk_x\\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\\n for (uint i = 0; i < input.length; i++) {\\n require(input[i] < snark_scalar_field,\\\"verifier-gte-snark-scalar-field\\\");\\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\\n }\\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\\n if (!Pairing.pairingProd4(\\n Pairing.negate(proof.A), proof.B,\\n vk.alfa1, vk.beta2,\\n vk_x, vk.gamma2,\\n proof.C, vk.delta2\\n )) return 1;\\n return 0;\\n }\\n /// @return r bool true if proof is valid\\n function verifyProof(\\n uint[2] memory a,\\n uint[2][2] memory b,\\n uint[2] memory c,\\n uint[9] memory input\\n ) public view returns (bool r) {\\n Proof memory proof;\\n proof.A = Pairing.G1Point(a[0], a[1]);\\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\\n proof.C = Pairing.G1Point(c[0], c[1]);\\n uint[] memory inputValues = new uint[](input.length);\\n for(uint i = 0; i < input.length; i++){\\n inputValues[i] = input[i];\\n }\\n if (verify(inputValues, proof) == 0) {\\n return true;\\n } else {\\n return false;\\n }\\n }\\n}\\n\",\"keccak256\":\"0x3babb956e64535b9bf535df94288b4d83ea82c54727f79ee8949fe4a19c1d5ba\",\"license\":\"GPL-3.0\"}},\"version\":1}", - "bytecode": "0x608060405234801561001057600080fd5b5061151f806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c542c93b14610030575b600080fd5b61004361003e366004611356565b610057565b604051901515815260200160405180910390f35b6000610061611169565b60408051808201825287518152602080890151818301529083528151608081018352875151818401908152885183015160608301528152825180840184528883018051518252518301518184015281830152838201528151808301835286518152868201518183015283830152815160098082526101408201909352600092909182016101208036833701905050905060005b60098110156101435784816009811061010f5761010f611434565b602002015182828151811061012657610126611434565b60209081029190910101528061013b81611460565b9150506100f4565b5061014e818361016f565b60000361016057600192505050610167565b6000925050505b949350505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018161019b610366565b9050806080015151855160016101b19190611479565b146101f85760405162461bcd60e51b81526020600482015260126024820152711d995c9a599a595c8b5898590b5a5b9c1d5d60721b60448201526064015b60405180910390fd5b604080518082019091526000808252602082018190525b86518110156102e9578387828151811061022b5761022b611434565b6020026020010151106102805760405162461bcd60e51b815260206004820152601f60248201527f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c640060448201526064016101ef565b6102d5826102d085608001518460016102999190611479565b815181106102a9576102a9611434565b60200260200101518a85815181106102c3576102c3611434565b6020026020010151610ab8565b610b4e565b9150806102e181611460565b91505061020f565b5061031281836080015160008151811061030557610305611434565b6020026020010151610b4e565b90506103486103248660000151610be7565b8660200151846000015185602001518587604001518b604001518960600151610c86565b6103585760019350505050610360565b600093505050505b92915050565b61036e6111ba565b6040805180820182527f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e281527f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d19266020808301919091529083528151608080820184527f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c8285019081527f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab606080850191909152908352845180860186527f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a781527f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec8818601528385015285840192909252835180820185527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28186019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed828501528152845180860186527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa818601528185015285850152835190810184527f174892b5bad4ddcfd89eda92cc1a5fb630cfd006cdb1659b082e3fae39df9b9c8185019081527f256176846e5a9b02d671495ae4d617f2bd45ce621c1a181cb505f4b5b8b785ae828401528152835180850185527f02ca7609b5aecf9430434e2f4ecb35f1d85090b34f1e9db416b6ed27a47211ac81527f232e1bb08a19b6cc0e639c831b21a6fefdb07f9361801b61dcab9871483b7c528185015281840152908401528151600a8082526101608201909352919082015b60408051808201909152600080825260208201528152602001906001900390816105ea57505060808201908152604080518082019091527f0c32e6a2033cd6027d1a46a68265e41b8a47bfb7a3e130a2c0f533ef102de83d81527f0cc770fbf603ef9467a0c6e6cc28e85214afd8411c933e69178479d2841e976c60208201529051805160009061067d5761067d611434565b602002602001018190525060405180604001604052807f1c12c8210513044ddb9ea2a7cfb8f3b529b6d43abe416e35c005a63a6fffc83a81526020017f11921fe7e6b849a03a0428e49a6465a87f3c98016eb6d13ad110ab15ee0cb5bd81525081608001516001815181106106f4576106f4611434565b602002602001018190525060405180604001604052807e3ae0b7e630d0708e4da300f02dd27c42654381541ab974a678042eb4fadb3f81526020017e0ad667b81d05c6e95487a6140ca0dc3ba85d47509073a2c1b457cfbf67a1ea815250816080015160028151811061076957610769611434565b602002602001018190525060405180604001604052807f0bea1f762ed1b817dddb25a7b7e60f69ff7671eb72fe695a8a24b620fae6515381526020017f069f91831bbeea0bcb8e658c68c110e35e033ae01637be60803083e3696b439181525081608001516003815181106107e0576107e0611434565b602002602001018190525060405180604001604052807f1d8a4973e60e7186c4dd89fd553304f628ebac9870b43dead962ce96064803a681526020017f1ce0f6623640030a2a8210d5e37d04e983127c85dd0bca8f503b2b24c8ad04d1815250816080015160048151811061085757610857611434565b602002602001018190525060405180604001604052807f1955b5fc797055fe5682e71ee08375742622a371f736e40a827fde747dbc7b1881526020017f259ab98a8122832a5779c0c1373733a1d9204803eabd831c550583852bab2c1e81525081608001516005815181106108ce576108ce611434565b602002602001018190525060405180604001604052807f0f2d07869bdb9a50651a2ad87da88a78d29bc7f5abb0c866769189f94f3b37d581526020017f3042b79c235d1a7e6781dde92773e7a52276a8912fe06de16a781d3995ed1319815250816080015160068151811061094557610945611434565b602002602001018190525060405180604001604052807f14dde6710af95fd2d6c49a1cadc761ae8b093e2b80fe9d7b980538baf49b854981526020017f0c4f6f112e147b22270b3c65f5d65a07842b81682deb09f6d4236dac4b9b1fd081525081608001516007815181106109bc576109bc611434565b602002602001018190525060405180604001604052807f1239824d3a77d0e97d55504525df59d36e148fab147bc75b41e74e47478c5f6c81526020017f25393a4bf81046bad1869efc59edfb1a6b379d1d1eab45fcb634b73c0108ebf98152508160800151600881518110610a3357610a33611434565b602002602001018190525060405180604001604052807f13ae19e280548637b1ce4de3d1405ffdd1d8838f2c34a3017cb05810880cd9a481526020017f0803bdf0743261ea96d28d68f7f3cce9505ad2dbce28eb78ba7ccc002c93991a8152508160800151600981518110610aaa57610aaa611434565b602002602001018190525090565b6040805180820190915260008082526020820152610ad461120b565b835181526020808501519082015260408101839052600060608360808460076107d05a03fa90508080610b0357fe5b5080610b465760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5b5d5b0b59985a5b195960721b60448201526064016101ef565b505092915050565b6040805180820190915260008082526020820152610b6a611229565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa90508080610ba457fe5b5080610b465760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5859190b59985a5b195960721b60448201526064016101ef565b604080518082019091526000808252602082015281517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4790158015610c2e57506020830151155b15610c4e5750506040805180820190915260008082526020820152919050565b604051806040016040528084600001518152602001828560200151610c739190611491565b610c7d90846114b3565b90529392505050565b60408051600480825260a08201909252600091829190816020015b6040805180820190915260008082526020820152815260200190600190039081610ca157505060408051600480825260a0820190925291925060009190602082015b610ceb611247565b815260200190600190039081610ce35790505090508a82600081518110610d1457610d14611434565b60200260200101819052508882600181518110610d3357610d33611434565b60200260200101819052508682600281518110610d5257610d52611434565b60200260200101819052508482600381518110610d7157610d71611434565b60200260200101819052508981600081518110610d9057610d90611434565b60200260200101819052508781600181518110610daf57610daf611434565b60200260200101819052508581600281518110610dce57610dce611434565b60200260200101819052508381600381518110610ded57610ded611434565b6020026020010181905250610e028282610e11565b9b9a5050505050505050505050565b60008151835114610e5d5760405162461bcd60e51b81526020600482015260166024820152751c185a5c9a5b99cb5b195b99dd1a1ccb59985a5b195960521b60448201526064016101ef565b82516000610e6c8260066114ca565b905060008167ffffffffffffffff811115610e8957610e896112a3565b604051908082528060200260200182016040528015610eb2578160200160208202803683370190505b50905060005b838110156110ed57868181518110610ed257610ed2611434565b60200260200101516000015182826006610eec91906114ca565b610ef7906000611479565b81518110610f0757610f07611434565b602002602001018181525050868181518110610f2557610f25611434565b60200260200101516020015182826006610f3f91906114ca565b610f4a906001611479565b81518110610f5a57610f5a611434565b602002602001018181525050858181518110610f7857610f78611434565b6020908102919091010151515182610f918360066114ca565b610f9c906002611479565b81518110610fac57610fac611434565b602002602001018181525050858181518110610fca57610fca611434565b60209081029190910181015151015182610fe58360066114ca565b610ff0906003611479565b8151811061100057611000611434565b60200260200101818152505085818151811061101e5761101e611434565b60200260200101516020015160006002811061103c5761103c611434565b60200201518261104d8360066114ca565b611058906004611479565b8151811061106857611068611434565b60200260200101818152505085818151811061108657611086611434565b6020026020010151602001516001600281106110a4576110a4611434565b6020020151826110b58360066114ca565b6110c0906005611479565b815181106110d0576110d0611434565b6020908102919091010152806110e581611460565b915050610eb8565b506110f6611267565b6000602082602086026020860160086107d05a03fa9050808061111557fe5b508061115b5760405162461bcd60e51b81526020600482015260156024820152741c185a5c9a5b99cb5bdc18dbd9194b59985a5b1959605a1b60448201526064016101ef565b505115159695505050505050565b6040805160a081019091526000606082018181526080830191909152815260208101611193611247565b81526020016111b5604051806040016040528060008152602001600081525090565b905290565b6040805160e08101909152600060a0820181815260c08301919091528152602081016111e4611247565b81526020016111f1611247565b81526020016111fe611247565b8152602001606081525090565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b604051806040016040528061125a611285565b81526020016111b5611285565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156112dc576112dc6112a3565b60405290565b604051610120810167ffffffffffffffff811182821017156112dc576112dc6112a3565b600082601f83011261131757600080fd5b61131f6112b9565b80604084018581111561133157600080fd5b845b8181101561134b578035845260209384019301611333565b509095945050505050565b60008060008061022080868803121561136e57600080fd5b6113788787611306565b9450604087605f88011261138b57600080fd5b6113936112b9565b8060c089018a8111156113a557600080fd5b838a015b818110156113ca576113bb8c82611306565b845260209093019284016113a9565b508197506113d88b82611306565b9650505050508661011f8701126113ee57600080fd5b6113f66112e2565b90860190808883111561140857600080fd5b61010088015b8381101561142657803583526020928301920161140e565b509598949750929550505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016114725761147261144a565b5060010190565b6000821982111561148c5761148c61144a565b500190565b6000826114ae57634e487b7160e01b600052601260045260246000fd5b500690565b6000828210156114c5576114c561144a565b500390565b60008160001904831182151516156114e4576114e461144a565b50029056fea264697066735822122064ca8e728369809bbfe58b0cff27a54a0e5e793919a8ed928a392738c3f2924564736f6c634300080e0033", - "deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063c542c93b14610030575b600080fd5b61004361003e366004611356565b610057565b604051901515815260200160405180910390f35b6000610061611169565b60408051808201825287518152602080890151818301529083528151608081018352875151818401908152885183015160608301528152825180840184528883018051518252518301518184015281830152838201528151808301835286518152868201518183015283830152815160098082526101408201909352600092909182016101208036833701905050905060005b60098110156101435784816009811061010f5761010f611434565b602002015182828151811061012657610126611434565b60209081029190910101528061013b81611460565b9150506100f4565b5061014e818361016f565b60000361016057600192505050610167565b6000925050505b949350505050565b60007f30644e72e131a029b85045b68181585d2833e84879b9709143e1f593f00000018161019b610366565b9050806080015151855160016101b19190611479565b146101f85760405162461bcd60e51b81526020600482015260126024820152711d995c9a599a595c8b5898590b5a5b9c1d5d60721b60448201526064015b60405180910390fd5b604080518082019091526000808252602082018190525b86518110156102e9578387828151811061022b5761022b611434565b6020026020010151106102805760405162461bcd60e51b815260206004820152601f60248201527f76657269666965722d6774652d736e61726b2d7363616c61722d6669656c640060448201526064016101ef565b6102d5826102d085608001518460016102999190611479565b815181106102a9576102a9611434565b60200260200101518a85815181106102c3576102c3611434565b6020026020010151610ab8565b610b4e565b9150806102e181611460565b91505061020f565b5061031281836080015160008151811061030557610305611434565b6020026020010151610b4e565b90506103486103248660000151610be7565b8660200151846000015185602001518587604001518b604001518960600151610c86565b6103585760019350505050610360565b600093505050505b92915050565b61036e6111ba565b6040805180820182527f2d4d9aa7e302d9df41749d5507949d05dbea33fbb16c643b22f599a2be6df2e281527f14bedd503c37ceb061d8ec60209fe345ce89830a19230301f076caff004d19266020808301919091529083528151608080820184527f0967032fcbf776d1afc985f88877f182d38480a653f2decaa9794cbc3bf3060c8285019081527f0e187847ad4c798374d0d6732bf501847dd68bc0e071241e0213bc7fc13db7ab606080850191909152908352845180860186527f304cfbd1e08a704a99f5e847d93f8c3caafddec46b7a0d379da69a4d112346a781527f1739c1b1a457a8c7313123d24d2f9192f896b7c63eea05a9d57f06547ad0cec8818601528385015285840192909252835180820185527f198e9393920d483a7260bfb731fb5d25f1aa493335a9e71297e485b7aef312c28186019081527f1800deef121f1e76426a00665e5c4479674322d4f75edadd46debd5cd992f6ed828501528152845180860186527f090689d0585ff075ec9e99ad690c3395bc4b313370b38ef355acdadcd122975b81527f12c85ea5db8c6deb4aab71808dcb408fe3d1e7690c43d37b4ce6cc0166fa7daa818601528185015285850152835190810184527f174892b5bad4ddcfd89eda92cc1a5fb630cfd006cdb1659b082e3fae39df9b9c8185019081527f256176846e5a9b02d671495ae4d617f2bd45ce621c1a181cb505f4b5b8b785ae828401528152835180850185527f02ca7609b5aecf9430434e2f4ecb35f1d85090b34f1e9db416b6ed27a47211ac81527f232e1bb08a19b6cc0e639c831b21a6fefdb07f9361801b61dcab9871483b7c528185015281840152908401528151600a8082526101608201909352919082015b60408051808201909152600080825260208201528152602001906001900390816105ea57505060808201908152604080518082019091527f0c32e6a2033cd6027d1a46a68265e41b8a47bfb7a3e130a2c0f533ef102de83d81527f0cc770fbf603ef9467a0c6e6cc28e85214afd8411c933e69178479d2841e976c60208201529051805160009061067d5761067d611434565b602002602001018190525060405180604001604052807f1c12c8210513044ddb9ea2a7cfb8f3b529b6d43abe416e35c005a63a6fffc83a81526020017f11921fe7e6b849a03a0428e49a6465a87f3c98016eb6d13ad110ab15ee0cb5bd81525081608001516001815181106106f4576106f4611434565b602002602001018190525060405180604001604052807e3ae0b7e630d0708e4da300f02dd27c42654381541ab974a678042eb4fadb3f81526020017e0ad667b81d05c6e95487a6140ca0dc3ba85d47509073a2c1b457cfbf67a1ea815250816080015160028151811061076957610769611434565b602002602001018190525060405180604001604052807f0bea1f762ed1b817dddb25a7b7e60f69ff7671eb72fe695a8a24b620fae6515381526020017f069f91831bbeea0bcb8e658c68c110e35e033ae01637be60803083e3696b439181525081608001516003815181106107e0576107e0611434565b602002602001018190525060405180604001604052807f1d8a4973e60e7186c4dd89fd553304f628ebac9870b43dead962ce96064803a681526020017f1ce0f6623640030a2a8210d5e37d04e983127c85dd0bca8f503b2b24c8ad04d1815250816080015160048151811061085757610857611434565b602002602001018190525060405180604001604052807f1955b5fc797055fe5682e71ee08375742622a371f736e40a827fde747dbc7b1881526020017f259ab98a8122832a5779c0c1373733a1d9204803eabd831c550583852bab2c1e81525081608001516005815181106108ce576108ce611434565b602002602001018190525060405180604001604052807f0f2d07869bdb9a50651a2ad87da88a78d29bc7f5abb0c866769189f94f3b37d581526020017f3042b79c235d1a7e6781dde92773e7a52276a8912fe06de16a781d3995ed1319815250816080015160068151811061094557610945611434565b602002602001018190525060405180604001604052807f14dde6710af95fd2d6c49a1cadc761ae8b093e2b80fe9d7b980538baf49b854981526020017f0c4f6f112e147b22270b3c65f5d65a07842b81682deb09f6d4236dac4b9b1fd081525081608001516007815181106109bc576109bc611434565b602002602001018190525060405180604001604052807f1239824d3a77d0e97d55504525df59d36e148fab147bc75b41e74e47478c5f6c81526020017f25393a4bf81046bad1869efc59edfb1a6b379d1d1eab45fcb634b73c0108ebf98152508160800151600881518110610a3357610a33611434565b602002602001018190525060405180604001604052807f13ae19e280548637b1ce4de3d1405ffdd1d8838f2c34a3017cb05810880cd9a481526020017f0803bdf0743261ea96d28d68f7f3cce9505ad2dbce28eb78ba7ccc002c93991a8152508160800151600981518110610aaa57610aaa611434565b602002602001018190525090565b6040805180820190915260008082526020820152610ad461120b565b835181526020808501519082015260408101839052600060608360808460076107d05a03fa90508080610b0357fe5b5080610b465760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5b5d5b0b59985a5b195960721b60448201526064016101ef565b505092915050565b6040805180820190915260008082526020820152610b6a611229565b8351815260208085015181830152835160408301528301516060808301919091526000908360c08460066107d05a03fa90508080610ba457fe5b5080610b465760405162461bcd60e51b81526020600482015260126024820152711c185a5c9a5b99cb5859190b59985a5b195960721b60448201526064016101ef565b604080518082019091526000808252602082015281517f30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd4790158015610c2e57506020830151155b15610c4e5750506040805180820190915260008082526020820152919050565b604051806040016040528084600001518152602001828560200151610c739190611491565b610c7d90846114b3565b90529392505050565b60408051600480825260a08201909252600091829190816020015b6040805180820190915260008082526020820152815260200190600190039081610ca157505060408051600480825260a0820190925291925060009190602082015b610ceb611247565b815260200190600190039081610ce35790505090508a82600081518110610d1457610d14611434565b60200260200101819052508882600181518110610d3357610d33611434565b60200260200101819052508682600281518110610d5257610d52611434565b60200260200101819052508482600381518110610d7157610d71611434565b60200260200101819052508981600081518110610d9057610d90611434565b60200260200101819052508781600181518110610daf57610daf611434565b60200260200101819052508581600281518110610dce57610dce611434565b60200260200101819052508381600381518110610ded57610ded611434565b6020026020010181905250610e028282610e11565b9b9a5050505050505050505050565b60008151835114610e5d5760405162461bcd60e51b81526020600482015260166024820152751c185a5c9a5b99cb5b195b99dd1a1ccb59985a5b195960521b60448201526064016101ef565b82516000610e6c8260066114ca565b905060008167ffffffffffffffff811115610e8957610e896112a3565b604051908082528060200260200182016040528015610eb2578160200160208202803683370190505b50905060005b838110156110ed57868181518110610ed257610ed2611434565b60200260200101516000015182826006610eec91906114ca565b610ef7906000611479565b81518110610f0757610f07611434565b602002602001018181525050868181518110610f2557610f25611434565b60200260200101516020015182826006610f3f91906114ca565b610f4a906001611479565b81518110610f5a57610f5a611434565b602002602001018181525050858181518110610f7857610f78611434565b6020908102919091010151515182610f918360066114ca565b610f9c906002611479565b81518110610fac57610fac611434565b602002602001018181525050858181518110610fca57610fca611434565b60209081029190910181015151015182610fe58360066114ca565b610ff0906003611479565b8151811061100057611000611434565b60200260200101818152505085818151811061101e5761101e611434565b60200260200101516020015160006002811061103c5761103c611434565b60200201518261104d8360066114ca565b611058906004611479565b8151811061106857611068611434565b60200260200101818152505085818151811061108657611086611434565b6020026020010151602001516001600281106110a4576110a4611434565b6020020151826110b58360066114ca565b6110c0906005611479565b815181106110d0576110d0611434565b6020908102919091010152806110e581611460565b915050610eb8565b506110f6611267565b6000602082602086026020860160086107d05a03fa9050808061111557fe5b508061115b5760405162461bcd60e51b81526020600482015260156024820152741c185a5c9a5b99cb5bdc18dbd9194b59985a5b1959605a1b60448201526064016101ef565b505115159695505050505050565b6040805160a081019091526000606082018181526080830191909152815260208101611193611247565b81526020016111b5604051806040016040528060008152602001600081525090565b905290565b6040805160e08101909152600060a0820181815260c08301919091528152602081016111e4611247565b81526020016111f1611247565b81526020016111fe611247565b8152602001606081525090565b60405180606001604052806003906020820280368337509192915050565b60405180608001604052806004906020820280368337509192915050565b604051806040016040528061125a611285565b81526020016111b5611285565b60405180602001604052806001906020820280368337509192915050565b60405180604001604052806002906020820280368337509192915050565b634e487b7160e01b600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156112dc576112dc6112a3565b60405290565b604051610120810167ffffffffffffffff811182821017156112dc576112dc6112a3565b600082601f83011261131757600080fd5b61131f6112b9565b80604084018581111561133157600080fd5b845b8181101561134b578035845260209384019301611333565b509095945050505050565b60008060008061022080868803121561136e57600080fd5b6113788787611306565b9450604087605f88011261138b57600080fd5b6113936112b9565b8060c089018a8111156113a557600080fd5b838a015b818110156113ca576113bb8c82611306565b845260209093019284016113a9565b508197506113d88b82611306565b9650505050508661011f8701126113ee57600080fd5b6113f66112e2565b90860190808883111561140857600080fd5b61010088015b8381101561142657803583526020928301920161140e565b509598949750929550505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016114725761147261144a565b5060010190565b6000821982111561148c5761148c61144a565b500190565b6000826114ae57634e487b7160e01b600052601260045260246000fd5b500690565b6000828210156114c5576114c561144a565b500390565b60008160001904831182151516156114e4576114e461144a565b50029056fea264697066735822122064ca8e728369809bbfe58b0cff27a54a0e5e793919a8ed928a392738c3f2924564736f6c634300080e0033", - "devdoc": { - "kind": "dev", - "methods": { - "verifyProof(uint256[2],uint256[2][2],uint256[2],uint256[9])": { - "returns": { - "r": " bool true if proof is valid" - } - } - }, - "version": 1 - }, - "userdoc": { - "kind": "user", - "methods": {}, - "version": 1 - }, - "storageLayout": { - "storage": [], - "types": null - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/solcInputs/6edb98fea2bf424a369954d0e80655f6.json b/deployments/sandboxPolygon/solcInputs/6edb98fea2bf424a369954d0e80655f6.json deleted file mode 100644 index 8f3bf5d..0000000 --- a/deployments/sandboxPolygon/solcInputs/6edb98fea2bf424a369954d0e80655f6.json +++ /dev/null @@ -1,237 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "@openzeppelin/contracts/access/AccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role);\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `_msgSender()` is missing `role`.\n * Overriding this function changes the behavior of the {onlyRole} modifier.\n *\n * Format of the revert message is described in {_checkRole}.\n *\n * _Available since v4.6._\n */\n function _checkRole(bytes32 role) internal view virtual {\n _checkRole(role, _msgSender());\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(account),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleGranted} event.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n *\n * May emit a {RoleRevoked} event.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n *\n * May emit a {RoleRevoked} event.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * May emit a {RoleGranted} event.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleGranted} event.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n *\n * May emit a {RoleRevoked} event.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" - }, - "@openzeppelin/contracts/access/IAccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" - }, - "@openzeppelin/contracts/access/Ownable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n _checkOwner();\n _;\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if the sender is not the owner.\n */\n function _checkOwner() internal view virtual {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" - }, - "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializing the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overridden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overridden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n * @custom:oz-retyped-from bool\n */\n uint8 private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) || (!Address.isContract(address(this)) && _initialized == 1),\n \"Initializable: contract is already initialized\"\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(!_initializing && _initialized < version, \"Initializable: contract is already initialized\");\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, \"Initializable: contract is initializing\");\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" - }, - "@openzeppelin/contracts/security/Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n _requireNotPaused();\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n _requirePaused();\n _;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Throws if the contract is paused.\n */\n function _requireNotPaused() internal view virtual {\n require(!paused(), \"Pausable: paused\");\n }\n\n /**\n * @dev Throws if the contract is not paused.\n */\n function _requirePaused() internal view virtual {\n require(paused(), \"Pausable: not paused\");\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/ERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC1155/ERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC1155.sol\";\nimport \"./IERC1155Receiver.sol\";\nimport \"./extensions/IERC1155MetadataURI.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of the basic standard multi-token.\n * See https://eips.ethereum.org/EIPS/eip-1155\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\n *\n * _Available since v3.1._\n */\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\n using Address for address;\n\n // Mapping from token ID to account balances\n mapping(uint256 => mapping(address => uint256)) private _balances;\n\n // Mapping from account to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n string private _uri;\n\n /**\n * @dev See {_setURI}.\n */\n constructor(string memory uri_) {\n _setURI(uri_);\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155).interfaceId ||\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC1155MetadataURI-uri}.\n *\n * This implementation returns the same URI for *all* token types. It relies\n * on the token type ID substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * Clients calling this function must replace the `\\{id\\}` substring with the\n * actual token type ID.\n */\n function uri(uint256) public view virtual override returns (string memory) {\n return _uri;\n }\n\n /**\n * @dev See {IERC1155-balanceOf}.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\n require(account != address(0), \"ERC1155: address zero is not a valid owner\");\n return _balances[id][account];\n }\n\n /**\n * @dev See {IERC1155-balanceOfBatch}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\n public\n view\n virtual\n override\n returns (uint256[] memory)\n {\n require(accounts.length == ids.length, \"ERC1155: accounts and ids length mismatch\");\n\n uint256[] memory batchBalances = new uint256[](accounts.length);\n\n for (uint256 i = 0; i < accounts.length; ++i) {\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\n }\n\n return batchBalances;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev See {IERC1155-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not token owner or approved\"\n );\n _safeTransferFrom(from, to, id, amount, data);\n }\n\n /**\n * @dev See {IERC1155-safeBatchTransferFrom}.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not token owner or approved\"\n );\n _safeBatchTransferFrom(from, to, ids, amounts, data);\n }\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n\n emit TransferSingle(operator, from, to, id, amount);\n\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\n\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; ++i) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n }\n\n emit TransferBatch(operator, from, to, ids, amounts);\n\n _afterTokenTransfer(operator, from, to, ids, amounts, data);\n\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\n }\n\n /**\n * @dev Sets a new URI for all token types, by relying on the token type ID\n * substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * By this mechanism, any occurrence of the `\\{id\\}` substring in either the\n * URI or any of the amounts in the JSON file at said URI will be replaced by\n * clients with the token type ID.\n *\n * For example, the `https://token-cdn-domain/\\{id\\}.json` URI would be\n * interpreted by clients as\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\n * for token type ID 0x4cce0.\n *\n * See {uri}.\n *\n * Because these URIs cannot be meaningfully represented by the {URI} event,\n * this function emits no events.\n */\n function _setURI(string memory newuri) internal virtual {\n _uri = newuri;\n }\n\n /**\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _mint(\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _balances[id][to] += amount;\n emit TransferSingle(operator, address(0), to, id, amount);\n\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _mintBatch(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; i++) {\n _balances[ids[i]][to] += amounts[i];\n }\n\n emit TransferBatch(operator, address(0), to, ids, amounts);\n\n _afterTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\n }\n\n /**\n * @dev Destroys `amount` tokens of token type `id` from `from`\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `from` must have at least `amount` tokens of token type `id`.\n */\n function _burn(\n address from,\n uint256 id,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n\n address operator = _msgSender();\n uint256[] memory ids = _asSingletonArray(id);\n uint256[] memory amounts = _asSingletonArray(amount);\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n\n emit TransferSingle(operator, from, address(0), id, amount);\n\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n */\n function _burnBatch(\n address from,\n uint256[] memory ids,\n uint256[] memory amounts\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n for (uint256 i = 0; i < ids.length; i++) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n }\n\n emit TransferBatch(operator, from, address(0), ids, amounts);\n\n _afterTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC1155: setting approval status for self\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `ids` and `amounts` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `id` and `amount` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n function _doSafeTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\n if (response != IERC1155Receiver.onERC1155Received.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non-ERC1155Receiver implementer\");\n }\n }\n }\n\n function _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\n bytes4 response\n ) {\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non-ERC1155Receiver implementer\");\n }\n }\n }\n\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\n uint256[] memory array = new uint256[](1);\n array[0] = element;\n\n return array;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1155.sol\";\nimport \"../../../security/Pausable.sol\";\n\n/**\n * @dev ERC1155 token with pausable token transfers, minting and burning.\n *\n * Useful for scenarios such as preventing trades until the end of an evaluation\n * period, or having an emergency switch for freezing all token transfers in the\n * event of a large bug.\n *\n * _Available since v3.1._\n */\nabstract contract ERC1155Pausable is ERC1155, Pausable {\n /**\n * @dev See {ERC1155-_beforeTokenTransfer}.\n *\n * Requirements:\n *\n * - the contract must not be paused.\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n require(!paused(), \"ERC1155Pausable: token transfer while paused\");\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155MetadataURI is IERC1155 {\n /**\n * @dev Returns the URI for token type `id`.\n *\n * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n * clients with the actual token type ID.\n */\n function uri(uint256 id) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/ERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"./extensions/IERC721Metadata.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/Strings.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: address zero is not a valid owner\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _ownerOf(tokenId);\n require(owner != address(0), \"ERC721: invalid token ID\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n _requireMinted(tokenId);\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overridden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not token owner or approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n _requireMinted(tokenId);\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: caller is not token owner or approved\");\n _safeTransfer(from, to, tokenId, data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns the owner of the `tokenId`. Does NOT revert if token doesn't exist\n */\n function _ownerOf(uint256 tokenId) internal view virtual returns (address) {\n return _owners[tokenId];\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _ownerOf(tokenId) != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || isApprovedForAll(owner, spender) || getApproved(tokenId) == spender);\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId, 1);\n\n // Check that tokenId was not minted by `_beforeTokenTransfer` hook\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n unchecked {\n // Will not overflow unless all 2**256 token ids are minted to the same owner.\n // Given that tokens are minted one by one, it is impossible in practice that\n // this ever happens. Might change if we allow batch minting.\n // The ERC fails to describe this case.\n _balances[to] += 1;\n }\n\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId, 1);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n * This is an internal function that does not check if the sender is authorized to operate on the token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId, 1);\n\n // Update ownership in case tokenId was transferred by `_beforeTokenTransfer` hook\n owner = ERC721.ownerOf(tokenId);\n\n // Clear approvals\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // Cannot overflow, as that would require more tokens to be burned/transferred\n // out than the owner initially received through minting and transferring in.\n _balances[owner] -= 1;\n }\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId, 1);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId, 1);\n\n // Check that tokenId was not transferred by `_beforeTokenTransfer` hook\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n\n // Clear approvals from the previous owner\n delete _tokenApprovals[tokenId];\n\n unchecked {\n // `_balances[from]` cannot overflow for the same reason as described in `_burn`:\n // `from`'s balance is the number of token held, which is at least one before the current\n // transfer.\n // `_balances[to]` could overflow in the conditions described in `_mint`. That would require\n // all 2**256 token ids to be minted, which in practice is impossible.\n _balances[from] -= 1;\n _balances[to] += 1;\n }\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId, 1);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits an {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits an {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Reverts if the `tokenId` has not been minted yet.\n */\n function _requireMinted(uint256 tokenId) internal view virtual {\n require(_exists(tokenId), \"ERC721: invalid token ID\");\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, data) returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n /// @solidity memory-safe-assembly\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens will be transferred to `to`.\n * - When `from` is zero, the tokens will be minted for `to`.\n * - When `to` is zero, ``from``'s tokens will be burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256, /* firstTokenId */\n uint256 batchSize\n ) internal virtual {\n if (batchSize > 1) {\n if (from != address(0)) {\n _balances[from] -= batchSize;\n }\n if (to != address(0)) {\n _balances[to] += batchSize;\n }\n }\n }\n\n /**\n * @dev Hook that is called after any token transfer. This includes minting and burning. If {ERC721Consecutive} is\n * used, the hook may be called as part of a consecutive (batch) mint, as indicated by `batchSize` greater than 1.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s tokens were transferred to `to`.\n * - When `from` is zero, the tokens were minted for `to`.\n * - When `to` is zero, ``from``'s tokens were burned.\n * - `from` and `to` are never both zero.\n * - `batchSize` is non-zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 firstTokenId,\n uint256 batchSize\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721\n * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must\n * understand this adds an external call which potentially creates a reentrancy vulnerability.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721Receiver.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResultFromTarget(target, success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling\n * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract.\n *\n * _Available since v4.8._\n */\n function verifyCallResultFromTarget(\n address target,\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n if (success) {\n if (returndata.length == 0) {\n // only check isContract if the call was successful and the return data is empty\n // otherwise we already know that it was a contract\n require(isContract(target), \"Address: call to non-contract\");\n }\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n /**\n * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason or using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n _revert(returndata, errorMessage);\n }\n }\n\n function _revert(bytes memory returndata, string memory errorMessage) private pure {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n /// @solidity memory-safe-assembly\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/ERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/utils/math/Math.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Standard math utilities missing in the Solidity language.\n */\nlibrary Math {\n enum Rounding {\n Down, // Toward negative infinity\n Up, // Toward infinity\n Zero // Toward zero\n }\n\n /**\n * @dev Returns the largest of two numbers.\n */\n function max(uint256 a, uint256 b) internal pure returns (uint256) {\n return a > b ? a : b;\n }\n\n /**\n * @dev Returns the smallest of two numbers.\n */\n function min(uint256 a, uint256 b) internal pure returns (uint256) {\n return a < b ? a : b;\n }\n\n /**\n * @dev Returns the average of two numbers. The result is rounded towards\n * zero.\n */\n function average(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b) / 2 can overflow.\n return (a & b) + (a ^ b) / 2;\n }\n\n /**\n * @dev Returns the ceiling of the division of two numbers.\n *\n * This differs from standard division with `/` in that it rounds up instead\n * of rounding down.\n */\n function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {\n // (a + b - 1) / b can overflow on addition, so we distribute.\n return a == 0 ? 0 : (a - 1) / b + 1;\n }\n\n /**\n * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0\n * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)\n * with further edits by Uniswap Labs also under MIT license.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator\n ) internal pure returns (uint256 result) {\n unchecked {\n // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use\n // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256\n // variables such that product = prod1 * 2^256 + prod0.\n uint256 prod0; // Least significant 256 bits of the product\n uint256 prod1; // Most significant 256 bits of the product\n assembly {\n let mm := mulmod(x, y, not(0))\n prod0 := mul(x, y)\n prod1 := sub(sub(mm, prod0), lt(mm, prod0))\n }\n\n // Handle non-overflow cases, 256 by 256 division.\n if (prod1 == 0) {\n return prod0 / denominator;\n }\n\n // Make sure the result is less than 2^256. Also prevents denominator == 0.\n require(denominator > prod1);\n\n ///////////////////////////////////////////////\n // 512 by 256 division.\n ///////////////////////////////////////////////\n\n // Make division exact by subtracting the remainder from [prod1 prod0].\n uint256 remainder;\n assembly {\n // Compute remainder using mulmod.\n remainder := mulmod(x, y, denominator)\n\n // Subtract 256 bit number from 512 bit number.\n prod1 := sub(prod1, gt(remainder, prod0))\n prod0 := sub(prod0, remainder)\n }\n\n // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.\n // See https://cs.stackexchange.com/q/138556/92363.\n\n // Does not overflow because the denominator cannot be zero at this stage in the function.\n uint256 twos = denominator & (~denominator + 1);\n assembly {\n // Divide denominator by twos.\n denominator := div(denominator, twos)\n\n // Divide [prod1 prod0] by twos.\n prod0 := div(prod0, twos)\n\n // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.\n twos := add(div(sub(0, twos), twos), 1)\n }\n\n // Shift in bits from prod1 into prod0.\n prod0 |= prod1 * twos;\n\n // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such\n // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for\n // four bits. That is, denominator * inv = 1 mod 2^4.\n uint256 inverse = (3 * denominator) ^ 2;\n\n // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works\n // in modular arithmetic, doubling the correct bits in each step.\n inverse *= 2 - denominator * inverse; // inverse mod 2^8\n inverse *= 2 - denominator * inverse; // inverse mod 2^16\n inverse *= 2 - denominator * inverse; // inverse mod 2^32\n inverse *= 2 - denominator * inverse; // inverse mod 2^64\n inverse *= 2 - denominator * inverse; // inverse mod 2^128\n inverse *= 2 - denominator * inverse; // inverse mod 2^256\n\n // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.\n // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is\n // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1\n // is no longer required.\n result = prod0 * inverse;\n return result;\n }\n }\n\n /**\n * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.\n */\n function mulDiv(\n uint256 x,\n uint256 y,\n uint256 denominator,\n Rounding rounding\n ) internal pure returns (uint256) {\n uint256 result = mulDiv(x, y, denominator);\n if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {\n result += 1;\n }\n return result;\n }\n\n /**\n * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.\n *\n * Inspired by Henry S. Warren, Jr.'s \"Hacker's Delight\" (Chapter 11).\n */\n function sqrt(uint256 a) internal pure returns (uint256) {\n if (a == 0) {\n return 0;\n }\n\n // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.\n //\n // We know that the \"msb\" (most significant bit) of our target number `a` is a power of 2 such that we have\n // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.\n //\n // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`\n // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`\n // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`\n //\n // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.\n uint256 result = 1 << (log2(a) >> 1);\n\n // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,\n // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at\n // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision\n // into the expected uint128 result.\n unchecked {\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n result = (result + a / result) >> 1;\n return min(result, a / result);\n }\n }\n\n /**\n * @notice Calculates sqrt(a), following the selected rounding direction.\n */\n function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = sqrt(a);\n return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 2, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 128;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 64;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 32;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 16;\n }\n if (value >> 8 > 0) {\n value >>= 8;\n result += 8;\n }\n if (value >> 4 > 0) {\n value >>= 4;\n result += 4;\n }\n if (value >> 2 > 0) {\n value >>= 2;\n result += 2;\n }\n if (value >> 1 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 2, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log2(value);\n return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 10, rounded down, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >= 10**64) {\n value /= 10**64;\n result += 64;\n }\n if (value >= 10**32) {\n value /= 10**32;\n result += 32;\n }\n if (value >= 10**16) {\n value /= 10**16;\n result += 16;\n }\n if (value >= 10**8) {\n value /= 10**8;\n result += 8;\n }\n if (value >= 10**4) {\n value /= 10**4;\n result += 4;\n }\n if (value >= 10**2) {\n value /= 10**2;\n result += 2;\n }\n if (value >= 10**1) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log10(value);\n return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);\n }\n }\n\n /**\n * @dev Return the log in base 256, rounded down, of a positive value.\n * Returns 0 if given 0.\n *\n * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.\n */\n function log256(uint256 value) internal pure returns (uint256) {\n uint256 result = 0;\n unchecked {\n if (value >> 128 > 0) {\n value >>= 128;\n result += 16;\n }\n if (value >> 64 > 0) {\n value >>= 64;\n result += 8;\n }\n if (value >> 32 > 0) {\n value >>= 32;\n result += 4;\n }\n if (value >> 16 > 0) {\n value >>= 16;\n result += 2;\n }\n if (value >> 8 > 0) {\n result += 1;\n }\n }\n return result;\n }\n\n /**\n * @dev Return the log in base 10, following the selected rounding direction, of a positive value.\n * Returns 0 if given 0.\n */\n function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {\n unchecked {\n uint256 result = log256(value);\n return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/StorageSlot.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.7.0) (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n /// @solidity memory-safe-assembly\n assembly {\n r.slot := slot\n }\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Strings.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./math/Math.sol\";\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _SYMBOLS = \"0123456789abcdef\";\n uint8 private constant _ADDRESS_LENGTH = 20;\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n unchecked {\n uint256 length = Math.log10(value) + 1;\n string memory buffer = new string(length);\n uint256 ptr;\n /// @solidity memory-safe-assembly\n assembly {\n ptr := add(buffer, add(32, length))\n }\n while (true) {\n ptr--;\n /// @solidity memory-safe-assembly\n assembly {\n mstore8(ptr, byte(mod(value, 10), _SYMBOLS))\n }\n value /= 10;\n if (value == 0) break;\n }\n return buffer;\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n unchecked {\n return toHexString(value, Math.log256(value) + 1);\n }\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n\n /**\n * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.\n */\n function toHexString(address addr) internal pure returns (string memory) {\n return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);\n }\n}\n" - }, - "@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract HydraS1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [8609986746108439658545470593166889256314951959466775818870246174320018498804,\n 6848251127850009101372611262053374737897586140140607384018397707035108265914],\n [21367916863936594568281095443965096905143705300114190558130516981138584550504,\n 13327705762185115653848159709412003423932761899188342359583872691135383932883]\n );\n vk.IC = new Pairing.G1Point[](11);\n \n vk.IC[0] = Pairing.G1Point( \n 19965766170734310004645394427613286415565755728797065894668054116047682895204,\n 6952067612339183672227137101423582097916038093373585908267153974352032944482\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 13987716160490730015463796942940452666334097189904948795214986996497499925899,\n 5336810094802209074340875836312868429276540870324469349093948627126061524544\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 14931593253473978964215343699995811275378324235306358485461293343370969283966,\n 564306919152089917957316877787764763278299990971316475606280877961553231205\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11591267743733991434114686002448165336885445656808796470854638278338319268343,\n 11495219763417990955889652410266075210402006084183208750635660647824890013350\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 8183184532870222270700473518157259944911700429689031755853536692005688965081,\n 9121077094104828462137861111631978599019724423614716723152060153405564278301\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 4314095526093128699362232919686741372014146055311239687202926853002748112330,\n 11665330391505820654128458332883010598817535082070674418723503440883598640597\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\n 181057165072599074288983745076121344893296348827576905983079816835912241514\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 18925967077785550270509493111690046951994174908254476036944536825999614778001,\n 4990629719417206796668074534812314525340851981015724652256935997545282642849\n ); \n \n vk.IC[10] = Pairing.G1Point( \n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[10] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "@sismo-core/pythia-1/contracts/Pythia1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract Pythia1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\n );\n vk.IC = new Pairing.G1Point[](10);\n \n vk.IC[0] = Pairing.G1Point( \n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 104028078850975554065172701281783302003220555203883119831575537681421753151,\n 19148240629904598794948591359118971959790791697910953160820265703277306346\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[9] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/HydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1Base} from './IHydraS1Base.sol';\nimport {Attester} from '../../../core/Attester.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Hydra S1 ZK Proving Scheme\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to the following:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n *\n */\nabstract contract HydraS1Base is IHydraS1Base, Attester, Initializable {\n using HydraS1Lib for HydraS1ProofData;\n\n // ZK-SNARK Verifier\n HydraS1Verifier immutable VERIFIER;\n // Registry storing the Commitment Mapper EdDSA Public key\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS\n *******************************************************/\n\n /**\n * @dev Constructor. Initializes the contract\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\n * @param commitmentMapperAddress Commitment mapper's public key registry\n */\n constructor(\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress\n ) {\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\n }\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\n return COMMITMENT_MAPPER_REGISTRY;\n }\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\n return AVAILABLE_ROOTS_REGISTRY;\n }\n\n /*******************************************************\n Hydra-S1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the nullifier from an attestation extraData\n * @dev Getter of a nullifier encoded in extraData\n * @notice Must be implemented by the inheriting contracts\n * @param extraData extraData where nullifier can be encoded\n */\n function getNullifierFromExtraData(\n bytes memory extraData\n ) external view virtual returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the external nullifier from a user request\n * so it can be checked against snark input\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\n * users bring sourceSecretHash as private input which guarantees privacy\n *\n * This function MUST be implemented by Hydra-S1 attesters.\n * This is the core function that implements the logic of external nullifiers\n *\n * Do they get one external nullifier per claim?\n * Do they get 2 external nullifiers per claim?\n * Do they get 1 external nullifier per claim, every month?\n * Take a look at Hydra-S1 Simple Attester for an example\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\n */\n function _getExternalNullifierOfClaim(\n HydraS1Claim memory claim\n ) internal view virtual returns (uint256);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(\n HydraS1Claim memory claim,\n HydraS1ProofInput memory input\n ) internal view virtual {\n if (input.accountsTreeValue != claim.groupId) {\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\n }\n\n if (input.isStrict == claim.groupProperties.isScore) {\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n }\n\n if (input.destination != claim.destination) {\n revert DestinationMismatch(claim.destination, input.destination);\n }\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot)) {\n revert RegistryRootMismatch(input.registryRoot);\n }\n\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\n if (\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\n ) {\n revert CommitmentMapperPubKeyMismatch(\n commitmentMapperPubKey[0],\n commitmentMapperPubKey[1],\n input.commitmentMapperPubKey[0],\n input.commitmentMapperPubKey[1]\n );\n }\n\n uint256 externalNullifier = _getExternalNullifierOfClaim(claim);\n\n if (input.externalNullifier != externalNullifier) {\n revert ExternalNullifierMismatch(externalNullifier, input.externalNullifier);\n }\n }\n\n /**\n * @dev verify the groth16 mathematical proof\n * @param proofData snark public input\n */\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(uint256 /*errorCode*/) {\n revert InvalidGroth16Proof('');\n } catch (bytes memory /*lowLevelData*/) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/IHydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Interface\n * @author Sismo\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\n * We invite readers to refer to the following:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n **/\ninterface IHydraS1Base is IAttester {\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\n error RegistryRootMismatch(uint256 inputRoot);\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error CommitmentMapperPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error ExternalNullifierMismatch(uint256 expectedExternalNullifier, uint256 externalNullifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error AccountsTreeValueMismatch(\n uint256 expectedAccountsTreeValue,\n uint256 inputAccountsTreeValue\n );\n error InvalidGroth16Proof(string reason);\n\n function getNullifierFromExtraData(bytes memory extraData) external view returns (uint256);\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier);\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\n\nimport {IHydraS1AccountboundAttester} from './interfaces/IHydraS1AccountboundAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from '../../core/libs/Structs.sol';\n\n// Imports related to Hydra-S1\nimport {HydraS1SimpleAttester, IAttester, HydraS1Lib, HydraS1ProofData, HydraS1Claim} from './HydraS1SimpleAttester.sol';\n\n/**\n * @title Hydra-S1 Accountbound Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Simple Attester contract is inherited and holds the complex Hydra S1 verification logic.\n * Request verification alongside proof verification is already implemented in the inherited HydraS1SimpleAttester, along with the buildAttestations logic.\n * However, we override the buildAttestations function to encode the nullifier and its burn count in the user attestation.\n * The _beforeRecordAttestations is also overriden to fit the Accountbound logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Nullified\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\n * While semaphore/ tornado cash are using the following notations: nullifierHash = hash(IdNullifier, externalNullifier)\n * We prefered to use the naming 'nullifier' instead of 'nullifierHash' in our contracts and documentation.\n * We also renamed 'IdNullifier' in 'sourceSecret' (the secret tied to a source account) and we kept the 'externalNullifier' notation.\n * Finally, here is our notations at Sismo: nullifier = hash(sourceSecret, externalNullifier)\n\n * - Accountbound (opt-in, with cooldown period)\n * The owner of this attester can set a cooldown duration for a specific group, activating the accountbound feature for this group.\n * Users can update their attestation's destination by providing a new Hydra-S1 ZK proof \n * It means the attestation is bound to the source account, stored on an updatable destination account.\n * When deleting/ sending to a new destination, the nullifier will enter a cooldown period, so it remains occasional.\n * A group that has its cooldown duration set to 0 means it has been configured to not feature accountbound attestations, attestations can not be transferred\n * One can however know that the former and the new destinations were created using the same nullifier, thus creating a link between those two destinations.\n \n * - Renewable\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew or update their attestations\n **/\n\ncontract HydraS1AccountboundAttester is\n IHydraS1AccountboundAttester,\n HydraS1SimpleAttester,\n Ownable\n{\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n uint8 public constant IMPLEMENTATION_VERSION = 4;\n\n /*******************************************************\n Storage layout:\n 20 slots between HydraS1SimpleAttester and HydraS1AccountboundAttester\n 1 currently used by Ownable\n 19 place holders\n 2O for config\n 1 currently used\n 19 place holders\n 20 for logic\n 2 currently used\n 18 place holders\n *******************************************************/\n\n // keeping some space for future config logics\n uint256[19] private _placeHolderBeforeHydraS1Accountbound;\n\n // cooldown durations for each groupIndex\n mapping(uint256 => uint32) internal _cooldownDurations;\n\n // keeping some space for future config logics\n uint256[19] private _placeHoldersHydraS1AccountboundConfig;\n\n mapping(uint256 => uint32) internal _nullifiersCooldownStart;\n mapping(uint256 => uint16) internal _nullifiersBurnCount;\n\n // keeping some space for future config logics\n uint256[18] private _placeHoldersHydraS1AccountboundLogic;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first attestation collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last attestation collection in which the attester is supposed to record\n * @param owner Address of attester's owner\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address owner\n )\n HydraS1SimpleAttester(\n attestationsRegistryAddress,\n hydraS1VerifierAddress,\n availableRootsRegistryAddress,\n commitmentMapperAddress,\n collectionIdFirst,\n collectionIdLast\n )\n {\n initialize(owner);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n }\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Returns the actual attestations constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark public input as well as snark proof\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) public view virtual override(IAttester, HydraS1SimpleAttester) returns (Attestation[] memory) {\n Attestation[] memory attestations = super.buildAttestations(request, proofData);\n\n uint256 nullifier = proofData._getNullifier();\n attestations[0].extraData = abi.encode(\n attestations[0].extraData, // nullifier, from HydraS1 Simple\n _getNextBurnCount(nullifier, attestations[0].owner) // BurnCount\n );\n\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Hook run before recording the attestation.\n * Throws if nullifier already used, not a renewal, and nullifier on cooldown.\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n uint256 nullifier = proofData._getNullifier();\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\n\n HydraS1Claim memory claim = request._claim();\n\n // check if the nullifier has already been used previously, if so it may be on cooldown\n if (\n previousNullifierDestination != address(0) &&\n previousNullifierDestination != claim.destination\n ) {\n uint32 cooldownDuration = _getCooldownDurationForGroupIndex(claim.groupProperties.groupIndex);\n if (cooldownDuration == 0) {\n revert CooldownDurationNotSetForGroupIndex(claim.groupProperties.groupIndex);\n }\n if (_isOnCooldown(nullifier, cooldownDuration)) {\n uint16 burnCount = _getNullifierBurnCount(nullifier);\n revert NullifierOnCooldown(\n nullifier,\n previousNullifierDestination,\n burnCount,\n cooldownDuration\n );\n }\n\n // Delete the old Attestation linked to the nullifier before recording the new one (accountbound feature)\n _deletePreviousAttestation(claim, previousNullifierDestination);\n\n _setNullifierOnCooldownAndIncrementBurnCount(nullifier);\n }\n _setDestinationForNullifier(nullifier, request.destination);\n }\n\n /*******************************************************\n LOGIC FUNCTIONS RELATED TO ACCOUNTBOUND FEATURE\n *******************************************************/\n\n /**\n * @dev Getter, returns the burnCount of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16) {\n return _getNullifierBurnCount(nullifier);\n }\n\n /**\n * @dev Getter, returns the cooldown start of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32) {\n return _getNullifierCooldownStart(nullifier);\n }\n\n /**\n * @dev returns the nullifier for a given extraData\n * @param extraData bytes where the nullifier is encoded\n */\n function getNullifierFromExtraData(\n bytes memory extraData\n ) external pure override(HydraS1SimpleAttester, IHydraS1AccountboundAttester) returns (uint256) {\n (uint256 nullifier, ) = abi.decode(extraData, (uint256, uint16));\n\n return nullifier;\n }\n\n /**\n * @dev Returns the burn count for a given extraData\n * @param extraData bytes where the burnCount is encoded\n */\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16) {\n (, uint16 burnCount) = abi.decode(extraData, (uint256, uint16));\n\n return burnCount;\n }\n\n /**\n * @dev Checks if a nullifier is on cooldown\n * @param nullifier user nullifier\n * @param cooldownDuration waiting time before the user can change its badge destination\n */\n function _isOnCooldown(uint256 nullifier, uint32 cooldownDuration) internal view returns (bool) {\n return _getNullifierCooldownStart(nullifier) + cooldownDuration > block.timestamp;\n }\n\n /**\n * @dev Delete the previous attestation created with this nullifier\n * @param claim user claim\n * @param previousNullifierDestination previous destination chosen for this user nullifier\n */\n function _deletePreviousAttestation(\n HydraS1Claim memory claim,\n address previousNullifierDestination\n ) internal {\n address[] memory attestationOwners = new address[](1);\n uint256[] memory attestationCollectionIds = new uint256[](1);\n\n attestationOwners[0] = previousNullifierDestination;\n attestationCollectionIds[0] = AUTHORIZED_COLLECTION_ID_FIRST + claim.groupProperties.groupIndex;\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n }\n\n function _setNullifierOnCooldownAndIncrementBurnCount(uint256 nullifier) internal {\n _nullifiersCooldownStart[nullifier] = uint32(block.timestamp);\n _nullifiersBurnCount[nullifier] += 1;\n emit NullifierSetOnCooldown(nullifier, _nullifiersBurnCount[nullifier]);\n }\n\n function _getNullifierCooldownStart(uint256 nullifier) internal view returns (uint32) {\n return _nullifiersCooldownStart[nullifier];\n }\n\n function _getNullifierBurnCount(uint256 nullifier) internal view returns (uint16) {\n return _nullifiersBurnCount[nullifier];\n }\n\n /**\n * @dev returns burn count or burn count + 1 if new burn will happen\n * @param nullifier user nullifier\n * @param claimDestination destination referenced in the user claim\n */\n function _getNextBurnCount(\n uint256 nullifier,\n address claimDestination\n ) public view virtual returns (uint16) {\n address previousNullifierDestination = _getDestinationOfNullifier(nullifier);\n uint16 burnCount = _getNullifierBurnCount(nullifier);\n // If the attestation is minted on a new destination address\n // the burnCount that will be encoded in the extraData of the Attestation should be incremented\n if (\n previousNullifierDestination != address(0) && previousNullifierDestination != claimDestination\n ) {\n burnCount += 1;\n }\n return burnCount;\n }\n\n /*******************************************************\n GROUP CONFIGURATION LOGIC\n *******************************************************/\n\n /**\n * @dev Setter, sets the cooldown duration of a groupIndex\n * @notice set to 0 to deactivate the accountbound feature for this group\n * @param groupIndex internal collection id\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\n **/\n function setCooldownDurationForGroupIndex(\n uint256 groupIndex,\n uint32 cooldownDuration\n ) external onlyOwner {\n _cooldownDurations[groupIndex] = cooldownDuration;\n emit CooldownDurationSetForGroupIndex(groupIndex, cooldownDuration);\n }\n\n /**\n * @dev Getter, get the cooldown duration of a groupIndex\n * @notice returns 0 when the accountbound feature is deactivated for this group\n * @param groupIndex internal collection id\n **/\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32) {\n return _getCooldownDurationForGroupIndex(groupIndex);\n }\n\n // = 0 means that the accountbound feature is deactivated for this group\n function _getCooldownDurationForGroupIndex(uint256 groupIndex) internal view returns (uint32) {\n return _cooldownDurations[groupIndex];\n }\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\nimport {IHydraS1Base} from './base/IHydraS1Base.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Nullified\n * Each source account gets one nullifier per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * nullifier = hash(sourceSecret, externalNullifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - Renewable\n * A nullifier can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew their attestations\n **/\n\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n /*******************************************************\n Storage layout:\n 20 slots for HydraS1\n 1 slot used\n 19 place holders\n *******************************************************/\n\n mapping(uint256 => address) internal _nullifiersDestinations;\n\n // keeping some space for future\n uint256[19] private _placeHoldersHydraS1Simple;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\n HydraS1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n uint256 nullifier = proofData._getNullifier();\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n abi.encode(nullifier)\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if nullifier already used and not a renewal (e.g destination different that last)\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n // we get the nullifier used from the snark input in the data provided\n uint256 nullifier = proofData._getNullifier();\n address currentDestination = _getDestinationOfNullifier(nullifier);\n\n if (currentDestination != address(0) && currentDestination != request.destination) {\n revert NullifierUsed(nullifier);\n }\n\n _setDestinationForNullifier(nullifier, request.destination);\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the external nullifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * nullifier = hash(sourceSecretHash, externalNullifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose externalNullifier = hash(attesterAddress, claim.GroupId)\n * Creates one nullifier per group, per user and makes sure no collision with other attester's nullifiers\n **/\n function _getExternalNullifierOfClaim(\n HydraS1Claim memory claim\n ) internal view override returns (uint256) {\n uint256 externalNullifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.groupIndex\n );\n return externalNullifier;\n }\n\n /**\n * @dev returns the nullifier for a given extraData\n * @param extraData bytes where the nullifier is encoded\n */\n function getNullifierFromExtraData(\n bytes memory extraData\n ) external pure virtual override(IHydraS1Base, HydraS1Base) returns (uint256) {\n return abi.decode(extraData, (uint256));\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a nullifier\n * @param nullifier nullifier used\n **/\n function getDestinationOfNullifier(uint256 nullifier) external view override returns (address) {\n return _getDestinationOfNullifier(nullifier);\n }\n\n function _setDestinationForNullifier(uint256 nullifier, address destination) internal virtual {\n _nullifiersDestinations[nullifier] = destination;\n emit NullifierDestinationUpdated(nullifier, destination);\n }\n\n function _getDestinationOfNullifier(uint256 nullifier) internal view returns (address) {\n return _nullifiersDestinations[nullifier];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from '././IHydraS1SimpleAttester.sol';\n\n/**\n * @title Hydra-S1 Accountbound Interface\n * @author Sismo\n * @notice Interface of the HydraS1AccountboundAttester contract which inherits from the errors, events and methods specific to the HydraS1SimpleAttester interface.\n **/\ninterface IHydraS1AccountboundAttester is IHydraS1SimpleAttester {\n /**\n * @dev Event emitted when the duration of the cooldown duration for a group index (internal collection id) has been set\n * @param groupIndex internal collection id\n * @param cooldownDuration the duration of the cooldown period\n **/\n event CooldownDurationSetForGroupIndex(uint256 indexed groupIndex, uint32 cooldownDuration);\n\n /**\n * @dev Event emitted when the nullifier has been set on cooldown. This happens when the\n * attestation destination of a nullifier has been changed\n * @param nullifier user nullifier\n * @param burnCount the number of times the attestation destination of a nullifier has been changed\n **/\n event NullifierSetOnCooldown(uint256 indexed nullifier, uint16 burnCount);\n\n /**\n * @dev Error when the nullifier is on cooldown. The user have to wait the cooldownDuration\n * before being able to change again the destination address.\n **/\n error NullifierOnCooldown(\n uint256 nullifier,\n address destination,\n uint16 burnCount,\n uint32 cooldownStart\n );\n\n /**\n * @dev Error when the cooldown duration for a given groupIndex is equal to zero.\n * The HydraS1AccountboundAttester behaves like the HydraS1SimpleAttester.\n **/\n error CooldownDurationNotSetForGroupIndex(uint256 groupIndex);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) external;\n\n /**\n * @dev returns the nullifier for a given extraData\n * @param extraData bytes where the nullifier is encoded\n */\n function getNullifierFromExtraData(bytes memory extraData) external pure returns (uint256);\n\n /**\n * @dev Returns the burn count for a given extraData\n * @param extraData bytes where the burnCount is encoded\n */\n function getBurnCountFromExtraData(bytes memory extraData) external pure returns (uint16);\n\n /**\n * @dev Getter, returns the cooldown start of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierCooldownStart(uint256 nullifier) external view returns (uint32);\n\n /**\n * @dev Getter, returns the burnCount of a nullifier\n * @param nullifier nullifier used\n **/\n function getNullifierBurnCount(uint256 nullifier) external view returns (uint16);\n\n /**\n * @dev Setter, sets the cooldown duration of a groupIndex\n * @param groupIndex internal collection id\n * @param cooldownDuration cooldown duration we want to set for the groupIndex\n **/\n function setCooldownDurationForGroupIndex(uint256 groupIndex, uint32 cooldownDuration) external;\n\n /*/**\n * @dev Getter, get the cooldown duration of a groupIndex\n * @notice returns 0 when the accountbound feature is deactivated for this group\n * @param groupIndex internal collection id\n **/\n function getCooldownDurationForGroupIndex(uint256 groupIndex) external view returns (uint32);\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Accountbound Interface\n * @author Sismo\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\n **/\ninterface IHydraS1SimpleAttester is IHydraS1Base {\n /**\n * @dev Error when the nullifier is already used for a destination address\n **/\n error NullifierUsed(uint256 nullifier);\n\n /**\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\n **/\n error CollectionIdOutOfBound(uint256 collectionId);\n\n /**\n * @dev Event emitted when the nullifier is associated to a destination address.\n **/\n event NullifierDestinationUpdated(uint256 nullifier, address newOwner);\n\n /**\n * @dev Getter, returns the last attestation destination of a nullifier\n * @param nullifier nullifier used\n **/\n function getDestinationOfNullifier(uint256 nullifier) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1AccountboundLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Lib, HydraS1Claim, HydraS1GroupProperties} from './HydraS1Lib.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1AccountboundClaim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1AccountboundGroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1AccountboundGroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n uint32 cooldownDuration;\n bool isScore;\n}\n\nlibrary HydraS1AccountboundLib {\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _hydraS1claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n HydraS1GroupProperties memory hydraS1GroupProperties = HydraS1GroupProperties(\n groupProperties.groupIndex,\n groupProperties.generationTimestamp,\n groupProperties.isScore\n );\n\n return (\n HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, hydraS1GroupProperties)\n );\n }\n\n function _hydraS1Accountboundclaim(\n Request memory self\n ) internal pure returns (HydraS1AccountboundClaim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory hydraS1AccountboundGroupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n return (\n HydraS1AccountboundClaim(\n claim.groupId,\n claim.claimedValue,\n self.destination,\n hydraS1AccountboundGroupProperties\n )\n );\n }\n\n function _generateGroupIdFromEncodedProperties(\n bytes memory encodedProperties\n ) internal pure returns (uint256) {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1GroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n bool isScore;\n}\n\nstruct HydraS1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct HydraS1ProofData {\n HydraS1CircomSnarkProof proof;\n uint256[10] input;\n // destination\n // chainId\n // commitmentMapperPubKey.x\n // commitmentMapperPubKey.y\n // registryTreeRoot\n // externalNullifier\n // nullifier\n // claimedValue\n // accountsTreeValue\n // isStrict\n}\n\nstruct HydraS1ProofInput {\n address destination;\n uint256 chainId;\n uint256 registryRoot;\n uint256 externalNullifier;\n uint256 nullifier;\n uint256 value;\n uint256 accountsTreeValue;\n bool isStrict;\n uint256[2] commitmentMapperPubKey;\n}\n\nlibrary HydraS1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\n return\n HydraS1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getRegistryRoot(self),\n _getExpectedExternalNullifier(self),\n _getNullifier(self),\n _getValue(self),\n _getAccountsTreeValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1GroupProperties)\n );\n\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(\n HydraS1ProofData memory self\n )\n internal\n pure\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[10] memory)\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(\n HydraS1ProofData memory self\n ) internal pure returns (uint256[2] memory) {\n return [self.input[2], self.input[3]];\n }\n\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(\n HydraS1ProofData memory self\n ) internal pure returns (uint256) {\n return self.input[5];\n }\n\n function _getNullifier(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[8];\n }\n\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\n return self.input[9] == 1;\n }\n\n function _getNullifier(bytes calldata self) internal pure returns (uint256) {\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\n uint256 nullifier = uint256(_getNullifier(snarkProofData));\n return nullifier;\n }\n\n function _generateGroupIdFromProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\n );\n }\n\n function _generateGroupIdFromEncodedProperties(\n bytes memory encodedProperties\n ) internal pure returns (uint256) {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(groupIndex, generationTimestamp, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/pythia-1/base/IPythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\n\ninterface IPythia1Base {\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error UserShouldOwnItsDestination(address sender, address inputdestination);\n error CommitmentSignerPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier);\n\n /**\n * @dev Getter of the Commitment Signer EdDSA Public Key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\n}\n" - }, - "contracts/attesters/pythia-1/base/Pythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IPythia1Base} from './IPythia1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Pythia 1 ZK Proving Scheme\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\n\n/**\n * @title Pythia-1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \n * without anyone being able to make the link between the offchain service and the onchain service.\n * It is inherited by the family of Pythia-1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n \n \n **/\nabstract contract Pythia1Base is IPythia1Base, Initializable {\n using Pythia1Lib for Pythia1ProofData;\n\n // ZK-SNARK Verifier\n Pythia1Verifier immutable VERIFIER;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\n */\n constructor(address Pythia1VerifierAddress) {\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\n }\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of the Commitment signer Eddsa Public key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\n return _getCommitmentSignerPubKey();\n }\n\n /*******************************************************\n Pythia-1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * the secretHash is a number only known by the user and is used in \n * the zero knowledge as a private input which guarantees privacy\n\n * This function MUST be implemented by Pythia-1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Pythia-1 Simple Attester for an example\n * @param claim user claim: a particular claim that a user have that he can prove s right.\n */\n function _getTicketIdentifierOfClaim(\n Pythia1Claim memory claim\n ) internal view virtual returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\n * prove the claim was correctly issued for the user.\n */\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(\n Pythia1Claim memory claim,\n Pythia1ProofInput memory input\n ) internal view virtual {\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (claim.destination != msg.sender)\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\n if (\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\n )\n revert CommitmentSignerPubKeyMismatch(\n commitmentSignerPubKey[0],\n commitmentSignerPubKey[1],\n input.commitmentSignerPubKey[0],\n input.commitmentSignerPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the plonk mathematical proof using the circom verifier contract\n * @param proofData snark public input\n */\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(uint256 /*errorCode*/) {\n revert InvalidGroth16Proof('');\n } catch (bytes memory /*lowLevelData*/) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\n\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\n error TicketUsed(uint256 userTicket);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/pythia-1/libs/Pythia1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\n\n// user Pythia-1 claim retrieved form his request\nstruct Pythia1Claim {\n uint256 groupId; // user claims be part of this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct Pythia1GroupProperties {\n uint128 internalCollectionId;\n bool isScore;\n}\n\nstruct Pythia1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct Pythia1ProofData {\n Pythia1CircomSnarkProof proof;\n uint256[9] input;\n // destination;\n // chainId;\n // commitmentSignerPubKey.x;\n // commitmentSignerPubKey.y;\n // groupId;\n // ticketIdentifier;\n // userTicket;\n // value;\n // isStrict;\n}\n\nstruct Pythia1ProofInput {\n address destination;\n uint256 chainId;\n uint256 groupId;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n bool isStrict;\n uint256[2] commitmentSignerPubKey;\n}\n\nlibrary Pythia1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\n return\n Pythia1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getGroupId(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n Pythia1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (Pythia1GroupProperties)\n );\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(\n Pythia1ProofData memory self\n )\n internal\n pure\n returns (uint256[2] memory, uint256[2][2] memory, uint256[2] memory, uint256[9] memory)\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(\n Pythia1ProofData memory self\n ) internal pure returns (uint256[2] memory) {\n return [self.input[2], self.input[3]];\n }\n\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(\n Pythia1ProofData memory self\n ) internal pure returns (uint256) {\n return self.input[5];\n }\n\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\n return self.input[8] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(\n uint128 internalCollectionId,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\n }\n\n function _generateGroupIdFromEncodedProperties(\n bytes memory encodedProperties\n ) internal pure returns (uint256) {\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 internalCollectionId,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(internalCollectionId, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to Pythia1 Proving Scheme\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\n\n/**\n * @title Pythia-1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Pythia-1 Attesters.\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \n * offchain service in a privacy preserving way. \n * That means no-one can make the link between the account used in the offchain service\n * and the onchain account where the attestation is stored.\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each users gets one userTicket per claim\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n **/\n\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\n using Pythia1Lib for Pythia1ProofData;\n using Pythia1Lib for bytes;\n using Pythia1Lib for Request;\n\n uint8 public constant IMPLEMENTATION_VERSION = 3;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n uint256[2] internal _commitmentSignerPubKey;\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\n * @param owner The owner of the contract that can update the commitment signer pub key\n */\n constructor(\n address attestationsRegistryAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address pythia1VerifierAddress,\n uint256[2] memory commitmentSignerPubKey,\n address owner\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n initialize(commitmentSignerPubKey, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param ownerAddress Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n uint256[2] memory commitmentSignerPubKey,\n address ownerAddress\n ) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into Pythia1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\n Pythia1ProofInput memory snarkInput = snarkProof._input();\n Pythia1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata\n ) public view virtual override(IAttester, Attester) returns (Attestation[] memory) {\n Pythia1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.internalCollectionId;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n uint32(block.timestamp),\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used\n * @param request users request. Claim of beiing part of a group.\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0)) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * users bring secretHash as private input in snark which guarantees privacy\n * the secretHash is only known by the user and never escape the user's browser\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(\n Pythia1Claim memory claim\n ) internal view override returns (uint256) {\n uint256 ticketIdentifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.internalCollectionId\n );\n return ticketIdentifier;\n }\n\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\n return _commitmentSignerPubKey;\n }\n\n /*******************************************************\n Pythia-1 Attester Specific Functions\n *******************************************************/\n\n function updateCommitmentSignerPubKey(\n uint256[2] memory commitmentSignerPubKey\n ) external onlyOwner {\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\n _commitmentSignerPubKey = commitmentSignerPubKey;\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\n }\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/core/AttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\nimport {Attestation, AttestationData} from './libs/Structs.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Attestations Registry\n * @author Sismo\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\n * Only authorized attestations issuers can record attestation in the registry\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\n * For more information: https://attestations-registry.docs.sismo.io\n\n * For each attestation recorded, a badge is received by the user\n * The badge is the Non transferrable NFT representation of an attestation \n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\n * It enables off-chain apps such as opensea to catch the \"shadow mint\" of the badge\n **/\ncontract AttestationsRegistry is\n AttestationsRegistryState,\n IAttestationsRegistry,\n AttestationsRegistryConfigLogic\n{\n uint8 public constant IMPLEMENTATION_VERSION = 3;\n IBadges immutable BADGES;\n\n /**\n * @dev Constructor.\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @param badgesAddress Stateless ERC1155 Badges contract\n */\n constructor(address owner, address badgesAddress) {\n BADGES = IBadges(badgesAddress);\n initialize(owner);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n }\n }\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\n address issuer = _msgSender();\n for (uint256 i = 0; i < attestations.length; i++) {\n if (!_isAuthorized(issuer, attestations[i].collectionId))\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\n\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\n attestations[i].owner\n ].value;\n\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\n attestations[i].issuer,\n attestations[i].value,\n attestations[i].timestamp,\n attestations[i].extraData\n );\n\n _triggerBadgeTransferEvent(\n attestations[i].collectionId,\n attestations[i].owner,\n previousAttestationValue,\n attestations[i].value\n );\n emit AttestationRecorded(attestations[i]);\n }\n }\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(\n address[] calldata owners,\n uint256[] calldata collectionIds\n ) external override whenNotPaused {\n if (owners.length != collectionIds.length)\n revert OwnersAndCollectionIdsLengthMismatch(owners, collectionIds);\n\n address issuer = _msgSender();\n for (uint256 i = 0; i < owners.length; i++) {\n AttestationData memory attestationData = _attestationsData[collectionIds[i]][owners[i]];\n\n if (!_isAuthorized(issuer, collectionIds[i]))\n revert IssuerNotAuthorized(issuer, collectionIds[i]);\n delete _attestationsData[collectionIds[i]][owners[i]];\n\n _triggerBadgeTransferEvent(collectionIds[i], owners[i], attestationData.value, 0);\n\n emit AttestationDeleted(\n Attestation(\n collectionIds[i],\n owners[i],\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n )\n );\n }\n }\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(\n uint256 collectionId,\n address owner\n ) external view override returns (bool) {\n return _getAttestationValue(collectionId, owner) != 0;\n }\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(\n uint256 collectionId,\n address owner\n ) external view override returns (AttestationData memory) {\n return _getAttestationData(collectionId, owner);\n }\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(\n uint256 collectionId,\n address owner\n ) external view override returns (uint256) {\n return _getAttestationValue(collectionId, owner);\n }\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(\n uint256 collectionId,\n address owner\n ) external view override returns (address, uint256, uint32, bytes memory) {\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\n return (\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n );\n }\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(\n uint256 collectionId,\n address owner\n ) external view override returns (bytes memory) {\n return _attestationsData[collectionId][owner].extraData;\n }\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(\n uint256 collectionId,\n address owner\n ) external view override returns (address) {\n return _attestationsData[collectionId][owner].issuer;\n }\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(\n uint256 collectionId,\n address owner\n ) external view override returns (uint32) {\n return _attestationsData[collectionId][owner].timestamp;\n }\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view override returns (AttestationData[] memory) {\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\n }\n return attestationsDataArray;\n }\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view override returns (uint256[] memory) {\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\n }\n return attestationsValues;\n }\n\n /**\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\n * It enables off-chain apps such as opensea to catch the \"shadow mints/burns\" of badges\n */\n function _triggerBadgeTransferEvent(\n uint256 badgeTokenId,\n address owner,\n uint256 previousValue,\n uint256 newValue\n ) internal {\n bool isGreaterValue = newValue > previousValue;\n address operator = address(this);\n address from = isGreaterValue ? address(0) : owner;\n address to = isGreaterValue ? owner : address(0);\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\n\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\n }\n\n function _getAttestationData(\n uint256 collectionId,\n address owner\n ) internal view returns (AttestationData memory) {\n return (_attestationsData[collectionId][owner]);\n }\n\n function _getAttestationValue(\n uint256 collectionId,\n address owner\n ) internal view returns (uint256) {\n return _attestationsData[collectionId][owner].value;\n }\n}\n" - }, - "contracts/core/Attester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\n\n/**\n * @title Attester Abstract Contract\n * @author Sismo\n * @notice Contract to be inherited by Attesters\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\n * are recommended to implemented this abstract contract\n\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\n *\n * This contracts is built around two main external standard functions.\n * They must NOT be override them, unless your really know what you are doing\n \n * - generateAttestations(request, proof) => will write attestations in the registry\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\n\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\n\n * For more information: https://attesters.docs.sismo.io\n **/\nabstract contract Attester is IAttester {\n // Registry where all attestations are stored\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n // Verify if request is valid by verifying against proof\n _verifyRequest(request, proofData);\n\n // Generate the actual attestations from user request\n Attestation[] memory attestations = buildAttestations(request, proofData);\n\n _beforeRecordAttestations(request, proofData);\n\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n\n _afterRecordAttestations(attestations);\n\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationGenerated(attestations[i]);\n }\n\n return attestations;\n }\n\n /**\n * @dev External facing function. Allows to delete attestations by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that were deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n address[] memory attestationOwners = new address[](collectionIds.length);\n\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\n\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n // fetch attestations from the registry\n (\n address issuer,\n uint256 attestationValue,\n uint32 timestamp,\n bytes memory extraData\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\n\n attestationOwners[i] = attestationsOwner;\n attestationCollectionIds[i] = collectionIds[i];\n\n attestations[i] = (\n Attestation(\n collectionIds[i],\n attestationsOwner,\n issuer,\n attestationValue,\n timestamp,\n extraData\n )\n );\n }\n\n _verifyAttestationsDeletionRequest(attestations, proofData);\n\n _beforeDeleteAttestations(attestations, proofData);\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n\n _afterDeleteAttestations(attestations, proofData);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n emit AttestationDeleted(attestations[i]);\n }\n return attestations;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) public view virtual returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry getter\n * @return attestationRegistry\n */\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\n return ATTESTATIONS_REGISTRY;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should verify the user request is valid\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\n\n /**\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\n * Default behavior: throws\n * It should verify attestations deletion request is valid\n * @param attestations Attestations that will be deleted\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyAttestationsDeletionRequest(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {\n revert AttestationDeletionNotImplemented();\n }\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before recording attestations in the registry\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _beforeRecordAttestations(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual {}\n\n /**\n * @dev (Optional) Can be overridden in attesters inheriting this contract\n * Will be called after recording an attestation\n * @param attestations Recorded attestations\n */\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _beforeDeleteAttestations(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called after deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _afterDeleteAttestations(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {}\n}\n" - }, - "contracts/core/Badges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Badges contract\n * @author Sismo\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n * For more information: https://badges.docs.sismo.io\n */\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\n uint8 public constant IMPLEMENTATION_VERSION = 3;\n\n IAttestationsRegistry internal _attestationsRegistry;\n\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\n\n /**\n * @dev Constructor\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n constructor(\n string memory uri,\n address owner // This is Sismo Frontend Contract\n ) ERC1155(uri) {\n initialize(uri, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n string memory uri,\n address owner\n ) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup uri yet or if called by constructor (for implem setup)\n if (bytes(ERC1155.uri(0)).length == 0 || address(this).code.length == 0) {\n _setURI(uri);\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n }\n }\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(\n address account,\n uint256 id\n ) public view virtual override(ERC1155, IBadges) returns (uint256) {\n return _attestationsRegistry.getAttestationValue(id, account);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function isApprovedForAll(\n address account,\n address operator\n ) public view virtual override returns (bool) {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\n emit TransferSingle(operator, from, to, id, value);\n }\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(\n address attestationsRegistry\n ) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\n }\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _setURI(uri);\n }\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view override returns (address) {\n return address(_attestationsRegistry);\n }\n\n /**\n * @dev Getter of the badge issuer\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeIssuer(address account, uint256 id) external view returns (address) {\n return _attestationsRegistry.getAttestationIssuer(id, account);\n }\n\n /**\n * @dev Getter of the badge timestamp\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32) {\n return _attestationsRegistry.getAttestationTimestamp(id, account);\n }\n\n /**\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory) {\n return _attestationsRegistry.getAttestationExtraData(id, account);\n }\n\n /**\n * @dev Getter of the value of a specific badge attribute\n * @param id Badge Id to check (= attestationCollectionId)\n * @param index Index of the attribute\n */\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8) {\n return _attestationsRegistry.getAttributeValueForAttestationsCollection(id, index);\n }\n\n /**\n * @dev Getter of all badge attributes and their values for a specific badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getAttributesNamesAndValuesForBadge(\n uint256 id\n ) external view returns (bytes32[] memory, uint8[] memory) {\n return _attestationsRegistry.getAttributesNamesAndValuesForAttestationsCollection(id);\n }\n\n /**\n * @dev ERC165\n */\n function supportsInterface(\n bytes4 interfaceId\n ) public view virtual override(AccessControl, ERC1155) returns (bool) {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n revert BadgesNonTransferrable();\n }\n}\n" - }, - "contracts/core/Front.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IFront} from './interfaces/IFront.sol';\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation} from './libs/Structs.sol';\n\n/**\n * @title Front\n * @author Sismo\n * @notice This is the Front contract of the Sismo protocol\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\n\n * For more information: https://front.docs.sismo.io\n */\ncontract Front is IFront {\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\n uint256 public constant EARLY_USER_COLLECTION = 0;\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress Attestations registry contract address\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n Attestation[] memory attestations = _forwardAttestationsGeneration(\n attester,\n request,\n proofData\n );\n _generateEarlyUserAttestation(request.destination);\n return attestations;\n }\n\n /**\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n address destination = requests[0].destination;\n for (uint256 i = 0; i < attesters.length; i++) {\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\n attestations[i] = _forwardAttestationsGeneration(\n attesters[i],\n requests[i],\n proofDataArray[i]\n );\n }\n _generateEarlyUserAttestation(destination);\n return attestations;\n }\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view override returns (Attestation[] memory) {\n return _forwardAttestationsBuild(attester, request, proofData);\n }\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function of targeted attester\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n\n for (uint256 i = 0; i < attesters.length; i++) {\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\n }\n return attestations;\n }\n\n function _forwardAttestationsBuild(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal view returns (Attestation[] memory) {\n return IAttester(attester).buildAttestations(request, proofData);\n }\n\n function _forwardAttestationsGeneration(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal returns (Attestation[] memory) {\n return IAttester(attester).generateAttestations(request, proofData);\n }\n\n function _generateEarlyUserAttestation(address destination) internal {\n uint32 currentTimestamp = uint32(block.timestamp);\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\n EARLY_USER_COLLECTION,\n destination\n );\n\n if (!alreadyHasAttestation) {\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n EARLY_USER_COLLECTION,\n destination,\n address(this),\n 1,\n currentTimestamp,\n 'With strong love from Sismo'\n );\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n emit EarlyUserAttestationGenerated(destination);\n }\n }\n }\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\nimport {IAttestationsRegistryConfigLogic} from './IAttestationsRegistryConfigLogic.sol';\n\n/**\n * @title IAttestationsRegistry\n * @author Sismo\n * @notice This is the interface of the AttestationRegistry\n */\ninterface IAttestationsRegistry is IAttestationsRegistryConfigLogic {\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\n event AttestationRecorded(Attestation attestation);\n event AttestationDeleted(Attestation attestation);\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external;\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(\n uint256 collectionId,\n address owner\n ) external view returns (AttestationData memory);\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(\n uint256 collectionId,\n address owner\n ) external view returns (address, uint256, uint32, bytes memory);\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(\n uint256 collectionId,\n address owner\n ) external view returns (bytes memory);\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(\n uint256 collectionId,\n address owner\n ) external view returns (address);\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(\n uint256 collectionId,\n address owner\n ) external view returns (uint32);\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view returns (AttestationData[] memory);\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(\n uint256[] memory collectionIds,\n address[] memory owners\n ) external view returns (uint256[] memory);\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\n\ninterface IAttestationsRegistryConfigLogic {\n error AttesterNotFound(address issuer);\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\n error IdsMismatch(\n address issuer,\n uint256 rangeIndex,\n uint256 expectedFirstId,\n uint256 expectedLastId,\n uint256 FirstId,\n uint256 lastCollectionId\n );\n error AttributeDoesNotExist(uint8 attributeIndex);\n error AttributeAlreadyExists(uint8 attributeIndex);\n error ArgsLengthDoesNotMatch();\n\n event NewAttributeCreated(uint8 attributeIndex, bytes32 attributeName);\n event AttributeNameUpdated(\n uint8 attributeIndex,\n bytes32 newAttributeName,\n bytes32 previousAttributeName\n );\n event AttributeDeleted(uint8 attributeIndex, bytes32 deletedAttributeName);\n\n event AttestationsCollectionAttributeSet(\n uint256 collectionId,\n uint8 attributeIndex,\n uint8 attributeValue\n );\n\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n\n /**\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute. Can go from 0 to 63.\n */\n function attestationsCollectionHasAttribute(\n uint256 collectionId,\n uint8 index\n ) external view returns (bool);\n\n function attestationsCollectionHasAttributes(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (bool);\n\n /**\n * @dev Returns the attribute's value (from 1 to 15) of an attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param attributeIndex Index of the attribute. Can go from 0 to 63.\n */\n function getAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 attributeIndex\n ) external view returns (uint8);\n\n function getAttributesValuesForAttestationsCollection(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (uint8[] memory);\n\n /**\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute (must be between 0 and 63)\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\n */\n function setAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 index,\n uint8 value\n ) external;\n\n function setAttributesValuesForAttestationsCollections(\n uint256[] memory collectionIds,\n uint8[] memory indices,\n uint8[] memory values\n ) external;\n\n /**\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n */\n function getAttributesNamesAndValuesForAttestationsCollection(\n uint256 collectionId\n ) external view returns (bytes32[] memory, uint8[] memory);\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external;\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external;\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external;\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external;\n\n /**\n * @dev Create a new attribute.\n * @param index Index of the attribute. Can go from 0 to 63.\n * @param name Name in bytes32 of the attribute\n */\n function createNewAttribute(uint8 index, bytes32 name) external;\n\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external;\n\n /**\n * @dev Update the name of an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\n * @param newName new name in bytes32 of the attribute\n */\n function updateAttributeName(uint8 index, bytes32 newName) external;\n\n function updateAttributesName(uint8[] memory indices, bytes32[] memory names) external;\n\n /**\n * @dev Delete an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\n */\n function deleteAttribute(uint8 index) external;\n\n function deleteAttributes(uint8[] memory indices) external;\n}\n" - }, - "contracts/core/interfaces/IAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\n\n/**\n * @title IAttester\n * @author Sismo\n * @notice This is the interface for the attesters in Sismo Protocol\n */\ninterface IAttester {\n event AttestationGenerated(Attestation attestation);\n\n event AttestationDeleted(Attestation attestation);\n\n error AttestationDeletionNotImplemented();\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev External facing function. Allows to delete an attestation by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that was deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry address getter\n * @return attestationRegistry Address of the registry\n */\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\n}\n" - }, - "contracts/core/interfaces/IBadges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Interface for Badges contract\n * @author Sismo\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n */\ninterface IBadges {\n error BadgesNonTransferrable();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(string memory uri, address owner) external;\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external;\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry) external;\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external;\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view returns (address);\n\n /**\n * @dev Getter of the badge issuer\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeIssuer(address account, uint256 id) external view returns (address);\n\n /**\n * @dev Getter of the badge timestamp\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeTimestamp(address account, uint256 id) external view returns (uint32);\n\n /**\n * @dev Getter of the badge extra data (it can store nullifier and burnCount)\n * @param account Address that holds the badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getBadgeExtraData(address account, uint256 id) external view returns (bytes memory);\n\n /**\n * @dev Getter of the value of a specific badge attribute\n * @param id Badge Id to check (= attestationCollectionId)\n * @param index Index of the attribute\n */\n function getAttributeValueForBadge(uint256 id, uint8 index) external view returns (uint8);\n\n /**\n * @dev Getter of all badge attributes and their values for a specific badge\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function getAttributesNamesAndValuesForBadge(\n uint256 id\n ) external view returns (bytes32[] memory, uint8[] memory);\n}\n" - }, - "contracts/core/interfaces/IFront.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\n\n/**\n * @title IFront\n * @author Sismo\n * @notice This is the interface of the Front Contract\n */\ninterface IFront {\n error DifferentRequestsDestinations();\n event EarlyUserAttestationGenerated(address destination);\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev generate multiple attestations at once, to the same destination\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external returns (Attestation[][] memory);\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function(s) of targeted attester(s)\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view returns (Attestation[][] memory);\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport './OwnableLogic.sol';\nimport './PausableLogic.sol';\nimport './InitializableLogic.sol';\nimport './AttestationsRegistryState.sol';\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\nimport {Bitmap256Bit} from '../utils/Bitmap256Bit.sol';\n\n/**\n * @title Attestations Registry Config Logic contract\n * @author Sismo\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\n **/\ncontract AttestationsRegistryConfigLogic is\n AttestationsRegistryState,\n IAttestationsRegistryConfigLogic,\n OwnableLogic,\n PausableLogic,\n InitializableLogic\n{\n using RangeUtils for Range[];\n using Bitmap256Bit for uint256;\n using Bitmap256Bit for uint8;\n\n /******************************************\n *\n * ATTESTATION REGISTRY WRITE ACCESS MANAGEMENT (ISSUERS)\n *\n *****************************************/\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external override onlyOwner {\n _pause();\n }\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external override onlyOwner {\n _unpause();\n }\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\n for (uint256 i = 0; i < ranges.length; i++) {\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external override onlyOwner {\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\n return _isAuthorized(issuer, collectionId);\n }\n\n /******************************************\n *\n * ATTRIBUTES CONFIG LOGIC\n *\n *****************************************/\n\n /**\n * @dev Create a new attribute.\n * @param index Index of the attribute. Can go from 0 to 63.\n * @param name Name in bytes32 of the attribute\n */\n function createNewAttribute(uint8 index, bytes32 name) public onlyOwner {\n index._checkIndexIsValid();\n if (_isAttributeCreated(index)) {\n revert AttributeAlreadyExists(index);\n }\n _createNewAttribute(index, name);\n }\n\n function createNewAttributes(uint8[] memory indices, bytes32[] memory names) external onlyOwner {\n if (indices.length != names.length) {\n revert ArgsLengthDoesNotMatch();\n }\n\n for (uint256 i = 0; i < indices.length; i++) {\n createNewAttribute(indices[i], names[i]);\n }\n }\n\n /**\n * @dev Update the name of an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must exist\n * @param newName new name in bytes32 of the attribute\n */\n function updateAttributeName(uint8 index, bytes32 newName) public onlyOwner {\n index._checkIndexIsValid();\n if (!_isAttributeCreated(index)) {\n revert AttributeDoesNotExist(index);\n }\n _updateAttributeName(index, newName);\n }\n\n function updateAttributesName(\n uint8[] memory indices,\n bytes32[] memory newNames\n ) external onlyOwner {\n if (indices.length != newNames.length) {\n revert ArgsLengthDoesNotMatch();\n }\n\n for (uint256 i = 0; i < indices.length; i++) {\n updateAttributeName(indices[i], newNames[i]);\n }\n }\n\n /**\n * @dev Delete an existing attribute\n * @param index Index of the attribute. Can go from 0 to 63. The attribute must already exist\n */\n function deleteAttribute(uint8 index) public onlyOwner {\n index._checkIndexIsValid();\n if (!_isAttributeCreated(index)) {\n revert AttributeDoesNotExist(index);\n }\n _deleteAttribute(index);\n }\n\n function deleteAttributes(uint8[] memory indices) external onlyOwner {\n for (uint256 i = 0; i < indices.length; i++) {\n deleteAttribute(indices[i]);\n }\n }\n\n /**\n * @dev Set a value for an attribute of an attestationsCollection. The attribute should already be created.\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute (must be between 0 and 63)\n * @param value Value of the attribute we want to set for this attestationsCollection. Can take the value 0 to 15\n */\n function setAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 index,\n uint8 value\n ) public onlyOwner {\n index._checkIndexIsValid();\n\n if (!_isAttributeCreated(index)) {\n revert AttributeDoesNotExist(index);\n }\n\n _setAttributeForAttestationsCollection(collectionId, index, value);\n }\n\n function setAttributesValuesForAttestationsCollections(\n uint256[] memory collectionIds,\n uint8[] memory indices,\n uint8[] memory values\n ) external onlyOwner {\n if (collectionIds.length != indices.length || collectionIds.length != values.length) {\n revert ArgsLengthDoesNotMatch();\n }\n for (uint256 i = 0; i < collectionIds.length; i++) {\n setAttributeValueForAttestationsCollection(collectionIds[i], indices[i], values[i]);\n }\n }\n\n /**\n * @dev Returns the attribute's value (from 0 to 15) of an attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute. Can go from 0 to 63.\n */\n function getAttributeValueForAttestationsCollection(\n uint256 collectionId,\n uint8 index\n ) public view returns (uint8) {\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\n collectionId\n );\n return currentAttributesValues._get(index);\n }\n\n function getAttributesValuesForAttestationsCollection(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (uint8[] memory) {\n uint8[] memory attributesValues = new uint8[](indices.length);\n for (uint256 i = 0; i < indices.length; i++) {\n attributesValues[i] = getAttributeValueForAttestationsCollection(collectionId, indices[i]);\n }\n return attributesValues;\n }\n\n /**\n * @dev Returns whether an attestationsCollection has a specific attribute referenced by its index\n * @param collectionId Collection Id of the targeted attestationsCollection\n * @param index Index of the attribute. Can go from 0 to 63.\n */\n function attestationsCollectionHasAttribute(\n uint256 collectionId,\n uint8 index\n ) public view returns (bool) {\n uint256 currentAttributeValues = _getAttributesValuesBitmapForAttestationsCollection(\n collectionId\n );\n return currentAttributeValues._get(index) > 0;\n }\n\n function attestationsCollectionHasAttributes(\n uint256 collectionId,\n uint8[] memory indices\n ) external view returns (bool) {\n for (uint256 i = 0; i < indices.length; i++) {\n if (!attestationsCollectionHasAttribute(collectionId, indices[i])) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * @dev Returns all the enabled attributes names and their values for a specific attestationsCollection\n * @param collectionId Collection Id of the targeted attestationsCollection\n */\n function getAttributesNamesAndValuesForAttestationsCollection(\n uint256 collectionId\n ) public view returns (bytes32[] memory, uint8[] memory) {\n uint256 currentAttributesValues = _getAttributesValuesBitmapForAttestationsCollection(\n collectionId\n );\n\n (\n uint8[] memory indices,\n uint8[] memory values,\n uint8 nbOfNonZeroValues\n ) = currentAttributesValues._getAllNonZeroValues();\n\n bytes32[] memory attributesNames = new bytes32[](nbOfNonZeroValues);\n uint8[] memory attributesValues = new uint8[](nbOfNonZeroValues);\n for (uint8 i = 0; i < nbOfNonZeroValues; i++) {\n attributesNames[i] = _attributesNames[indices[i]];\n attributesValues[i] = values[i];\n }\n\n return (attributesNames, attributesValues);\n }\n\n /*****************************\n *\n * INTERNAL FUNCTIONS\n *\n *****************************/\n\n function _authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal {\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\n _authorizedRanges[issuer].push(newRange);\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal onlyOwner {\n if (rangeIndex >= _authorizedRanges[issuer].length)\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\n\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\n revert IdsMismatch(\n issuer,\n rangeIndex,\n expectedFirstId,\n expectedLastId,\n firstCollectionId,\n lastCollectionId\n );\n\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\n _authorizedRanges[issuer].length - 1\n ];\n _authorizedRanges[issuer].pop();\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\n return _authorizedRanges[issuer]._includes(collectionId);\n }\n\n function _setAttributeForAttestationsCollection(\n uint256 collectionId,\n uint8 index,\n uint8 value\n ) internal {\n uint256 currentAttributes = _getAttributesValuesBitmapForAttestationsCollection(collectionId);\n\n _attestationsCollectionAttributesValuesBitmap[collectionId] = currentAttributes._set(\n index,\n value\n );\n\n emit AttestationsCollectionAttributeSet(collectionId, index, value);\n }\n\n function _createNewAttribute(uint8 index, bytes32 name) internal {\n _attributesNames[index] = name;\n\n emit NewAttributeCreated(index, name);\n }\n\n function _updateAttributeName(uint8 index, bytes32 newName) internal {\n bytes32 previousName = _attributesNames[index];\n\n _attributesNames[index] = newName;\n\n emit AttributeNameUpdated(index, newName, previousName);\n }\n\n function _deleteAttribute(uint8 index) internal {\n bytes32 deletedName = _attributesNames[index];\n\n delete _attributesNames[index];\n\n emit AttributeDeleted(index, deletedName);\n }\n\n function _getAttributesValuesBitmapForAttestationsCollection(\n uint256 collectionId\n ) internal view returns (uint256) {\n return _attestationsCollectionAttributesValuesBitmap[collectionId];\n }\n\n function _isAttributeCreated(uint8 index) internal view returns (bool) {\n if (_attributesNames[index] == 0) {\n return false;\n }\n return true;\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryState.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Range} from '../utils/RangeLib.sol';\nimport {Attestation, AttestationData} from '../Structs.sol';\n\ncontract AttestationsRegistryState {\n /*******************************************************\n Storage layout:\n 19 slots for config\n 4 currently used for _initialized, _initializing, _paused, _owner\n 15 place holders\n 16 slots for logic\n 3 currently used for _authorizedRanges, _attestationsCollectionAttributesValuesBitmap, _attributesNames\n 13 place holders\n 1 slot for _attestationsData \n *******************************************************/\n\n // main config\n // changed `_initialized` from bool to uint8\n // as we were using OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n // and changed to OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n // PR: https://github.com/sismo-core/sismo-protocol/pull/41\n uint8 internal _initialized;\n bool internal _initializing;\n bool internal _paused;\n address internal _owner;\n // keeping some space for future\n uint256[15] private _placeHoldersAdmin;\n\n // storing the authorized ranges for each attesters\n mapping(address => Range[]) internal _authorizedRanges;\n // Storing the attributes values used for each attestations collection\n // Each attribute value is an hexadecimal\n mapping(uint256 => uint256) internal _attestationsCollectionAttributesValuesBitmap;\n // Storing the attribute name for each attributes index\n mapping(uint8 => bytes32) internal _attributesNames;\n // keeping some space for future\n uint256[13] private _placeHoldersConfig;\n // storing the data of attestations\n // =collectionId=> =owner=> attestationData\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\n}\n" - }, - "contracts/core/libs/attestations-registry/InitializableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.8.0) (proxy/utils/Initializable.sol)\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Address.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\n * reused. This mechanism prevents re-execution of each \"step\" but allows the creation of new initialization steps in\n * case an upgrade adds a module that needs to be initialized.\n *\n * For example:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * contract MyToken is ERC20Upgradeable {\n * function initialize() initializer public {\n * __ERC20_init(\"MyToken\", \"MTK\");\n * }\n * }\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\n * function initializeV2() reinitializer(2) public {\n * __ERC20Permit_init(\"MyToken\");\n * }\n * }\n * ```\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() {\n * _disableInitializers();\n * }\n * ```\n * ====\n */\nabstract contract InitializableLogic is AttestationsRegistryState {\n // only diff with oz\n // /**\n // * @dev Indicates that the contract has been initialized.\n // */\n // bool private _initialized;\n\n // /**\n // * @dev Indicates that the contract is in the process of being initialized.\n // */\n // bool private _initializing;\n\n /**\n * @dev Triggered when the contract has been initialized or reinitialized.\n */\n event Initialized(uint8 version);\n\n /**\n * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\n * `onlyInitializing` functions can be used to initialize parent contracts.\n *\n * Similar to `reinitializer(1)`, except that functions marked with `initializer` can be nested in the context of a\n * constructor.\n *\n * Emits an {Initialized} event.\n */\n modifier initializer() {\n bool isTopLevelCall = !_initializing;\n require(\n (isTopLevelCall && _initialized < 1) ||\n (!Address.isContract(address(this)) && _initialized == 1),\n 'Initializable: contract is already initialized'\n );\n _initialized = 1;\n if (isTopLevelCall) {\n _initializing = true;\n }\n _;\n if (isTopLevelCall) {\n _initializing = false;\n emit Initialized(1);\n }\n }\n\n /**\n * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\n * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\n * used to initialize parent contracts.\n *\n * A reinitializer may be used after the original initialization step. This is essential to configure modules that\n * are added through upgrades and that require initialization.\n *\n * When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`\n * cannot be nested. If one is invoked in the context of another, execution will revert.\n *\n * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\n * a contract, executing them in the right order is up to the developer or operator.\n *\n * WARNING: setting the version to 255 will prevent any future reinitialization.\n *\n * Emits an {Initialized} event.\n */\n modifier reinitializer(uint8 version) {\n require(\n !_initializing && _initialized < version,\n 'Initializable: contract is already initialized'\n );\n _initialized = version;\n _initializing = true;\n _;\n _initializing = false;\n emit Initialized(version);\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} and {reinitializer} modifiers, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, 'Initializable: contract is not initializing');\n _;\n }\n\n /**\n * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\n * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\n * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\n * through proxies.\n *\n * Emits an {Initialized} event the first time it is successfully executed.\n */\n function _disableInitializers() internal virtual {\n require(!_initializing, 'Initializable: contract is initializing');\n if (_initialized < type(uint8).max) {\n _initialized = type(uint8).max;\n emit Initialized(type(uint8).max);\n }\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initialized`\n */\n function _getInitializedVersion() internal view returns (uint8) {\n return _initialized;\n }\n\n /**\n * @dev Internal function that returns the initialized version. Returns `_initializing`\n */\n function _isInitializing() internal view returns (bool) {\n return _initializing;\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/OwnableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n // This is the only diff with OZ contract\n // address private _owner;\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/PausableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableLogic is Context, AttestationsRegistryState {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n // this is the only diff with OZ contract\n // bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), 'Pausable: paused');\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), 'Pausable: not paused');\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "contracts/core/libs/Structs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Attestations Registry State\n * @author Sismo\n * @notice This contract holds all of the storage variables and data\n * structures used by the AttestationsRegistry and parent\n * contracts.\n */\n\n// User Attestation Request, can be made by any user\n// The context of an Attestation Request is a specific attester contract\n// Each attester has groups of accounts in its available data\n// eg: for a specific attester:\n// group 1 <=> accounts that sent txs on mainnet\n// group 2 <=> accounts that sent txs on polygon\n// eg: for another attester:\n// group 1 <=> accounts that sent eth txs in 2022\n// group 2 <=> accounts sent eth txs in 2021\nstruct Request {\n // implicit address attester;\n // implicit uint256 chainId;\n Claim[] claims;\n address destination; // destination that will receive the end attestation\n}\n\nstruct Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\n}\n\n/**\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\n * @param collectionId Attestation collection\n * @param owner Attestation collection\n * @param issuer Attestation collection\n * @param value Attestation collection\n * @param timestamp Attestation collection\n * @param extraData Attestation collection\n */\nstruct Attestation {\n // implicit uint256 chainId;\n uint256 collectionId; // Id of the attestation collection (in the registry)\n address owner; // Owner of the attestation\n address issuer; // Contract that created or last updated the record.\n uint256 value; // Value of the attestation\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\n // it is different from the recording timestamp (date when the attestation was recorded)\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\n bytes extraData; // arbitrary data that can be added by the attester\n}\n\n// Attestation Data, stored in the registry\n// The context is a specific owner of a specific collection\nstruct AttestationData {\n // implicit uint256 chainId\n // implicit uint256 collectionId - from context\n // implicit owner\n address issuer; // Address of the contract that recorded the attestation\n uint256 value; // Value of the attestation\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\n bytes extraData; // arbitrary data that can be added by the attester\n}\n" - }, - "contracts/core/libs/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, 'Address: insufficient balance');\n\n (bool success, ) = recipient.call{value: amount}('');\n require(success, 'Address: unable to send value, recipient may have reverted');\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, 'Address: low-level call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, 'Address: insufficient balance for call');\n require(isContract(target), 'Address: call to non-contract');\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data\n ) internal view returns (bytes memory) {\n return functionStaticCall(target, data, 'Address: low-level static call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), 'Address: static call to non-contract');\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), 'Address: delegate call to non-contract');\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/core/libs/utils/Bitmap256Bit.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/*\n * The 256-bit bitmap is structured in 64 chuncks of 4 bits each.\n * The 4 bits can encode any value from 0 to 15.\n\n chunck63 chunck2 chunck1 chunck0\n bits bits bits bits \n ┌────────────┐ ┌────────────┬────────────┬────────────┐\n │ 1 1 1 1 │ .... │ 1 0 1 1 │ 0 0 0 0 │ 0 0 0 1 │\n └────────────┘ └────────────┴────────────┴────────────┘\n value 15 value 11 value 0 value 1\n\n * A chunck index must be between 0 and 63.\n * A value must be between 0 and 15.\n **/\n\nlibrary Bitmap256Bit {\n uint256 constant MAX_INT = 2 ** 256 - 1;\n\n error IndexOutOfBounds(uint8 index);\n error ValueOutOfBounds(uint8 value);\n\n /**\n * @dev Return the value at a given index of a 256-bit bitmap\n * @param index index where the value can be found. Can be between 0 and 63\n */\n function _get(uint256 self, uint8 index) internal pure returns (uint8) {\n uint256 currentValues = self;\n // Get the encoded 4-bit value by right shifting to the `index` position\n uint256 shifted = currentValues >> (4 * index);\n // Get the value by only masking the last 4 bits with an AND operator\n return uint8(shifted & (2 ** 4 - 1));\n }\n\n /**\n * @dev Set a value at a chosen index in a 256-bit bitmap\n * @param index index where the value will be stored. Can be between 0 and 63\n * @param value value to store. Can be between 0 and 15\n */\n function _set(uint256 self, uint8 index, uint8 value) internal pure returns (uint256) {\n _checkIndexIsValid(index);\n _checkValueIsValid(value);\n\n uint256 currentValues = self;\n // 1. first we need to remove the current value for the inputed `index`\n // Left Shift 4 bits mask (1111 mask) to the `index` position\n uint256 mask = (2 ** 4 - 1) << (4 * index);\n // Apply a XOR operation to obtain a mask with all bits set to 1 except the 4 bits that we want to remove\n uint256 negativeMask = MAX_INT ^ mask;\n // Apply a AND operation between the current values and the negative mask to remove the wanted bits\n uint256 newValues = currentValues & negativeMask;\n\n // 2. We set the new value wanted at the `index` position\n // Create the 4 bits encoding the new value and left shift them to the `index` position\n uint256 newValueMask = uint256(value) << (4 * index);\n // Apply an OR operation between the current values and the newValueMask to reference new value\n return newValues | newValueMask;\n }\n\n /**\n * @dev Get all the non-zero values in a 256-bit bitmap\n * @param self a 256-bit bitmap\n */\n function _getAllNonZeroValues(\n uint256 self\n ) internal pure returns (uint8[] memory, uint8[] memory, uint8) {\n uint8[] memory indices = new uint8[](64);\n uint8[] memory values = new uint8[](64);\n uint8 nbOfNonZeroValues = 0;\n for (uint8 i = 0; i < 63; i++) {\n uint8 value = _get(self, i);\n if (value > 0) {\n indices[nbOfNonZeroValues] = i;\n values[nbOfNonZeroValues] = value;\n nbOfNonZeroValues++;\n }\n }\n return (indices, values, nbOfNonZeroValues);\n }\n\n /**\n * @dev Check if the index is valid (is between 0 and 63)\n * @param index index of a chunck\n */\n function _checkIndexIsValid(uint8 index) internal pure {\n if (index > 63) {\n revert IndexOutOfBounds(index);\n }\n }\n\n /**\n * @dev Check if the value is valid (is between 0 and 15)\n * @param value value to encode in a chunck\n */\n function _checkValueIsValid(uint8 value) internal pure {\n if (value > 15) {\n revert ValueOutOfBounds(value);\n }\n }\n}\n" - }, - "contracts/core/libs/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.14;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "contracts/core/libs/utils/RangeLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nstruct Range {\n uint256 min;\n uint256 max;\n}\n\n// Range [0;3] includees 0 and 3\nlibrary RangeUtils {\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\n for (uint256 i = 0; i < ranges.length; i++) {\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\n return true;\n }\n }\n return false;\n }\n}\n" - }, - "contracts/periphery/badges-examples/BAYCOwnershipBadgeExample.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC721} from '@openzeppelin/contracts/token/ERC721/ERC721.sol';\nimport {IAttestationsRegistry} from '../../core/interfaces/IAttestationsRegistry.sol';\n\ncontract BAYCOwnershipBadge is ERC721 {\n IAttestationsRegistry immutable ATTESTATIONS_REGISTRY;\n uint256 constant HydraS1_BAYC_ATTESTATION_COLLECTION_ID = 100000001;\n uint256 constant SMPS_BAYC_ATTESTATION_COLLECTION_ID = 30000000000003;\n\n constructor(\n address attestationsRegistryAddress,\n string memory name,\n string memory symbol\n ) ERC721(name, symbol) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n function balanceOf(address account) public view virtual override returns (uint256) {\n bool hasZKAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n HydraS1_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n bool hasDoxingAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n SMPS_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n return hasZKAttestation || hasDoxingAttestation ? 1 : 0;\n }\n}\n" - }, - "contracts/periphery/utils/AvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n/**\n * @title Attesters Groups Registry\n * @author Sismo\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\n * For more information: https://available-roots-registry.docs.sismo.io\n *\n **/\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\n uint8 public constant IMPLEMENTATION_VERSION = 2;\n\n mapping(address => mapping(uint256 => bool)) public _roots;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can register/ unregister roots\n */\n constructor(address owner) {\n initialize(owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address ownerAddress) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n }\n }\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\n _registerRootForAttester(attester, root);\n }\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\n _unregisterRootForAttester(attester, root);\n }\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external onlyOwner {\n _registerRootForAttester(address(0), root);\n }\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external onlyOwner {\n _unregisterRootForAttester(address(0), root);\n }\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\n return _roots[_msgSender()][root] || _roots[address(0)][root];\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\n return _roots[attester][root] || _roots[address(0)][root];\n }\n\n function _registerRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = true;\n if (attester == address(0)) {\n emit RegisteredRootForAll(root);\n } else {\n emit RegisteredRootForAttester(attester, root);\n }\n }\n\n function _unregisterRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = false;\n if (attester == address(0)) {\n emit UnregisteredRootForAll(root);\n } else {\n emit UnregisteredRootForAttester(attester, root);\n }\n }\n}\n" - }, - "contracts/periphery/utils/CommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\n\n/**\n * @title Commitment Mapper Registry Contract\n * @author Sismo\n * @notice This contract stores information about the commitment mapper.\n * Its ethereum address and its EdDSA public key\n * For more information: https://commitment-mapper.docs.sismo.io\n *\n **/\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\n uint8 public constant IMPLEMENTATION_VERSION = 2;\n\n uint256[2] internal _commitmentMapperPubKey;\n address _commitmentMapperAddress;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n constructor(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) {\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param ownerAddress Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n address ownerAddress,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) public reinitializer(IMPLEMENTATION_VERSION) {\n // if proxy did not setup owner yet or if called by constructor (for implem setup)\n if (owner() == address(0) || address(this).code.length == 0) {\n _transferOwnership(ownerAddress);\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\n _updateCommitmentMapperAddress(commitmentMapperAddress);\n }\n }\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\n }\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\n _updateCommitmentMapperAddress(newAddress);\n }\n\n /**\n * @dev Getter of the EdDSA public key of the commitment mapper\n */\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\n return _commitmentMapperPubKey;\n }\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view override returns (address) {\n return _commitmentMapperAddress;\n }\n\n function _updateCommitmentMapperAddress(address newAddress) internal {\n _commitmentMapperAddress = newAddress;\n emit UpdatedCommitmentMapperAddress(newAddress);\n }\n\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\n _commitmentMapperPubKey = pubKey;\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\n/**\n * @title IAvailableRootsRegistry\n * @author Sismo\n * @notice Interface for (Merkle) Roots Registry\n */\ninterface IAvailableRootsRegistry {\n event RegisteredRootForAttester(address attester, uint256 root);\n event RegisteredRootForAll(uint256 root);\n event UnregisteredRootForAttester(address attester, uint256 root);\n event UnregisteredRootForAll(uint256 root);\n\n error CannotRegisterForZeroAddress();\n error CannotUnregisterForZeroAddress();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(address owner) external;\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external;\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external;\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\n}\n" - }, - "contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\ninterface ICommitmentMapperRegistry {\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\n event UpdatedCommitmentMapperAddress(address newAddress);\n error PubKeyNotValid(uint256[2] pubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n * @notice The reinitializer modifier is needed to configure modules that are added through upgrades and that require initialization.\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) external;\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external;\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getEdDSAPubKey() external view returns (uint256[2] memory);\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view returns (address);\n}\n" - }, - "contracts/periphery/utils/TransparentUpgradeableProxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n// Note: we just copied so that we can see the contract used\npragma solidity ^0.8.14;\n\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(''), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(\n address newImplementation,\n bytes calldata data\n ) external payable ifAdmin {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(\n msg.sender != _getAdmin(),\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\n );\n super._beforeFallback();\n }\n}\n" - }, - "contracts/tests/MockAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttestationsRegistry} from '../core/interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from '../core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from '../core/libs/attestations-registry/AttestationsRegistryState.sol';\nimport {IBadges} from '../core/interfaces/IBadges.sol';\nimport {Attestation, AttestationData} from '../core/libs/Structs.sol';\n\ncontract MockAttestationsRegistry {\n uint256 immutable ATTESTATION_VALUE;\n\n event AttestationRecorded(Attestation attestation);\n\n constructor(uint256 attestationValue) {\n ATTESTATION_VALUE = attestationValue;\n }\n\n function getAttestationValue(\n uint256 collectionId,\n address owner\n ) external view returns (uint256) {\n return ATTESTATION_VALUE;\n }\n\n function recordAttestations(Attestation[] calldata attestations) external {\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationRecorded(attestations[i]);\n }\n }\n}\n" - }, - "contracts/tests/MockAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\nimport {Attestation, Request} from '../core/libs/Structs.sol';\nimport {Attester} from '../core/Attester.sol';\nimport {IAttester} from '../core/interfaces/IAttester.sol';\n\ncontract MockAttester is IAttester, Attester {\n uint256 public immutable ATTESTATION_ID_MIN;\n uint256 public immutable ATTESTATION_ID_MAX;\n\n constructor(\n address ATTESTATION_REGISTRY_ADDRESS,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n ) Attester(ATTESTATION_REGISTRY_ADDRESS) {\n ATTESTATION_ID_MIN = collectionIdFirst;\n ATTESTATION_ID_MAX = collectionIdLast;\n }\n\n function _verifyRequest(\n Request calldata request,\n bytes calldata proofData\n ) internal virtual override {}\n\n function buildAttestations(\n Request calldata request,\n bytes calldata /*data*/\n ) public view virtual override(Attester, IAttester) returns (Attestation[] memory) {\n uint256 collectionId = ATTESTATION_ID_MIN + request.claims[0].groupId;\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n collectionId,\n request.destination,\n address(this),\n request.claims[0].claimedValue,\n abi.decode(request.claims[0].extraData, (uint32)),\n 'Mock Attester v0'\n );\n return (attestations);\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates", - "storageLayout" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/solcInputs/70d5ec851bd4311fac67c09b114b9c0c.json b/deployments/sandboxPolygon/solcInputs/70d5ec851bd4311fac67c09b114b9c0c.json deleted file mode 100644 index 1733491..0000000 --- a/deployments/sandboxPolygon/solcInputs/70d5ec851bd4311fac67c09b114b9c0c.json +++ /dev/null @@ -1,227 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/attesters/hydra-s1/base/HydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1Base} from './IHydraS1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Hydra S1 ZK Proving Scheme\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n \n \n **/\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\n using HydraS1Lib for HydraS1ProofData;\n\n // ZK-SNARK Verifier\n HydraS1Verifier immutable VERIFIER;\n // Registry storing the Commitment Mapper EdDSA Public key\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\n * @param commitmentMapperAddress Commitment mapper's public key registry\n */\n constructor(\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress\n ) {\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\n }\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\n return COMMITMENT_MAPPER_REGISTRY;\n }\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\n return AVAILABLE_ROOTS_REGISTRY;\n }\n\n /*******************************************************\n Hydra-S1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input which guarantees privacy\n\n * This function MUST be implemented by Hydra-S1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Hydra-S1 Simple Attester for an example\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\n */\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n virtual\n returns (uint256);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\n internal\n view\n virtual\n {\n if (input.accountsTreeValue != claim.groupId)\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\n revert RegistryRootMismatch(input.registryRoot);\n\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\n if (\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\n )\n revert CommitmentMapperPubKeyMismatch(\n commitmentMapperPubKey[0],\n commitmentMapperPubKey[1],\n input.commitmentMapperPubKey[0],\n input.commitmentMapperPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the groth16 mathematical proof\n * @param proofData snark public input\n */\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(\n uint256 /*errorCode*/\n ) {\n revert InvalidGroth16Proof('');\n } catch (\n bytes memory /*lowLevelData*/\n ) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/IHydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n// todo: explain well what is specific to this attester\ninterface IHydraS1Base {\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\n error RegistryRootMismatch(uint256 inputRoot);\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error CommitmentMapperPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error AccountsTreeValueMismatch(\n uint256 expectedAccountsTreeValue,\n uint256 inputAccountsTreeValue\n );\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier);\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\n}\n" - }, - "@openzeppelin/contracts/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" - }, - "contracts/core/libs/Structs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Attestations Registry State\n * @author Sismo\n * @notice This contract holds all of the storage variables and data\n * structures used by the AttestationsRegistry and parent\n * contracts.\n */\n\n// User Attestation Request, can be made by any user\n// The context of an Attestation Request is a specific attester contract\n// Each attester has groups of accounts in its available data\n// eg: for a specific attester:\n// group 1 <=> accounts that sent txs on mainnet\n// group 2 <=> accounts that sent txs on polygon\n// eg: for another attester:\n// group 1 <=> accounts that sent eth txs in 2022\n// group 2 <=> accounts sent eth txs in 2021\nstruct Request {\n // implicit address attester;\n // implicit uint256 chainId;\n Claim[] claims;\n address destination; // destination that will receive the end attestation\n}\n\nstruct Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\n}\n\n/**\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\n * @param collectionId Attestation collection\n * @param owner Attestation collection\n * @param issuer Attestation collection\n * @param value Attestation collection\n * @param timestamp Attestation collection\n * @param extraData Attestation collection\n */\nstruct Attestation {\n // implicit uint256 chainId;\n uint256 collectionId; // Id of the attestation collection (in the registry)\n address owner; // Owner of the attestation\n address issuer; // Contract that created or last updated the record.\n uint256 value; // Value of the attestation\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\n // it is different from the recording timestamp (date when the attestation was recorded)\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\n bytes extraData; // arbitrary data that can be added by the attester\n}\n\n// Attestation Data, stored in the registry\n// The context is a specific owner of a specific collection\nstruct AttestationData {\n // implicit uint256 chainId\n // implicit uint256 collectionId - from context\n // implicit owner\n address issuer; // Address of the contract that recorded the attestation\n uint256 value; // Value of the attestation\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\n bytes extraData; // arbitrary data that can be added by the attester\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1GroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n bool isScore;\n}\n\nstruct HydraS1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct HydraS1ProofData {\n HydraS1CircomSnarkProof proof;\n uint256[10] input;\n // destination\n // chainId\n // commitmentMapperPubKey.x\n // commitmentMapperPubKey.y\n // registryTreeRoot\n // ticketIdentifier\n // ticket\n // claimedValue\n // accountsTreeValue\n // isStrict\n}\n\nstruct HydraS1ProofInput {\n address destination;\n uint256 chainId;\n uint256 registryRoot;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n uint256 accountsTreeValue;\n bool isStrict;\n uint256[2] commitmentMapperPubKey;\n}\n\nlibrary HydraS1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\n return\n HydraS1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getRegistryRoot(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getAccountsTreeValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1GroupProperties)\n );\n\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(HydraS1ProofData memory self)\n internal\n pure\n returns (\n uint256[2] memory,\n uint256[2][2] memory,\n uint256[2] memory,\n uint256[10] memory\n )\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\n internal\n pure\n returns (uint256[2] memory)\n {\n return [self.input[2], self.input[3]];\n }\n\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\n internal\n pure\n returns (uint256)\n {\n return self.input[5];\n }\n\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[8];\n }\n\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\n return self.input[9] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\n );\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(groupIndex, generationTimestamp, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/periphery/utils/CommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\n\n/**\n * @title Commitment Mapper Registry Contract\n * @author Sismo\n * @notice This contract stores information about the commitment mapper.\n * Its ethereum address and its EdDSA public key\n * For more information: https://commitment-mapper.docs.sismo.io\n *\n **/\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\n uint256[2] internal _commitmentMapperPubKey;\n address _commitmentMapperAddress;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n constructor(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) {\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) public initializer {\n _transferOwnership(owner);\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\n _updateCommitmentMapperAddress(commitmentMapperAddress);\n }\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\n }\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\n _updateCommitmentMapperAddress(newAddress);\n }\n\n /**\n * @dev Getter of the EdDSA public key of the commitment mapper\n */\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\n return _commitmentMapperPubKey;\n }\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view override returns (address) {\n return _commitmentMapperAddress;\n }\n\n function _updateCommitmentMapperAddress(address newAddress) internal {\n _commitmentMapperAddress = newAddress;\n emit UpdatedCommitmentMapperAddress(newAddress);\n }\n\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\n _commitmentMapperPubKey = pubKey;\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\n }\n}\n" - }, - "contracts/periphery/utils/AvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n/**\n * @title Attesters Groups Registry\n * @author Sismo\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\n * For more information: https://available-roots-registry.docs.sismo.io\n *\n **/\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\n mapping(address => mapping(uint256 => bool)) public _roots;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can register/ unregister roots\n */\n constructor(address owner) {\n initialize(owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) public initializer {\n _transferOwnership(owner);\n }\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\n _registerRootForAttester(attester, root);\n }\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\n _unregisterRootForAttester(attester, root);\n }\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external onlyOwner {\n _registerRootForAttester(address(0), root);\n }\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external onlyOwner {\n _unregisterRootForAttester(address(0), root);\n }\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\n return _roots[_msgSender()][root] || _roots[address(0)][root];\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\n return _roots[attester][root] || _roots[address(0)][root];\n }\n\n function _registerRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = true;\n if (attester == address(0)) {\n emit RegisteredRootForAll(root);\n } else {\n emit RegisteredRootForAttester(attester, root);\n }\n }\n\n function _unregisterRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = false;\n if (attester == address(0)) {\n emit UnregisteredRootForAll(root);\n } else {\n emit UnregisteredRootForAttester(attester, root);\n }\n }\n}\n" - }, - "@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract HydraS1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\n );\n vk.IC = new Pairing.G1Point[](11);\n \n vk.IC[0] = Pairing.G1Point( \n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\n 546002182798634190282541153661423157791776194062719045593389981526666716416\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\n 181057165072599074288983745076121344893296348827576905983079816835912241514\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\n ); \n \n vk.IC[10] = Pairing.G1Point( \n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[10] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "@openzeppelin/contracts/access/Ownable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\ninterface ICommitmentMapperRegistry {\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\n event UpdatedCommitmentMapperAddress(address newAddress);\n error PubKeyNotValid(uint256[2] pubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) external;\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external;\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getEdDSAPubKey() external view returns (uint256[2] memory);\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\n/**\n * @title IAvailableRootsRegistry\n * @author Sismo\n * @notice Interface for (Merkle) Roots Registry\n */\ninterface IAvailableRootsRegistry {\n event RegisteredRootForAttester(address attester, uint256 root);\n event RegisteredRootForAll(uint256 root);\n event UnregisteredRootForAttester(address attester, uint256 root);\n event UnregisteredRootForAll(uint256 root);\n\n error CannotRegisterForZeroAddress();\n error CannotUnregisterForZeroAddress();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) external;\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external;\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external;\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\n}\n" - }, - "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SoulboundAttester} from '../interfaces/IHydraS1SoulboundAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from '../../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from '../base/HydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Soulbound Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - SoulBound (with cooldown period)\n * A user can chose to delete attestations or generate attestation to a new destination.\n * When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional\n * User will need to wait until the end of the cooldown period before being able to delete or switch destination again\n * One can however know that the former and the new destinations were created using the same userTicket\n \n * - Renewable\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew or update their attestations\n **/\ncontract HydraS1SoulboundAttester is IHydraS1SoulboundAttester, HydraS1Base, Attester {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n uint256 public immutable SOULBOUND_COOLDOWN_DURATION;\n\n mapping(uint256 => TicketData) internal _userTicketsData;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n uint256 soulboundCooldownDuration\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n SOULBOUND_COOLDOWN_DURATION = soulboundCooldownDuration;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user attestations request is invalid\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark proof backing the claim\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Throws if user attestations deletion request is not made by its owner\n * @param attestations attestations to delete\n */\n function _verifyAttestationsDeletionRequest(Attestation[] memory attestations, bytes calldata)\n internal\n view\n override\n {\n for (uint256 i = 0; i < attestations.length; i++) {\n uint256 userTicket = abi.decode(attestations[0].extraData, (uint256));\n if (_userTicketsData[userTicket].destination != msg.sender)\n revert NotAttestationOwner(userTicket, msg.sender);\n }\n }\n\n /**\n * @dev Returns the actual attestations constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark public input as well as snark proof\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n HydraS1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n // The issuer of attestations is the attester\n address issuer = address(this);\n // user sends the ticket as input in the data\n uint256 userTicket = proofData._getTicket();\n\n attestations[0] = Attestation(\n attestationCollectionId,\n request.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n abi.encode(userTicket)\n );\n\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used, not a renewal, and ticket on cooldown.\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n uint256 userTicket = proofData._getTicket();\n TicketData memory userTicketData = _userTicketsData[userTicket];\n\n if (\n userTicketData.destination != address(0) && userTicketData.destination != request.destination\n ) {\n if (_isOnCooldown(userTicketData)) revert TicketUsedAndOnCooldown(userTicketData);\n _setTicketOnCooldown(userTicket);\n }\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n override\n {\n // we retrieve the ticketUsed from attestations extraData\n for (uint256 i = 0; i < attestations.length; i++) {\n uint256 userTicket = abi.decode(attestations[i].extraData, (uint256));\n if (_isOnCooldown(_userTicketsData[userTicket]) == true) revert TicketFrozen(userTicket);\n _userTicketsData[userTicket].destination = address(0);\n }\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\n return ticketIdentifier;\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n /**\n * @dev Getter, returns the data linked to a ticket\n * @param userTicket ticket used\n **/\n function getTicketData(uint256 userTicket) external view override returns (TicketData memory) {\n return _getTicketData(userTicket);\n }\n\n /**\n * @dev returns whether a ticket is on cooldown or not\n * @param userTicket ticket used\n **/\n function isTicketOnCooldown(uint256 userTicket) external view override returns (bool) {\n return _isOnCooldown(_getTicketData(userTicket));\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _userTicketsData[userTicket].destination = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _setTicketOnCooldown(uint256 userTicket) internal {\n _userTicketsData[userTicket].cooldownStart = uint32(block.timestamp);\n emit TicketSetOnCooldown(userTicket);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _userTicketsData[userTicket].destination;\n }\n\n function _isOnCooldown(TicketData memory userTicketData) internal view returns (bool) {\n return userTicketData.cooldownStart + SOULBOUND_COOLDOWN_DURATION < block.timestamp;\n }\n\n function _getTicketData(uint256 userTicket) internal view returns (TicketData memory) {\n return _userTicketsData[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1SoulboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n// todo: explain well what is specific to this attester\ninterface IHydraS1SoulboundAttester is IHydraS1Base, IAttester {\n struct TicketData {\n address destination;\n uint32 cooldownStart;\n }\n error NotAttestationOwner(uint256 ticket, address sender);\n error TicketFrozen(uint256 ticketData);\n error TicketUsedAndOnCooldown(TicketData ticketData);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n event TicketSetOnCooldown(uint256 ticket);\n\n /**\n * @dev returns whether a ticket is on cooldown or not\n * @param userTicket ticket used\n **/\n function isTicketOnCooldown(uint256 userTicket) external view returns (bool);\n\n /**\n * @dev Getter, returns the data linked to a ticket\n * @param userTicket ticket used\n **/\n function getTicketData(uint256 userTicket) external view returns (TicketData memory);\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the duration of the cooldown period after having used a ticket\n **/\n function SOULBOUND_COOLDOWN_DURATION() external view returns (uint256);\n}\n" - }, - "contracts/core/Attester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\n\n/**\n * @title Attester Abstract Contract\n * @author Sismo\n * @notice Contract to be inherited by Attesters\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\n * are recommended to implemented this abstract contract\n\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\n *\n * This contracts is built around two main external standard functions.\n * They must NOT be override them, unless your really know what you are doing\n \n * - generateAttestations(request, proof) => will write attestations in the registry\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\n\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\n\n * For more information: https://attesters.docs.sismo.io\n **/\nabstract contract Attester is IAttester {\n // Registry where all attestations are stored\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(Request calldata request, bytes calldata proofData)\n external\n override\n returns (Attestation[] memory)\n {\n // Verify if request is valid by verifying against proof\n _verifyRequest(request, proofData);\n\n // Generate the actual attestations from user request\n Attestation[] memory attestations = buildAttestations(request, proofData);\n\n _beforeRecordAttestations(request, proofData);\n\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n\n _afterRecordAttestations(attestations);\n\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationGenerated(attestations[i]);\n }\n\n return attestations;\n }\n\n /**\n * @dev External facing function. Allows to delete attestations by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that were deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n // fetch attestations from the registry\n Attestation[] memory attestationsToDelete;\n for (uint256 i = 0; i < collectionIds.length; i++) {\n (\n address issuer,\n uint256 attestationValue,\n uint32 timestamp,\n bytes memory extraData\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\n\n attestationsToDelete[i] = (\n Attestation(\n collectionIds[i],\n attestationsOwner,\n issuer,\n attestationValue,\n timestamp,\n extraData\n )\n );\n }\n\n _verifyAttestationsDeletionRequest(attestationsToDelete, proofData);\n\n _beforeDeleteAttestations(attestationsToDelete, proofData);\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationsToDelete);\n\n _afterDeleteAttestations(attestationsToDelete, proofData);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n emit AttestationDeleted(attestationsToDelete[i]);\n }\n return attestationsToDelete;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n public\n view\n virtual\n returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry getter\n * @return attestationRegistry\n */\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\n return ATTESTATIONS_REGISTRY;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should verify the user request is valid\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\n\n /**\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\n * Default behavior: throws\n * It should verify attestations deletion request is valid\n * @param attestations Attestations that will be deleted\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyAttestationsDeletionRequest(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {\n revert AttestationDeletionNotImplemented();\n }\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before recording attestations in the registry\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n {}\n\n /**\n * @dev (Optional) Can be overridden in attesters inheriting this contract\n * Will be called after recording an attestation\n * @param attestations Recorded attestations\n */\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n virtual\n {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called after deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n virtual\n {}\n}\n" - }, - "contracts/core/interfaces/IAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\n\n/**\n * @title IAttester\n * @author Sismo\n * @notice This is the interface for the attesters in Sismo Protocol\n */\ninterface IAttester {\n event AttestationGenerated(Attestation attestation);\n\n event AttestationDeleted(Attestation attestation);\n\n error AttestationDeletionNotImplemented();\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(Request calldata request, bytes calldata proofData)\n external\n returns (Attestation[] memory);\n\n /**\n * @dev External facing function. Allows to delete an attestation by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that was deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n external\n view\n returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry address getter\n * @return attestationRegistry Address of the registry\n */\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\n\n/**\n * @title IAttestationsRegistry\n * @author Sismo\n * @notice This is the interface of the AttestationRegistry\n */\ninterface IAttestationsRegistry {\n event AttestationRecorded(Attestation attestation);\n event AttestationDeleted(Attestation attestation);\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external;\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param attestations Attestations to be deleted\n */\n function deleteAttestations(Attestation[] calldata attestations) external;\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(uint256 collectionId, address owner)\n external\n view\n returns (AttestationData memory);\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(uint256 collectionId, address owner)\n external\n view\n returns (\n address,\n uint256,\n uint32,\n bytes memory\n );\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(uint256 collectionId, address owner)\n external\n view\n returns (bytes memory);\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(uint256 collectionId, address owner)\n external\n view\n returns (address);\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(uint256 collectionId, address owner)\n external\n view\n returns (uint32);\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n returns (AttestationData[] memory);\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n returns (uint256[] memory);\n}\n" - }, - "contracts/tests/MockAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\nimport {Attestation, Request} from '../core/libs/Structs.sol';\nimport {Attester} from '../core/Attester.sol';\nimport {IAttester} from '../core/interfaces/IAttester.sol';\n\ncontract MockAttester is IAttester, Attester {\n uint256 public immutable ATTESTATION_ID_MIN;\n uint256 public immutable ATTESTATION_ID_MAX;\n\n constructor(\n address ATTESTATION_REGISTRY_ADDRESS,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n ) Attester(ATTESTATION_REGISTRY_ADDRESS) {\n ATTESTATION_ID_MIN = collectionIdFirst;\n ATTESTATION_ID_MAX = collectionIdLast;\n }\n\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {}\n\n function buildAttestations(\n Request calldata request,\n bytes calldata /*data*/\n ) public view virtual override(Attester, IAttester) returns (Attestation[] memory) {\n uint256 collectionId = ATTESTATION_ID_MIN + request.claims[0].groupId;\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n collectionId,\n request.destination,\n address(this),\n request.claims[0].claimedValue,\n abi.decode(request.claims[0].extraData, (uint32)),\n 'Mock Attester v0'\n );\n return (attestations);\n }\n}\n" - }, - "contracts/core/Front.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IFront} from './interfaces/IFront.sol';\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation} from './libs/Structs.sol';\n\n/**\n * @title Front\n * @author Sismo\n * @notice This is the Front contract of the Sismo protocol\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\n\n * For more information: https://front.docs.sismo.io\n */\ncontract Front is IFront {\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\n uint256 public constant EARLY_USER_COLLECTION = 0;\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress Attestations registry contract address\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n Attestation[] memory attestations = _forwardAttestationsGeneration(\n attester,\n request,\n proofData\n );\n _generateEarlyUserAttestation(request.destination);\n return attestations;\n }\n\n /**\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n address destination = requests[0].destination;\n for (uint256 i = 0; i < attesters.length; i++) {\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\n attestations[i] = _forwardAttestationsGeneration(\n attesters[i],\n requests[i],\n proofDataArray[i]\n );\n }\n _generateEarlyUserAttestation(destination);\n return attestations;\n }\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view override returns (Attestation[] memory) {\n return _forwardAttestationsBuild(attester, request, proofData);\n }\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function of targeted attester\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n\n for (uint256 i = 0; i < attesters.length; i++) {\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\n }\n return attestations;\n }\n\n function _forwardAttestationsBuild(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal view returns (Attestation[] memory) {\n return IAttester(attester).buildAttestations(request, proofData);\n }\n\n function _forwardAttestationsGeneration(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal returns (Attestation[] memory) {\n return IAttester(attester).generateAttestations(request, proofData);\n }\n\n function _generateEarlyUserAttestation(address destination) internal {\n uint32 currentTimestamp = uint32(block.timestamp);\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\n EARLY_USER_COLLECTION,\n destination\n );\n\n if (!alreadyHasAttestation) {\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n EARLY_USER_COLLECTION,\n destination,\n address(this),\n 1,\n currentTimestamp,\n 'With strong love from Sismo'\n );\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n emit EarlyUserAttestationGenerated(destination);\n }\n }\n }\n}\n" - }, - "contracts/core/interfaces/IFront.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\n\n/**\n * @title IFront\n * @author Sismo\n * @notice This is the interface of the Front Contract\n */\ninterface IFront {\n error DifferentRequestsDestinations();\n event EarlyUserAttestationGenerated(address destination);\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev generate multiple attestations at once, to the same destination\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external returns (Attestation[][] memory);\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function(s) of targeted attester(s)\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view returns (Attestation[][] memory);\n}\n" - }, - "contracts/tests/MockAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttestationsRegistry} from '../core/interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from '../core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from '../core/libs/attestations-registry/AttestationsRegistryState.sol';\nimport {IBadges} from '../core/interfaces/IBadges.sol';\nimport {Attestation, AttestationData} from '../core/libs/Structs.sol';\n\ncontract MockAttestationsRegistry {\n uint256 immutable ATTESTATION_VALUE;\n\n event AttestationRecorded(Attestation attestation);\n\n constructor(uint256 attestationValue) {\n ATTESTATION_VALUE = attestationValue;\n }\n\n function getAttestationValue(uint256 collectionId, address owner)\n external\n view\n returns (uint256)\n {\n return ATTESTATION_VALUE;\n }\n\n function recordAttestations(Attestation[] calldata attestations) external {\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationRecorded(attestations[i]);\n }\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport './OwnableLogic.sol';\nimport './PausableLogic.sol';\nimport './InitializableLogic.sol';\nimport './AttestationsRegistryState.sol';\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\n\n/**\n * @title Attestations Registry Config Logic contract\n * @author Sismo\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\n **/\ncontract AttestationsRegistryConfigLogic is\n AttestationsRegistryState,\n IAttestationsRegistryConfigLogic,\n OwnableLogic,\n PausableLogic,\n InitializableLogic\n{\n using RangeUtils for Range[];\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\n for (uint256 i = 0; i < ranges.length; i++) {\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external override onlyOwner {\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\n return _isAuthorized(issuer, collectionId);\n }\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external override onlyOwner {\n _pause();\n }\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external override onlyOwner {\n _unpause();\n }\n\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\n return _authorizedRanges[issuer]._includes(collectionId);\n }\n\n function _authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal {\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\n _authorizedRanges[issuer].push(newRange);\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal onlyOwner {\n if (rangeIndex >= _authorizedRanges[issuer].length)\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\n\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\n revert IdsMismatch(\n issuer,\n rangeIndex,\n expectedFirstId,\n expectedLastId,\n firstCollectionId,\n lastCollectionId\n );\n\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\n _authorizedRanges[issuer].length - 1\n ];\n _authorizedRanges[issuer].pop();\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryState.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Range} from '../utils/RangeLib.sol';\nimport {Attestation, AttestationData} from '../Structs.sol';\n\ncontract AttestationsRegistryState {\n // main config\n bool internal _initialized;\n bool internal _initializing;\n bool internal _paused;\n address internal _owner;\n // keeping some space for future\n uint256[15] private _placeHolders;\n\n // storing the authorized ranges for each attesters\n mapping(address => Range[]) internal _authorizedRanges;\n // keeping some space for future\n uint256[15] private _placeHolders2;\n // storing the data of attestations\n // =collectionId=> =owner=> attestationData\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\n}\n" - }, - "contracts/core/interfaces/IBadges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Interface for Badges contract\n * @author Sismo\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n */\ninterface IBadges {\n error BadgesNonTransferrable();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n function initialize(string memory uri, address owner) external;\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external;\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry) external;\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external;\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view returns (address);\n}\n" - }, - "contracts/core/libs/attestations-registry/OwnableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n // This is the only diff with OZ contract\n // address private _owner;\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/PausableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableLogic is Context, AttestationsRegistryState {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n // this is the only diff with OZ contract\n // bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), 'Pausable: paused');\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), 'Pausable: not paused');\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/InitializableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Address.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract InitializableLogic is AttestationsRegistryState {\n // only diff with oz\n // /**\n // * @dev Indicates that the contract has been initialized.\n // */\n // bool private _initialized;\n\n // /**\n // * @dev Indicates that the contract is in the process of being initialized.\n // */\n // bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(\n _initializing ? _isConstructor() : !_initialized,\n 'Initializable: contract is already initialized'\n );\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, 'Initializable: contract is not initializing');\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\n\ninterface IAttestationsRegistryConfigLogic {\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\n error AttesterNotFound(address issuer);\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\n error IdsMismatch(\n address issuer,\n uint256 rangeIndex,\n uint256 expectedFirstId,\n uint256 expectedLastId,\n uint256 FirstId,\n uint256 lastCollectionId\n );\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external;\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external;\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external;\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external;\n}\n" - }, - "contracts/core/libs/utils/RangeLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nstruct Range {\n uint256 min;\n uint256 max;\n}\n\n// Range [0;3] includees 0 and 3\nlibrary RangeUtils {\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\n for (uint256 i = 0; i < ranges.length; i++) {\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\n return true;\n }\n }\n return false;\n }\n}\n" - }, - "contracts/core/libs/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.14;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "contracts/core/libs/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, 'Address: insufficient balance');\n\n (bool success, ) = recipient.call{value: amount}('');\n require(success, 'Address: unable to send value, recipient may have reverted');\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, 'Address: low-level call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, 'Address: insufficient balance for call');\n require(isContract(target), 'Address: call to non-contract');\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data)\n internal\n view\n returns (bytes memory)\n {\n return functionStaticCall(target, data, 'Address: low-level static call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), 'Address: static call to non-contract');\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), 'Address: delegate call to non-contract');\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/core/Badges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Badges contract\n * @author Sismo\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n * For more information: https://badges.docs.sismo.io\n */\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\n IAttestationsRegistry internal _attestationsRegistry;\n\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\n\n /**\n * @dev Constructor\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n constructor(\n string memory uri,\n address owner // This is Sismo Frontend Contract\n ) ERC1155(uri) {\n initialize(uri, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n function initialize(string memory uri, address owner) public initializer {\n _setURI(uri);\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n }\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id)\n public\n view\n virtual\n override(ERC1155, IBadges)\n returns (uint256)\n {\n return _attestationsRegistry.getAttestationValue(id, account);\n }\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\n emit TransferSingle(operator, from, to, id, value);\n }\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry)\n external\n override\n onlyRole(DEFAULT_ADMIN_ROLE)\n {\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\n }\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _setURI(uri);\n }\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view override returns (address) {\n return address(_attestationsRegistry);\n }\n\n /**\n * @dev ERC165\n */\n function supportsInterface(bytes4 interfaceId)\n public\n view\n virtual\n override(AccessControl, ERC1155)\n returns (bool)\n {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n revert BadgesNonTransferrable();\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/ERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC1155.sol\";\nimport \"./IERC1155Receiver.sol\";\nimport \"./extensions/IERC1155MetadataURI.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of the basic standard multi-token.\n * See https://eips.ethereum.org/EIPS/eip-1155\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\n *\n * _Available since v3.1._\n */\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\n using Address for address;\n\n // Mapping from token ID to account balances\n mapping(uint256 => mapping(address => uint256)) private _balances;\n\n // Mapping from account to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n string private _uri;\n\n /**\n * @dev See {_setURI}.\n */\n constructor(string memory uri_) {\n _setURI(uri_);\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155).interfaceId ||\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC1155MetadataURI-uri}.\n *\n * This implementation returns the same URI for *all* token types. It relies\n * on the token type ID substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * Clients calling this function must replace the `\\{id\\}` substring with the\n * actual token type ID.\n */\n function uri(uint256) public view virtual override returns (string memory) {\n return _uri;\n }\n\n /**\n * @dev See {IERC1155-balanceOf}.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\n require(account != address(0), \"ERC1155: balance query for the zero address\");\n return _balances[id][account];\n }\n\n /**\n * @dev See {IERC1155-balanceOfBatch}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\n public\n view\n virtual\n override\n returns (uint256[] memory)\n {\n require(accounts.length == ids.length, \"ERC1155: accounts and ids length mismatch\");\n\n uint256[] memory batchBalances = new uint256[](accounts.length);\n\n for (uint256 i = 0; i < accounts.length; ++i) {\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\n }\n\n return batchBalances;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev See {IERC1155-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not owner nor approved\"\n );\n _safeTransferFrom(from, to, id, amount, data);\n }\n\n /**\n * @dev See {IERC1155-safeBatchTransferFrom}.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: transfer caller is not owner nor approved\"\n );\n _safeBatchTransferFrom(from, to, ids, amounts, data);\n }\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n\n emit TransferSingle(operator, from, to, id, amount);\n\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; ++i) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n }\n\n emit TransferBatch(operator, from, to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\n }\n\n /**\n * @dev Sets a new URI for all token types, by relying on the token type ID\n * substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * By this mechanism, any occurrence of the `\\{id\\}` substring in either the\n * URI or any of the amounts in the JSON file at said URI will be replaced by\n * clients with the token type ID.\n *\n * For example, the `https://token-cdn-domain/\\{id\\}.json` URI would be\n * interpreted by clients as\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\n * for token type ID 0x4cce0.\n *\n * See {uri}.\n *\n * Because these URIs cannot be meaningfully represented by the {URI} event,\n * this function emits no events.\n */\n function _setURI(string memory newuri) internal virtual {\n _uri = newuri;\n }\n\n /**\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _mint(\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);\n\n _balances[id][to] += amount;\n emit TransferSingle(operator, address(0), to, id, amount);\n\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _mintBatch(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; i++) {\n _balances[ids[i]][to] += amounts[i];\n }\n\n emit TransferBatch(operator, address(0), to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\n }\n\n /**\n * @dev Destroys `amount` tokens of token type `id` from `from`\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `from` must have at least `amount` tokens of token type `id`.\n */\n function _burn(\n address from,\n uint256 id,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), \"\");\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n\n emit TransferSingle(operator, from, address(0), id, amount);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n */\n function _burnBatch(\n address from,\n uint256[] memory ids,\n uint256[] memory amounts\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n for (uint256 i = 0; i < ids.length; i++) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n }\n\n emit TransferBatch(operator, from, address(0), ids, amounts);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits a {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC1155: setting approval status for self\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `id` and `amount` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n function _doSafeTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\n if (response != IERC1155Receiver.onERC1155Received.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\n bytes4 response\n ) {\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\n uint256[] memory array = new uint256[](1);\n array[0] = element;\n\n return array;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1155.sol\";\nimport \"../../../security/Pausable.sol\";\n\n/**\n * @dev ERC1155 token with pausable token transfers, minting and burning.\n *\n * Useful for scenarios such as preventing trades until the end of an evaluation\n * period, or having an emergency switch for freezing all token transfers in the\n * event of a large bug.\n *\n * _Available since v3.1._\n */\nabstract contract ERC1155Pausable is ERC1155, Pausable {\n /**\n * @dev See {ERC1155-_beforeTokenTransfer}.\n *\n * Requirements:\n *\n * - the contract must not be paused.\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n require(!paused(), \"ERC1155Pausable: token transfer while paused\");\n }\n}\n" - }, - "@openzeppelin/contracts/access/AccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role, _msgSender());\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(uint160(account), 20),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155MetadataURI is IERC1155 {\n /**\n * @dev Returns the URI for token type `id`.\n *\n * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n * clients with the actual token type ID.\n */\n function uri(uint256 id) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/ERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/security/Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), \"Pausable: paused\");\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), \"Pausable: not paused\");\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "@openzeppelin/contracts/access/IAccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" - }, - "@openzeppelin/contracts/utils/Strings.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n // Inspired by OraclizeAPI's implementation - MIT licence\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0x00\";\n }\n uint256 temp = value;\n uint256 length = 0;\n while (temp != 0) {\n length++;\n temp >>= 8;\n }\n return toHexString(value, length);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n}\n" - }, - "contracts/periphery/badges-examples/BAYCOwnershipBadgeExample.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC721} from '@openzeppelin/contracts/token/ERC721/ERC721.sol';\nimport {IAttestationsRegistry} from '../../core/interfaces/IAttestationsRegistry.sol';\n\ncontract BAYCOwnershipBadge is ERC721 {\n IAttestationsRegistry immutable ATTESTATIONS_REGISTRY;\n uint256 constant HydraS1_BAYC_ATTESTATION_COLLECTION_ID = 100000001;\n uint256 constant SMPS_BAYC_ATTESTATION_COLLECTION_ID = 30000000000003;\n\n constructor(\n address attestationsRegistryAddress,\n string memory name,\n string memory symbol\n ) ERC721(name, symbol) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n function balanceOf(address account) public view virtual override returns (uint256) {\n bool hasZKAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n HydraS1_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n bool hasDoxingAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n SMPS_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n return hasZKAttestation || hasDoxingAttestation ? 1 : 0;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/ERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"./extensions/IERC721Metadata.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/Strings.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: balance query for the zero address\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _owners[tokenId];\n require(owner != address(0), \"ERC721: owner query for nonexistent token\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n require(_exists(tokenId), \"ERC721Metadata: URI query for nonexistent token\");\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overriden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not owner nor approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n require(_exists(tokenId), \"ERC721: approved query for nonexistent token\");\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: transfer caller is not owner nor approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: transfer caller is not owner nor approved\");\n _safeTransfer(from, to, tokenId, _data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `_data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, _data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _owners[tokenId] != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n require(_exists(tokenId), \"ERC721: operator query for nonexistent token\");\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, _data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId);\n\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId);\n\n // Clear approvals\n _approve(address(0), tokenId);\n\n _balances[owner] -= 1;\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId);\n\n // Clear approvals from the previous owner\n _approve(address(0), tokenId);\n\n _balances[from] -= 1;\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits a {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits a {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param _data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, ``from``'s `tokenId` will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" - }, - "@openzeppelin/contracts/utils/StorageSlot.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" - }, - "contracts/periphery/utils/TransparentUpgradeableProxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n// Note: we just copied so that we can see the contract used\npragma solidity ^0.8.14;\n\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(''), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n ifAdmin\n {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(\n msg.sender != _getAdmin(),\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\n );\n super._beforeFallback();\n }\n}\n" - }, - "contracts/attesters/pythia-1/base/Pythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IPythia1Base} from './IPythia1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Pythia 1 ZK Proving Scheme\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\n\n/**\n * @title Pythia-1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \n * without anyone being able to make the link between the offchain service and the onchain service.\n * It is inherited by the family of Pythia-1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n \n \n **/\nabstract contract Pythia1Base is IPythia1Base, Initializable {\n using Pythia1Lib for Pythia1ProofData;\n\n // ZK-SNARK Verifier\n Pythia1Verifier immutable VERIFIER;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\n */\n constructor(address Pythia1VerifierAddress) {\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\n }\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of the Commitment signer Eddsa Public key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\n return _getCommitmentSignerPubKey();\n }\n\n /*******************************************************\n Pythia-1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * the secretHash is a number only known by the user and is used in \n * the zero knowledge as a private input which guarantees privacy\n\n * This function MUST be implemented by Pythia-1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Pythia-1 Simple Attester for an example\n * @param claim user claim: a particular claim that a user have that he can prove s right.\n */\n function _getTicketIdentifierOfClaim(Pythia1Claim memory claim)\n internal\n view\n virtual\n returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\n * prove the claim was correctly issued for the user.\n */\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(Pythia1Claim memory claim, Pythia1ProofInput memory input)\n internal\n view\n virtual\n {\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (claim.destination != msg.sender)\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\n if (\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\n )\n revert CommitmentSignerPubKeyMismatch(\n commitmentSignerPubKey[0],\n commitmentSignerPubKey[1],\n input.commitmentSignerPubKey[0],\n input.commitmentSignerPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the plonk mathematical proof using the circom verifier contract\n * @param proofData snark public input\n */\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(\n uint256 /*errorCode*/\n ) {\n revert InvalidGroth16Proof('');\n } catch (\n bytes memory /*lowLevelData*/\n ) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/pythia-1/base/IPythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\n\ninterface IPythia1Base {\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error UserShouldOwnItsDestination(address sender, address inputdestination);\n error CommitmentSignerPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier);\n\n /**\n * @dev Getter of the Commitment Signer EdDSA Public Key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\n}\n" - }, - "contracts/attesters/pythia-1/libs/Pythia1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\n\n// user Pythia-1 claim retrieved form his request\nstruct Pythia1Claim {\n uint256 groupId; // user claims be part of this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct Pythia1GroupProperties {\n uint128 internalCollectionId;\n bool isScore;\n}\n\nstruct Pythia1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct Pythia1ProofData {\n Pythia1CircomSnarkProof proof;\n uint256[9] input;\n // destination;\n // chainId;\n // commitmentSignerPubKey.x;\n // commitmentSignerPubKey.y;\n // groupId;\n // ticketIdentifier;\n // userTicket;\n // value;\n // isStrict;\n}\n\nstruct Pythia1ProofInput {\n address destination;\n uint256 chainId;\n uint256 groupId;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n bool isStrict;\n uint256[2] commitmentSignerPubKey;\n}\n\nlibrary Pythia1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\n return\n Pythia1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getGroupId(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n Pythia1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (Pythia1GroupProperties)\n );\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(Pythia1ProofData memory self)\n internal\n pure\n returns (\n uint256[2] memory,\n uint256[2][2] memory,\n uint256[2] memory,\n uint256[9] memory\n )\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(Pythia1ProofData memory self)\n internal\n pure\n returns (uint256[2] memory)\n {\n return [self.input[2], self.input[3]];\n }\n\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(Pythia1ProofData memory self)\n internal\n pure\n returns (uint256)\n {\n return self.input[5];\n }\n\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\n return self.input[8] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(uint128 internalCollectionId, bool isScore)\n internal\n pure\n returns (uint256)\n {\n return\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(uint128 internalCollectionId, bool isScore)\n internal\n pure\n returns (bytes memory)\n {\n return abi.encode(internalCollectionId, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "@sismo-core/pythia-1/contracts/Pythia1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract Pythia1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\n );\n vk.IC = new Pairing.G1Point[](10);\n \n vk.IC[0] = Pairing.G1Point( \n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 104028078850975554065172701281783302003220555203883119831575537681421753151,\n 19148240629904598794948591359118971959790791697910953160820265703277306346\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[9] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to Pythia1 Proving Scheme\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\n\n/**\n * @title Pythia-1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Pythia-1 Attesters.\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \n * offchain service in a privacy preserving way. \n * That means no-one can make the link between the account used in the offchain service\n * and the onchain account where the attestation is stored.\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each users gets one userTicket per claim\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n **/\n\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\n using Pythia1Lib for Pythia1ProofData;\n using Pythia1Lib for bytes;\n using Pythia1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n uint256[2] internal _commitmentSignerPubKey;\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\n * @param owner The owner of the contract that can update the commitment signer pub key\n */\n constructor(\n address attestationsRegistryAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address pythia1VerifierAddress,\n uint256[2] memory commitmentSignerPubKey,\n address owner\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n initialize(commitmentSignerPubKey, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) public initializer {\n _transferOwnership(owner);\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into Pythia1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\n Pythia1ProofInput memory snarkInput = snarkProof._input();\n Pythia1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(Request calldata request, bytes calldata)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n Pythia1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.internalCollectionId;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n uint32(block.timestamp),\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used\n * @param request users request. Claim of beiing part of a group.\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0)) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * users bring secretHash as private input in snark which guarantees privacy\n * the secretHash is only known by the user and never escape the user's browser\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(Pythia1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.internalCollectionId\n );\n return ticketIdentifier;\n }\n\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\n return _commitmentSignerPubKey;\n }\n\n /*******************************************************\n Pythia-1 Attester Specific Functions\n *******************************************************/\n\n function updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey)\n external\n onlyOwner\n {\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\n _commitmentSignerPubKey = commitmentSignerPubKey;\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\n }\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\n\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\n error TicketUsed(uint256 userTicket);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n// todo: explain well what is specific to this attester\ninterface IHydraS1SimpleAttester is IHydraS1Base, IAttester {\n error TicketUsed(uint256 userTicket);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - Renewable\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew their attestations\n **/\n\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base, Attester {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(Request calldata request, bytes calldata)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n HydraS1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used and not a renewal (e.g destination different that last)\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0) && currentDestination != request.destination) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\n return ticketIdentifier;\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/core/AttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\nimport {Attestation, AttestationData} from './libs/Structs.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Attestations Registry\n * @author Sismo\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\n * Only authorized attestations issuers can record attestation in the registry\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\n * For more information: https://attestations-registry.docs.sismo.io\n\n * For each attestation recorded, a badge is received by the user\n * The badge is the Non transferrable NFT representation of an attestation \n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\n * It enables off-chain apps such as opensea to catch the \"shadow mint\" of the badge\n **/\ncontract AttestationsRegistry is\n AttestationsRegistryState,\n IAttestationsRegistry,\n AttestationsRegistryConfigLogic\n{\n IBadges immutable BADGES;\n\n /**\n * @dev Constructor.\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @param badgesAddress Stateless ERC1155 Badges contract\n */\n constructor(address owner, address badgesAddress) {\n initialize(owner);\n BADGES = IBadges(badgesAddress);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n */\n function initialize(address owner) public initializer {\n _transferOwnership(owner);\n }\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\n address issuer = _msgSender();\n for (uint256 i = 0; i < attestations.length; i++) {\n if (!_isAuthorized(issuer, attestations[i].collectionId))\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\n\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\n attestations[i].owner\n ].value;\n\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\n attestations[i].issuer,\n attestations[i].value,\n attestations[i].timestamp,\n attestations[i].extraData\n );\n\n _triggerBadgeTransferEvent(\n attestations[i].collectionId,\n attestations[i].owner,\n previousAttestationValue,\n attestations[i].value\n );\n emit AttestationRecorded(attestations[i]);\n }\n }\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param attestations Attestations to be deleted\n */\n function deleteAttestations(Attestation[] memory attestations) external override whenNotPaused {\n address issuer = _msgSender();\n for (uint256 i = 0; i < attestations.length; i++) {\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\n attestations[i].owner\n ].value;\n\n if (!_isAuthorized(issuer, attestations[i].collectionId))\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\n delete _attestationsData[attestations[i].collectionId][attestations[i].owner];\n\n _triggerBadgeTransferEvent(\n attestations[i].collectionId,\n attestations[i].owner,\n previousAttestationValue,\n 0\n );\n\n emit AttestationDeleted(\n Attestation(\n attestations[i].collectionId,\n attestations[i].owner,\n attestations[i].issuer,\n attestations[i].value,\n attestations[i].timestamp,\n attestations[i].extraData\n )\n );\n }\n }\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner)\n external\n view\n override\n returns (bool)\n {\n return _getAttestationValue(collectionId, owner) != 0;\n }\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(uint256 collectionId, address owner)\n external\n view\n override\n returns (AttestationData memory)\n {\n return _getAttestationData(collectionId, owner);\n }\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner)\n external\n view\n override\n returns (uint256)\n {\n return _getAttestationValue(collectionId, owner);\n }\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(uint256 collectionId, address owner)\n external\n view\n override\n returns (\n address,\n uint256,\n uint32,\n bytes memory\n )\n {\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\n return (\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n );\n }\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(uint256 collectionId, address owner)\n external\n view\n override\n returns (bytes memory)\n {\n return _attestationsData[collectionId][owner].extraData;\n }\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(uint256 collectionId, address owner)\n external\n view\n override\n returns (address)\n {\n return _attestationsData[collectionId][owner].issuer;\n }\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(uint256 collectionId, address owner)\n external\n view\n override\n returns (uint32)\n {\n return _attestationsData[collectionId][owner].timestamp;\n }\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n override\n returns (AttestationData[] memory)\n {\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\n }\n return attestationsDataArray;\n }\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n override\n returns (uint256[] memory)\n {\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\n }\n return attestationsValues;\n }\n\n /**\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\n * It enables off-chain apps such as opensea to catch the \"shadow mints/burns\" of badges\n */\n function _triggerBadgeTransferEvent(\n uint256 badgeTokenId,\n address owner,\n uint256 previousValue,\n uint256 newValue\n ) internal {\n bool isGreaterValue = newValue > previousValue;\n address operator = address(this);\n address from = isGreaterValue ? address(0) : owner;\n address to = isGreaterValue ? owner : address(0);\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\n\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\n }\n\n function _getAttestationData(uint256 collectionId, address owner)\n internal\n view\n returns (AttestationData memory)\n {\n return (_attestationsData[collectionId][owner]);\n }\n\n function _getAttestationValue(uint256 collectionId, address owner)\n internal\n view\n returns (uint256)\n {\n return _attestationsData[collectionId][owner].value;\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/solcInputs/c7c67c4a1ddf53de4ef76f8a114dfc39.json b/deployments/sandboxPolygon/solcInputs/c7c67c4a1ddf53de4ef76f8a114dfc39.json deleted file mode 100644 index 74d45b0..0000000 --- a/deployments/sandboxPolygon/solcInputs/c7c67c4a1ddf53de4ef76f8a114dfc39.json +++ /dev/null @@ -1,230 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/attesters/hydra-s1/base/HydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1Base} from './IHydraS1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Hydra S1 ZK Proving Scheme\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to the following:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n **/\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\n using HydraS1Lib for HydraS1ProofData;\n\n // ZK-SNARK Verifier\n HydraS1Verifier immutable VERIFIER;\n // Registry storing the Commitment Mapper EdDSA Public key\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\n * @param commitmentMapperAddress Commitment mapper's public key registry\n */\n constructor(\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress\n ) {\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\n }\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\n return COMMITMENT_MAPPER_REGISTRY;\n }\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\n return AVAILABLE_ROOTS_REGISTRY;\n }\n\n /*******************************************************\n Hydra-S1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input which guarantees privacy\n\n * This function MUST be implemented by Hydra-S1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Hydra-S1 Simple Attester for an example\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\n */\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n virtual\n returns (uint256);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\n internal\n view\n virtual\n {\n if (input.accountsTreeValue != claim.groupId)\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\n revert RegistryRootMismatch(input.registryRoot);\n\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\n if (\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\n )\n revert CommitmentMapperPubKeyMismatch(\n commitmentMapperPubKey[0],\n commitmentMapperPubKey[1],\n input.commitmentMapperPubKey[0],\n input.commitmentMapperPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the groth16 mathematical proof\n * @param proofData snark public input\n */\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(\n uint256 /*errorCode*/\n ) {\n revert InvalidGroth16Proof('');\n } catch (\n bytes memory /*lowLevelData*/\n ) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/IHydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Interface\n * @author Sismo\n * @notice Interface that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the errors and method specific of the Hydra-S1 attesters family and the Hydra-S1 ZK Proving Scheme\n * We invite readers to refer to the following:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n **/\ninterface IHydraS1Base {\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\n error RegistryRootMismatch(uint256 inputRoot);\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error CommitmentMapperPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error AccountsTreeValueMismatch(\n uint256 expectedAccountsTreeValue,\n uint256 inputAccountsTreeValue\n );\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier);\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\n}\n" - }, - "@openzeppelin/contracts/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" - }, - "contracts/core/libs/Structs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Attestations Registry State\n * @author Sismo\n * @notice This contract holds all of the storage variables and data\n * structures used by the AttestationsRegistry and parent\n * contracts.\n */\n\n// User Attestation Request, can be made by any user\n// The context of an Attestation Request is a specific attester contract\n// Each attester has groups of accounts in its available data\n// eg: for a specific attester:\n// group 1 <=> accounts that sent txs on mainnet\n// group 2 <=> accounts that sent txs on polygon\n// eg: for another attester:\n// group 1 <=> accounts that sent eth txs in 2022\n// group 2 <=> accounts sent eth txs in 2021\nstruct Request {\n // implicit address attester;\n // implicit uint256 chainId;\n Claim[] claims;\n address destination; // destination that will receive the end attestation\n}\n\nstruct Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\n}\n\n/**\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\n * @param collectionId Attestation collection\n * @param owner Attestation collection\n * @param issuer Attestation collection\n * @param value Attestation collection\n * @param timestamp Attestation collection\n * @param extraData Attestation collection\n */\nstruct Attestation {\n // implicit uint256 chainId;\n uint256 collectionId; // Id of the attestation collection (in the registry)\n address owner; // Owner of the attestation\n address issuer; // Contract that created or last updated the record.\n uint256 value; // Value of the attestation\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\n // it is different from the recording timestamp (date when the attestation was recorded)\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\n bytes extraData; // arbitrary data that can be added by the attester\n}\n\n// Attestation Data, stored in the registry\n// The context is a specific owner of a specific collection\nstruct AttestationData {\n // implicit uint256 chainId\n // implicit uint256 collectionId - from context\n // implicit owner\n address issuer; // Address of the contract that recorded the attestation\n uint256 value; // Value of the attestation\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\n bytes extraData; // arbitrary data that can be added by the attester\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1GroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n bool isScore;\n}\n\nstruct HydraS1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct HydraS1ProofData {\n HydraS1CircomSnarkProof proof;\n uint256[10] input;\n // destination\n // chainId\n // commitmentMapperPubKey.x\n // commitmentMapperPubKey.y\n // registryTreeRoot\n // ticketIdentifier\n // ticket\n // claimedValue\n // accountsTreeValue\n // isStrict\n}\n\nstruct HydraS1ProofInput {\n address destination;\n uint256 chainId;\n uint256 registryRoot;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n uint256 accountsTreeValue;\n bool isStrict;\n uint256[2] commitmentMapperPubKey;\n}\n\nlibrary HydraS1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\n return\n HydraS1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getRegistryRoot(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getAccountsTreeValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1GroupProperties)\n );\n\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(HydraS1ProofData memory self)\n internal\n pure\n returns (\n uint256[2] memory,\n uint256[2][2] memory,\n uint256[2] memory,\n uint256[10] memory\n )\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\n internal\n pure\n returns (uint256[2] memory)\n {\n return [self.input[2], self.input[3]];\n }\n\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\n internal\n pure\n returns (uint256)\n {\n return self.input[5];\n }\n\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[8];\n }\n\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\n return self.input[9] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\n );\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(groupIndex, generationTimestamp, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/periphery/utils/CommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\n\n/**\n * @title Commitment Mapper Registry Contract\n * @author Sismo\n * @notice This contract stores information about the commitment mapper.\n * Its ethereum address and its EdDSA public key\n * For more information: https://commitment-mapper.docs.sismo.io\n *\n **/\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\n uint256[2] internal _commitmentMapperPubKey;\n address _commitmentMapperAddress;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n constructor(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) {\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) public initializer {\n _transferOwnership(owner);\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\n _updateCommitmentMapperAddress(commitmentMapperAddress);\n }\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\n }\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\n _updateCommitmentMapperAddress(newAddress);\n }\n\n /**\n * @dev Getter of the EdDSA public key of the commitment mapper\n */\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\n return _commitmentMapperPubKey;\n }\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view override returns (address) {\n return _commitmentMapperAddress;\n }\n\n function _updateCommitmentMapperAddress(address newAddress) internal {\n _commitmentMapperAddress = newAddress;\n emit UpdatedCommitmentMapperAddress(newAddress);\n }\n\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\n _commitmentMapperPubKey = pubKey;\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\n }\n}\n" - }, - "contracts/periphery/utils/AvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n/**\n * @title Attesters Groups Registry\n * @author Sismo\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\n * For more information: https://available-roots-registry.docs.sismo.io\n *\n **/\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\n mapping(address => mapping(uint256 => bool)) public _roots;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can register/ unregister roots\n */\n constructor(address owner) {\n initialize(owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) public initializer {\n _transferOwnership(owner);\n }\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\n _registerRootForAttester(attester, root);\n }\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\n _unregisterRootForAttester(attester, root);\n }\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external onlyOwner {\n _registerRootForAttester(address(0), root);\n }\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external onlyOwner {\n _unregisterRootForAttester(address(0), root);\n }\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\n return _roots[_msgSender()][root] || _roots[address(0)][root];\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\n return _roots[attester][root] || _roots[address(0)][root];\n }\n\n function _registerRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = true;\n if (attester == address(0)) {\n emit RegisteredRootForAll(root);\n } else {\n emit RegisteredRootForAttester(attester, root);\n }\n }\n\n function _unregisterRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = false;\n if (attester == address(0)) {\n emit UnregisteredRootForAll(root);\n } else {\n emit UnregisteredRootForAttester(attester, root);\n }\n }\n}\n" - }, - "@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract HydraS1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\n );\n vk.IC = new Pairing.G1Point[](11);\n \n vk.IC[0] = Pairing.G1Point( \n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\n 546002182798634190282541153661423157791776194062719045593389981526666716416\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\n 181057165072599074288983745076121344893296348827576905983079816835912241514\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\n ); \n \n vk.IC[10] = Pairing.G1Point( \n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[10] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "@openzeppelin/contracts/access/Ownable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\ninterface ICommitmentMapperRegistry {\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\n event UpdatedCommitmentMapperAddress(address newAddress);\n error PubKeyNotValid(uint256[2] pubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) external;\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external;\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getEdDSAPubKey() external view returns (uint256[2] memory);\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\n/**\n * @title IAvailableRootsRegistry\n * @author Sismo\n * @notice Interface for (Merkle) Roots Registry\n */\ninterface IAvailableRootsRegistry {\n event RegisteredRootForAttester(address attester, uint256 root);\n event RegisteredRootForAll(uint256 root);\n event UnregisteredRootForAttester(address attester, uint256 root);\n event UnregisteredRootForAll(uint256 root);\n\n error CannotRegisterForZeroAddress();\n error CannotUnregisterForZeroAddress();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) external;\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external;\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external;\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\n}\n" - }, - "contracts/attesters/hydra-s1/variants/HydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1AccountboundAttester} from '../interfaces/IHydraS1AccountboundAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from '../../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from '../base/HydraS1Base.sol';\nimport {HydraS1AccountboundLib, HydraS1AccountboundClaim} from '../libs/HydraS1AccountboundLib.sol';\n\n/**\n * @title Hydra-S1 Accountbound Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - Accountbound (with cooldown period)\n * Users can choose to delete or generate attestations to a new destination using their source account.\n * The attestation is \"Accountbound\" to the source account.\n * When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional\n * User will need to wait until the end of the cooldown period before being able to delete or switch destination again\n * One can however know that the former and the new destinations were created using the same userTicket\n \n * - Renewable\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew or update their attestations\n **/\ncontract HydraS1AccountboundAttester is IHydraS1AccountboundAttester, HydraS1Base, Attester {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1AccountboundLib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n mapping(uint256 => TicketData) internal _userTicketsData;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user attestations request is invalid\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark proof backing the claim\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._hydraS1claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns the actual attestations constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark public input as well as snark proof\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n HydraS1AccountboundClaim memory claim = request._hydraS1Accountboundclaim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n // The issuer of attestations is the attester\n address issuer = address(this);\n // user sends the ticket as input in the data\n uint256 userTicket = proofData._getTicket();\n TicketData memory userTicketData = _userTicketsData[userTicket];\n\n uint16 burnCount = userTicketData.burnCount;\n // If the attestation is minted on a new destination address\n // the burnCount encoded in the extraData of the Attestation should be incremented\n if (\n userTicketData.destination != address(0) && userTicketData.destination != request.destination\n ) {\n burnCount += 1;\n }\n\n attestations[0] = Attestation(\n attestationCollectionId,\n request.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n abi.encode(userTicket, burnCount)\n );\n\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used, not a renewal, and ticket on cooldown.\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n uint256 userTicket = proofData._getTicket();\n TicketData memory userTicketData = _userTicketsData[userTicket];\n\n if (\n userTicketData.destination != address(0) && userTicketData.destination != request.destination\n ) {\n HydraS1AccountboundClaim memory claim = request._hydraS1Accountboundclaim();\n if (_isOnCooldown(userTicketData, claim.groupProperties.cooldownDuration))\n revert TicketOnCooldown(userTicketData, claim.groupProperties.cooldownDuration);\n\n // Delete the old Attestation on the account before recording the new one\n address[] memory attestationOwners = new address[](1);\n uint256[] memory attestationCollectionIds = new uint256[](1);\n\n attestationOwners[0] = userTicketData.destination;\n attestationCollectionIds[0] =\n AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n\n emit AttestationDeleted(\n Attestation(\n AUTHORIZED_COLLECTION_ID_FIRST + claim.groupProperties.groupIndex,\n userTicketData.destination,\n address(this),\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n abi.encode(userTicket, userTicketData.burnCount)\n )\n );\n _setTicketOnCooldown(userTicket);\n }\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\n return ticketIdentifier;\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n /**\n * @dev Getter, returns the data linked to a ticket\n * @param userTicket ticket used\n **/\n function getTicketData(uint256 userTicket) external view override returns (TicketData memory) {\n return _getTicketData(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _userTicketsData[userTicket].destination = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _setTicketOnCooldown(uint256 userTicket) internal {\n _userTicketsData[userTicket].cooldownStart = uint32(block.timestamp);\n _userTicketsData[userTicket].burnCount += 1;\n emit TicketSetOnCooldown(userTicket, _userTicketsData[userTicket].burnCount);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _userTicketsData[userTicket].destination;\n }\n\n function _isOnCooldown(TicketData memory userTicketData, uint32 cooldownDuration)\n internal\n view\n returns (bool)\n {\n return userTicketData.cooldownStart + cooldownDuration > block.timestamp;\n }\n\n function _getTicketData(uint256 userTicket) internal view returns (TicketData memory) {\n return _userTicketsData[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1AccountboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Accountbound Interface\n * @author Sismo\n * @notice Interface with the errors, events and methods specific to the HydraS1AcountboundAttester.\n **/\ninterface IHydraS1AccountboundAttester is IHydraS1Base, IAttester {\n struct TicketData {\n address destination;\n uint32 cooldownStart;\n uint16 burnCount;\n }\n\n /**\n * @dev Error when the userTicket is on cooldown. The user have to wait the cooldownDuration\n * before being able to change again the destination address.\n **/\n error TicketOnCooldown(TicketData ticketData, uint32 cooldownDuration);\n\n /**\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\n **/\n error CollectionIdOutOfBound(uint256 collectionId);\n\n /**\n * @dev Event emitted when the userTicket (or nullifierHash) is associated to a destination address.\n **/\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n\n /**\n * @dev Event emitted when the userTicket has been set on cooldown. This happens when the\n * attestation destination of a ticket has been changed\n **/\n event TicketSetOnCooldown(uint256 ticket, uint16 burnCount);\n\n /**\n * @dev Getter, returns the data linked to a ticket\n * @param userTicket ticket used\n **/\n function getTicketData(uint256 userTicket) external view returns (TicketData memory);\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/core/Attester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\n\n/**\n * @title Attester Abstract Contract\n * @author Sismo\n * @notice Contract to be inherited by Attesters\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\n * are recommended to implemented this abstract contract\n\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\n *\n * This contracts is built around two main external standard functions.\n * They must NOT be override them, unless your really know what you are doing\n \n * - generateAttestations(request, proof) => will write attestations in the registry\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\n\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\n\n * For more information: https://attesters.docs.sismo.io\n **/\nabstract contract Attester is IAttester {\n // Registry where all attestations are stored\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(Request calldata request, bytes calldata proofData)\n external\n override\n returns (Attestation[] memory)\n {\n // Verify if request is valid by verifying against proof\n _verifyRequest(request, proofData);\n\n // Generate the actual attestations from user request\n Attestation[] memory attestations = buildAttestations(request, proofData);\n\n _beforeRecordAttestations(request, proofData);\n\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n\n _afterRecordAttestations(attestations);\n\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationGenerated(attestations[i]);\n }\n\n return attestations;\n }\n\n /**\n * @dev External facing function. Allows to delete attestations by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that were deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n address[] memory attestationOwners = new address[](collectionIds.length);\n\n uint256[] memory attestationCollectionIds = new uint256[](collectionIds.length);\n\n Attestation[] memory attestations = new Attestation[](collectionIds.length);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n // fetch attestations from the registry\n (\n address issuer,\n uint256 attestationValue,\n uint32 timestamp,\n bytes memory extraData\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\n\n attestationOwners[i] = attestationsOwner;\n attestationCollectionIds[i] = collectionIds[i];\n\n attestations[i] = (\n Attestation(\n collectionIds[i],\n attestationsOwner,\n issuer,\n attestationValue,\n timestamp,\n extraData\n )\n );\n }\n\n _verifyAttestationsDeletionRequest(attestations, proofData);\n\n _beforeDeleteAttestations(attestations, proofData);\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationOwners, attestationCollectionIds);\n\n _afterDeleteAttestations(attestations, proofData);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n emit AttestationDeleted(attestations[i]);\n }\n return attestations;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n public\n view\n virtual\n returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry getter\n * @return attestationRegistry\n */\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\n return ATTESTATIONS_REGISTRY;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should verify the user request is valid\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\n\n /**\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\n * Default behavior: throws\n * It should verify attestations deletion request is valid\n * @param attestations Attestations that will be deleted\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyAttestationsDeletionRequest(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {\n revert AttestationDeletionNotImplemented();\n }\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before recording attestations in the registry\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n {}\n\n /**\n * @dev (Optional) Can be overridden in attesters inheriting this contract\n * Will be called after recording an attestation\n * @param attestations Recorded attestations\n */\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n virtual\n {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called after deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n virtual\n {}\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1AccountboundLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Lib, HydraS1Claim, HydraS1GroupProperties} from './HydraS1Lib.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1AccountboundClaim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1AccountboundGroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1AccountboundGroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n uint32 cooldownDuration;\n bool isScore;\n}\n\nlibrary HydraS1AccountboundLib {\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _hydraS1claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n HydraS1GroupProperties memory hydraS1GroupProperties = HydraS1GroupProperties(\n groupProperties.groupIndex,\n groupProperties.generationTimestamp,\n groupProperties.isScore\n );\n\n return (\n HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, hydraS1GroupProperties)\n );\n }\n\n function _hydraS1Accountboundclaim(Request memory self)\n internal\n pure\n returns (HydraS1AccountboundClaim memory)\n {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1AccountboundGroupProperties memory hydraS1AccountboundGroupProperties = abi.decode(\n claim.extraData,\n (HydraS1AccountboundGroupProperties)\n );\n\n return (\n HydraS1AccountboundClaim(\n claim.groupId,\n claim.claimedValue,\n self.destination,\n hydraS1AccountboundGroupProperties\n )\n );\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/core/interfaces/IAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\n\n/**\n * @title IAttester\n * @author Sismo\n * @notice This is the interface for the attesters in Sismo Protocol\n */\ninterface IAttester {\n event AttestationGenerated(Attestation attestation);\n\n event AttestationDeleted(Attestation attestation);\n\n error AttestationDeletionNotImplemented();\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(Request calldata request, bytes calldata proofData)\n external\n returns (Attestation[] memory);\n\n /**\n * @dev External facing function. Allows to delete an attestation by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that was deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n external\n view\n returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry address getter\n * @return attestationRegistry Address of the registry\n */\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\n\n/**\n * @title IAttestationsRegistry\n * @author Sismo\n * @notice This is the interface of the AttestationRegistry\n */\ninterface IAttestationsRegistry {\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\n error OwnersAndCollectionIdsLengthMismatch(address[] owners, uint256[] collectionIds);\n event AttestationRecorded(Attestation attestation);\n event AttestationDeleted(Attestation attestation);\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external;\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds) external;\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(uint256 collectionId, address owner)\n external\n view\n returns (AttestationData memory);\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(uint256 collectionId, address owner)\n external\n view\n returns (\n address,\n uint256,\n uint32,\n bytes memory\n );\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(uint256 collectionId, address owner)\n external\n view\n returns (bytes memory);\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(uint256 collectionId, address owner)\n external\n view\n returns (address);\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(uint256 collectionId, address owner)\n external\n view\n returns (uint32);\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n returns (AttestationData[] memory);\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n returns (uint256[] memory);\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Accountbound Interface\n * @author Sismo\n * @notice Interface with errors, events and methods specific to the HydraS1SimpleAttester.\n **/\ninterface IHydraS1SimpleAttester is IHydraS1Base, IAttester {\n /**\n * @dev Error when the userTicket (or nullifierHash) is already used for a destination address\n **/\n error TicketUsed(uint256 userTicket);\n\n /**\n * @dev Error when the collectionId of an attestation overflow the AUTHORIZED_COLLECTION_ID_LAST\n **/\n error CollectionIdOutOfBound(uint256 collectionId);\n\n /**\n * @dev Event emitted when the userTicket (or nullifierHash) is associated to a destination address.\n **/\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/core/Badges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Badges contract\n * @author Sismo\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n * For more information: https://badges.docs.sismo.io\n */\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\n IAttestationsRegistry internal _attestationsRegistry;\n\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\n\n /**\n * @dev Constructor\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n constructor(\n string memory uri,\n address owner // This is Sismo Frontend Contract\n ) ERC1155(uri) {\n initialize(uri, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n function initialize(string memory uri, address owner) public initializer {\n _setURI(uri);\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n }\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id)\n public\n view\n virtual\n override(ERC1155, IBadges)\n returns (uint256)\n {\n return _attestationsRegistry.getAttestationValue(id, account);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function isApprovedForAll(address account, address operator)\n public\n view\n virtual\n override\n returns (bool)\n {\n revert BadgesNonTransferrable();\n }\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\n emit TransferSingle(operator, from, to, id, value);\n }\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry)\n external\n override\n onlyRole(DEFAULT_ADMIN_ROLE)\n {\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\n }\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _setURI(uri);\n }\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view override returns (address) {\n return address(_attestationsRegistry);\n }\n\n /**\n * @dev ERC165\n */\n function supportsInterface(bytes4 interfaceId)\n public\n view\n virtual\n override(AccessControl, ERC1155)\n returns (bool)\n {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n revert BadgesNonTransferrable();\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/ERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC1155.sol\";\nimport \"./IERC1155Receiver.sol\";\nimport \"./extensions/IERC1155MetadataURI.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of the basic standard multi-token.\n * See https://eips.ethereum.org/EIPS/eip-1155\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\n *\n * _Available since v3.1._\n */\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\n using Address for address;\n\n // Mapping from token ID to account balances\n mapping(uint256 => mapping(address => uint256)) private _balances;\n\n // Mapping from account to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n string private _uri;\n\n /**\n * @dev See {_setURI}.\n */\n constructor(string memory uri_) {\n _setURI(uri_);\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155).interfaceId ||\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC1155MetadataURI-uri}.\n *\n * This implementation returns the same URI for *all* token types. It relies\n * on the token type ID substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * Clients calling this function must replace the `\\{id\\}` substring with the\n * actual token type ID.\n */\n function uri(uint256) public view virtual override returns (string memory) {\n return _uri;\n }\n\n /**\n * @dev See {IERC1155-balanceOf}.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\n require(account != address(0), \"ERC1155: balance query for the zero address\");\n return _balances[id][account];\n }\n\n /**\n * @dev See {IERC1155-balanceOfBatch}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\n public\n view\n virtual\n override\n returns (uint256[] memory)\n {\n require(accounts.length == ids.length, \"ERC1155: accounts and ids length mismatch\");\n\n uint256[] memory batchBalances = new uint256[](accounts.length);\n\n for (uint256 i = 0; i < accounts.length; ++i) {\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\n }\n\n return batchBalances;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev See {IERC1155-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not owner nor approved\"\n );\n _safeTransferFrom(from, to, id, amount, data);\n }\n\n /**\n * @dev See {IERC1155-safeBatchTransferFrom}.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: transfer caller is not owner nor approved\"\n );\n _safeBatchTransferFrom(from, to, ids, amounts, data);\n }\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n\n emit TransferSingle(operator, from, to, id, amount);\n\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; ++i) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n }\n\n emit TransferBatch(operator, from, to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\n }\n\n /**\n * @dev Sets a new URI for all token types, by relying on the token type ID\n * substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * By this mechanism, any occurrence of the `\\{id\\}` substring in either the\n * URI or any of the amounts in the JSON file at said URI will be replaced by\n * clients with the token type ID.\n *\n * For example, the `https://token-cdn-domain/\\{id\\}.json` URI would be\n * interpreted by clients as\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\n * for token type ID 0x4cce0.\n *\n * See {uri}.\n *\n * Because these URIs cannot be meaningfully represented by the {URI} event,\n * this function emits no events.\n */\n function _setURI(string memory newuri) internal virtual {\n _uri = newuri;\n }\n\n /**\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _mint(\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);\n\n _balances[id][to] += amount;\n emit TransferSingle(operator, address(0), to, id, amount);\n\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _mintBatch(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; i++) {\n _balances[ids[i]][to] += amounts[i];\n }\n\n emit TransferBatch(operator, address(0), to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\n }\n\n /**\n * @dev Destroys `amount` tokens of token type `id` from `from`\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `from` must have at least `amount` tokens of token type `id`.\n */\n function _burn(\n address from,\n uint256 id,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), \"\");\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n\n emit TransferSingle(operator, from, address(0), id, amount);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n */\n function _burnBatch(\n address from,\n uint256[] memory ids,\n uint256[] memory amounts\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n for (uint256 i = 0; i < ids.length; i++) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n }\n\n emit TransferBatch(operator, from, address(0), ids, amounts);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits a {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC1155: setting approval status for self\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `id` and `amount` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n function _doSafeTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\n if (response != IERC1155Receiver.onERC1155Received.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\n bytes4 response\n ) {\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\n uint256[] memory array = new uint256[](1);\n array[0] = element;\n\n return array;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1155.sol\";\nimport \"../../../security/Pausable.sol\";\n\n/**\n * @dev ERC1155 token with pausable token transfers, minting and burning.\n *\n * Useful for scenarios such as preventing trades until the end of an evaluation\n * period, or having an emergency switch for freezing all token transfers in the\n * event of a large bug.\n *\n * _Available since v3.1._\n */\nabstract contract ERC1155Pausable is ERC1155, Pausable {\n /**\n * @dev See {ERC1155-_beforeTokenTransfer}.\n *\n * Requirements:\n *\n * - the contract must not be paused.\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n require(!paused(), \"ERC1155Pausable: token transfer while paused\");\n }\n}\n" - }, - "@openzeppelin/contracts/access/AccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role, _msgSender());\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(uint160(account), 20),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" - }, - "contracts/core/interfaces/IBadges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Interface for Badges contract\n * @author Sismo\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n */\ninterface IBadges {\n error BadgesNonTransferrable();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n function initialize(string memory uri, address owner) external;\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external;\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry) external;\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external;\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155MetadataURI is IERC1155 {\n /**\n * @dev Returns the URI for token type `id`.\n *\n * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n * clients with the actual token type ID.\n */\n function uri(uint256 id) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/ERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/security/Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), \"Pausable: paused\");\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), \"Pausable: not paused\");\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "@openzeppelin/contracts/access/IAccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" - }, - "@openzeppelin/contracts/utils/Strings.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n // Inspired by OraclizeAPI's implementation - MIT licence\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0x00\";\n }\n uint256 temp = value;\n uint256 length = 0;\n while (temp != 0) {\n length++;\n temp >>= 8;\n }\n return toHexString(value, length);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n}\n" - }, - "contracts/tests/MockAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttestationsRegistry} from '../core/interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from '../core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from '../core/libs/attestations-registry/AttestationsRegistryState.sol';\nimport {IBadges} from '../core/interfaces/IBadges.sol';\nimport {Attestation, AttestationData} from '../core/libs/Structs.sol';\n\ncontract MockAttestationsRegistry {\n uint256 immutable ATTESTATION_VALUE;\n\n event AttestationRecorded(Attestation attestation);\n\n constructor(uint256 attestationValue) {\n ATTESTATION_VALUE = attestationValue;\n }\n\n function getAttestationValue(uint256 collectionId, address owner)\n external\n view\n returns (uint256)\n {\n return ATTESTATION_VALUE;\n }\n\n function recordAttestations(Attestation[] calldata attestations) external {\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationRecorded(attestations[i]);\n }\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport './OwnableLogic.sol';\nimport './PausableLogic.sol';\nimport './InitializableLogic.sol';\nimport './AttestationsRegistryState.sol';\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\n\n/**\n * @title Attestations Registry Config Logic contract\n * @author Sismo\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\n **/\ncontract AttestationsRegistryConfigLogic is\n AttestationsRegistryState,\n IAttestationsRegistryConfigLogic,\n OwnableLogic,\n PausableLogic,\n InitializableLogic\n{\n using RangeUtils for Range[];\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\n for (uint256 i = 0; i < ranges.length; i++) {\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external override onlyOwner {\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\n return _isAuthorized(issuer, collectionId);\n }\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external override onlyOwner {\n _pause();\n }\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external override onlyOwner {\n _unpause();\n }\n\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\n return _authorizedRanges[issuer]._includes(collectionId);\n }\n\n function _authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal {\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\n _authorizedRanges[issuer].push(newRange);\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal onlyOwner {\n if (rangeIndex >= _authorizedRanges[issuer].length)\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\n\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\n revert IdsMismatch(\n issuer,\n rangeIndex,\n expectedFirstId,\n expectedLastId,\n firstCollectionId,\n lastCollectionId\n );\n\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\n _authorizedRanges[issuer].length - 1\n ];\n _authorizedRanges[issuer].pop();\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryState.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Range} from '../utils/RangeLib.sol';\nimport {Attestation, AttestationData} from '../Structs.sol';\n\ncontract AttestationsRegistryState {\n // main config\n bool internal _initialized;\n bool internal _initializing;\n bool internal _paused;\n address internal _owner;\n // keeping some space for future\n uint256[15] private _placeHolders;\n\n // storing the authorized ranges for each attesters\n mapping(address => Range[]) internal _authorizedRanges;\n // keeping some space for future\n uint256[15] private _placeHolders2;\n // storing the data of attestations\n // =collectionId=> =owner=> attestationData\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\n}\n" - }, - "contracts/core/libs/attestations-registry/OwnableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n // This is the only diff with OZ contract\n // address private _owner;\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/PausableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableLogic is Context, AttestationsRegistryState {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n // this is the only diff with OZ contract\n // bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), 'Pausable: paused');\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), 'Pausable: not paused');\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/InitializableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Address.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract InitializableLogic is AttestationsRegistryState {\n // only diff with oz\n // /**\n // * @dev Indicates that the contract has been initialized.\n // */\n // bool private _initialized;\n\n // /**\n // * @dev Indicates that the contract is in the process of being initialized.\n // */\n // bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(\n _initializing ? _isConstructor() : !_initialized,\n 'Initializable: contract is already initialized'\n );\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, 'Initializable: contract is not initializing');\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\n\ninterface IAttestationsRegistryConfigLogic {\n error AttesterNotFound(address issuer);\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\n error IdsMismatch(\n address issuer,\n uint256 rangeIndex,\n uint256 expectedFirstId,\n uint256 expectedLastId,\n uint256 FirstId,\n uint256 lastCollectionId\n );\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external;\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external;\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external;\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external;\n}\n" - }, - "contracts/core/libs/utils/RangeLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nstruct Range {\n uint256 min;\n uint256 max;\n}\n\n// Range [0;3] includees 0 and 3\nlibrary RangeUtils {\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\n for (uint256 i = 0; i < ranges.length; i++) {\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\n return true;\n }\n }\n return false;\n }\n}\n" - }, - "contracts/core/libs/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.14;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "contracts/core/libs/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, 'Address: insufficient balance');\n\n (bool success, ) = recipient.call{value: amount}('');\n require(success, 'Address: unable to send value, recipient may have reverted');\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, 'Address: low-level call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, 'Address: insufficient balance for call');\n require(isContract(target), 'Address: call to non-contract');\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data)\n internal\n view\n returns (bytes memory)\n {\n return functionStaticCall(target, data, 'Address: low-level static call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), 'Address: static call to non-contract');\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), 'Address: delegate call to non-contract');\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/tests/MockAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\nimport {Attestation, Request} from '../core/libs/Structs.sol';\nimport {Attester} from '../core/Attester.sol';\nimport {IAttester} from '../core/interfaces/IAttester.sol';\n\ncontract MockAttester is IAttester, Attester {\n uint256 public immutable ATTESTATION_ID_MIN;\n uint256 public immutable ATTESTATION_ID_MAX;\n\n constructor(\n address ATTESTATION_REGISTRY_ADDRESS,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n ) Attester(ATTESTATION_REGISTRY_ADDRESS) {\n ATTESTATION_ID_MIN = collectionIdFirst;\n ATTESTATION_ID_MAX = collectionIdLast;\n }\n\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {}\n\n function buildAttestations(\n Request calldata request,\n bytes calldata /*data*/\n ) public view virtual override(Attester, IAttester) returns (Attestation[] memory) {\n uint256 collectionId = ATTESTATION_ID_MIN + request.claims[0].groupId;\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n collectionId,\n request.destination,\n address(this),\n request.claims[0].claimedValue,\n abi.decode(request.claims[0].extraData, (uint32)),\n 'Mock Attester v0'\n );\n return (attestations);\n }\n}\n" - }, - "contracts/core/Front.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IFront} from './interfaces/IFront.sol';\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation} from './libs/Structs.sol';\n\n/**\n * @title Front\n * @author Sismo\n * @notice This is the Front contract of the Sismo protocol\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\n\n * For more information: https://front.docs.sismo.io\n */\ncontract Front is IFront {\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\n uint256 public constant EARLY_USER_COLLECTION = 0;\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress Attestations registry contract address\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n Attestation[] memory attestations = _forwardAttestationsGeneration(\n attester,\n request,\n proofData\n );\n _generateEarlyUserAttestation(request.destination);\n return attestations;\n }\n\n /**\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n address destination = requests[0].destination;\n for (uint256 i = 0; i < attesters.length; i++) {\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\n attestations[i] = _forwardAttestationsGeneration(\n attesters[i],\n requests[i],\n proofDataArray[i]\n );\n }\n _generateEarlyUserAttestation(destination);\n return attestations;\n }\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view override returns (Attestation[] memory) {\n return _forwardAttestationsBuild(attester, request, proofData);\n }\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function of targeted attester\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n\n for (uint256 i = 0; i < attesters.length; i++) {\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\n }\n return attestations;\n }\n\n function _forwardAttestationsBuild(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal view returns (Attestation[] memory) {\n return IAttester(attester).buildAttestations(request, proofData);\n }\n\n function _forwardAttestationsGeneration(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal returns (Attestation[] memory) {\n return IAttester(attester).generateAttestations(request, proofData);\n }\n\n function _generateEarlyUserAttestation(address destination) internal {\n uint32 currentTimestamp = uint32(block.timestamp);\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\n EARLY_USER_COLLECTION,\n destination\n );\n\n if (!alreadyHasAttestation) {\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n EARLY_USER_COLLECTION,\n destination,\n address(this),\n 1,\n currentTimestamp,\n 'With strong love from Sismo'\n );\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n emit EarlyUserAttestationGenerated(destination);\n }\n }\n }\n}\n" - }, - "contracts/core/interfaces/IFront.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\n\n/**\n * @title IFront\n * @author Sismo\n * @notice This is the interface of the Front Contract\n */\ninterface IFront {\n error DifferentRequestsDestinations();\n event EarlyUserAttestationGenerated(address destination);\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev generate multiple attestations at once, to the same destination\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external returns (Attestation[][] memory);\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function(s) of targeted attester(s)\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view returns (Attestation[][] memory);\n}\n" - }, - "contracts/periphery/badges-examples/BAYCOwnershipBadgeExample.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC721} from '@openzeppelin/contracts/token/ERC721/ERC721.sol';\nimport {IAttestationsRegistry} from '../../core/interfaces/IAttestationsRegistry.sol';\n\ncontract BAYCOwnershipBadge is ERC721 {\n IAttestationsRegistry immutable ATTESTATIONS_REGISTRY;\n uint256 constant HydraS1_BAYC_ATTESTATION_COLLECTION_ID = 100000001;\n uint256 constant SMPS_BAYC_ATTESTATION_COLLECTION_ID = 30000000000003;\n\n constructor(\n address attestationsRegistryAddress,\n string memory name,\n string memory symbol\n ) ERC721(name, symbol) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n function balanceOf(address account) public view virtual override returns (uint256) {\n bool hasZKAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n HydraS1_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n bool hasDoxingAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n SMPS_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n return hasZKAttestation || hasDoxingAttestation ? 1 : 0;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/ERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"./extensions/IERC721Metadata.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/Strings.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: balance query for the zero address\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _owners[tokenId];\n require(owner != address(0), \"ERC721: owner query for nonexistent token\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n require(_exists(tokenId), \"ERC721Metadata: URI query for nonexistent token\");\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overriden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not owner nor approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n require(_exists(tokenId), \"ERC721: approved query for nonexistent token\");\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: transfer caller is not owner nor approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: transfer caller is not owner nor approved\");\n _safeTransfer(from, to, tokenId, _data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `_data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, _data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _owners[tokenId] != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n require(_exists(tokenId), \"ERC721: operator query for nonexistent token\");\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, _data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId);\n\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId);\n\n // Clear approvals\n _approve(address(0), tokenId);\n\n _balances[owner] -= 1;\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId);\n\n // Clear approvals from the previous owner\n _approve(address(0), tokenId);\n\n _balances[from] -= 1;\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits a {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits a {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param _data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, ``from``'s `tokenId` will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" - }, - "@openzeppelin/contracts/utils/StorageSlot.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" - }, - "contracts/periphery/utils/TransparentUpgradeableProxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n// Note: we just copied so that we can see the contract used\npragma solidity ^0.8.14;\n\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(''), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n ifAdmin\n {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(\n msg.sender != _getAdmin(),\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\n );\n super._beforeFallback();\n }\n}\n" - }, - "contracts/attesters/pythia-1/Pythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IPythia1SimpleAttester} from './interfaces/IPythia1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to Pythia1 Proving Scheme\nimport {Pythia1Base, Pythia1Lib, Pythia1ProofData, Pythia1ProofInput, Pythia1Claim} from './base/Pythia1Base.sol';\n\n/**\n * @title Pythia-1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Pythia-1 Attesters.\n * Pythia-1 attesters enable users to prove they have a claim and its proof issued by an \n * offchain service in a privacy preserving way. \n * That means no-one can make the link between the account used in the offchain service\n * and the onchain account where the attestation is stored.\n * The Pythia-1 Base abstract contract is inherited and holds the complex Pythia 1 verification logic.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what offchain issuer's account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each users gets one userTicket per claim\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(secret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n **/\n\ncontract Pythia1SimpleAttester is IPythia1SimpleAttester, Pythia1Base, Attester, Ownable {\n using Pythia1Lib for Pythia1ProofData;\n using Pythia1Lib for bytes;\n using Pythia1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n uint256[2] internal _commitmentSignerPubKey;\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n * @param pythia1VerifierAddress ZK Snark Pythia-1 Verifier contract\n * @param commitmentSignerPubKey The EdDSA public key of the commitment signer for the Pythia 1 Proving Scheme\n * @param owner The owner of the contract that can update the commitment signer pub key\n */\n constructor(\n address attestationsRegistryAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n address pythia1VerifierAddress,\n uint256[2] memory commitmentSignerPubKey,\n address owner\n ) Attester(attestationsRegistryAddress) Pythia1Base(pythia1VerifierAddress) {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n initialize(commitmentSignerPubKey, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) public initializer {\n _transferOwnership(owner);\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into Pythia1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n Pythia1ProofData memory snarkProof = abi.decode(proofData, (Pythia1ProofData));\n Pythia1ProofInput memory snarkInput = snarkProof._input();\n Pythia1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(Request calldata request, bytes calldata)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n Pythia1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.internalCollectionId;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n uint32(block.timestamp),\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used\n * @param request users request. Claim of beiing part of a group.\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0)) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Pythia-1 MANDATORY FUNCTIONS FROM Pythia-1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Pythia-1 claim = have an offchain account with a specific value in a specific group\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * users bring secretHash as private input in snark which guarantees privacy\n * the secretHash is only known by the user and never escape the user's browser\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(Pythia1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(\n address(this),\n claim.groupProperties.internalCollectionId\n );\n return ticketIdentifier;\n }\n\n function _getCommitmentSignerPubKey() internal view override returns (uint256[2] memory) {\n return _commitmentSignerPubKey;\n }\n\n /*******************************************************\n Pythia-1 Attester Specific Functions\n *******************************************************/\n\n function updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey)\n external\n onlyOwner\n {\n _updateCommitmentSignerPubKey(commitmentSignerPubKey);\n }\n\n function _updateCommitmentSignerPubKey(uint256[2] memory commitmentSignerPubKey) internal {\n _commitmentSignerPubKey = commitmentSignerPubKey;\n emit CommitmentSignerPubKeyUpdated(commitmentSignerPubKey);\n }\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % Pythia1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/pythia-1/interfaces/IPythia1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {Pythia1Lib, Pythia1ProofData, Pythia1ProofInput} from './../libs/Pythia1Lib.sol';\nimport {IPythia1Base} from './../base/IPythia1Base.sol';\n\ninterface IPythia1SimpleAttester is IPythia1Base, IAttester {\n error TicketUsed(uint256 userTicket);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n event CommitmentSignerPubKeyUpdated(uint256[2] newCommitmentSignerPubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param commitmentSignerPubKey EdDSA public key of the commitment signer\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(uint256[2] memory commitmentSignerPubKey, address owner) external;\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/pythia-1/base/Pythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IPythia1Base} from './IPythia1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Pythia 1 ZK Proving Scheme\nimport {Pythia1Verifier, Pythia1Lib, Pythia1Claim, Pythia1ProofData, Pythia1ProofInput, Pythia1GroupProperties} from '../libs/Pythia1Lib.sol';\n\n/**\n * @title Pythia-1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Pythia-1 ZK Proving Scheme.\n * Pythia-1: it allows issuing attestations from an offchain service and send it onchain \n * without anyone being able to make the link between the offchain service and the onchain service.\n * It is inherited by the family of Pythia-1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to:\n * - https://pythia-1.docs.sismo.io for a full guide through the Pythia-1 ZK Attestations\n * - https://pythia-1-circuits.docs.sismo.io for circuits, prover and verifiers of Pythia-1\n \n \n **/\nabstract contract Pythia1Base is IPythia1Base, Initializable {\n using Pythia1Lib for Pythia1ProofData;\n\n // ZK-SNARK Verifier\n Pythia1Verifier immutable VERIFIER;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param Pythia1VerifierAddress ZK Snark Verifier contract\n */\n constructor(address Pythia1VerifierAddress) {\n VERIFIER = Pythia1Verifier(Pythia1VerifierAddress);\n }\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of the Commitment signer Eddsa Public key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory) {\n return _getCommitmentSignerPubKey();\n }\n\n /*******************************************************\n Pythia-1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(secretHash, ticketIdentifier), which is verified inside the snark\n * the secretHash is a number only known by the user and is used in \n * the zero knowledge as a private input which guarantees privacy\n\n * This function MUST be implemented by Pythia-1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Pythia-1 Simple Attester for an example\n * @param claim user claim: a particular claim that a user have that he can prove s right.\n */\n function _getTicketIdentifierOfClaim(Pythia1Claim memory claim)\n internal\n view\n virtual\n returns (uint256);\n\n /**\n * @dev MANDATORY: must be implemented to return the commitment signer that allows to\n * prove the claim was correctly issued for the user.\n */\n function _getCommitmentSignerPubKey() internal view virtual returns (uint256[2] memory);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(Pythia1Claim memory claim, Pythia1ProofInput memory input)\n internal\n view\n virtual\n {\n if (input.groupId != claim.groupId) revert GroupIdMismatch(claim.groupId, input.groupId);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (claim.destination != msg.sender)\n revert UserShouldOwnItsDestination(msg.sender, claim.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n uint256[2] memory commitmentSignerPubKey = _getCommitmentSignerPubKey();\n if (\n input.commitmentSignerPubKey[0] != commitmentSignerPubKey[0] ||\n input.commitmentSignerPubKey[1] != commitmentSignerPubKey[1]\n )\n revert CommitmentSignerPubKeyMismatch(\n commitmentSignerPubKey[0],\n commitmentSignerPubKey[1],\n input.commitmentSignerPubKey[0],\n input.commitmentSignerPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the plonk mathematical proof using the circom verifier contract\n * @param proofData snark public input\n */\n function _verifyProof(Pythia1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(\n uint256 /*errorCode*/\n ) {\n revert InvalidGroth16Proof('');\n } catch (\n bytes memory /*lowLevelData*/\n ) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/pythia-1/libs/Pythia1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {Pythia1Verifier} from '@sismo-core/pythia-1/contracts/Pythia1Verifier.sol';\n\n// user Pythia-1 claim retrieved form his request\nstruct Pythia1Claim {\n uint256 groupId; // user claims be part of this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n Pythia1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct Pythia1GroupProperties {\n uint128 internalCollectionId;\n bool isScore;\n}\n\nstruct Pythia1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct Pythia1ProofData {\n Pythia1CircomSnarkProof proof;\n uint256[9] input;\n // destination;\n // chainId;\n // commitmentSignerPubKey.x;\n // commitmentSignerPubKey.y;\n // groupId;\n // ticketIdentifier;\n // userTicket;\n // value;\n // isStrict;\n}\n\nstruct Pythia1ProofInput {\n address destination;\n uint256 chainId;\n uint256 groupId;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n bool isStrict;\n uint256[2] commitmentSignerPubKey;\n}\n\nlibrary Pythia1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(Pythia1ProofData memory self) internal pure returns (Pythia1ProofInput memory) {\n return\n Pythia1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getGroupId(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (Pythia1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n Pythia1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (Pythia1GroupProperties)\n );\n return (Pythia1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(Pythia1ProofData memory self)\n internal\n pure\n returns (\n uint256[2] memory,\n uint256[2][2] memory,\n uint256[2] memory,\n uint256[9] memory\n )\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(Pythia1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(Pythia1ProofData memory self)\n internal\n pure\n returns (uint256[2] memory)\n {\n return [self.input[2], self.input[3]];\n }\n\n function _getGroupId(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(Pythia1ProofData memory self)\n internal\n pure\n returns (uint256)\n {\n return self.input[5];\n }\n\n function _getTicket(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(Pythia1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getIsStrict(Pythia1ProofData memory self) internal pure returns (bool) {\n return self.input[8] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n Pythia1ProofData memory snarkProofData = abi.decode(self, (Pythia1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(uint128 internalCollectionId, bool isScore)\n internal\n pure\n returns (uint256)\n {\n return\n _generateGroupIdFromEncodedProperties(_encodeGroupProperties(internalCollectionId, isScore));\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % Pythia1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(uint128 internalCollectionId, bool isScore)\n internal\n pure\n returns (bytes memory)\n {\n return abi.encode(internalCollectionId, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/attesters/pythia-1/base/IPythia1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Pythia1Verifier, Pythia1Lib, Pythia1ProofData} from '../libs/Pythia1Lib.sol';\n\ninterface IPythia1Base {\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error UserShouldOwnItsDestination(address sender, address inputdestination);\n error CommitmentSignerPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error GroupIdMismatch(uint256 expectedAccountsTreeValue, uint256 inputAccountsTreeValue);\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Pythia-1 Verifier contract\n */\n function getVerifier() external view returns (Pythia1Verifier);\n\n /**\n * @dev Getter of the Commitment Signer EdDSA Public Key\n */\n function getCommitmentSignerPubKey() external view returns (uint256[2] memory);\n}\n" - }, - "@sismo-core/pythia-1/contracts/Pythia1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract Pythia1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [10531421060471803210764242282180596988661354300825243432694370526898549660572,\n 16907777539267866029484140695898606769333962039725819851897531221528016291246],\n [1262343472093645508827094724965505457998222566160570888483460111770233999788,\n 15912415772039780433311820224136904737706664077875817672499292870626930031698]\n );\n vk.IC = new Pairing.G1Point[](10);\n \n vk.IC[0] = Pairing.G1Point( \n 5517688305750201128762483893091304147062827104408157512730579569350848407613,\n 5780136537335992008649392871793066674866342777759859789350700119480160130924\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 12697944246979452442578306963760600646953905903147293524406388488412105525306,\n 7947498303555241939381866476162499321683671397366404411964730108870115767741\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 104028078850975554065172701281783302003220555203883119831575537681421753151,\n 19148240629904598794948591359118971959790791697910953160820265703277306346\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 5389100687915168292769005150998138946551934165417656464020514059527551078739,\n 2995810062694628906192141834014562842416411391073941090612035469327148467089\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 13361404455959093513465491032733056651449943760514352043673570676442342622118,\n 13062233980231097531380816290641636455952795449264050237462472029810698552529\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 11459259237872151197093706264224074511822899275820846406369316478681920338712,\n 17008950402703007066305862393917002979068108987255258732198250350572930280478\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 6864252787935048608809029133239993600538509116976873537320635937882667431893,\n 21828895867329533519544146243248306555649073137427314743033980762667640230681\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 9438320622270795479948280183526528671720880729000858589094410097102899873097,\n 5568101658133066923956745075211904883930639183482936243523669908553853509584\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 8243240866289541427505408968801246044483594232529594515653799293334187695980,\n 16836688029681482175969944959379945743029264506292968109365225279154937195513\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 8901554162474861401157311041464523592671931268194133233238376271355243714980,\n 3625114242544161778734123207817598834256751400634638318925544817537792055578\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[9] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - Renewable\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew their attestations\n **/\n\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base, Attester {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(Request calldata request, bytes calldata)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n HydraS1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used and not a renewal (e.g destination different that last)\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0) && currentDestination != request.destination) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\n return ticketIdentifier;\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/core/AttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\nimport {Attestation, AttestationData} from './libs/Structs.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Attestations Registry\n * @author Sismo\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\n * Only authorized attestations issuers can record attestation in the registry\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\n * For more information: https://attestations-registry.docs.sismo.io\n\n * For each attestation recorded, a badge is received by the user\n * The badge is the Non transferrable NFT representation of an attestation \n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\n * It enables off-chain apps such as opensea to catch the \"shadow mint\" of the badge\n **/\ncontract AttestationsRegistry is\n AttestationsRegistryState,\n IAttestationsRegistry,\n AttestationsRegistryConfigLogic\n{\n IBadges immutable BADGES;\n\n /**\n * @dev Constructor.\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @param badgesAddress Stateless ERC1155 Badges contract\n */\n constructor(address owner, address badgesAddress) {\n initialize(owner);\n BADGES = IBadges(badgesAddress);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n */\n function initialize(address owner) public initializer {\n _transferOwnership(owner);\n }\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\n address issuer = _msgSender();\n for (uint256 i = 0; i < attestations.length; i++) {\n if (!_isAuthorized(issuer, attestations[i].collectionId))\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\n\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\n attestations[i].owner\n ].value;\n\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\n attestations[i].issuer,\n attestations[i].value,\n attestations[i].timestamp,\n attestations[i].extraData\n );\n\n _triggerBadgeTransferEvent(\n attestations[i].collectionId,\n attestations[i].owner,\n previousAttestationValue,\n attestations[i].value\n );\n emit AttestationRecorded(attestations[i]);\n }\n }\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param owners The owners of the attestations to be deleted\n * @param collectionIds The collection ids of the attestations to be deleted\n */\n function deleteAttestations(address[] calldata owners, uint256[] calldata collectionIds)\n external\n override\n whenNotPaused\n {\n if (owners.length != collectionIds.length)\n revert OwnersAndCollectionIdsLengthMismatch(owners, collectionIds);\n\n address issuer = _msgSender();\n for (uint256 i = 0; i < owners.length; i++) {\n AttestationData memory attestationData = _attestationsData[collectionIds[i]][owners[i]];\n\n if (!_isAuthorized(issuer, collectionIds[i]))\n revert IssuerNotAuthorized(issuer, collectionIds[i]);\n delete _attestationsData[collectionIds[i]][owners[i]];\n\n _triggerBadgeTransferEvent(collectionIds[i], owners[i], attestationData.value, 0);\n\n emit AttestationDeleted(\n Attestation(\n collectionIds[i],\n owners[i],\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n )\n );\n }\n }\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner)\n external\n view\n override\n returns (bool)\n {\n return _getAttestationValue(collectionId, owner) != 0;\n }\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(uint256 collectionId, address owner)\n external\n view\n override\n returns (AttestationData memory)\n {\n return _getAttestationData(collectionId, owner);\n }\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner)\n external\n view\n override\n returns (uint256)\n {\n return _getAttestationValue(collectionId, owner);\n }\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(uint256 collectionId, address owner)\n external\n view\n override\n returns (\n address,\n uint256,\n uint32,\n bytes memory\n )\n {\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\n return (\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n );\n }\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(uint256 collectionId, address owner)\n external\n view\n override\n returns (bytes memory)\n {\n return _attestationsData[collectionId][owner].extraData;\n }\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(uint256 collectionId, address owner)\n external\n view\n override\n returns (address)\n {\n return _attestationsData[collectionId][owner].issuer;\n }\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(uint256 collectionId, address owner)\n external\n view\n override\n returns (uint32)\n {\n return _attestationsData[collectionId][owner].timestamp;\n }\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n override\n returns (AttestationData[] memory)\n {\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\n }\n return attestationsDataArray;\n }\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n override\n returns (uint256[] memory)\n {\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\n }\n return attestationsValues;\n }\n\n /**\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\n * It enables off-chain apps such as opensea to catch the \"shadow mints/burns\" of badges\n */\n function _triggerBadgeTransferEvent(\n uint256 badgeTokenId,\n address owner,\n uint256 previousValue,\n uint256 newValue\n ) internal {\n bool isGreaterValue = newValue > previousValue;\n address operator = address(this);\n address from = isGreaterValue ? address(0) : owner;\n address to = isGreaterValue ? owner : address(0);\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\n\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\n }\n\n function _getAttestationData(uint256 collectionId, address owner)\n internal\n view\n returns (AttestationData memory)\n {\n return (_attestationsData[collectionId][owner]);\n }\n\n function _getAttestationValue(uint256 collectionId, address owner)\n internal\n view\n returns (uint256)\n {\n return _attestationsData[collectionId][owner].value;\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/deployments/sandboxPolygon/solcInputs/c872f238f220b3571ef309821a459203.json b/deployments/sandboxPolygon/solcInputs/c872f238f220b3571ef309821a459203.json deleted file mode 100644 index d924d5b..0000000 --- a/deployments/sandboxPolygon/solcInputs/c872f238f220b3571ef309821a459203.json +++ /dev/null @@ -1,209 +0,0 @@ -{ - "language": "Solidity", - "sources": { - "contracts/attesters/hydra-s1/base/HydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1Base} from './IHydraS1Base.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n// Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\n\n// Imports related to Hydra S1 ZK Proving Scheme\nimport {HydraS1Verifier, HydraS1Lib, HydraS1Claim, HydraS1ProofData, HydraS1ProofInput, HydraS1GroupProperties} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n/**\n * @title Hydra-S1 Base Attester\n * @author Sismo\n * @notice Abstract contract that facilitates the use of the Hydra-S1 ZK Proving Scheme.\n * Hydra-S1 is single source, single group: it allows users to verify they are part of one and only one group at a time\n * It is inherited by the family of Hydra-S1 attesters.\n * It contains the user input checking and the ZK-SNARK proof verification.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n \n \n **/\nabstract contract HydraS1Base is IHydraS1Base, Initializable {\n using HydraS1Lib for HydraS1ProofData;\n\n // ZK-SNARK Verifier\n HydraS1Verifier immutable VERIFIER;\n // Registry storing the Commitment Mapper EdDSA Public key\n ICommitmentMapperRegistry immutable COMMITMENT_MAPPER_REGISTRY;\n // Registry storing the Registry Tree Roots of the Attester's available ClaimData\n IAvailableRootsRegistry immutable AVAILABLE_ROOTS_REGISTRY;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param hydraS1VerifierAddress ZK Snark Verifier contract\n * @param availableRootsRegistryAddress Registry where is the Available Data (Registry Merkle Roots)\n * @param commitmentMapperAddress Commitment mapper's public key registry\n */\n constructor(\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress\n ) {\n VERIFIER = HydraS1Verifier(hydraS1VerifierAddress);\n AVAILABLE_ROOTS_REGISTRY = IAvailableRootsRegistry(availableRootsRegistryAddress);\n COMMITMENT_MAPPER_REGISTRY = ICommitmentMapperRegistry(commitmentMapperAddress);\n }\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier) {\n return VERIFIER;\n }\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry) {\n return COMMITMENT_MAPPER_REGISTRY;\n }\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry) {\n return AVAILABLE_ROOTS_REGISTRY;\n }\n\n /*******************************************************\n Hydra-S1 SPECIFIC FUNCTIONS\n *******************************************************/\n\n /**\n * @dev MANDATORY: must be implemented to return the ticket identifier from a user request\n * so it can be checked against snark input\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input which guarantees privacy\n\n * This function MUST be implemented by Hydra-S1 attesters.\n * This is the core function that implements the logic of tickets\n\n * Do they get one ticket per claim?\n * Do they get 2 tickets per claim?\n * Do they get 1 ticket per claim, every month?\n * Take a look at Hydra-S1 Simple Attester for an example\n * @param claim user claim: part of a group of accounts, with a claimedValue for their account\n */\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n virtual\n returns (uint256);\n\n /**\n * @dev Checks whether the user claim and the snark public input are a match\n * @param claim user claim\n * @param input snark public input\n */\n function _validateInput(HydraS1Claim memory claim, HydraS1ProofInput memory input)\n internal\n view\n virtual\n {\n if (input.accountsTreeValue != claim.groupId)\n revert AccountsTreeValueMismatch(claim.groupId, input.accountsTreeValue);\n\n if (input.isStrict == claim.groupProperties.isScore)\n revert IsStrictMismatch(claim.groupProperties.isScore, input.isStrict);\n\n if (input.destination != claim.destination)\n revert DestinationMismatch(claim.destination, input.destination);\n\n if (input.chainId != block.chainid) revert ChainIdMismatch(block.chainid, input.chainId);\n\n if (input.value != claim.claimedValue) revert ValueMismatch(claim.claimedValue, input.value);\n\n if (!AVAILABLE_ROOTS_REGISTRY.isRootAvailableForMe(input.registryRoot))\n revert RegistryRootMismatch(input.registryRoot);\n\n uint256[2] memory commitmentMapperPubKey = COMMITMENT_MAPPER_REGISTRY.getEdDSAPubKey();\n if (\n input.commitmentMapperPubKey[0] != commitmentMapperPubKey[0] ||\n input.commitmentMapperPubKey[1] != commitmentMapperPubKey[1]\n )\n revert CommitmentMapperPubKeyMismatch(\n commitmentMapperPubKey[0],\n commitmentMapperPubKey[1],\n input.commitmentMapperPubKey[0],\n input.commitmentMapperPubKey[1]\n );\n\n uint256 ticketIdentifier = _getTicketIdentifierOfClaim(claim);\n\n if (input.ticketIdentifier != ticketIdentifier)\n revert TicketIdentifierMismatch(ticketIdentifier, input.ticketIdentifier);\n }\n\n /**\n * @dev verify the groth16 mathematical proof\n * @param proofData snark public input\n */\n function _verifyProof(HydraS1ProofData memory proofData) internal view virtual {\n try\n VERIFIER.verifyProof(proofData.proof.a, proofData.proof.b, proofData.proof.c, proofData.input)\n returns (bool success) {\n if (!success) revert InvalidGroth16Proof('');\n } catch Error(string memory reason) {\n revert InvalidGroth16Proof(reason);\n } catch Panic(\n uint256 /*errorCode*/\n ) {\n revert InvalidGroth16Proof('');\n } catch (\n bytes memory /*lowLevelData*/\n ) {\n revert InvalidGroth16Proof('');\n }\n }\n}\n" - }, - "contracts/attesters/hydra-s1/base/IHydraS1Base.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {HydraS1Verifier, HydraS1Lib, HydraS1ProofData} from '../libs/HydraS1Lib.sol';\nimport {ICommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {IAvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\n\n// todo: explain well what is specific to this attester\ninterface IHydraS1Base {\n error ClaimsLengthDifferentThanOne(uint256 claimLength);\n error RegistryRootMismatch(uint256 inputRoot);\n error DestinationMismatch(address expectedDestination, address inputDestination);\n error CommitmentMapperPubKeyMismatch(\n uint256 expectedX,\n uint256 expectedY,\n uint256 inputX,\n uint256 inputY\n );\n error TicketIdentifierMismatch(uint256 expectedTicketIdentifier, uint256 ticketIdentifier);\n error IsStrictMismatch(bool expectedStrictness, bool strictNess);\n error ChainIdMismatch(uint256 expectedChainId, uint256 chainId);\n error ValueMismatch(uint256 expectedValue, uint256 inputValue);\n error AccountsTreeValueMismatch(\n uint256 expectedAccountsTreeValue,\n uint256 inputAccountsTreeValue\n );\n error InvalidGroth16Proof(string reason);\n\n /**\n * @dev Getter of Hydra-S1 Verifier contract\n */\n function getVerifier() external view returns (HydraS1Verifier);\n\n /**\n * @dev Getter of Commitment Mapper Registry contract\n */\n function getCommitmentMapperRegistry() external view returns (ICommitmentMapperRegistry);\n\n /**\n * @dev Getter of Roots Registry Contract\n */\n function getAvailableRootsRegistry() external view returns (IAvailableRootsRegistry);\n}\n" - }, - "@openzeppelin/contracts/proxy/utils/Initializable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/Address.sol\";\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract Initializable {\n /**\n * @dev Indicates that the contract has been initialized.\n */\n bool private _initialized;\n\n /**\n * @dev Indicates that the contract is in the process of being initialized.\n */\n bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(_initializing ? _isConstructor() : !_initialized, \"Initializable: contract is already initialized\");\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, \"Initializable: contract is not initializing\");\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" - }, - "contracts/core/libs/Structs.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Attestations Registry State\n * @author Sismo\n * @notice This contract holds all of the storage variables and data\n * structures used by the AttestationsRegistry and parent\n * contracts.\n */\n\n// User Attestation Request, can be made by any user\n// The context of an Attestation Request is a specific attester contract\n// Each attester has groups of accounts in its available data\n// eg: for a specific attester:\n// group 1 <=> accounts that sent txs on mainnet\n// group 2 <=> accounts that sent txs on polygon\n// eg: for another attester:\n// group 1 <=> accounts that sent eth txs in 2022\n// group 2 <=> accounts sent eth txs in 2021\nstruct Request {\n // implicit address attester;\n // implicit uint256 chainId;\n Claim[] claims;\n address destination; // destination that will receive the end attestation\n}\n\nstruct Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n bytes extraData; // arbitrary data, may be required by the attester to verify claims or generate a specific attestation\n}\n\n/**\n * @dev Attestation Struct. This is the struct receive as argument by the Attestation Registry.\n * @param collectionId Attestation collection\n * @param owner Attestation collection\n * @param issuer Attestation collection\n * @param value Attestation collection\n * @param timestamp Attestation collection\n * @param extraData Attestation collection\n */\nstruct Attestation {\n // implicit uint256 chainId;\n uint256 collectionId; // Id of the attestation collection (in the registry)\n address owner; // Owner of the attestation\n address issuer; // Contract that created or last updated the record.\n uint256 value; // Value of the attestation\n uint32 timestamp; // Timestamp chosen by the attester, should correspond to the effective date of the attestation\n // it is different from the recording timestamp (date when the attestation was recorded)\n // e.g a proof of NFT ownership may have be recorded today which is 2 month old data.\n bytes extraData; // arbitrary data that can be added by the attester\n}\n\n// Attestation Data, stored in the registry\n// The context is a specific owner of a specific collection\nstruct AttestationData {\n // implicit uint256 chainId\n // implicit uint256 collectionId - from context\n // implicit owner\n address issuer; // Address of the contract that recorded the attestation\n uint256 value; // Value of the attestation\n uint32 timestamp; // Effective date of issuance of the attestation. (can be different from the recording timestamp)\n bytes extraData; // arbitrary data that can be added by the attester\n}\n" - }, - "contracts/attesters/hydra-s1/libs/HydraS1Lib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Claim, Request} from '../../../core/libs/Structs.sol';\nimport {HydraS1Verifier} from '@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol';\n\n// user Hydra-S1 claim retrieved form his request\nstruct HydraS1Claim {\n uint256 groupId; // user claims to have an account in this group\n uint256 claimedValue; // user claims this value for its account in the group\n address destination; // user claims to own this destination[]\n HydraS1GroupProperties groupProperties; // user claims the group has the following properties\n}\n\nstruct HydraS1GroupProperties {\n uint128 groupIndex;\n uint32 generationTimestamp;\n bool isScore;\n}\n\nstruct HydraS1CircomSnarkProof {\n uint256[2] a;\n uint256[2][2] b;\n uint256[2] c;\n}\n\nstruct HydraS1ProofData {\n HydraS1CircomSnarkProof proof;\n uint256[10] input;\n // destination\n // chainId\n // commitmentMapperPubKey.x\n // commitmentMapperPubKey.y\n // registryTreeRoot\n // ticketIdentifier\n // ticket\n // claimedValue\n // accountsTreeValue\n // isStrict\n}\n\nstruct HydraS1ProofInput {\n address destination;\n uint256 chainId;\n uint256 registryRoot;\n uint256 ticketIdentifier;\n uint256 ticket;\n uint256 value;\n uint256 accountsTreeValue;\n bool isStrict;\n uint256[2] commitmentMapperPubKey;\n}\n\nlibrary HydraS1Lib {\n uint256 constant SNARK_FIELD =\n 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n\n error GroupIdAndPropertiesMismatch(uint256 expectedGroupId, uint256 groupId);\n\n function _input(HydraS1ProofData memory self) internal pure returns (HydraS1ProofInput memory) {\n return\n HydraS1ProofInput(\n _getDestination(self),\n _getChainId(self),\n _getRegistryRoot(self),\n _getExpectedExternalNullifier(self),\n _getTicket(self),\n _getValue(self),\n _getAccountsTreeValue(self),\n _getIsStrict(self),\n _getCommitmentMapperPubKey(self)\n );\n }\n\n function _claim(Request memory self) internal pure returns (HydraS1Claim memory) {\n Claim memory claim = self.claims[0];\n _validateClaim(claim);\n\n HydraS1GroupProperties memory groupProperties = abi.decode(\n claim.extraData,\n (HydraS1GroupProperties)\n );\n\n return (HydraS1Claim(claim.groupId, claim.claimedValue, self.destination, groupProperties));\n }\n\n function _toCircomFormat(HydraS1ProofData memory self)\n internal\n pure\n returns (\n uint256[2] memory,\n uint256[2][2] memory,\n uint256[2] memory,\n uint256[10] memory\n )\n {\n return (self.proof.a, self.proof.b, self.proof.c, self.input);\n }\n\n function _getDestination(HydraS1ProofData memory self) internal pure returns (address) {\n return address(uint160(self.input[0]));\n }\n\n function _getChainId(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[1];\n }\n\n function _getCommitmentMapperPubKey(HydraS1ProofData memory self)\n internal\n pure\n returns (uint256[2] memory)\n {\n return [self.input[2], self.input[3]];\n }\n\n function _getRegistryRoot(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[4];\n }\n\n function _getExpectedExternalNullifier(HydraS1ProofData memory self)\n internal\n pure\n returns (uint256)\n {\n return self.input[5];\n }\n\n function _getTicket(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[6];\n }\n\n function _getValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[7];\n }\n\n function _getAccountsTreeValue(HydraS1ProofData memory self) internal pure returns (uint256) {\n return self.input[8];\n }\n\n function _getIsStrict(HydraS1ProofData memory self) internal pure returns (bool) {\n return self.input[9] == 1;\n }\n\n function _getTicket(bytes calldata self) internal pure returns (uint256) {\n HydraS1ProofData memory snarkProofData = abi.decode(self, (HydraS1ProofData));\n uint256 userTicket = uint256(_getTicket(snarkProofData));\n return userTicket;\n }\n\n function _generateGroupIdFromProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (uint256) {\n return\n _generateGroupIdFromEncodedProperties(\n _encodeGroupProperties(groupIndex, generationTimestamp, isScore)\n );\n }\n\n function _generateGroupIdFromEncodedProperties(bytes memory encodedProperties)\n internal\n pure\n returns (uint256)\n {\n return uint256(keccak256(encodedProperties)) % HydraS1Lib.SNARK_FIELD;\n }\n\n function _encodeGroupProperties(\n uint128 groupIndex,\n uint32 generationTimestamp,\n bool isScore\n ) internal pure returns (bytes memory) {\n return abi.encode(groupIndex, generationTimestamp, isScore);\n }\n\n function _validateClaim(Claim memory claim) internal pure {\n uint256 expectedGroupId = _generateGroupIdFromEncodedProperties(claim.extraData);\n if (claim.groupId != expectedGroupId)\n revert GroupIdAndPropertiesMismatch(expectedGroupId, claim.groupId);\n }\n}\n" - }, - "contracts/periphery/utils/CommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ICommitmentMapperRegistry} from './interfaces/ICommitmentMapperRegistry.sol';\n\n/**\n * @title Commitment Mapper Registry Contract\n * @author Sismo\n * @notice This contract stores information about the commitment mapper.\n * Its ethereum address and its EdDSA public key\n * For more information: https://commitment-mapper.docs.sismo.io\n *\n **/\ncontract CommitmentMapperRegistry is ICommitmentMapperRegistry, Initializable, Ownable {\n uint256[2] internal _commitmentMapperPubKey;\n address _commitmentMapperAddress;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n constructor(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) {\n initialize(owner, commitmentMapperEdDSAPubKey, commitmentMapperAddress);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) public initializer {\n _transferOwnership(owner);\n _updateCommitmentMapperEdDSAPubKey(commitmentMapperEdDSAPubKey);\n _updateCommitmentMapperAddress(commitmentMapperAddress);\n }\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external onlyOwner {\n _updateCommitmentMapperEdDSAPubKey(newEdDSAPubKey);\n }\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external onlyOwner {\n _updateCommitmentMapperAddress(newAddress);\n }\n\n /**\n * @dev Getter of the EdDSA public key of the commitment mapper\n */\n function getEdDSAPubKey() external view override returns (uint256[2] memory) {\n return _commitmentMapperPubKey;\n }\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view override returns (address) {\n return _commitmentMapperAddress;\n }\n\n function _updateCommitmentMapperAddress(address newAddress) internal {\n _commitmentMapperAddress = newAddress;\n emit UpdatedCommitmentMapperAddress(newAddress);\n }\n\n function _updateCommitmentMapperEdDSAPubKey(uint256[2] memory pubKey) internal {\n _commitmentMapperPubKey = pubKey;\n emit UpdatedCommitmentMapperEdDSAPubKey(pubKey);\n }\n}\n" - }, - "contracts/periphery/utils/AvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Ownable} from '@openzeppelin/contracts/access/Ownable.sol';\nimport {IAvailableRootsRegistry} from './interfaces/IAvailableRootsRegistry.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\n\n/**\n * @title Attesters Groups Registry\n * @author Sismo\n * @notice This contract stores that data required by attesters to be available so they can verify user claims\n * This contract is deployed behind a proxy and this implementation is focused on storing merkle roots\n * For more information: https://available-roots-registry.docs.sismo.io\n *\n **/\ncontract AvailableRootsRegistry is IAvailableRootsRegistry, Initializable, Ownable {\n mapping(address => mapping(uint256 => bool)) public _roots;\n\n /**\n * @dev Constructor\n * @param owner Owner of the contract, can register/ unregister roots\n */\n constructor(address owner) {\n initialize(owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) public initializer {\n _transferOwnership(owner);\n }\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotRegisterForZeroAddress();\n _registerRootForAttester(attester, root);\n }\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external onlyOwner {\n if (attester == address(0)) revert CannotUnregisterForZeroAddress();\n _unregisterRootForAttester(attester, root);\n }\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external onlyOwner {\n _registerRootForAttester(address(0), root);\n }\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external onlyOwner {\n _unregisterRootForAttester(address(0), root);\n }\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool) {\n return _roots[_msgSender()][root] || _roots[address(0)][root];\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool) {\n return _roots[attester][root] || _roots[address(0)][root];\n }\n\n function _registerRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = true;\n if (attester == address(0)) {\n emit RegisteredRootForAll(root);\n } else {\n emit RegisteredRootForAttester(attester, root);\n }\n }\n\n function _unregisterRootForAttester(address attester, uint256 root) internal {\n _roots[attester][root] = false;\n if (attester == address(0)) {\n emit UnregisteredRootForAll(root);\n } else {\n emit UnregisteredRootForAttester(attester, root);\n }\n }\n}\n" - }, - "@sismo-core/hydra-s1/contracts/HydraS1Verifier.sol": { - "content": "//\n// Copyright 2017 Christian Reitwiessner\n// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n//\n// 2019 OKIMS\n// ported to solidity 0.6\n// fixed linter warnings\n// added requiere error messages\n//\n//\n// SPDX-License-Identifier: GPL-3.0\npragma solidity ^0.8.0;\nlibrary Pairing {\n struct G1Point {\n uint X;\n uint Y;\n }\n // Encoding of field elements is: X[0] * z + X[1]\n struct G2Point {\n uint[2] X;\n uint[2] Y;\n }\n /// @return the generator of G1\n function P1() internal pure returns (G1Point memory) {\n return G1Point(1, 2);\n }\n /// @return the generator of G2\n function P2() internal pure returns (G2Point memory) {\n // Original code point\n return G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n\n/*\n // Changed by Jordi point\n return G2Point(\n [10857046999023057135944570762232829481370756359578518086990519993285655852781,\n 11559732032986387107991004021392285783925812861821192530917403151452391805634],\n [8495653923123431417604973247489272438418190587263600148770280649306958101930,\n 4082367875863433681332203403145435568316851327593401208105741076214120093531]\n );\n*/\n }\n /// @return r the negation of p, i.e. p.addition(p.negate()) should be zero.\n function negate(G1Point memory p) internal pure returns (G1Point memory r) {\n // The prime q in the base field F_q for G1\n uint q = 21888242871839275222246405745257275088696311157297823662689037894645226208583;\n if (p.X == 0 && p.Y == 0)\n return G1Point(0, 0);\n return G1Point(p.X, q - (p.Y % q));\n }\n /// @return r the sum of two points of G1\n function addition(G1Point memory p1, G1Point memory p2) internal view returns (G1Point memory r) {\n uint[4] memory input;\n input[0] = p1.X;\n input[1] = p1.Y;\n input[2] = p2.X;\n input[3] = p2.Y;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 6, input, 0xc0, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-add-failed\");\n }\n /// @return r the product of a point on G1 and a scalar, i.e.\n /// p == p.scalar_mul(1) and p.addition(p) == p.scalar_mul(2) for all points p.\n function scalar_mul(G1Point memory p, uint s) internal view returns (G1Point memory r) {\n uint[3] memory input;\n input[0] = p.X;\n input[1] = p.Y;\n input[2] = s;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 7, input, 0x80, r, 0x60)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require (success,\"pairing-mul-failed\");\n }\n /// @return the result of computing the pairing check\n /// e(p1[0], p2[0]) * .... * e(p1[n], p2[n]) == 1\n /// For example pairing([P1(), P1().negate()], [P2(), P2()]) should\n /// return true.\n function pairing(G1Point[] memory p1, G2Point[] memory p2) internal view returns (bool) {\n require(p1.length == p2.length,\"pairing-lengths-failed\");\n uint elements = p1.length;\n uint inputSize = elements * 6;\n uint[] memory input = new uint[](inputSize);\n for (uint i = 0; i < elements; i++)\n {\n input[i * 6 + 0] = p1[i].X;\n input[i * 6 + 1] = p1[i].Y;\n input[i * 6 + 2] = p2[i].X[0];\n input[i * 6 + 3] = p2[i].X[1];\n input[i * 6 + 4] = p2[i].Y[0];\n input[i * 6 + 5] = p2[i].Y[1];\n }\n uint[1] memory out;\n bool success;\n // solium-disable-next-line security/no-inline-assembly\n assembly {\n success := staticcall(sub(gas(), 2000), 8, add(input, 0x20), mul(inputSize, 0x20), out, 0x20)\n // Use \"invalid\" to make gas estimation work\n switch success case 0 { invalid() }\n }\n require(success,\"pairing-opcode-failed\");\n return out[0] != 0;\n }\n /// Convenience method for a pairing check for two pairs.\n function pairingProd2(G1Point memory a1, G2Point memory a2, G1Point memory b1, G2Point memory b2) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](2);\n G2Point[] memory p2 = new G2Point[](2);\n p1[0] = a1;\n p1[1] = b1;\n p2[0] = a2;\n p2[1] = b2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for three pairs.\n function pairingProd3(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](3);\n G2Point[] memory p2 = new G2Point[](3);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n return pairing(p1, p2);\n }\n /// Convenience method for a pairing check for four pairs.\n function pairingProd4(\n G1Point memory a1, G2Point memory a2,\n G1Point memory b1, G2Point memory b2,\n G1Point memory c1, G2Point memory c2,\n G1Point memory d1, G2Point memory d2\n ) internal view returns (bool) {\n G1Point[] memory p1 = new G1Point[](4);\n G2Point[] memory p2 = new G2Point[](4);\n p1[0] = a1;\n p1[1] = b1;\n p1[2] = c1;\n p1[3] = d1;\n p2[0] = a2;\n p2[1] = b2;\n p2[2] = c2;\n p2[3] = d2;\n return pairing(p1, p2);\n }\n}\ncontract HydraS1Verifier {\n using Pairing for *;\n struct VerifyingKey {\n Pairing.G1Point alfa1;\n Pairing.G2Point beta2;\n Pairing.G2Point gamma2;\n Pairing.G2Point delta2;\n Pairing.G1Point[] IC;\n }\n struct Proof {\n Pairing.G1Point A;\n Pairing.G2Point B;\n Pairing.G1Point C;\n }\n function verifyingKey() internal pure returns (VerifyingKey memory vk) {\n vk.alfa1 = Pairing.G1Point(\n 20491192805390485299153009773594534940189261866228447918068658471970481763042,\n 9383485363053290200918347156157836566562967994039712273449902621266178545958\n );\n\n vk.beta2 = Pairing.G2Point(\n [4252822878758300859123897981450591353533073413197771768651442665752259397132,\n 6375614351688725206403948262868962793625744043794305715222011528459656738731],\n [21847035105528745403288232691147584728191162732299865338377159692350059136679,\n 10505242626370262277552901082094356697409835680220590971873171140371331206856]\n );\n vk.gamma2 = Pairing.G2Point(\n [11559732032986387107991004021392285783925812861821192530917403151452391805634,\n 10857046999023057135944570762232829481370756359578518086990519993285655852781],\n [4082367875863433681332203403145435568316851327593401208105741076214120093531,\n 8495653923123431417604973247489272438418190587263600148770280649306958101930]\n );\n vk.delta2 = Pairing.G2Point(\n [16703691932058078091905716404571265959476320760471681443119627655715361207341,\n 14290274403144646058563103675066900294643500151498463054614740831207315388514],\n [9120517679481713774648131333833134160499672068094273767171232839700590114148,\n 18338638855816625080803231766917659002322979855877827709378572546717723262324]\n );\n vk.IC = new Pairing.G1Point[](11);\n \n vk.IC[0] = Pairing.G1Point( \n 15183981365841448712456044920259850142312423574262787585047804960636415432994,\n 7001044530623564797357151512361873851017731748844374046997463344585588795777\n ); \n \n vk.IC[1] = Pairing.G1Point( \n 3754737654948662562435613969155994959132173506784418442817218316697091994043,\n 16520141448541154153981919757383608282199583682574061862571018786569723115048\n ); \n \n vk.IC[2] = Pairing.G1Point( \n 14734466460881491794568175288621656907425457509621292263456156896685122952305,\n 18495564446073110430251898491840031389094613665866187171071741938161262650771\n ); \n \n vk.IC[3] = Pairing.G1Point( \n 16380352455102502109444307845900237792657209995731679788026311308996926499427,\n 11872494853967118743957240270505831687788406895959276908447589431944985706662\n ); \n \n vk.IC[4] = Pairing.G1Point( \n 20199514202493196707492057247804402540358301491780845748325025913208809441866,\n 12760637713678265881350279209961337475498485836996922236408521200416764617323\n ); \n \n vk.IC[5] = Pairing.G1Point( \n 19153715775490328450864792250302417403928222720390978634383848496516270422395,\n 546002182798634190282541153661423157791776194062719045593389981526666716416\n ); \n \n vk.IC[6] = Pairing.G1Point( \n 2572546294944895555897986264162285493992700415786641015895831165477991460890,\n 16475880996834565556958124284585338184010927435675877479782010166270319781724\n ); \n \n vk.IC[7] = Pairing.G1Point( \n 1189084334785746899933155760881982253715630415235816484826929546449434025692,\n 4229672360641556939458327562740354930286687266228809328535679188294452033396\n ); \n \n vk.IC[8] = Pairing.G1Point( \n 19602244162575575785636531633124796303002902053486919698240132790672698216585,\n 181057165072599074288983745076121344893296348827576905983079816835912241514\n ); \n \n vk.IC[9] = Pairing.G1Point( \n 2674333225598340315002358633842521216418358316694409406540164227900893354209,\n 2129512057743264354864596186877181463207231175912159744730924346148245351960\n ); \n \n vk.IC[10] = Pairing.G1Point( \n 7320700433668244102684846027945878190869912696586803178638351868907615350377,\n 2941840530209756385349015075958743796933501451265755778001586753024906675441\n ); \n \n }\n function verify(uint[] memory input, Proof memory proof) internal view returns (uint) {\n uint256 snark_scalar_field = 21888242871839275222246405745257275088548364400416034343698204186575808495617;\n VerifyingKey memory vk = verifyingKey();\n require(input.length + 1 == vk.IC.length,\"verifier-bad-input\");\n // Compute the linear combination vk_x\n Pairing.G1Point memory vk_x = Pairing.G1Point(0, 0);\n for (uint i = 0; i < input.length; i++) {\n require(input[i] < snark_scalar_field,\"verifier-gte-snark-scalar-field\");\n vk_x = Pairing.addition(vk_x, Pairing.scalar_mul(vk.IC[i + 1], input[i]));\n }\n vk_x = Pairing.addition(vk_x, vk.IC[0]);\n if (!Pairing.pairingProd4(\n Pairing.negate(proof.A), proof.B,\n vk.alfa1, vk.beta2,\n vk_x, vk.gamma2,\n proof.C, vk.delta2\n )) return 1;\n return 0;\n }\n /// @return r bool true if proof is valid\n function verifyProof(\n uint[2] memory a,\n uint[2][2] memory b,\n uint[2] memory c,\n uint[10] memory input\n ) public view returns (bool r) {\n Proof memory proof;\n proof.A = Pairing.G1Point(a[0], a[1]);\n proof.B = Pairing.G2Point([b[0][0], b[0][1]], [b[1][0], b[1][1]]);\n proof.C = Pairing.G1Point(c[0], c[1]);\n uint[] memory inputValues = new uint[](input.length);\n for(uint i = 0; i < input.length; i++){\n inputValues[i] = input[i];\n }\n if (verify(inputValues, proof) == 0) {\n return true;\n } else {\n return false;\n }\n }\n}\n" - }, - "@openzeppelin/contracts/access/Ownable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract Ownable is Context {\n address private _owner;\n\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), \"Ownable: caller is not the owner\");\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), \"Ownable: new owner is the zero address\");\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/ICommitmentMapperRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\ninterface ICommitmentMapperRegistry {\n event UpdatedCommitmentMapperEdDSAPubKey(uint256[2] newEdDSAPubKey);\n event UpdatedCommitmentMapperAddress(address newAddress);\n error PubKeyNotValid(uint256[2] pubKey);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n * @param commitmentMapperEdDSAPubKey EdDSA public key of the commitment mapper\n * @param commitmentMapperAddress Address of the commitment mapper\n */\n function initialize(\n address owner,\n uint256[2] memory commitmentMapperEdDSAPubKey,\n address commitmentMapperAddress\n ) external;\n\n /**\n * @dev Updates the EdDSA public key\n * @param newEdDSAPubKey new EdDSA pubic key\n */\n function updateCommitmentMapperEdDSAPubKey(uint256[2] memory newEdDSAPubKey) external;\n\n /**\n * @dev Updates the address\n * @param newAddress new address\n */\n function updateCommitmentMapperAddress(address newAddress) external;\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getEdDSAPubKey() external view returns (uint256[2] memory);\n\n /**\n * @dev Getter of the address of the commitment mapper\n */\n function getAddress() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, \"Address: insufficient balance\");\n\n (bool success, ) = recipient.call{value: amount}(\"\");\n require(success, \"Address: unable to send value, recipient may have reverted\");\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, \"Address: low-level call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, \"Address: low-level call with value failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, \"Address: insufficient balance for call\");\n require(isContract(target), \"Address: call to non-contract\");\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\n return functionStaticCall(target, data, \"Address: low-level static call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), \"Address: static call to non-contract\");\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, \"Address: low-level delegate call failed\");\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), \"Address: delegate call to non-contract\");\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/periphery/utils/interfaces/IAvailableRootsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\n/**\n * @title IAvailableRootsRegistry\n * @author Sismo\n * @notice Interface for (Merkle) Roots Registry\n */\ninterface IAvailableRootsRegistry {\n event RegisteredRootForAttester(address attester, uint256 root);\n event RegisteredRootForAll(uint256 root);\n event UnregisteredRootForAttester(address attester, uint256 root);\n event UnregisteredRootForAll(uint256 root);\n\n error CannotRegisterForZeroAddress();\n error CannotUnregisterForZeroAddress();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, can update public key and address\n */\n function initialize(address owner) external;\n\n /**\n * @dev Register a root available for an attester\n * @param attester Attester which will have the root available\n * @param root Root to register\n */\n function registerRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Unregister a root for an attester\n * @param attester Attester which will no longer have the root available\n * @param root Root to unregister\n */\n function unregisterRootForAttester(address attester, uint256 root) external;\n\n /**\n * @dev Registers a root, available for all contracts\n * @param root Root to register\n */\n function registerRootForAll(uint256 root) external;\n\n /**\n * @dev Unregister a root, available for all contracts\n * @param root Root to unregister\n */\n function unregisterRootForAll(uint256 root) external;\n\n /**\n * @dev returns whether a root is available for a caller (msg.sender)\n * @param root root to check whether it is registered for me or not\n */\n function isRootAvailableForMe(uint256 root) external view returns (bool);\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param attester Owner of the contract, can update public key and address\n * @param root Owner of the contract, can update public key and address\n */\n function isRootAvailableForAttester(address attester, uint256 root) external view returns (bool);\n}\n" - }, - "contracts/attesters/hydra-s1/variants/HydraS1SoulboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SoulboundAttester} from '../interfaces/IHydraS1SoulboundAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from '../../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from '../../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from '../base/HydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Soulbound Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - SoulBound (with cooldown period)\n * A user can chose to delete attestations or generate attestation to a new destination.\n * When deleting/ sending to a new destination, the ticket will enter a cooldown period, so it remains occasional\n * User will need to wait until the end of the cooldown period before being able to delete or switch destination again\n * One can however know that the former and the new destinations were created using the same userTicket\n \n * - Renewable\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew or update their attestations\n **/\ncontract HydraS1SoulboundAttester is IHydraS1SoulboundAttester, HydraS1Base, Attester {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n uint256 public immutable SOULBOUND_COOLDOWN_DURATION;\n\n mapping(uint256 => TicketData) internal _userTicketsData;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast,\n uint256 soulboundCooldownDuration\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n SOULBOUND_COOLDOWN_DURATION = soulboundCooldownDuration;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user attestations request is invalid\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark proof backing the claim\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Throws if user attestations deletion request is not made by its owner\n * @param attestations attestations to delete\n */\n function _verifyAttestationsDeletionRequest(Attestation[] memory attestations, bytes calldata)\n internal\n view\n override\n {\n for (uint256 i = 0; i < attestations.length; i++) {\n uint256 userTicket = abi.decode(attestations[0].extraData, (uint256));\n if (_userTicketsData[userTicket].destination != msg.sender)\n revert NotAttestationOwner(userTicket, msg.sender);\n }\n }\n\n /**\n * @dev Returns the actual attestations constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData snark public input as well as snark proof\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n HydraS1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n // The issuer of attestations is the attester\n address issuer = address(this);\n // user sends the ticket as input in the data\n uint256 userTicket = proofData._getTicket();\n\n attestations[0] = Attestation(\n attestationCollectionId,\n request.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n abi.encode(userTicket)\n );\n\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used, not a renewal, and ticket on cooldown.\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n uint256 userTicket = proofData._getTicket();\n TicketData memory userTicketData = _userTicketsData[userTicket];\n\n if (\n userTicketData.destination != address(0) && userTicketData.destination != request.destination\n ) {\n if (_isOnCooldown(userTicketData)) revert TicketUsedAndOnCooldown(userTicketData);\n _setTicketOnCooldown(userTicket);\n }\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n override\n {\n // we retrieve the ticketUsed from attestations extraData\n for (uint256 i = 0; i < attestations.length; i++) {\n uint256 userTicket = abi.decode(attestations[i].extraData, (uint256));\n if (_isOnCooldown(_userTicketsData[userTicket]) == true) revert TicketFrozen(userTicket);\n _userTicketsData[userTicket].destination = address(0);\n }\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\n return ticketIdentifier;\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n /**\n * @dev Getter, returns the data linked to a ticket\n * @param userTicket ticket used\n **/\n function getTicketData(uint256 userTicket) external view override returns (TicketData memory) {\n return _getTicketData(userTicket);\n }\n\n /**\n * @dev returns whether a ticket is on cooldown or not\n * @param userTicket ticket used\n **/\n function isTicketOnCooldown(uint256 userTicket) external view override returns (bool) {\n return _isOnCooldown(_getTicketData(userTicket));\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _userTicketsData[userTicket].destination = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _setTicketOnCooldown(uint256 userTicket) internal {\n _userTicketsData[userTicket].cooldownStart = uint32(block.timestamp);\n emit TicketSetOnCooldown(userTicket);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _userTicketsData[userTicket].destination;\n }\n\n function _isOnCooldown(TicketData memory userTicketData) internal view returns (bool) {\n return userTicketData.cooldownStart + SOULBOUND_COOLDOWN_DURATION < block.timestamp;\n }\n\n function _getTicketData(uint256 userTicket) internal view returns (TicketData memory) {\n return _userTicketsData[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1SoulboundAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n// todo: explain well what is specific to this attester\ninterface IHydraS1SoulboundAttester is IHydraS1Base, IAttester {\n struct TicketData {\n address destination;\n uint32 cooldownStart;\n }\n error NotAttestationOwner(uint256 ticket, address sender);\n error TicketFrozen(uint256 ticketData);\n error TicketUsedAndOnCooldown(TicketData ticketData);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n event TicketSetOnCooldown(uint256 ticket);\n\n /**\n * @dev returns whether a ticket is on cooldown or not\n * @param userTicket ticket used\n **/\n function isTicketOnCooldown(uint256 userTicket) external view returns (bool);\n\n /**\n * @dev Getter, returns the data linked to a ticket\n * @param userTicket ticket used\n **/\n function getTicketData(uint256 userTicket) external view returns (TicketData memory);\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the duration of the cooldown period after having used a ticket\n **/\n function SOULBOUND_COOLDOWN_DURATION() external view returns (uint256);\n}\n" - }, - "contracts/core/Attester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation, AttestationData} from './libs/Structs.sol';\n\n/**\n * @title Attester Abstract Contract\n * @author Sismo\n * @notice Contract to be inherited by Attesters\n * All attesters that expect to be authorized in Sismo Protocol (i.e write access on the registry)\n * are recommended to implemented this abstract contract\n\n * Take a look at the HydraS1SimpleAttester.sol for example on how to implement this abstract contract\n *\n * This contracts is built around two main external standard functions.\n * They must NOT be override them, unless your really know what you are doing\n \n * - generateAttestations(request, proof) => will write attestations in the registry\n * 1. (MANDATORY) Implement the buildAttestations() view function which generate attestations from user request\n * 2. (MANDATORY) Implement teh _verifyRequest() internal function where to write checks\n * 3. (OPTIONAL) Override _beforeRecordAttestations and _afterRecordAttestations hooks\n\n * - deleteAttestations(collectionId, owner, proof) => will delete attestations in the registry\n * 1. (DEFAULT) By default this function throws (see _verifyAttestationsDeletionRequest)\n * 2. (OPTIONAL) Override the _verifyAttestationsDeletionRequest so it no longer throws\n * 3. (OPTIONAL) Override _beforeDeleteAttestations and _afterDeleteAttestations hooks\n\n * For more information: https://attesters.docs.sismo.io\n **/\nabstract contract Attester is IAttester {\n // Registry where all attestations are stored\n IAttestationsRegistry internal immutable ATTESTATIONS_REGISTRY;\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress The address of the AttestationsRegistry contract storing attestations\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(Request calldata request, bytes calldata proofData)\n external\n override\n returns (Attestation[] memory)\n {\n // Verify if request is valid by verifying against proof\n _verifyRequest(request, proofData);\n\n // Generate the actual attestations from user request\n Attestation[] memory attestations = buildAttestations(request, proofData);\n\n _beforeRecordAttestations(request, proofData);\n\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n\n _afterRecordAttestations(attestations);\n\n for (uint256 i = 0; i < attestations.length; i++) {\n emit AttestationGenerated(attestations[i]);\n }\n\n return attestations;\n }\n\n /**\n * @dev External facing function. Allows to delete attestations by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that were deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n // fetch attestations from the registry\n Attestation[] memory attestationsToDelete;\n for (uint256 i = 0; i < collectionIds.length; i++) {\n (\n address issuer,\n uint256 attestationValue,\n uint32 timestamp,\n bytes memory extraData\n ) = ATTESTATIONS_REGISTRY.getAttestationDataTuple(collectionIds[i], attestationsOwner);\n\n attestationsToDelete[i] = (\n Attestation(\n collectionIds[i],\n attestationsOwner,\n issuer,\n attestationValue,\n timestamp,\n extraData\n )\n );\n }\n\n _verifyAttestationsDeletionRequest(attestationsToDelete, proofData);\n\n _beforeDeleteAttestations(attestationsToDelete, proofData);\n\n ATTESTATIONS_REGISTRY.deleteAttestations(attestationsToDelete);\n\n _afterDeleteAttestations(attestationsToDelete, proofData);\n\n for (uint256 i = 0; i < collectionIds.length; i++) {\n emit AttestationDeleted(attestationsToDelete[i]);\n }\n return attestationsToDelete;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n public\n view\n virtual\n returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry getter\n * @return attestationRegistry\n */\n function getAttestationRegistry() external view override returns (IAttestationsRegistry) {\n return ATTESTATIONS_REGISTRY;\n }\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should verify the user request is valid\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData) internal virtual;\n\n /**\n * @dev Optional: must be overridden by attesters that want to feature attestations deletion\n * Default behavior: throws\n * It should verify attestations deletion request is valid\n * @param attestations Attestations that will be deleted\n * @param proofData Data sent along the request to prove its validity\n */\n function _verifyAttestationsDeletionRequest(\n Attestation[] memory attestations,\n bytes calldata proofData\n ) internal virtual {\n revert AttestationDeletionNotImplemented();\n }\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before recording attestations in the registry\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n {}\n\n /**\n * @dev (Optional) Can be overridden in attesters inheriting this contract\n * Will be called after recording an attestation\n * @param attestations Recorded attestations\n */\n function _afterRecordAttestations(Attestation[] memory attestations) internal virtual {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called before deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _beforeDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n virtual\n {}\n\n /**\n * @dev Optional: Hook, can be overridden in attesters\n * Will be called after deleting attestations from the registry\n * @param attestations Attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n */\n function _afterDeleteAttestations(Attestation[] memory attestations, bytes calldata proofData)\n internal\n virtual\n {}\n}\n" - }, - "contracts/core/interfaces/IAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\nimport {IAttestationsRegistry} from '../interfaces/IAttestationsRegistry.sol';\n\n/**\n * @title IAttester\n * @author Sismo\n * @notice This is the interface for the attesters in Sismo Protocol\n */\ninterface IAttester {\n event AttestationGenerated(Attestation attestation);\n\n event AttestationDeleted(Attestation attestation);\n\n error AttestationDeletionNotImplemented();\n\n /**\n * @dev Main external function. Allows to generate attestations by making a request and submitting proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that has been recorded\n */\n function generateAttestations(Request calldata request, bytes calldata proofData)\n external\n returns (Attestation[] memory);\n\n /**\n * @dev External facing function. Allows to delete an attestation by submitting proof\n * @param collectionIds Collection identifier of attestations to delete\n * @param attestationsOwner Owner of attestations to delete\n * @param proofData Data sent along the deletion request to prove its validity\n * @return attestations Attestations that was deleted\n */\n function deleteAttestations(\n uint256[] calldata collectionIds,\n address attestationsOwner,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev MANDATORY: must be implemented in attesters\n * It should build attestations from the user request and the proof\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(Request calldata request, bytes calldata proofData)\n external\n view\n returns (Attestation[] memory);\n\n /**\n * @dev Attestation registry address getter\n * @return attestationRegistry Address of the registry\n */\n function getAttestationRegistry() external view returns (IAttestationsRegistry);\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Attestation, AttestationData} from '../libs/Structs.sol';\n\n/**\n * @title IAttestationsRegistry\n * @author Sismo\n * @notice This is the interface of the AttestationRegistry\n */\ninterface IAttestationsRegistry {\n event AttestationRecorded(Attestation attestation);\n event AttestationDeleted(Attestation attestation);\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external;\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param attestations Attestations to be deleted\n */\n function deleteAttestations(Attestation[] calldata attestations) external;\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner) external returns (bool);\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(uint256 collectionId, address owner)\n external\n view\n returns (AttestationData memory);\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner) external view returns (uint256);\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(uint256 collectionId, address owner)\n external\n view\n returns (\n address,\n uint256,\n uint32,\n bytes memory\n );\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(uint256 collectionId, address owner)\n external\n view\n returns (bytes memory);\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(uint256 collectionId, address owner)\n external\n view\n returns (address);\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(uint256 collectionId, address owner)\n external\n view\n returns (uint32);\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n returns (AttestationData[] memory);\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n returns (uint256[] memory);\n}\n" - }, - "contracts/tests/MockAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\n\nimport {Attestation, Request} from '../core/libs/Structs.sol';\nimport {Attester} from '../core/Attester.sol';\nimport {IAttester} from '../core/interfaces/IAttester.sol';\n\ncontract MockAttester is IAttester, Attester {\n uint256 public immutable ATTESTATION_ID_MIN;\n uint256 public immutable ATTESTATION_ID_MAX;\n\n constructor(\n address ATTESTATION_REGISTRY_ADDRESS,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n ) Attester(ATTESTATION_REGISTRY_ADDRESS) {\n ATTESTATION_ID_MIN = collectionIdFirst;\n ATTESTATION_ID_MAX = collectionIdLast;\n }\n\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {}\n\n function buildAttestations(\n Request calldata request,\n bytes calldata /*data*/\n ) public view virtual override(Attester, IAttester) returns (Attestation[] memory) {\n uint256 collectionId = ATTESTATION_ID_MIN + request.claims[0].groupId;\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n collectionId,\n request.destination,\n address(this),\n request.claims[0].claimedValue,\n abi.decode(request.claims[0].extraData, (uint32)),\n 'Mock Attester v0'\n );\n return (attestations);\n }\n}\n" - }, - "contracts/core/Front.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IFront} from './interfaces/IFront.sol';\nimport {IAttester} from './interfaces/IAttester.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {Request, Attestation} from './libs/Structs.sol';\n\n/**\n * @title Front\n * @author Sismo\n * @notice This is the Front contract of the Sismo protocol\n * Behind a proxy, it routes attestations request to the targeted attester and can perform some actions\n * This specific implementation rewards early users with a early user attestation if they used sismo before ethcc conference\n\n * For more information: https://front.docs.sismo.io\n */\ncontract Front is IFront {\n IAttestationsRegistry public immutable ATTESTATIONS_REGISTRY;\n uint256 public constant EARLY_USER_COLLECTION = 0;\n uint32 public constant EARLY_USER_BADGE_END_DATE = 1663200000; // Sept 15\n\n /**\n * @dev Constructor\n * @param attestationsRegistryAddress Attestations registry contract address\n */\n constructor(address attestationsRegistryAddress) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external override returns (Attestation[] memory) {\n Attestation[] memory attestations = _forwardAttestationsGeneration(\n attester,\n request,\n proofData\n );\n _generateEarlyUserAttestation(request.destination);\n return attestations;\n }\n\n /**\n * @dev generate multiple attestations at once, to the same destination, generates an early user attestation\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n address destination = requests[0].destination;\n for (uint256 i = 0; i < attesters.length; i++) {\n if (requests[i].destination != destination) revert DifferentRequestsDestinations();\n attestations[i] = _forwardAttestationsGeneration(\n attesters[i],\n requests[i],\n proofDataArray[i]\n );\n }\n _generateEarlyUserAttestation(destination);\n return attestations;\n }\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view override returns (Attestation[] memory) {\n return _forwardAttestationsBuild(attester, request, proofData);\n }\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function of targeted attester\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view override returns (Attestation[][] memory) {\n Attestation[][] memory attestations = new Attestation[][](attesters.length);\n\n for (uint256 i = 0; i < attesters.length; i++) {\n attestations[i] = _forwardAttestationsBuild(attesters[i], requests[i], proofDataArray[i]);\n }\n return attestations;\n }\n\n function _forwardAttestationsBuild(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal view returns (Attestation[] memory) {\n return IAttester(attester).buildAttestations(request, proofData);\n }\n\n function _forwardAttestationsGeneration(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) internal returns (Attestation[] memory) {\n return IAttester(attester).generateAttestations(request, proofData);\n }\n\n function _generateEarlyUserAttestation(address destination) internal {\n uint32 currentTimestamp = uint32(block.timestamp);\n if (currentTimestamp < EARLY_USER_BADGE_END_DATE) {\n bool alreadyHasAttestation = ATTESTATIONS_REGISTRY.hasAttestation(\n EARLY_USER_COLLECTION,\n destination\n );\n\n if (!alreadyHasAttestation) {\n Attestation[] memory attestations = new Attestation[](1);\n attestations[0] = Attestation(\n EARLY_USER_COLLECTION,\n destination,\n address(this),\n 1,\n currentTimestamp,\n 'With strong love from Sismo'\n );\n ATTESTATIONS_REGISTRY.recordAttestations(attestations);\n emit EarlyUserAttestationGenerated(destination);\n }\n }\n }\n}\n" - }, - "contracts/core/interfaces/IFront.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Request, Attestation} from '../libs/Structs.sol';\n\n/**\n * @title IFront\n * @author Sismo\n * @notice This is the interface of the Front Contract\n */\ninterface IFront {\n error DifferentRequestsDestinations();\n event EarlyUserAttestationGenerated(address destination);\n\n /**\n * @dev Forward a request to an attester and generates an early user attestation\n * @param attester Attester targeted by the request\n * @param request Request sent to the attester\n * @param proofData Data provided to the attester to back the request\n */\n function generateAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external returns (Attestation[] memory);\n\n /**\n * @dev generate multiple attestations at once, to the same destination\n * @param attesters Attesters targeted by the attesters\n * @param requests Requests sent to attester\n * @param proofDataArray Data sent with each request\n */\n function batchGenerateAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external returns (Attestation[][] memory);\n\n /**\n * @dev build the attestations from a user request targeting a specific attester.\n * Forwards to the build function of targeted attester\n * @param attester Targeted attester\n * @param request User request\n * @param proofData Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function buildAttestations(\n address attester,\n Request calldata request,\n bytes calldata proofData\n ) external view returns (Attestation[] memory);\n\n /**\n * @dev build the attestations from multiple user requests.\n * Forwards to the build function(s) of targeted attester(s)\n * @param attesters Targeted attesters\n * @param requests User requests\n * @param proofDataArray Data sent along the request to prove its validity\n * @return attestations Attestations that will be recorded\n */\n function batchBuildAttestations(\n address[] calldata attesters,\n Request[] calldata requests,\n bytes[] calldata proofDataArray\n ) external view returns (Attestation[][] memory);\n}\n" - }, - "contracts/tests/MockAttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\nimport {IAttestationsRegistry} from '../core/interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from '../core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from '../core/libs/attestations-registry/AttestationsRegistryState.sol';\nimport {IBadges} from '../core/interfaces/IBadges.sol';\nimport {Attestation, AttestationData} from '../core/libs/Structs.sol';\n\ncontract MockAttestationsRegistry {\n uint256 immutable ATTESTATION_VALUE;\n IBadges immutable BADGES;\n\n constructor(address badgesAddress, uint256 attestationValue) {\n BADGES = IBadges(badgesAddress);\n ATTESTATION_VALUE = attestationValue;\n }\n\n function getAttestationValue(uint256 collectionId, address owner)\n external\n view\n returns (uint256)\n {\n return ATTESTATION_VALUE;\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport './OwnableLogic.sol';\nimport './PausableLogic.sol';\nimport './InitializableLogic.sol';\nimport './AttestationsRegistryState.sol';\nimport {IAttestationsRegistryConfigLogic} from './../../interfaces/IAttestationsRegistryConfigLogic.sol';\nimport {Range, RangeUtils} from '../utils/RangeLib.sol';\n\n/**\n * @title Attestations Registry Config Logic contract\n * @author Sismo\n * @notice Holds the logic of how to authorize/ unauthorize issuers of attestations in the registry\n **/\ncontract AttestationsRegistryConfigLogic is\n AttestationsRegistryState,\n IAttestationsRegistryConfigLogic,\n OwnableLogic,\n PausableLogic,\n InitializableLogic\n{\n using RangeUtils for Range[];\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _authorizeRange(issuer, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external override onlyOwner {\n _unauthorizeRange(issuer, rangeIndex, firstCollectionId, lastCollectionId);\n }\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external override onlyOwner {\n for (uint256 i = 0; i < ranges.length; i++) {\n _authorizeRange(issuer, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external override onlyOwner {\n for (uint256 i = 0; i < rangeIndexes.length; i++) {\n _unauthorizeRange(issuer, rangeIndexes[i] - i, ranges[i].min, ranges[i].max);\n }\n }\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool) {\n return _isAuthorized(issuer, collectionId);\n }\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external override onlyOwner {\n _pause();\n }\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external override onlyOwner {\n _unpause();\n }\n\n function _isAuthorized(address issuer, uint256 collectionId) internal view returns (bool) {\n return _authorizedRanges[issuer]._includes(collectionId);\n }\n\n function _authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal {\n Range memory newRange = Range(firstCollectionId, lastCollectionId);\n _authorizedRanges[issuer].push(newRange);\n emit IssuerAuthorized(issuer, firstCollectionId, lastCollectionId);\n }\n\n function _unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) internal onlyOwner {\n if (rangeIndex >= _authorizedRanges[issuer].length)\n revert RangeIndexOutOfBounds(issuer, _authorizedRanges[issuer].length, rangeIndex);\n\n uint256 expectedFirstId = _authorizedRanges[issuer][rangeIndex].min;\n uint256 expectedLastId = _authorizedRanges[issuer][rangeIndex].max;\n if (firstCollectionId != expectedFirstId || lastCollectionId != expectedLastId)\n revert IdsMismatch(\n issuer,\n rangeIndex,\n expectedFirstId,\n expectedLastId,\n firstCollectionId,\n lastCollectionId\n );\n\n _authorizedRanges[issuer][rangeIndex] = _authorizedRanges[issuer][\n _authorizedRanges[issuer].length - 1\n ];\n _authorizedRanges[issuer].pop();\n emit IssuerUnauthorized(issuer, firstCollectionId, lastCollectionId);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/AttestationsRegistryState.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {Range} from '../utils/RangeLib.sol';\nimport {Attestation, AttestationData} from '../Structs.sol';\n\ncontract AttestationsRegistryState {\n // main config\n bool internal _initialized;\n bool internal _initializing;\n bool internal _paused;\n address internal _owner;\n // keeping some space for future\n uint256[15] private _placeHolders;\n\n // storing the authorized ranges for each attesters\n mapping(address => Range[]) internal _authorizedRanges;\n // keeping some space for future\n uint256[15] private _placeHolders2;\n // storing the data of attestations\n // =collectionId=> =owner=> attestationData\n mapping(uint256 => mapping(address => AttestationData)) internal _attestationsData;\n}\n" - }, - "contracts/core/interfaces/IBadges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\n/**\n * @title Interface for Badges contract\n * @author Sismo\n * @notice Stateless ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n */\ninterface IBadges {\n error BadgesNonTransferrable();\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n function initialize(string memory uri, address owner) external;\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external;\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry) external;\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external;\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view returns (address);\n}\n" - }, - "contracts/core/libs/attestations-registry/OwnableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which provides a basic access control mechanism, where\n * there is an account (an owner) that can be granted exclusive access to\n * specific functions.\n *\n * By default, the owner account will be the one that deploys the contract. This\n * can later be changed with {transferOwnership}.\n *\n * This module is used through inheritance. It will make available the modifier\n * `onlyOwner`, which can be applied to your functions to restrict their use to\n * the owner.\n */\nabstract contract OwnableLogic is Context, AttestationsRegistryState {\n event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\n\n // This is the only diff with OZ contract\n // address private _owner;\n\n /**\n * @dev Initializes the contract setting the deployer as the initial owner.\n */\n constructor() {\n _transferOwnership(_msgSender());\n }\n\n /**\n * @dev Returns the address of the current owner.\n */\n function owner() public view virtual returns (address) {\n return _owner;\n }\n\n /**\n * @dev Throws if called by any account other than the owner.\n */\n modifier onlyOwner() {\n require(owner() == _msgSender(), 'Ownable: caller is not the owner');\n _;\n }\n\n /**\n * @dev Leaves the contract without owner. It will not be possible to call\n * `onlyOwner` functions anymore. Can only be called by the current owner.\n *\n * NOTE: Renouncing ownership will leave the contract without an owner,\n * thereby removing any functionality that is only available to the owner.\n */\n function renounceOwnership() public virtual onlyOwner {\n _transferOwnership(address(0));\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Can only be called by the current owner.\n */\n function transferOwnership(address newOwner) public virtual onlyOwner {\n require(newOwner != address(0), 'Ownable: new owner is the zero address');\n _transferOwnership(newOwner);\n }\n\n /**\n * @dev Transfers ownership of the contract to a new account (`newOwner`).\n * Internal function without access restriction.\n */\n function _transferOwnership(address newOwner) internal virtual {\n address oldOwner = _owner;\n _owner = newOwner;\n emit OwnershipTransferred(oldOwner, newOwner);\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/PausableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Context.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract PausableLogic is Context, AttestationsRegistryState {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n // this is the only diff with OZ contract\n // bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), 'Pausable: paused');\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), 'Pausable: not paused');\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "contracts/core/libs/attestations-registry/InitializableLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/utils/Initializable.sol)\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport '../utils/Address.sol';\nimport './AttestationsRegistryState.sol';\n\n/**\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\n *\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\n *\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\n *\n * [CAUTION]\n * ====\n * Avoid leaving a contract uninitialized.\n *\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\n * contract, which may impact the proxy. To initialize the implementation contract, you can either invoke the\n * initializer manually, or you can include a constructor to automatically mark it as initialized when it is deployed:\n *\n * [.hljs-theme-light.nopadding]\n * ```\n * /// @custom:oz-upgrades-unsafe-allow constructor\n * constructor() initializer {}\n * ```\n * ====\n */\nabstract contract InitializableLogic is AttestationsRegistryState {\n // only diff with oz\n // /**\n // * @dev Indicates that the contract has been initialized.\n // */\n // bool private _initialized;\n\n // /**\n // * @dev Indicates that the contract is in the process of being initialized.\n // */\n // bool private _initializing;\n\n /**\n * @dev Modifier to protect an initializer function from being invoked twice.\n */\n modifier initializer() {\n // If the contract is initializing we ignore whether _initialized is set in order to support multiple\n // inheritance patterns, but we only do this in the context of a constructor, because in other contexts the\n // contract may have been reentered.\n require(\n _initializing ? _isConstructor() : !_initialized,\n 'Initializable: contract is already initialized'\n );\n\n bool isTopLevelCall = !_initializing;\n if (isTopLevelCall) {\n _initializing = true;\n _initialized = true;\n }\n\n _;\n\n if (isTopLevelCall) {\n _initializing = false;\n }\n }\n\n /**\n * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\n * {initializer} modifier, directly or indirectly.\n */\n modifier onlyInitializing() {\n require(_initializing, 'Initializable: contract is not initializing');\n _;\n }\n\n function _isConstructor() private view returns (bool) {\n return !Address.isContract(address(this));\n }\n}\n" - }, - "contracts/core/interfaces/IAttestationsRegistryConfigLogic.sol": { - "content": "// SPDX-License-Identifier: MIT\n// Forked from, removed storage, OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\n\npragma solidity ^0.8.14;\n\nimport {Range, RangeUtils} from '../libs/utils/RangeLib.sol';\n\ninterface IAttestationsRegistryConfigLogic {\n error IssuerNotAuthorized(address issuer, uint256 collectionId);\n error AttesterNotFound(address issuer);\n error RangeIndexOutOfBounds(address issuer, uint256 expectedArrayLength, uint256 rangeIndex);\n error IdsMismatch(\n address issuer,\n uint256 rangeIndex,\n uint256 expectedFirstId,\n uint256 expectedLastId,\n uint256 FirstId,\n uint256 lastCollectionId\n );\n event IssuerAuthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n event IssuerUnauthorized(address issuer, uint256 firstCollectionId, uint256 lastCollectionId);\n\n /**\n * @dev Authorize an issuer for a specific range\n * @param issuer Issuer that will be authorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be authorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be authorized\n */\n function authorizeRange(\n address issuer,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Unauthorize an issuer for a specific range\n * @param issuer Issuer that will be unauthorized\n * @param rangeIndex Index of the range to be unauthorized\n * @param firstCollectionId First collection Id of the range for which the issuer will be unauthorized\n * @param lastCollectionId Last collection Id of the range for which the issuer will be unauthorized\n */\n function unauthorizeRange(\n address issuer,\n uint256 rangeIndex,\n uint256 firstCollectionId,\n uint256 lastCollectionId\n ) external;\n\n /**\n * @dev Authorize an issuer for specific ranges\n * @param issuer Issuer that will be authorized\n * @param ranges Ranges for which the issuer will be authorized\n */\n function authorizeRanges(address issuer, Range[] memory ranges) external;\n\n /**\n * @dev Unauthorize an issuer for specific ranges\n * @param issuer Issuer that will be unauthorized\n * @param ranges Ranges for which the issuer will be unauthorized\n */\n function unauthorizeRanges(\n address issuer,\n Range[] memory ranges,\n uint256[] memory rangeIndexes\n ) external;\n\n /**\n * @dev Returns whether a specific issuer is authorized or not to record in a specific attestations collection\n * @param issuer Issuer to be checked\n * @param collectionId Collection Id for which the issuer will be checked\n */\n function isAuthorized(address issuer, uint256 collectionId) external view returns (bool);\n\n /**\n * @dev Pauses the registry. Issuers can no longer record or delete attestations\n */\n function pause() external;\n\n /**\n * @dev Unpauses the registry\n */\n function unpause() external;\n}\n" - }, - "contracts/core/libs/utils/RangeLib.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nstruct Range {\n uint256 min;\n uint256 max;\n}\n\n// Range [0;3] includees 0 and 3\nlibrary RangeUtils {\n function _includes(Range[] storage ranges, uint256 collectionId) internal view returns (bool) {\n for (uint256 i = 0; i < ranges.length; i++) {\n if (collectionId >= ranges[i].min && collectionId <= ranges[i].max) {\n return true;\n }\n }\n return false;\n }\n}\n" - }, - "contracts/core/libs/utils/Context.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\n\npragma solidity ^0.8.14;\n\n/**\n * @dev Provides information about the current execution context, including the\n * sender of the transaction and its data. While these are generally available\n * via msg.sender and msg.data, they should not be accessed in such a direct\n * manner, since when dealing with meta-transactions the account sending and\n * paying for execution may not be the actual sender (as far as an application\n * is concerned).\n *\n * This contract is only required for intermediate, library-like contracts.\n */\nabstract contract Context {\n function _msgSender() internal view virtual returns (address) {\n return msg.sender;\n }\n\n function _msgData() internal view virtual returns (bytes calldata) {\n return msg.data;\n }\n}\n" - }, - "contracts/core/libs/utils/Address.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where a contract lived, but was destroyed\n * ====\n *\n * [IMPORTANT]\n * ====\n * You shouldn't rely on `isContract` to protect against flash loan attacks!\n *\n * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\n * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\n * constructor.\n * ====\n */\n function isContract(address account) internal view returns (bool) {\n // This method relies on extcodesize/address.code.length, which returns 0\n // for contracts in construction, since the code is only stored at the end\n // of the constructor execution.\n\n return account.code.length > 0;\n }\n\n /**\n * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\n * `recipient`, forwarding all available gas and reverting on errors.\n *\n * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\n * of certain opcodes, possibly making contracts go over the 2300 gas limit\n * imposed by `transfer`, making them unable to receive funds via\n * `transfer`. {sendValue} removes this limitation.\n *\n * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\n *\n * IMPORTANT: because control is transferred to `recipient`, care must be\n * taken to not create reentrancy vulnerabilities. Consider using\n * {ReentrancyGuard} or the\n * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\n */\n function sendValue(address payable recipient, uint256 amount) internal {\n require(address(this).balance >= amount, 'Address: insufficient balance');\n\n (bool success, ) = recipient.call{value: amount}('');\n require(success, 'Address: unable to send value, recipient may have reverted');\n }\n\n /**\n * @dev Performs a Solidity function call using a low level `call`. A\n * plain `call` is an unsafe replacement for a function call: use this\n * function instead.\n *\n * If `target` reverts with a revert reason, it is bubbled up by this\n * function (like regular Solidity function calls).\n *\n * Returns the raw returned data. To convert to the expected return value,\n * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\n *\n * Requirements:\n *\n * - `target` must be a contract.\n * - calling `target` with `data` must not revert.\n *\n * _Available since v3.1._\n */\n function functionCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionCall(target, data, 'Address: low-level call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\n * `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, 0, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but also transferring `value` wei to `target`.\n *\n * Requirements:\n *\n * - the calling contract must have an ETH balance of at least `value`.\n * - the called Solidity function must be `payable`.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value\n ) internal returns (bytes memory) {\n return functionCallWithValue(target, data, value, 'Address: low-level call with value failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\n * with `errorMessage` as a fallback revert reason when `target` reverts.\n *\n * _Available since v3.1._\n */\n function functionCallWithValue(\n address target,\n bytes memory data,\n uint256 value,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(address(this).balance >= value, 'Address: insufficient balance for call');\n require(isContract(target), 'Address: call to non-contract');\n\n (bool success, bytes memory returndata) = target.call{value: value}(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(address target, bytes memory data)\n internal\n view\n returns (bytes memory)\n {\n return functionStaticCall(target, data, 'Address: low-level static call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a static call.\n *\n * _Available since v3.3._\n */\n function functionStaticCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal view returns (bytes memory) {\n require(isContract(target), 'Address: static call to non-contract');\n\n (bool success, bytes memory returndata) = target.staticcall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {\n return functionDelegateCall(target, data, 'Address: low-level delegate call failed');\n }\n\n /**\n * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\n * but performing a delegate call.\n *\n * _Available since v3.4._\n */\n function functionDelegateCall(\n address target,\n bytes memory data,\n string memory errorMessage\n ) internal returns (bytes memory) {\n require(isContract(target), 'Address: delegate call to non-contract');\n\n (bool success, bytes memory returndata) = target.delegatecall(data);\n return verifyCallResult(success, returndata, errorMessage);\n }\n\n /**\n * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\n * revert reason using the provided one.\n *\n * _Available since v4.3._\n */\n function verifyCallResult(\n bool success,\n bytes memory returndata,\n string memory errorMessage\n ) internal pure returns (bytes memory) {\n if (success) {\n return returndata;\n } else {\n // Look for revert reason and bubble it up if present\n if (returndata.length > 0) {\n // The easiest way to bubble the revert reason is using memory via assembly\n\n assembly {\n let returndata_size := mload(returndata)\n revert(add(32, returndata), returndata_size)\n }\n } else {\n revert(errorMessage);\n }\n }\n }\n}\n" - }, - "contracts/core/Badges.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC1155} from '@openzeppelin/contracts/token/ERC1155/ERC1155.sol';\nimport {Initializable} from '@openzeppelin/contracts/proxy/utils/Initializable.sol';\nimport {ERC1155Pausable} from '@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol';\nimport {AccessControl} from '@openzeppelin/contracts/access/AccessControl.sol';\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Badges contract\n * @author Sismo\n * @notice Stateless, Non-transferrable ERC1155 contract. Reads balance from the values of attestations\n * The associated attestations registry triggers TransferSingle events from this contract\n * It allows badge \"shadow mints and burns\" to be caught by off-chain platforms\n * For more information: https://badges.docs.sismo.io\n */\ncontract Badges is IBadges, Initializable, AccessControl, ERC1155 {\n IAttestationsRegistry internal _attestationsRegistry;\n\n bytes32 public constant EVENT_TRIGGERER_ROLE = keccak256('EVENT_TRIGGERER_ROLE');\n\n /**\n * @dev Constructor\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n constructor(\n string memory uri,\n address owner // This is Sismo Frontend Contract\n ) ERC1155(uri) {\n initialize(uri, owner);\n }\n\n /**\n * @dev Initializes the contract, to be called by the proxy delegating calls to this implementation\n * @param uri Uri for the metadata of badges\n * @param owner Owner of the contract, super admin, can setup roles and update the attestation registry\n */\n function initialize(string memory uri, address owner) public initializer {\n _setURI(uri);\n _grantRole(DEFAULT_ADMIN_ROLE, owner);\n }\n\n /**\n * @dev Main function of the ERC1155 badge\n * The balance of a user is equal to the value of the underlying attestation.\n * attestationCollectionId == badgeId\n * @param account Address to check badge balance (= value of attestation)\n * @param id Badge Id to check (= attestationCollectionId)\n */\n function balanceOf(address account, uint256 id)\n public\n view\n virtual\n override(ERC1155, IBadges)\n returns (uint256)\n {\n return _attestationsRegistry.getAttestationValue(id, account);\n }\n\n /**\n * @dev Emits a TransferSingle event, so subgraphs and other off-chain apps relying on events can see badge minting/burning\n * can only be called by address having the EVENT_TRIGGERER_ROLE (attestations registry address)\n * @param operator who is calling the TransferEvent\n * @param from address(0) if minting, address of the badge holder if burning\n * @param to address of the badge holder is minting, address(0) if burning\n * @param id badgeId for which to trigger the event\n * @param value minted/burned balance\n */\n function triggerTransferEvent(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 value\n ) external onlyRole(EVENT_TRIGGERER_ROLE) {\n emit TransferSingle(operator, from, to, id, value);\n }\n\n /**\n * @dev Set the attestations registry address. Can only be called by owner (default admin)\n * @param attestationsRegistry new attestations registry address\n */\n function setAttestationsRegistry(address attestationsRegistry)\n external\n override\n onlyRole(DEFAULT_ADMIN_ROLE)\n {\n _attestationsRegistry = IAttestationsRegistry(attestationsRegistry);\n }\n\n /**\n * @dev Set the URI. Can only be called by owner (default admin)\n * @param uri new attestations registry address\n */\n function setUri(string memory uri) external override onlyRole(DEFAULT_ADMIN_ROLE) {\n _setURI(uri);\n }\n\n /**\n * @dev Getter of the attestations registry\n */\n function getAttestationsRegistry() external view override returns (address) {\n return address(_attestationsRegistry);\n }\n\n /**\n * @dev ERC165\n */\n function supportsInterface(bytes4 interfaceId)\n public\n view\n virtual\n override(AccessControl, ERC1155)\n returns (bool)\n {\n return super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Reverts, this is a non transferable ERC115 contract\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n revert BadgesNonTransferrable();\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/ERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/ERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC1155.sol\";\nimport \"./IERC1155Receiver.sol\";\nimport \"./extensions/IERC1155MetadataURI.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of the basic standard multi-token.\n * See https://eips.ethereum.org/EIPS/eip-1155\n * Originally based on code by Enjin: https://github.com/enjin/erc-1155\n *\n * _Available since v3.1._\n */\ncontract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI {\n using Address for address;\n\n // Mapping from token ID to account balances\n mapping(uint256 => mapping(address => uint256)) private _balances;\n\n // Mapping from account to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json\n string private _uri;\n\n /**\n * @dev See {_setURI}.\n */\n constructor(string memory uri_) {\n _setURI(uri_);\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC1155).interfaceId ||\n interfaceId == type(IERC1155MetadataURI).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC1155MetadataURI-uri}.\n *\n * This implementation returns the same URI for *all* token types. It relies\n * on the token type ID substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * Clients calling this function must replace the `\\{id\\}` substring with the\n * actual token type ID.\n */\n function uri(uint256) public view virtual override returns (string memory) {\n return _uri;\n }\n\n /**\n * @dev See {IERC1155-balanceOf}.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) public view virtual override returns (uint256) {\n require(account != address(0), \"ERC1155: balance query for the zero address\");\n return _balances[id][account];\n }\n\n /**\n * @dev See {IERC1155-balanceOfBatch}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] memory accounts, uint256[] memory ids)\n public\n view\n virtual\n override\n returns (uint256[] memory)\n {\n require(accounts.length == ids.length, \"ERC1155: accounts and ids length mismatch\");\n\n uint256[] memory batchBalances = new uint256[](accounts.length);\n\n for (uint256 i = 0; i < accounts.length; ++i) {\n batchBalances[i] = balanceOf(accounts[i], ids[i]);\n }\n\n return batchBalances;\n }\n\n /**\n * @dev See {IERC1155-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC1155-isApprovedForAll}.\n */\n function isApprovedForAll(address account, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[account][operator];\n }\n\n /**\n * @dev See {IERC1155-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: caller is not owner nor approved\"\n );\n _safeTransferFrom(from, to, id, amount, data);\n }\n\n /**\n * @dev See {IERC1155-safeBatchTransferFrom}.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) public virtual override {\n require(\n from == _msgSender() || isApprovedForAll(from, _msgSender()),\n \"ERC1155: transfer caller is not owner nor approved\"\n );\n _safeBatchTransferFrom(from, to, ids, amounts, data);\n }\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, _asSingletonArray(id), _asSingletonArray(amount), data);\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n\n emit TransferSingle(operator, from, to, id, amount);\n\n _doSafeTransferAcceptanceCheck(operator, from, to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _safeBatchTransferFrom(\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n require(to != address(0), \"ERC1155: transfer to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; ++i) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: insufficient balance for transfer\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n _balances[id][to] += amount;\n }\n\n emit TransferBatch(operator, from, to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, amounts, data);\n }\n\n /**\n * @dev Sets a new URI for all token types, by relying on the token type ID\n * substitution mechanism\n * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].\n *\n * By this mechanism, any occurrence of the `\\{id\\}` substring in either the\n * URI or any of the amounts in the JSON file at said URI will be replaced by\n * clients with the token type ID.\n *\n * For example, the `https://token-cdn-domain/\\{id\\}.json` URI would be\n * interpreted by clients as\n * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`\n * for token type ID 0x4cce0.\n *\n * See {uri}.\n *\n * Because these URIs cannot be meaningfully represented by the {URI} event,\n * this function emits no events.\n */\n function _setURI(string memory newuri) internal virtual {\n _uri = newuri;\n }\n\n /**\n * @dev Creates `amount` tokens of token type `id`, and assigns them to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function _mint(\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, _asSingletonArray(id), _asSingletonArray(amount), data);\n\n _balances[id][to] += amount;\n emit TransferSingle(operator, address(0), to, id, amount);\n\n _doSafeTransferAcceptanceCheck(operator, address(0), to, id, amount, data);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function _mintBatch(\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {\n require(to != address(0), \"ERC1155: mint to the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, address(0), to, ids, amounts, data);\n\n for (uint256 i = 0; i < ids.length; i++) {\n _balances[ids[i]][to] += amounts[i];\n }\n\n emit TransferBatch(operator, address(0), to, ids, amounts);\n\n _doSafeBatchTransferAcceptanceCheck(operator, address(0), to, ids, amounts, data);\n }\n\n /**\n * @dev Destroys `amount` tokens of token type `id` from `from`\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `from` must have at least `amount` tokens of token type `id`.\n */\n function _burn(\n address from,\n uint256 id,\n uint256 amount\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), _asSingletonArray(id), _asSingletonArray(amount), \"\");\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n\n emit TransferSingle(operator, from, address(0), id, amount);\n }\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n */\n function _burnBatch(\n address from,\n uint256[] memory ids,\n uint256[] memory amounts\n ) internal virtual {\n require(from != address(0), \"ERC1155: burn from the zero address\");\n require(ids.length == amounts.length, \"ERC1155: ids and amounts length mismatch\");\n\n address operator = _msgSender();\n\n _beforeTokenTransfer(operator, from, address(0), ids, amounts, \"\");\n\n for (uint256 i = 0; i < ids.length; i++) {\n uint256 id = ids[i];\n uint256 amount = amounts[i];\n\n uint256 fromBalance = _balances[id][from];\n require(fromBalance >= amount, \"ERC1155: burn amount exceeds balance\");\n unchecked {\n _balances[id][from] = fromBalance - amount;\n }\n }\n\n emit TransferBatch(operator, from, address(0), ids, amounts);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits a {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC1155: setting approval status for self\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning, as well as batched variants.\n *\n * The same hook is called on both single and batched variants. For single\n * transfers, the length of the `id` and `amount` arrays will be 1.\n *\n * Calling conditions (for each `id` and `amount` pair):\n *\n * - When `from` and `to` are both non-zero, `amount` of ``from``'s tokens\n * of token type `id` will be transferred to `to`.\n * - When `from` is zero, `amount` tokens of token type `id` will be minted\n * for `to`.\n * - when `to` is zero, `amount` of ``from``'s tokens of token type `id`\n * will be burned.\n * - `from` and `to` are never both zero.\n * - `ids` and `amounts` have the same, non-zero length.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual {}\n\n function _doSafeTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155Received(operator, from, id, amount, data) returns (bytes4 response) {\n if (response != IERC1155Receiver.onERC1155Received.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _doSafeBatchTransferAcceptanceCheck(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) private {\n if (to.isContract()) {\n try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, amounts, data) returns (\n bytes4 response\n ) {\n if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {\n revert(\"ERC1155: ERC1155Receiver rejected tokens\");\n }\n } catch Error(string memory reason) {\n revert(reason);\n } catch {\n revert(\"ERC1155: transfer to non ERC1155Receiver implementer\");\n }\n }\n }\n\n function _asSingletonArray(uint256 element) private pure returns (uint256[] memory) {\n uint256[] memory array = new uint256[](1);\n array[0] = element;\n\n return array;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/ERC1155Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/ERC1155Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../ERC1155.sol\";\nimport \"../../../security/Pausable.sol\";\n\n/**\n * @dev ERC1155 token with pausable token transfers, minting and burning.\n *\n * Useful for scenarios such as preventing trades until the end of an evaluation\n * period, or having an emergency switch for freezing all token transfers in the\n * event of a large bug.\n *\n * _Available since v3.1._\n */\nabstract contract ERC1155Pausable is ERC1155, Pausable {\n /**\n * @dev See {ERC1155-_beforeTokenTransfer}.\n *\n * Requirements:\n *\n * - the contract must not be paused.\n */\n function _beforeTokenTransfer(\n address operator,\n address from,\n address to,\n uint256[] memory ids,\n uint256[] memory amounts,\n bytes memory data\n ) internal virtual override {\n super._beforeTokenTransfer(operator, from, to, ids, amounts, data);\n\n require(!paused(), \"ERC1155Pausable: token transfer while paused\");\n }\n}\n" - }, - "@openzeppelin/contracts/access/AccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (access/AccessControl.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IAccessControl.sol\";\nimport \"../utils/Context.sol\";\nimport \"../utils/Strings.sol\";\nimport \"../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Contract module that allows children to implement role-based access\n * control mechanisms. This is a lightweight version that doesn't allow enumerating role\n * members except through off-chain means by accessing the contract event logs. Some\n * applications may benefit from on-chain enumerability, for those cases see\n * {AccessControlEnumerable}.\n *\n * Roles are referred to by their `bytes32` identifier. These should be exposed\n * in the external API and be unique. The best way to achieve this is by\n * using `public constant` hash digests:\n *\n * ```\n * bytes32 public constant MY_ROLE = keccak256(\"MY_ROLE\");\n * ```\n *\n * Roles can be used to represent a set of permissions. To restrict access to a\n * function call, use {hasRole}:\n *\n * ```\n * function foo() public {\n * require(hasRole(MY_ROLE, msg.sender));\n * ...\n * }\n * ```\n *\n * Roles can be granted and revoked dynamically via the {grantRole} and\n * {revokeRole} functions. Each role has an associated admin role, and only\n * accounts that have a role's admin role can call {grantRole} and {revokeRole}.\n *\n * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means\n * that only accounts with this role will be able to grant or revoke other\n * roles. More complex role relationships can be created by using\n * {_setRoleAdmin}.\n *\n * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to\n * grant and revoke this role. Extra precautions should be taken to secure\n * accounts that have been granted it.\n */\nabstract contract AccessControl is Context, IAccessControl, ERC165 {\n struct RoleData {\n mapping(address => bool) members;\n bytes32 adminRole;\n }\n\n mapping(bytes32 => RoleData) private _roles;\n\n bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;\n\n /**\n * @dev Modifier that checks that an account has a specific role. Reverts\n * with a standardized message including the required role.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n *\n * _Available since v4.1._\n */\n modifier onlyRole(bytes32 role) {\n _checkRole(role, _msgSender());\n _;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) public view virtual override returns (bool) {\n return _roles[role].members[account];\n }\n\n /**\n * @dev Revert with a standard message if `account` is missing `role`.\n *\n * The format of the revert reason is given by the following regular expression:\n *\n * /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/\n */\n function _checkRole(bytes32 role, address account) internal view virtual {\n if (!hasRole(role, account)) {\n revert(\n string(\n abi.encodePacked(\n \"AccessControl: account \",\n Strings.toHexString(uint160(account), 20),\n \" is missing role \",\n Strings.toHexString(uint256(role), 32)\n )\n )\n );\n }\n }\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {\n return _roles[role].adminRole;\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _grantRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {\n _revokeRole(role, account);\n }\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been revoked `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) public virtual override {\n require(account == _msgSender(), \"AccessControl: can only renounce roles for self\");\n\n _revokeRole(role, account);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event. Note that unlike {grantRole}, this function doesn't perform any\n * checks on the calling account.\n *\n * [WARNING]\n * ====\n * This function should only be called from the constructor when setting\n * up the initial roles for the system.\n *\n * Using this function in any other way is effectively circumventing the admin\n * system imposed by {AccessControl}.\n * ====\n *\n * NOTE: This function is deprecated in favor of {_grantRole}.\n */\n function _setupRole(bytes32 role, address account) internal virtual {\n _grantRole(role, account);\n }\n\n /**\n * @dev Sets `adminRole` as ``role``'s admin role.\n *\n * Emits a {RoleAdminChanged} event.\n */\n function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {\n bytes32 previousAdminRole = getRoleAdmin(role);\n _roles[role].adminRole = adminRole;\n emit RoleAdminChanged(role, previousAdminRole, adminRole);\n }\n\n /**\n * @dev Grants `role` to `account`.\n *\n * Internal function without access restriction.\n */\n function _grantRole(bytes32 role, address account) internal virtual {\n if (!hasRole(role, account)) {\n _roles[role].members[account] = true;\n emit RoleGranted(role, account, _msgSender());\n }\n }\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * Internal function without access restriction.\n */\n function _revokeRole(bytes32 role, address account) internal virtual {\n if (hasRole(role, account)) {\n _roles[role].members[account] = false;\n emit RoleRevoked(role, account, _msgSender());\n }\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/IERC1155.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC1155 compliant contract, as defined in the\n * https://eips.ethereum.org/EIPS/eip-1155[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155 is IERC165 {\n /**\n * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.\n */\n event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);\n\n /**\n * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all\n * transfers.\n */\n event TransferBatch(\n address indexed operator,\n address indexed from,\n address indexed to,\n uint256[] ids,\n uint256[] values\n );\n\n /**\n * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to\n * `approved`.\n */\n event ApprovalForAll(address indexed account, address indexed operator, bool approved);\n\n /**\n * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.\n *\n * If an {URI} event was emitted for `id`, the standard\n * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value\n * returned by {IERC1155MetadataURI-uri}.\n */\n event URI(string value, uint256 indexed id);\n\n /**\n * @dev Returns the amount of tokens of token type `id` owned by `account`.\n *\n * Requirements:\n *\n * - `account` cannot be the zero address.\n */\n function balanceOf(address account, uint256 id) external view returns (uint256);\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.\n *\n * Requirements:\n *\n * - `accounts` and `ids` must have the same length.\n */\n function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)\n external\n view\n returns (uint256[] memory);\n\n /**\n * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,\n *\n * Emits an {ApprovalForAll} event.\n *\n * Requirements:\n *\n * - `operator` cannot be the caller.\n */\n function setApprovalForAll(address operator, bool approved) external;\n\n /**\n * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.\n *\n * See {setApprovalForAll}.\n */\n function isApprovedForAll(address account, address operator) external view returns (bool);\n\n /**\n * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.\n *\n * Emits a {TransferSingle} event.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - If the caller is not `from`, it must be have been approved to spend ``from``'s tokens via {setApprovalForAll}.\n * - `from` must have a balance of tokens of type `id` of at least `amount`.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the\n * acceptance magic value.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 id,\n uint256 amount,\n bytes calldata data\n ) external;\n\n /**\n * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.\n *\n * Emits a {TransferBatch} event.\n *\n * Requirements:\n *\n * - `ids` and `amounts` must have the same length.\n * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the\n * acceptance magic value.\n */\n function safeBatchTransferFrom(\n address from,\n address to,\n uint256[] calldata ids,\n uint256[] calldata amounts,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/IERC1155Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev _Available since v3.1._\n */\ninterface IERC1155Receiver is IERC165 {\n /**\n * @dev Handles the receipt of a single ERC1155 token type. This function is\n * called at the end of a `safeTransferFrom` after the balance has been updated.\n *\n * NOTE: To accept the transfer, this must return\n * `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))`\n * (i.e. 0xf23a6e61, or its own function selector).\n *\n * @param operator The address which initiated the transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param id The ID of the token being transferred\n * @param value The amount of tokens being transferred\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155Received(address,address,uint256,uint256,bytes)\"))` if transfer is allowed\n */\n function onERC1155Received(\n address operator,\n address from,\n uint256 id,\n uint256 value,\n bytes calldata data\n ) external returns (bytes4);\n\n /**\n * @dev Handles the receipt of a multiple ERC1155 token types. This function\n * is called at the end of a `safeBatchTransferFrom` after the balances have\n * been updated.\n *\n * NOTE: To accept the transfer(s), this must return\n * `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))`\n * (i.e. 0xbc197c81, or its own function selector).\n *\n * @param operator The address which initiated the batch transfer (i.e. msg.sender)\n * @param from The address which previously owned the token\n * @param ids An array containing ids of each token being transferred (order and length must match values array)\n * @param values An array containing amounts of each token being transferred (order and length must match ids array)\n * @param data Additional data with no specified format\n * @return `bytes4(keccak256(\"onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)\"))` if transfer is allowed\n */\n function onERC1155BatchReceived(\n address operator,\n address from,\n uint256[] calldata ids,\n uint256[] calldata values,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC1155/extensions/IERC1155MetadataURI.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC1155/extensions/IERC1155MetadataURI.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC1155.sol\";\n\n/**\n * @dev Interface of the optional ERC1155MetadataExtension interface, as defined\n * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].\n *\n * _Available since v3.1._\n */\ninterface IERC1155MetadataURI is IERC1155 {\n /**\n * @dev Returns the URI for token type `id`.\n *\n * If the `\\{id\\}` substring is present in the URI, it must be replaced by\n * clients with the actual token type ID.\n */\n function uri(uint256 id) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/ERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC165.sol\";\n\n/**\n * @dev Implementation of the {IERC165} interface.\n *\n * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check\n * for the additional interface id that will be supported. For example:\n *\n * ```solidity\n * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);\n * }\n * ```\n *\n * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.\n */\nabstract contract ERC165 is IERC165 {\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {\n return interfaceId == type(IERC165).interfaceId;\n }\n}\n" - }, - "@openzeppelin/contracts/utils/introspection/IERC165.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Interface of the ERC165 standard, as defined in the\n * https://eips.ethereum.org/EIPS/eip-165[EIP].\n *\n * Implementers can declare support of contract interfaces, which can then be\n * queried by others ({ERC165Checker}).\n *\n * For an implementation, see {ERC165}.\n */\ninterface IERC165 {\n /**\n * @dev Returns true if this contract implements the interface defined by\n * `interfaceId`. See the corresponding\n * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]\n * to learn more about how these ids are created.\n *\n * This function call must use less than 30 000 gas.\n */\n function supportsInterface(bytes4 interfaceId) external view returns (bool);\n}\n" - }, - "@openzeppelin/contracts/security/Pausable.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (security/Pausable.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../utils/Context.sol\";\n\n/**\n * @dev Contract module which allows children to implement an emergency stop\n * mechanism that can be triggered by an authorized account.\n *\n * This module is used through inheritance. It will make available the\n * modifiers `whenNotPaused` and `whenPaused`, which can be applied to\n * the functions of your contract. Note that they will not be pausable by\n * simply including this module, only once the modifiers are put in place.\n */\nabstract contract Pausable is Context {\n /**\n * @dev Emitted when the pause is triggered by `account`.\n */\n event Paused(address account);\n\n /**\n * @dev Emitted when the pause is lifted by `account`.\n */\n event Unpaused(address account);\n\n bool private _paused;\n\n /**\n * @dev Initializes the contract in unpaused state.\n */\n constructor() {\n _paused = false;\n }\n\n /**\n * @dev Returns true if the contract is paused, and false otherwise.\n */\n function paused() public view virtual returns (bool) {\n return _paused;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is not paused.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n modifier whenNotPaused() {\n require(!paused(), \"Pausable: paused\");\n _;\n }\n\n /**\n * @dev Modifier to make a function callable only when the contract is paused.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n modifier whenPaused() {\n require(paused(), \"Pausable: not paused\");\n _;\n }\n\n /**\n * @dev Triggers stopped state.\n *\n * Requirements:\n *\n * - The contract must not be paused.\n */\n function _pause() internal virtual whenNotPaused {\n _paused = true;\n emit Paused(_msgSender());\n }\n\n /**\n * @dev Returns to normal state.\n *\n * Requirements:\n *\n * - The contract must be paused.\n */\n function _unpause() internal virtual whenPaused {\n _paused = false;\n emit Unpaused(_msgSender());\n }\n}\n" - }, - "@openzeppelin/contracts/access/IAccessControl.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev External interface of AccessControl declared to support ERC165 detection.\n */\ninterface IAccessControl {\n /**\n * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`\n *\n * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite\n * {RoleAdminChanged} not being emitted signaling this.\n *\n * _Available since v3.1._\n */\n event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);\n\n /**\n * @dev Emitted when `account` is granted `role`.\n *\n * `sender` is the account that originated the contract call, an admin role\n * bearer except when using {AccessControl-_setupRole}.\n */\n event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Emitted when `account` is revoked `role`.\n *\n * `sender` is the account that originated the contract call:\n * - if using `revokeRole`, it is the admin role bearer\n * - if using `renounceRole`, it is the role bearer (i.e. `account`)\n */\n event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);\n\n /**\n * @dev Returns `true` if `account` has been granted `role`.\n */\n function hasRole(bytes32 role, address account) external view returns (bool);\n\n /**\n * @dev Returns the admin role that controls `role`. See {grantRole} and\n * {revokeRole}.\n *\n * To change a role's admin, use {AccessControl-_setRoleAdmin}.\n */\n function getRoleAdmin(bytes32 role) external view returns (bytes32);\n\n /**\n * @dev Grants `role` to `account`.\n *\n * If `account` had not been already granted `role`, emits a {RoleGranted}\n * event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function grantRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from `account`.\n *\n * If `account` had been granted `role`, emits a {RoleRevoked} event.\n *\n * Requirements:\n *\n * - the caller must have ``role``'s admin role.\n */\n function revokeRole(bytes32 role, address account) external;\n\n /**\n * @dev Revokes `role` from the calling account.\n *\n * Roles are often managed via {grantRole} and {revokeRole}: this function's\n * purpose is to provide a mechanism for accounts to lose their privileges\n * if they are compromised (such as when a trusted device is misplaced).\n *\n * If the calling account had been granted `role`, emits a {RoleRevoked}\n * event.\n *\n * Requirements:\n *\n * - the caller must be `account`.\n */\n function renounceRole(bytes32 role, address account) external;\n}\n" - }, - "@openzeppelin/contracts/utils/Strings.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev String operations.\n */\nlibrary Strings {\n bytes16 private constant _HEX_SYMBOLS = \"0123456789abcdef\";\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` decimal representation.\n */\n function toString(uint256 value) internal pure returns (string memory) {\n // Inspired by OraclizeAPI's implementation - MIT licence\n // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\n\n if (value == 0) {\n return \"0\";\n }\n uint256 temp = value;\n uint256 digits;\n while (temp != 0) {\n digits++;\n temp /= 10;\n }\n bytes memory buffer = new bytes(digits);\n while (value != 0) {\n digits -= 1;\n buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\n value /= 10;\n }\n return string(buffer);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\n */\n function toHexString(uint256 value) internal pure returns (string memory) {\n if (value == 0) {\n return \"0x00\";\n }\n uint256 temp = value;\n uint256 length = 0;\n while (temp != 0) {\n length++;\n temp >>= 8;\n }\n return toHexString(value, length);\n }\n\n /**\n * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\n */\n function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\n bytes memory buffer = new bytes(2 * length + 2);\n buffer[0] = \"0\";\n buffer[1] = \"x\";\n for (uint256 i = 2 * length + 1; i > 1; --i) {\n buffer[i] = _HEX_SYMBOLS[value & 0xf];\n value >>= 4;\n }\n require(value == 0, \"Strings: hex length insufficient\");\n return string(buffer);\n }\n}\n" - }, - "contracts/periphery/badges-examples/BAYCOwnershipBadgeExample.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {ERC721} from '@openzeppelin/contracts/token/ERC721/ERC721.sol';\nimport {IAttestationsRegistry} from '../../core/interfaces/IAttestationsRegistry.sol';\n\ncontract BAYCOwnershipBadge is ERC721 {\n IAttestationsRegistry immutable ATTESTATIONS_REGISTRY;\n uint256 constant HydraS1_BAYC_ATTESTATION_COLLECTION_ID = 100000001;\n uint256 constant SMPS_BAYC_ATTESTATION_COLLECTION_ID = 30000000000003;\n\n constructor(\n address attestationsRegistryAddress,\n string memory name,\n string memory symbol\n ) ERC721(name, symbol) {\n ATTESTATIONS_REGISTRY = IAttestationsRegistry(attestationsRegistryAddress);\n }\n\n function balanceOf(address account) public view virtual override returns (uint256) {\n bool hasZKAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n HydraS1_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n bool hasDoxingAttestation = ATTESTATIONS_REGISTRY.getAttestationValue(\n SMPS_BAYC_ATTESTATION_COLLECTION_ID,\n account\n ) > 0;\n return hasZKAttestation || hasDoxingAttestation ? 1 : 0;\n }\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/ERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/ERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"./IERC721.sol\";\nimport \"./IERC721Receiver.sol\";\nimport \"./extensions/IERC721Metadata.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/Context.sol\";\nimport \"../../utils/Strings.sol\";\nimport \"../../utils/introspection/ERC165.sol\";\n\n/**\n * @dev Implementation of https://eips.ethereum.org/EIPS/eip-721[ERC721] Non-Fungible Token Standard, including\n * the Metadata extension, but not including the Enumerable extension, which is available separately as\n * {ERC721Enumerable}.\n */\ncontract ERC721 is Context, ERC165, IERC721, IERC721Metadata {\n using Address for address;\n using Strings for uint256;\n\n // Token name\n string private _name;\n\n // Token symbol\n string private _symbol;\n\n // Mapping from token ID to owner address\n mapping(uint256 => address) private _owners;\n\n // Mapping owner address to token count\n mapping(address => uint256) private _balances;\n\n // Mapping from token ID to approved address\n mapping(uint256 => address) private _tokenApprovals;\n\n // Mapping from owner to operator approvals\n mapping(address => mapping(address => bool)) private _operatorApprovals;\n\n /**\n * @dev Initializes the contract by setting a `name` and a `symbol` to the token collection.\n */\n constructor(string memory name_, string memory symbol_) {\n _name = name_;\n _symbol = symbol_;\n }\n\n /**\n * @dev See {IERC165-supportsInterface}.\n */\n function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) {\n return\n interfaceId == type(IERC721).interfaceId ||\n interfaceId == type(IERC721Metadata).interfaceId ||\n super.supportsInterface(interfaceId);\n }\n\n /**\n * @dev See {IERC721-balanceOf}.\n */\n function balanceOf(address owner) public view virtual override returns (uint256) {\n require(owner != address(0), \"ERC721: balance query for the zero address\");\n return _balances[owner];\n }\n\n /**\n * @dev See {IERC721-ownerOf}.\n */\n function ownerOf(uint256 tokenId) public view virtual override returns (address) {\n address owner = _owners[tokenId];\n require(owner != address(0), \"ERC721: owner query for nonexistent token\");\n return owner;\n }\n\n /**\n * @dev See {IERC721Metadata-name}.\n */\n function name() public view virtual override returns (string memory) {\n return _name;\n }\n\n /**\n * @dev See {IERC721Metadata-symbol}.\n */\n function symbol() public view virtual override returns (string memory) {\n return _symbol;\n }\n\n /**\n * @dev See {IERC721Metadata-tokenURI}.\n */\n function tokenURI(uint256 tokenId) public view virtual override returns (string memory) {\n require(_exists(tokenId), \"ERC721Metadata: URI query for nonexistent token\");\n\n string memory baseURI = _baseURI();\n return bytes(baseURI).length > 0 ? string(abi.encodePacked(baseURI, tokenId.toString())) : \"\";\n }\n\n /**\n * @dev Base URI for computing {tokenURI}. If set, the resulting URI for each\n * token will be the concatenation of the `baseURI` and the `tokenId`. Empty\n * by default, can be overriden in child contracts.\n */\n function _baseURI() internal view virtual returns (string memory) {\n return \"\";\n }\n\n /**\n * @dev See {IERC721-approve}.\n */\n function approve(address to, uint256 tokenId) public virtual override {\n address owner = ERC721.ownerOf(tokenId);\n require(to != owner, \"ERC721: approval to current owner\");\n\n require(\n _msgSender() == owner || isApprovedForAll(owner, _msgSender()),\n \"ERC721: approve caller is not owner nor approved for all\"\n );\n\n _approve(to, tokenId);\n }\n\n /**\n * @dev See {IERC721-getApproved}.\n */\n function getApproved(uint256 tokenId) public view virtual override returns (address) {\n require(_exists(tokenId), \"ERC721: approved query for nonexistent token\");\n\n return _tokenApprovals[tokenId];\n }\n\n /**\n * @dev See {IERC721-setApprovalForAll}.\n */\n function setApprovalForAll(address operator, bool approved) public virtual override {\n _setApprovalForAll(_msgSender(), operator, approved);\n }\n\n /**\n * @dev See {IERC721-isApprovedForAll}.\n */\n function isApprovedForAll(address owner, address operator) public view virtual override returns (bool) {\n return _operatorApprovals[owner][operator];\n }\n\n /**\n * @dev See {IERC721-transferFrom}.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n //solhint-disable-next-line max-line-length\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: transfer caller is not owner nor approved\");\n\n _transfer(from, to, tokenId);\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) public virtual override {\n safeTransferFrom(from, to, tokenId, \"\");\n }\n\n /**\n * @dev See {IERC721-safeTransferFrom}.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) public virtual override {\n require(_isApprovedOrOwner(_msgSender(), tokenId), \"ERC721: transfer caller is not owner nor approved\");\n _safeTransfer(from, to, tokenId, _data);\n }\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * `_data` is additional data, it has no specified format and it is sent in call to `to`.\n *\n * This internal function is equivalent to {safeTransferFrom}, and can be used to e.g.\n * implement alternative mechanisms to perform token transfer, such as signature-based.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeTransfer(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _transfer(from, to, tokenId);\n require(_checkOnERC721Received(from, to, tokenId, _data), \"ERC721: transfer to non ERC721Receiver implementer\");\n }\n\n /**\n * @dev Returns whether `tokenId` exists.\n *\n * Tokens can be managed by their owner or approved accounts via {approve} or {setApprovalForAll}.\n *\n * Tokens start existing when they are minted (`_mint`),\n * and stop existing when they are burned (`_burn`).\n */\n function _exists(uint256 tokenId) internal view virtual returns (bool) {\n return _owners[tokenId] != address(0);\n }\n\n /**\n * @dev Returns whether `spender` is allowed to manage `tokenId`.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function _isApprovedOrOwner(address spender, uint256 tokenId) internal view virtual returns (bool) {\n require(_exists(tokenId), \"ERC721: operator query for nonexistent token\");\n address owner = ERC721.ownerOf(tokenId);\n return (spender == owner || getApproved(tokenId) == spender || isApprovedForAll(owner, spender));\n }\n\n /**\n * @dev Safely mints `tokenId` and transfers it to `to`.\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function _safeMint(address to, uint256 tokenId) internal virtual {\n _safeMint(to, tokenId, \"\");\n }\n\n /**\n * @dev Same as {xref-ERC721-_safeMint-address-uint256-}[`_safeMint`], with an additional `data` parameter which is\n * forwarded in {IERC721Receiver-onERC721Received} to contract recipients.\n */\n function _safeMint(\n address to,\n uint256 tokenId,\n bytes memory _data\n ) internal virtual {\n _mint(to, tokenId);\n require(\n _checkOnERC721Received(address(0), to, tokenId, _data),\n \"ERC721: transfer to non ERC721Receiver implementer\"\n );\n }\n\n /**\n * @dev Mints `tokenId` and transfers it to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {_safeMint} whenever possible\n *\n * Requirements:\n *\n * - `tokenId` must not exist.\n * - `to` cannot be the zero address.\n *\n * Emits a {Transfer} event.\n */\n function _mint(address to, uint256 tokenId) internal virtual {\n require(to != address(0), \"ERC721: mint to the zero address\");\n require(!_exists(tokenId), \"ERC721: token already minted\");\n\n _beforeTokenTransfer(address(0), to, tokenId);\n\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(address(0), to, tokenId);\n\n _afterTokenTransfer(address(0), to, tokenId);\n }\n\n /**\n * @dev Destroys `tokenId`.\n * The approval is cleared when the token is burned.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n *\n * Emits a {Transfer} event.\n */\n function _burn(uint256 tokenId) internal virtual {\n address owner = ERC721.ownerOf(tokenId);\n\n _beforeTokenTransfer(owner, address(0), tokenId);\n\n // Clear approvals\n _approve(address(0), tokenId);\n\n _balances[owner] -= 1;\n delete _owners[tokenId];\n\n emit Transfer(owner, address(0), tokenId);\n\n _afterTokenTransfer(owner, address(0), tokenId);\n }\n\n /**\n * @dev Transfers `tokenId` from `from` to `to`.\n * As opposed to {transferFrom}, this imposes no restrictions on msg.sender.\n *\n * Requirements:\n *\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n *\n * Emits a {Transfer} event.\n */\n function _transfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {\n require(ERC721.ownerOf(tokenId) == from, \"ERC721: transfer from incorrect owner\");\n require(to != address(0), \"ERC721: transfer to the zero address\");\n\n _beforeTokenTransfer(from, to, tokenId);\n\n // Clear approvals from the previous owner\n _approve(address(0), tokenId);\n\n _balances[from] -= 1;\n _balances[to] += 1;\n _owners[tokenId] = to;\n\n emit Transfer(from, to, tokenId);\n\n _afterTokenTransfer(from, to, tokenId);\n }\n\n /**\n * @dev Approve `to` to operate on `tokenId`\n *\n * Emits a {Approval} event.\n */\n function _approve(address to, uint256 tokenId) internal virtual {\n _tokenApprovals[tokenId] = to;\n emit Approval(ERC721.ownerOf(tokenId), to, tokenId);\n }\n\n /**\n * @dev Approve `operator` to operate on all of `owner` tokens\n *\n * Emits a {ApprovalForAll} event.\n */\n function _setApprovalForAll(\n address owner,\n address operator,\n bool approved\n ) internal virtual {\n require(owner != operator, \"ERC721: approve to caller\");\n _operatorApprovals[owner][operator] = approved;\n emit ApprovalForAll(owner, operator, approved);\n }\n\n /**\n * @dev Internal function to invoke {IERC721Receiver-onERC721Received} on a target address.\n * The call is not executed if the target address is not a contract.\n *\n * @param from address representing the previous owner of the given token ID\n * @param to target address that will receive the tokens\n * @param tokenId uint256 ID of the token to be transferred\n * @param _data bytes optional data to send along with the call\n * @return bool whether the call correctly returned the expected magic value\n */\n function _checkOnERC721Received(\n address from,\n address to,\n uint256 tokenId,\n bytes memory _data\n ) private returns (bool) {\n if (to.isContract()) {\n try IERC721Receiver(to).onERC721Received(_msgSender(), from, tokenId, _data) returns (bytes4 retval) {\n return retval == IERC721Receiver.onERC721Received.selector;\n } catch (bytes memory reason) {\n if (reason.length == 0) {\n revert(\"ERC721: transfer to non ERC721Receiver implementer\");\n } else {\n assembly {\n revert(add(32, reason), mload(reason))\n }\n }\n }\n } else {\n return true;\n }\n }\n\n /**\n * @dev Hook that is called before any token transfer. This includes minting\n * and burning.\n *\n * Calling conditions:\n *\n * - When `from` and `to` are both non-zero, ``from``'s `tokenId` will be\n * transferred to `to`.\n * - When `from` is zero, `tokenId` will be minted for `to`.\n * - When `to` is zero, ``from``'s `tokenId` will be burned.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _beforeTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n\n /**\n * @dev Hook that is called after any transfer of tokens. This includes\n * minting and burning.\n *\n * Calling conditions:\n *\n * - when `from` and `to` are both non-zero.\n * - `from` and `to` are never both zero.\n *\n * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\n */\n function _afterTokenTransfer(\n address from,\n address to,\n uint256 tokenId\n ) internal virtual {}\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../../utils/introspection/IERC165.sol\";\n\n/**\n * @dev Required interface of an ERC721 compliant contract.\n */\ninterface IERC721 is IERC165 {\n /**\n * @dev Emitted when `tokenId` token is transferred from `from` to `to`.\n */\n event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.\n */\n event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);\n\n /**\n * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.\n */\n event ApprovalForAll(address indexed owner, address indexed operator, bool approved);\n\n /**\n * @dev Returns the number of tokens in ``owner``'s account.\n */\n function balanceOf(address owner) external view returns (uint256 balance);\n\n /**\n * @dev Returns the owner of the `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function ownerOf(uint256 tokenId) external view returns (address owner);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients\n * are aware of the ERC721 protocol to prevent tokens from being forever locked.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Transfers `tokenId` token from `from` to `to`.\n *\n * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n *\n * Emits a {Transfer} event.\n */\n function transferFrom(\n address from,\n address to,\n uint256 tokenId\n ) external;\n\n /**\n * @dev Gives permission to `to` to transfer `tokenId` token to another account.\n * The approval is cleared when the token is transferred.\n *\n * Only a single account can be approved at a time, so approving the zero address clears previous approvals.\n *\n * Requirements:\n *\n * - The caller must own the token or be an approved operator.\n * - `tokenId` must exist.\n *\n * Emits an {Approval} event.\n */\n function approve(address to, uint256 tokenId) external;\n\n /**\n * @dev Returns the account approved for `tokenId` token.\n *\n * Requirements:\n *\n * - `tokenId` must exist.\n */\n function getApproved(uint256 tokenId) external view returns (address operator);\n\n /**\n * @dev Approve or remove `operator` as an operator for the caller.\n * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.\n *\n * Requirements:\n *\n * - The `operator` cannot be the caller.\n *\n * Emits an {ApprovalForAll} event.\n */\n function setApprovalForAll(address operator, bool _approved) external;\n\n /**\n * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.\n *\n * See {setApprovalForAll}\n */\n function isApprovedForAll(address owner, address operator) external view returns (bool);\n\n /**\n * @dev Safely transfers `tokenId` token from `from` to `to`.\n *\n * Requirements:\n *\n * - `from` cannot be the zero address.\n * - `to` cannot be the zero address.\n * - `tokenId` token must exist and be owned by `from`.\n * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.\n * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.\n *\n * Emits a {Transfer} event.\n */\n function safeTransferFrom(\n address from,\n address to,\n uint256 tokenId,\n bytes calldata data\n ) external;\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/IERC721Receiver.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @title ERC721 token receiver interface\n * @dev Interface for any contract that wants to support safeTransfers\n * from ERC721 asset contracts.\n */\ninterface IERC721Receiver {\n /**\n * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom}\n * by `operator` from `from`, this function is called.\n *\n * It must return its Solidity selector to confirm the token transfer.\n * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted.\n *\n * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`.\n */\n function onERC721Received(\n address operator,\n address from,\n uint256 tokenId,\n bytes calldata data\n ) external returns (bytes4);\n}\n" - }, - "@openzeppelin/contracts/token/ERC721/extensions/IERC721Metadata.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (token/ERC721/extensions/IERC721Metadata.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../IERC721.sol\";\n\n/**\n * @title ERC-721 Non-Fungible Token Standard, optional metadata extension\n * @dev See https://eips.ethereum.org/EIPS/eip-721\n */\ninterface IERC721Metadata is IERC721 {\n /**\n * @dev Returns the token collection name.\n */\n function name() external view returns (string memory);\n\n /**\n * @dev Returns the token collection symbol.\n */\n function symbol() external view returns (string memory);\n\n /**\n * @dev Returns the Uniform Resource Identifier (URI) for `tokenId` token.\n */\n function tokenURI(uint256 tokenId) external view returns (string memory);\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Upgrade.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/ERC1967/ERC1967Upgrade.sol)\n\npragma solidity ^0.8.2;\n\nimport \"../beacon/IBeacon.sol\";\nimport \"../../interfaces/draft-IERC1822.sol\";\nimport \"../../utils/Address.sol\";\nimport \"../../utils/StorageSlot.sol\";\n\n/**\n * @dev This abstract contract provides getters and event emitting update functions for\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967] slots.\n *\n * _Available since v4.1._\n *\n * @custom:oz-upgrades-unsafe-allow delegatecall\n */\nabstract contract ERC1967Upgrade {\n // This is the keccak-256 hash of \"eip1967.proxy.rollback\" subtracted by 1\n bytes32 private constant _ROLLBACK_SLOT = 0x4910fdfa16fed3260ed0e7147f7cc6da11a60208b5b9406d12a635614ffd9143;\n\n /**\n * @dev Storage slot with the address of the current implementation.\n * This is the keccak-256 hash of \"eip1967.proxy.implementation\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n\n /**\n * @dev Emitted when the implementation is upgraded.\n */\n event Upgraded(address indexed implementation);\n\n /**\n * @dev Returns the current implementation address.\n */\n function _getImplementation() internal view returns (address) {\n return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 implementation slot.\n */\n function _setImplementation(address newImplementation) private {\n require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n }\n\n /**\n * @dev Perform implementation upgrade\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeTo(address newImplementation) internal {\n _setImplementation(newImplementation);\n emit Upgraded(newImplementation);\n }\n\n /**\n * @dev Perform implementation upgrade with additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCall(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n _upgradeTo(newImplementation);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(newImplementation, data);\n }\n }\n\n /**\n * @dev Perform implementation upgrade with security checks for UUPS proxies, and additional setup call.\n *\n * Emits an {Upgraded} event.\n */\n function _upgradeToAndCallUUPS(\n address newImplementation,\n bytes memory data,\n bool forceCall\n ) internal {\n // Upgrades from old implementations will perform a rollback test. This test requires the new\n // implementation to upgrade back to the old, non-ERC1822 compliant, implementation. Removing\n // this special case will break upgrade paths from old UUPS implementation to new ones.\n if (StorageSlot.getBooleanSlot(_ROLLBACK_SLOT).value) {\n _setImplementation(newImplementation);\n } else {\n try IERC1822Proxiable(newImplementation).proxiableUUID() returns (bytes32 slot) {\n require(slot == _IMPLEMENTATION_SLOT, \"ERC1967Upgrade: unsupported proxiableUUID\");\n } catch {\n revert(\"ERC1967Upgrade: new implementation is not UUPS\");\n }\n _upgradeToAndCall(newImplementation, data, forceCall);\n }\n }\n\n /**\n * @dev Storage slot with the admin of the contract.\n * This is the keccak-256 hash of \"eip1967.proxy.admin\" subtracted by 1, and is\n * validated in the constructor.\n */\n bytes32 internal constant _ADMIN_SLOT = 0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103;\n\n /**\n * @dev Emitted when the admin account has changed.\n */\n event AdminChanged(address previousAdmin, address newAdmin);\n\n /**\n * @dev Returns the current admin.\n */\n function _getAdmin() internal view returns (address) {\n return StorageSlot.getAddressSlot(_ADMIN_SLOT).value;\n }\n\n /**\n * @dev Stores a new address in the EIP1967 admin slot.\n */\n function _setAdmin(address newAdmin) private {\n require(newAdmin != address(0), \"ERC1967: new admin is the zero address\");\n StorageSlot.getAddressSlot(_ADMIN_SLOT).value = newAdmin;\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n */\n function _changeAdmin(address newAdmin) internal {\n emit AdminChanged(_getAdmin(), newAdmin);\n _setAdmin(newAdmin);\n }\n\n /**\n * @dev The storage slot of the UpgradeableBeacon contract which defines the implementation for this proxy.\n * This is bytes32(uint256(keccak256('eip1967.proxy.beacon')) - 1)) and is validated in the constructor.\n */\n bytes32 internal constant _BEACON_SLOT = 0xa3f0ad74e5423aebfd80d3ef4346578335a9a72aeaee59ff6cb3582b35133d50;\n\n /**\n * @dev Emitted when the beacon is upgraded.\n */\n event BeaconUpgraded(address indexed beacon);\n\n /**\n * @dev Returns the current beacon.\n */\n function _getBeacon() internal view returns (address) {\n return StorageSlot.getAddressSlot(_BEACON_SLOT).value;\n }\n\n /**\n * @dev Stores a new beacon in the EIP1967 beacon slot.\n */\n function _setBeacon(address newBeacon) private {\n require(Address.isContract(newBeacon), \"ERC1967: new beacon is not a contract\");\n require(\n Address.isContract(IBeacon(newBeacon).implementation()),\n \"ERC1967: beacon implementation is not a contract\"\n );\n StorageSlot.getAddressSlot(_BEACON_SLOT).value = newBeacon;\n }\n\n /**\n * @dev Perform beacon upgrade with additional setup call. Note: This upgrades the address of the beacon, it does\n * not upgrade the implementation contained in the beacon (see {UpgradeableBeacon-_setImplementation} for that).\n *\n * Emits a {BeaconUpgraded} event.\n */\n function _upgradeBeaconToAndCall(\n address newBeacon,\n bytes memory data,\n bool forceCall\n ) internal {\n _setBeacon(newBeacon);\n emit BeaconUpgraded(newBeacon);\n if (data.length > 0 || forceCall) {\n Address.functionDelegateCall(IBeacon(newBeacon).implementation(), data);\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/beacon/IBeacon.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/beacon/IBeacon.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This is the interface that {BeaconProxy} expects of its beacon.\n */\ninterface IBeacon {\n /**\n * @dev Must return an address that can be used as a delegate call target.\n *\n * {BeaconProxy} will check that this address is a contract.\n */\n function implementation() external view returns (address);\n}\n" - }, - "@openzeppelin/contracts/interfaces/draft-IERC1822.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (interfaces/draft-IERC1822.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev ERC1822: Universal Upgradeable Proxy Standard (UUPS) documents a method for upgradeability through a simplified\n * proxy whose upgrades are fully controlled by the current implementation.\n */\ninterface IERC1822Proxiable {\n /**\n * @dev Returns the storage slot that the proxiable contract assumes is being used to store the implementation\n * address.\n *\n * IMPORTANT: A proxy pointing at a proxiable contract should not be considered proxiable itself, because this risks\n * bricking a proxy that upgrades to it, by delegating to itself until out of gas. Thus it is critical that this\n * function revert if invoked through a proxy.\n */\n function proxiableUUID() external view returns (bytes32);\n}\n" - }, - "@openzeppelin/contracts/utils/StorageSlot.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (utils/StorageSlot.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev Library for reading and writing primitive types to specific storage slots.\n *\n * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.\n * This library helps with reading and writing to such slots without the need for inline assembly.\n *\n * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.\n *\n * Example usage to set ERC1967 implementation slot:\n * ```\n * contract ERC1967 {\n * bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;\n *\n * function _getImplementation() internal view returns (address) {\n * return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;\n * }\n *\n * function _setImplementation(address newImplementation) internal {\n * require(Address.isContract(newImplementation), \"ERC1967: new implementation is not a contract\");\n * StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;\n * }\n * }\n * ```\n *\n * _Available since v4.1 for `address`, `bool`, `bytes32`, and `uint256`._\n */\nlibrary StorageSlot {\n struct AddressSlot {\n address value;\n }\n\n struct BooleanSlot {\n bool value;\n }\n\n struct Bytes32Slot {\n bytes32 value;\n }\n\n struct Uint256Slot {\n uint256 value;\n }\n\n /**\n * @dev Returns an `AddressSlot` with member `value` located at `slot`.\n */\n function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `BooleanSlot` with member `value` located at `slot`.\n */\n function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.\n */\n function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n\n /**\n * @dev Returns an `Uint256Slot` with member `value` located at `slot`.\n */\n function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {\n assembly {\n r.slot := slot\n }\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/ERC1967/ERC1967Proxy.sol)\n\npragma solidity ^0.8.0;\n\nimport \"../Proxy.sol\";\nimport \"./ERC1967Upgrade.sol\";\n\n/**\n * @dev This contract implements an upgradeable proxy. It is upgradeable because calls are delegated to an\n * implementation address that can be changed. This address is stored in storage in the location specified by\n * https://eips.ethereum.org/EIPS/eip-1967[EIP1967], so that it doesn't conflict with the storage layout of the\n * implementation behind the proxy.\n */\ncontract ERC1967Proxy is Proxy, ERC1967Upgrade {\n /**\n * @dev Initializes the upgradeable proxy with an initial implementation specified by `_logic`.\n *\n * If `_data` is nonempty, it's used as data in a delegate call to `_logic`. This will typically be an encoded\n * function call, and allows initializating the storage of the proxy like a Solidity constructor.\n */\n constructor(address _logic, bytes memory _data) payable {\n assert(_IMPLEMENTATION_SLOT == bytes32(uint256(keccak256(\"eip1967.proxy.implementation\")) - 1));\n _upgradeToAndCall(_logic, _data, false);\n }\n\n /**\n * @dev Returns the current implementation address.\n */\n function _implementation() internal view virtual override returns (address impl) {\n return ERC1967Upgrade._getImplementation();\n }\n}\n" - }, - "@openzeppelin/contracts/proxy/Proxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts (last updated v4.5.0) (proxy/Proxy.sol)\n\npragma solidity ^0.8.0;\n\n/**\n * @dev This abstract contract provides a fallback function that delegates all calls to another contract using the EVM\n * instruction `delegatecall`. We refer to the second contract as the _implementation_ behind the proxy, and it has to\n * be specified by overriding the virtual {_implementation} function.\n *\n * Additionally, delegation to the implementation can be triggered manually through the {_fallback} function, or to a\n * different contract through the {_delegate} function.\n *\n * The success and return data of the delegated call will be returned back to the caller of the proxy.\n */\nabstract contract Proxy {\n /**\n * @dev Delegates the current call to `implementation`.\n *\n * This function does not return to its internal call site, it will return directly to the external caller.\n */\n function _delegate(address implementation) internal virtual {\n assembly {\n // Copy msg.data. We take full control of memory in this inline assembly\n // block because it will not return to Solidity code. We overwrite the\n // Solidity scratch pad at memory position 0.\n calldatacopy(0, 0, calldatasize())\n\n // Call the implementation.\n // out and outsize are 0 because we don't know the size yet.\n let result := delegatecall(gas(), implementation, 0, calldatasize(), 0, 0)\n\n // Copy the returned data.\n returndatacopy(0, 0, returndatasize())\n\n switch result\n // delegatecall returns 0 on error.\n case 0 {\n revert(0, returndatasize())\n }\n default {\n return(0, returndatasize())\n }\n }\n }\n\n /**\n * @dev This is a virtual function that should be overriden so it returns the address to which the fallback function\n * and {_fallback} should delegate.\n */\n function _implementation() internal view virtual returns (address);\n\n /**\n * @dev Delegates the current call to the address returned by `_implementation()`.\n *\n * This function does not return to its internall call site, it will return directly to the external caller.\n */\n function _fallback() internal virtual {\n _beforeFallback();\n _delegate(_implementation());\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if no other\n * function in the contract matches the call data.\n */\n fallback() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Fallback function that delegates calls to the address returned by `_implementation()`. Will run if call data\n * is empty.\n */\n receive() external payable virtual {\n _fallback();\n }\n\n /**\n * @dev Hook that is called before falling back to the implementation. Can happen as part of a manual `_fallback`\n * call, or as part of the Solidity `fallback` or `receive` functions.\n *\n * If overriden should call `super._beforeFallback()`.\n */\n function _beforeFallback() internal virtual {}\n}\n" - }, - "contracts/periphery/utils/TransparentUpgradeableProxy.sol": { - "content": "// SPDX-License-Identifier: MIT\n// OpenZeppelin Contracts v4.4.1 (proxy/transparent/TransparentUpgradeableProxy.sol)\n// Note: we just copied so that we can see the contract used\npragma solidity ^0.8.14;\n\nimport {ERC1967Proxy} from '@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol';\n\n/**\n * @dev This contract implements a proxy that is upgradeable by an admin.\n *\n * To avoid https://medium.com/nomic-labs-blog/malicious-backdoors-in-ethereum-proxies-62629adf3357[proxy selector\n * clashing], which can potentially be used in an attack, this contract uses the\n * https://blog.openzeppelin.com/the-transparent-proxy-pattern/[transparent proxy pattern]. This pattern implies two\n * things that go hand in hand:\n *\n * 1. If any account other than the admin calls the proxy, the call will be forwarded to the implementation, even if\n * that call matches one of the admin functions exposed by the proxy itself.\n * 2. If the admin calls the proxy, it can access the admin functions, but its calls will never be forwarded to the\n * implementation. If the admin tries to call a function on the implementation it will fail with an error that says\n * \"admin cannot fallback to proxy target\".\n *\n * These properties mean that the admin account can only be used for admin actions like upgrading the proxy or changing\n * the admin, so it's best if it's a dedicated account that is not used for anything else. This will avoid headaches due\n * to sudden errors when trying to call a function from the proxy implementation.\n *\n * Our recommendation is for the dedicated account to be an instance of the {ProxyAdmin} contract. If set up this way,\n * you should think of the `ProxyAdmin` instance as the real administrative interface of your proxy.\n */\ncontract TransparentUpgradeableProxy is ERC1967Proxy {\n /**\n * @dev Initializes an upgradeable proxy managed by `_admin`, backed by the implementation at `_logic`, and\n * optionally initialized with `_data` as explained in {ERC1967Proxy-constructor}.\n */\n constructor(\n address _logic,\n address admin_,\n bytes memory _data\n ) payable ERC1967Proxy(_logic, _data) {\n assert(_ADMIN_SLOT == bytes32(uint256(keccak256('eip1967.proxy.admin')) - 1));\n _changeAdmin(admin_);\n }\n\n /**\n * @dev Modifier used internally that will delegate the call to the implementation unless the sender is the admin.\n */\n modifier ifAdmin() {\n if (msg.sender == _getAdmin()) {\n _;\n } else {\n _fallback();\n }\n }\n\n /**\n * @dev Returns the current admin.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyAdmin}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103`\n */\n function admin() external ifAdmin returns (address admin_) {\n admin_ = _getAdmin();\n }\n\n /**\n * @dev Returns the current implementation.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-getProxyImplementation}.\n *\n * TIP: To get this value clients can read directly from the storage slot shown below (specified by EIP1967) using the\n * https://eth.wiki/json-rpc/API#eth_getstorageat[`eth_getStorageAt`] RPC call.\n * `0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc`\n */\n function implementation() external ifAdmin returns (address implementation_) {\n implementation_ = _implementation();\n }\n\n /**\n * @dev Changes the admin of the proxy.\n *\n * Emits an {AdminChanged} event.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-changeProxyAdmin}.\n */\n function changeAdmin(address newAdmin) external virtual ifAdmin {\n _changeAdmin(newAdmin);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgrade}.\n */\n function upgradeTo(address newImplementation) external ifAdmin {\n _upgradeToAndCall(newImplementation, bytes(''), false);\n }\n\n /**\n * @dev Upgrade the implementation of the proxy, and then call a function from the new implementation as specified\n * by `data`, which should be an encoded function call. This is useful to initialize new storage variables in the\n * proxied contract.\n *\n * NOTE: Only the admin can call this function. See {ProxyAdmin-upgradeAndCall}.\n */\n function upgradeToAndCall(address newImplementation, bytes calldata data)\n external\n payable\n ifAdmin\n {\n _upgradeToAndCall(newImplementation, data, true);\n }\n\n /**\n * @dev Returns the current admin.\n */\n function _admin() internal view virtual returns (address) {\n return _getAdmin();\n }\n\n /**\n * @dev Makes sure the admin cannot access the fallback function. See {Proxy-_beforeFallback}.\n */\n function _beforeFallback() internal virtual override {\n require(\n msg.sender != _getAdmin(),\n 'TransparentUpgradeableProxy: admin cannot fallback to proxy target'\n );\n super._beforeFallback();\n }\n}\n" - }, - "contracts/attesters/hydra-s1/interfaces/IHydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {Attestation} from '../../../core/libs/Structs.sol';\nimport {IAttester} from '../../../core/interfaces/IAttester.sol';\nimport {CommitmentMapperRegistry} from '../../../periphery/utils/CommitmentMapperRegistry.sol';\nimport {AvailableRootsRegistry} from '../../../periphery/utils/AvailableRootsRegistry.sol';\nimport {HydraS1Lib, HydraS1ProofData, HydraS1ProofInput} from './../libs/HydraS1Lib.sol';\nimport {IHydraS1Base} from './../base/IHydraS1Base.sol';\n\n// todo: explain well what is specific to this attester\ninterface IHydraS1SimpleAttester is IHydraS1Base, IAttester {\n error TicketUsed(uint256 userTicket);\n error CollectionIdOutOfBound(uint256 collectionId);\n\n event TicketDestinationUpdated(uint256 ticket, address newOwner);\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view returns (address);\n\n /**\n * @dev Getter\n * returns of the first collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_FIRST() external view returns (uint256);\n\n /**\n * @dev Getter\n * returns of the last collection in which the attester is supposed to record\n **/\n function AUTHORIZED_COLLECTION_ID_LAST() external view returns (uint256);\n}\n" - }, - "contracts/attesters/hydra-s1/HydraS1SimpleAttester.sol": { - "content": "// SPDX-License-Identifier: MIT\n\npragma solidity ^0.8.14;\npragma experimental ABIEncoderV2;\n\nimport {IHydraS1SimpleAttester} from './interfaces/IHydraS1SimpleAttester.sol';\n\n// Core protocol Protocol imports\nimport {Request, Attestation, Claim} from './../../core/libs/Structs.sol';\nimport {Attester, IAttester, IAttestationsRegistry} from './../../core/Attester.sol';\n\n// Imports related to HydraS1 Proving Scheme\nimport {HydraS1Base, HydraS1Lib, HydraS1ProofData, HydraS1ProofInput, HydraS1Claim} from './base/HydraS1Base.sol';\n\n/**\n * @title Hydra-S1 Simple Attester\n * @author Sismo\n * @notice This attester is part of the family of the Hydra-S1 Attesters.\n * Hydra-S1 attesters enable users to prove they have an account in a group in a privacy preserving way.\n * The Hydra-S1 Base abstract contract is inherited and holds the complex Hydra S1 verification logic.\n * We invite readers to refer to:\n * - https://hydra-s1.docs.sismo.io for a full guide through the Hydra-S1 ZK Attestations\n * - https://hydra-s1-circuits.docs.sismo.io for circuits, prover and verifiers of Hydra-S1\n\n * This specific attester has the following characteristics:\n\n * - Zero Knowledge\n * One cannot deduct from an attestation what source account was used to generate the underlying proof\n\n * - Non Strict (scores)\n * If a user can generate an attestation of max value 100, they can also generate any attestation with value < 100.\n * This attester generate attestations of scores\n\n * - Ticketed\n * Each source account gets one userTicket per claim (i.e only one attestation per source account per claim)\n * For people used to semaphore/ tornado cash people:\n * userTicket = hash(sourceSecret, ticketIdentifier) <=> nullifierHash = hash(IdNullifier, externalNullifier)\n \n * - Renewable\n * A userTicket can actually be reused as long as the destination of the attestation remains the same\n * It enables users to renew their attestations\n **/\n\ncontract HydraS1SimpleAttester is IHydraS1SimpleAttester, HydraS1Base, Attester {\n using HydraS1Lib for HydraS1ProofData;\n using HydraS1Lib for bytes;\n using HydraS1Lib for Request;\n\n // The deployed contract will need to be authorized to write into the Attestation registry\n // It should get write access on attestation collections from AUTHORIZED_COLLECTION_ID_FIRST to AUTHORIZED_COLLECTION_ID_LAST.\n uint256 public immutable AUTHORIZED_COLLECTION_ID_FIRST;\n uint256 public immutable AUTHORIZED_COLLECTION_ID_LAST;\n\n mapping(uint256 => address) internal _ticketsDestinations;\n\n /*******************************************************\n INITIALIZATION FUNCTIONS \n *******************************************************/\n /**\n * @dev Constructor. Initializes the contract\n * @param attestationsRegistryAddress Attestations Registry contract on which the attester will write attestations\n * @param hydraS1VerifierAddress ZK Snark Hydra-S1 Verifier contract\n * @param availableRootsRegistryAddress Registry storing the available groups for this attester (e.g roots of registry merkle trees)\n * @param commitmentMapperAddress commitment mapper's public key registry\n * @param collectionIdFirst Id of the first collection in which the attester is supposed to record\n * @param collectionIdLast Id of the last collection in which the attester is supposed to record\n */\n constructor(\n address attestationsRegistryAddress,\n address hydraS1VerifierAddress,\n address availableRootsRegistryAddress,\n address commitmentMapperAddress,\n uint256 collectionIdFirst,\n uint256 collectionIdLast\n )\n Attester(attestationsRegistryAddress)\n HydraS1Base(hydraS1VerifierAddress, availableRootsRegistryAddress, commitmentMapperAddress)\n {\n AUTHORIZED_COLLECTION_ID_FIRST = collectionIdFirst;\n AUTHORIZED_COLLECTION_ID_LAST = collectionIdLast;\n }\n\n /*******************************************************\n MANDATORY FUNCTIONS TO OVERRIDE FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Throws if user request is invalid when verified against\n * Look into HydraS1Base for more details\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _verifyRequest(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n HydraS1ProofData memory snarkProof = abi.decode(proofData, (HydraS1ProofData));\n HydraS1ProofInput memory snarkInput = snarkProof._input();\n HydraS1Claim memory claim = request._claim();\n\n // verifies that the proof corresponds to the claim\n _validateInput(claim, snarkInput);\n // verifies the proof validity\n _verifyProof(snarkProof);\n }\n\n /**\n * @dev Returns attestations that will be recorded, constructed from the user request\n * @param request users request. Claim of having an account part of a group of accounts\n */\n function buildAttestations(Request calldata request, bytes calldata)\n public\n view\n virtual\n override(IAttester, Attester)\n returns (Attestation[] memory)\n {\n HydraS1Claim memory claim = request._claim();\n\n Attestation[] memory attestations = new Attestation[](1);\n\n uint256 attestationCollectionId = AUTHORIZED_COLLECTION_ID_FIRST +\n claim.groupProperties.groupIndex;\n\n if (attestationCollectionId > AUTHORIZED_COLLECTION_ID_LAST)\n revert CollectionIdOutOfBound(attestationCollectionId);\n\n address issuer = address(this);\n\n attestations[0] = Attestation(\n attestationCollectionId,\n claim.destination,\n issuer,\n claim.claimedValue,\n claim.groupProperties.generationTimestamp,\n ''\n );\n return (attestations);\n }\n\n /*******************************************************\n OPTIONAL HOOK VIRTUAL FUNCTIONS FROM ATTESTER.SOL\n *******************************************************/\n\n /**\n * @dev Hook run before recording the attestation.\n * Throws if ticket already used and not a renewal (e.g destination different that last)\n * @param request users request. Claim of having an account part of a group of accounts\n * @param proofData provided to back the request. snark input and snark proof\n */\n function _beforeRecordAttestations(Request calldata request, bytes calldata proofData)\n internal\n virtual\n override\n {\n // we get the ticket used from the snark input in the data provided\n uint256 userTicket = proofData._getTicket();\n address currentDestination = _getDestinationOfTicket(userTicket);\n\n if (currentDestination != address(0) && currentDestination != request.destination) {\n revert TicketUsed(userTicket);\n }\n\n _setDestinationForTicket(userTicket, request.destination);\n }\n\n /*******************************************************\n Hydra-S1 MANDATORY FUNCTIONS FROM Hydra-S1 Base Attester\n *******************************************************/\n\n /**\n * @dev Returns the ticket identifier from a user claim\n * @param claim user Hydra-S1 claim = have an account with a specific value in a specific group\n * ticket = hash(sourceSecretHash, ticketIdentifier), which is verified inside the snark\n * users bring sourceSecretHash as private input in snark which guarantees privacy\n \n * Here we chose ticketIdentifier = hash(attesterAddress, claim.GroupId)\n * Creates one ticket per group, per user and makes sure no collision with other attester's tickets\n **/\n function _getTicketIdentifierOfClaim(HydraS1Claim memory claim)\n internal\n view\n override\n returns (uint256)\n {\n uint256 ticketIdentifier = _encodeInSnarkField(address(this), claim.groupProperties.groupIndex);\n return ticketIdentifier;\n }\n\n /*******************************************************\n Hydra-S1 Attester Specific Functions\n *******************************************************/\n\n /**\n * @dev Getter, returns the last attestation destination of a ticket\n * @param userTicket ticket used\n **/\n function getDestinationOfTicket(uint256 userTicket) external view override returns (address) {\n return _getDestinationOfTicket(userTicket);\n }\n\n function _setDestinationForTicket(uint256 userTicket, address destination) internal virtual {\n _ticketsDestinations[userTicket] = destination;\n emit TicketDestinationUpdated(userTicket, destination);\n }\n\n function _getDestinationOfTicket(uint256 userTicket) internal view returns (address) {\n return _ticketsDestinations[userTicket];\n }\n\n function _encodeInSnarkField(address addr, uint256 nb) internal pure returns (uint256) {\n return uint256(keccak256(abi.encode(addr, nb))) % HydraS1Lib.SNARK_FIELD;\n }\n}\n" - }, - "contracts/core/AttestationsRegistry.sol": { - "content": "// SPDX-License-Identifier: MIT\npragma solidity ^0.8.14;\n\nimport {IAttestationsRegistry} from './interfaces/IAttestationsRegistry.sol';\nimport {AttestationsRegistryConfigLogic} from './libs/attestations-registry/AttestationsRegistryConfigLogic.sol';\nimport {AttestationsRegistryState} from './libs/attestations-registry/AttestationsRegistryState.sol';\nimport {Range, RangeUtils} from './libs/utils/RangeLib.sol';\nimport {Attestation, AttestationData} from './libs/Structs.sol';\nimport {IBadges} from './interfaces/IBadges.sol';\n\n/**\n * @title Attestations Registry\n * @author Sismo\n * @notice Main contract of Sismo, stores all recorded attestations in attestations collections\n * Only authorized attestations issuers can record attestation in the registry\n * Attesters that expect to record in the Attestations Registry must be authorized issuers\n * For more information: https://attestations-registry.docs.sismo.io\n\n * For each attestation recorded, a badge is received by the user\n * The badge is the Non transferrable NFT representation of an attestation \n * Its ERC1155 contract is stateless, balances are read directly from the registry. Badge balances <=> Attestations values\n * After the creation or update of an attestation, the registry triggers a TransferSingle event from the ERC1155 Badges contracts\n * It enables off-chain apps such as opensea to catch the \"shadow mint\" of the badge\n **/\ncontract AttestationsRegistry is\n AttestationsRegistryState,\n IAttestationsRegistry,\n AttestationsRegistryConfigLogic\n{\n IBadges immutable BADGES;\n\n /**\n * @dev Constructor.\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n * @param badgesAddress Stateless ERC1155 Badges contract\n */\n constructor(address owner, address badgesAddress) {\n initialize(owner);\n BADGES = IBadges(badgesAddress);\n }\n\n /**\n * @dev Initialize function, to be called by the proxy delegating calls to this implementation\n * @param owner Owner of the contract, has the right to authorize/unauthorize attestations issuers\n */\n function initialize(address owner) public initializer {\n _transferOwnership(owner);\n }\n\n /**\n * @dev Main function to be called by authorized issuers\n * @param attestations Attestations to be recorded (creates a new one or overrides an existing one)\n */\n function recordAttestations(Attestation[] calldata attestations) external override whenNotPaused {\n address issuer = _msgSender();\n for (uint256 i = 0; i < attestations.length; i++) {\n if (!_isAuthorized(issuer, attestations[i].collectionId))\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\n\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\n attestations[i].owner\n ].value;\n\n _attestationsData[attestations[i].collectionId][attestations[i].owner] = AttestationData(\n attestations[i].issuer,\n attestations[i].value,\n attestations[i].timestamp,\n attestations[i].extraData\n );\n\n _triggerBadgeTransferEvent(\n attestations[i].collectionId,\n attestations[i].owner,\n previousAttestationValue,\n attestations[i].value\n );\n emit AttestationRecorded(attestations[i]);\n }\n }\n\n /**\n * @dev Delete function to be called by authorized issuers\n * @param attestations Attestations to be deleted\n */\n function deleteAttestations(Attestation[] memory attestations) external override whenNotPaused {\n address issuer = _msgSender();\n for (uint256 i = 0; i < attestations.length; i++) {\n uint256 previousAttestationValue = _attestationsData[attestations[i].collectionId][\n attestations[i].owner\n ].value;\n\n if (!_isAuthorized(issuer, attestations[i].collectionId))\n revert IssuerNotAuthorized(issuer, attestations[i].collectionId);\n delete _attestationsData[attestations[i].collectionId][attestations[i].owner];\n\n _triggerBadgeTransferEvent(\n attestations[i].collectionId,\n attestations[i].owner,\n previousAttestationValue,\n 0\n );\n\n emit AttestationDeleted(\n Attestation(\n attestations[i].collectionId,\n attestations[i].owner,\n attestations[i].issuer,\n attestations[i].value,\n attestations[i].timestamp,\n attestations[i].extraData\n )\n );\n }\n }\n\n /**\n * @dev Returns whether a user has an attestation from a collection\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function hasAttestation(uint256 collectionId, address owner)\n external\n view\n override\n returns (bool)\n {\n return _getAttestationValue(collectionId, owner) != 0;\n }\n\n /**\n * @dev Getter of the data of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationData(uint256 collectionId, address owner)\n external\n view\n override\n returns (AttestationData memory)\n {\n return _getAttestationData(collectionId, owner);\n }\n\n /**\n * @dev Getter of the value of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationValue(uint256 collectionId, address owner)\n external\n view\n override\n returns (uint256)\n {\n return _getAttestationValue(collectionId, owner);\n }\n\n /**\n * @dev Getter of the data of a specific attestation as tuple\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationDataTuple(uint256 collectionId, address owner)\n external\n view\n override\n returns (\n address,\n uint256,\n uint32,\n bytes memory\n )\n {\n AttestationData memory attestationData = _attestationsData[collectionId][owner];\n return (\n attestationData.issuer,\n attestationData.value,\n attestationData.timestamp,\n attestationData.extraData\n );\n }\n\n /**\n * @dev Getter of the extraData of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationExtraData(uint256 collectionId, address owner)\n external\n view\n override\n returns (bytes memory)\n {\n return _attestationsData[collectionId][owner].extraData;\n }\n\n /**\n * @dev Getter of the issuer of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationIssuer(uint256 collectionId, address owner)\n external\n view\n override\n returns (address)\n {\n return _attestationsData[collectionId][owner].issuer;\n }\n\n /**\n * @dev Getter of the timestamp of a specific attestation\n * @param collectionId Collection identifier of the targeted attestation\n * @param owner Owner of the targeted attestation\n */\n function getAttestationTimestamp(uint256 collectionId, address owner)\n external\n view\n override\n returns (uint32)\n {\n return _attestationsData[collectionId][owner].timestamp;\n }\n\n /**\n * @dev Getter of the data of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationDataBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n override\n returns (AttestationData[] memory)\n {\n AttestationData[] memory attestationsDataArray = new AttestationData[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsDataArray[i] = _getAttestationData(collectionIds[i], owners[i]);\n }\n return attestationsDataArray;\n }\n\n /**\n * @dev Getter of the values of specific attestations\n * @param collectionIds Collection identifiers of the targeted attestations\n * @param owners Owners of the targeted attestations\n */\n function getAttestationValueBatch(uint256[] memory collectionIds, address[] memory owners)\n external\n view\n override\n returns (uint256[] memory)\n {\n uint256[] memory attestationsValues = new uint256[](collectionIds.length);\n for (uint256 i = 0; i < collectionIds.length; i++) {\n attestationsValues[i] = _getAttestationValue(collectionIds[i], owners[i]);\n }\n return attestationsValues;\n }\n\n /**\n * @dev Function that trigger a TransferSingle event from the stateless ERC1155 Badges contract\n * It enables off-chain apps such as opensea to catch the \"shadow mints/burns\" of badges\n */\n function _triggerBadgeTransferEvent(\n uint256 badgeTokenId,\n address owner,\n uint256 previousValue,\n uint256 newValue\n ) internal {\n bool isGreaterValue = newValue > previousValue;\n address operator = address(this);\n address from = isGreaterValue ? address(0) : owner;\n address to = isGreaterValue ? owner : address(0);\n uint256 value = isGreaterValue ? newValue - previousValue : previousValue - newValue;\n\n // if isGreaterValue is true, function triggers mint event. Otherwise triggers burn event.\n BADGES.triggerTransferEvent(operator, from, to, badgeTokenId, value);\n }\n\n function _getAttestationData(uint256 collectionId, address owner)\n internal\n view\n returns (AttestationData memory)\n {\n return (_attestationsData[collectionId][owner]);\n }\n\n function _getAttestationValue(uint256 collectionId, address owner)\n internal\n view\n returns (uint256)\n {\n return _attestationsData[collectionId][owner].value;\n }\n}\n" - } - }, - "settings": { - "optimizer": { - "enabled": true, - "runs": 200 - }, - "outputSelection": { - "*": { - "*": [ - "abi", - "evm.bytecode", - "evm.deployedBytecode", - "evm.methodIdentifiers", - "metadata", - "devdoc", - "userdoc", - "storageLayout", - "evm.gasEstimates" - ], - "": [ - "ast" - ] - } - }, - "metadata": { - "useLiteralContent": true - } - } -} \ No newline at end of file diff --git a/hardhat.config.ts b/hardhat.config.ts index eaac25f..5cf9ef8 100644 --- a/hardhat.config.ts +++ b/hardhat.config.ts @@ -47,12 +47,14 @@ const FORK_NETWORK = process.env.FORK_NETWORK || ''; const forkUrl = { kovan: NETWORKS_RPC_URL[EthereumNetwork.kovan], - goerli: NETWORKS_RPC_URL[EthereumNetwork.goerli], main: NETWORKS_RPC_URL[EthereumNetwork.main], polygon: NETWORKS_RPC_URL[PolygonNetwork.main], - sandboxPolygon: NETWORKS_RPC_URL[PolygonNetwork.main], + polygonPlayground: NETWORKS_RPC_URL[PolygonNetwork.main], rinkeby: NETWORKS_RPC_URL[EthereumNetwork.rinkeby], - mumbai: NETWORKS_RPC_URL[PolygonNetwork.mumbai], + goerliTestnet: NETWORKS_RPC_URL[EthereumNetwork.goerli], + mumbaiTestnet: NETWORKS_RPC_URL[PolygonNetwork.mumbai], + goerliStaging: NETWORKS_RPC_URL[EthereumNetwork.goerli], + mumbaiStaging: NETWORKS_RPC_URL[PolygonNetwork.mumbai], xdai: NETWORKS_RPC_URL[XDaiNetwork.xdai], }; @@ -107,12 +109,13 @@ const config: HardhatUserConfig = { defaultNetwork: 'hardhat', networks: { kovan: getCommonNetworkConfig(EthereumNetwork.kovan, 42), - goerli: getCommonNetworkConfig(EthereumNetwork.goerli, 5), main: getCommonNetworkConfig(EthereumNetwork.main, 1), polygon: getCommonNetworkConfig(PolygonNetwork.main, 137), - sandboxPolygon: getCommonNetworkConfig(PolygonNetwork.main, 137), - rinkeby: getCommonNetworkConfig(EthereumNetwork.rinkeby, 4), - mumbai: getCommonNetworkConfig(PolygonNetwork.mumbai, 80001), + polygonPlayground: getCommonNetworkConfig(PolygonNetwork.main, 137), + goerliStaging: getCommonNetworkConfig(EthereumNetwork.goerli, 5), + mumbaiStaging: getCommonNetworkConfig(PolygonNetwork.mumbai, 80001), + goerliTestnet: getCommonNetworkConfig(EthereumNetwork.goerli, 5), + mumbaiTestnet: getCommonNetworkConfig(PolygonNetwork.mumbai, 80001), xdai: getCommonNetworkConfig(XDaiNetwork.xdai, 100), local: { url: `http://${LOCAL_HOSTNAME}:${LOCAL_PORT}`, diff --git a/tasks/deploy-tasks/deployments-config.ts b/tasks/deploy-tasks/deployments-config.ts index c972d26..2826354 100644 --- a/tasks/deploy-tasks/deployments-config.ts +++ b/tasks/deploy-tasks/deployments-config.ts @@ -26,29 +26,36 @@ const COMMITMENT_SIGNER_PUB_KEY_SYNAPS_PROD = [ ]; const THREE_DAYS = '295200'; -// Rinkeby -const ALPHA_RINKEBY_OWNER = '0x4e070E9b85a659F0B7B47cde33152ad6c2F63954'; -const ALPHA_RINKEBY_ROOTS_OWNER_RELAYER = '0x5de4009c77d51782014bb16238ec32971ae9f8d0'; -const ALPHA_RINKEBY_PROXY_ADMIN = '0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc'; -// Goerli -const ALPHA_GOERLI_OWNER = '0x4e070E9b85a659F0B7B47cde33152ad6c2F63954'; -const ALPHA_GOERLI_ROOTS_OWNER_RELAYER = '0x7f2e6e158643bcaf85f30c57ae8625f623d82659'; -const ALPHA_GOERLI_PROXY_ADMIN = '0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc'; -// Mumbai -const ALPHA_MUMBAI_OWNER = '0x4e070E9b85a659F0B7B47cde33152ad6c2F63954'; -const ALPHA_MUMBAI_ROOTS_OWNER_RELAYER = '0x63f08f8f13126b9eadc76dd683902c61c5115138'; -const ALPHA_MUMBAI_PROXY_ADMIN = '0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc'; + // Polygon const ALPHA_POLYGON_OWNER = '0xaee4acd5c4Bf516330ca8fe11B07206fC6709294'; const ALPHA_POLYGON_ROOTS_OWNER_RELAYER = '0xf0a0b692e1c764281c211948d03edeef5fb57111'; const ALPHA_POLYGON_PROXY_ADMIN = '0x2110475dfbB8d331b300178A867372991ff35fA3'; -// Polygon Sandbox +// Polygon Playground const SANDBOX_POLYGON_OWNER = '0xaee4acd5c4Bf516330ca8fe11B07206fC6709294'; const SANDBOX_POLYGON_ROOTS_OWNER_RELAYER = '0x7e2305312099748bbd6a31bff27a8218edd4cbd2'; const SANDBOX_POLYGON_PROXY_ADMIN = '0x2110475dfbB8d331b300178A867372991ff35fA3'; +// Goerli Testnet +const ALPHA_GOERLI_TESTNET_OWNER = '0xaee4acd5c4Bf516330ca8fe11B07206fC6709294'; +const ALPHA_GOERLI_TESTNET_ROOTS_OWNER_RELAYER = '0xa687922c4bf2eb22297fdf89156b49ed3727618b'; +const ALPHA_GOERLI_TESTNET_PROXY_ADMIN = '0x2110475dfbB8d331b300178A867372991ff35fA3'; +// Mumbai Testnet +const ALPHA_MUMBAI_TESTNET_OWNER = '0xaee4acd5c4Bf516330ca8fe11B07206fC6709294'; +const ALPHA_MUMBAI_TESTNET_ROOTS_OWNER_RELAYER = '0xca0583a6682607282963d3e2545cd2e75697c2bb'; +const ALPHA_MUMBAI_TESTNET_PROXY_ADMIN = '0x2110475dfbB8d331b300178A867372991ff35fA3'; + +// Goerli Staging +const ALPHA_GOERLI_STAGING_OWNER = '0x4e070E9b85a659F0B7B47cde33152ad6c2F63954'; +const ALPHA_GOERLI_STAGING_ROOTS_OWNER_RELAYER = '0x7f2e6e158643bcaf85f30c57ae8625f623d82659'; +const ALPHA_GOERLI_STAGING_PROXY_ADMIN = '0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc'; +// Mumbai Staging +const ALPHA_MUMBAI_STAGING_OWNER = '0x4e070E9b85a659F0B7B47cde33152ad6c2F63954'; +const ALPHA_MUMBAI_STAGING_ROOTS_OWNER_RELAYER = '0x63f08f8f13126b9eadc76dd683902c61c5115138'; +const ALPHA_MUMBAI_STAGING_PROXY_ADMIN = '0x246E71bC2a257f4BE9C7fAD4664E6D7444844Adc'; + export const deploymentsConfig: DeploymentsConfigTypes = { - sandboxPolygon: { + polygonPlayground: { deployOptions: { manualConfirm: true, log: true, @@ -170,17 +177,145 @@ export const deploymentsConfig: DeploymentsConfigTypes = { EdDSAPubKeyY: COMMITMENT_MAPPER_EDDSA_PUB_KEY_PROD[1], }, }, + // deployer: alpha-testnets-goerli-mnemonic-deployer-dec-15-2022 + goerliTestnet: { + deployOptions: { + manualConfirm: true, + log: true, + behindProxy: true, + proxyAdmin: ALPHA_GOERLI_TESTNET_PROXY_ADMIN, + }, + badges: { + address: '0xA251eb9Be4e7E2bb382268eCdd0a5fca0A962E6c', + owner: ALPHA_GOERLI_TESTNET_OWNER, + // Badges Metadata URI for the Badges contract + uri: 'https://hub.testnets.sismo.io/badges/goerli/{id}.json', + }, + front: { + address: '0x40713429614c47e94bC078069Df9C084fb44edfC', + collectionIdFirst: '0', + collectionIdLast: '10000000', + }, + hydraS1Verifier: { + address: '0x6F470D565Effa8a2594B0BDB9E63Cd21D58FAC0f', + }, + hydraS1SimpleAttester: { + enableDeployment: false, + address: '', + collectionIdFirst: '', + collectionIdLast: '', + initialRoot: '0', + }, + hydraS1AccountboundAttester: { + address: '0x319d2a1f99DCE97bC1539643Df7cD7A0a978Eb7B', + collectionIdFirst: '10000001', + collectionIdLast: '20000000', + initialRoot: '0', + owner: ALPHA_GOERLI_TESTNET_OWNER, + }, + pythia1Verifier: { + address: '0xd6f79719F8e286987417F9910c0ED42AbF95B0EA', + }, + synapsPythia1SimpleAttester: { + address: '0x65130b44f33E2E97Ea7031412eAFf7d5FC7bf9ad', + collectionIdFirst: '30000001', + collectionIdLast: '30000100', + commitmentSignerPubKeyX: COMMITMENT_SIGNER_PUB_KEY_SYNAPS_PROD[0], + commitmentSignerPubKeyY: COMMITMENT_SIGNER_PUB_KEY_SYNAPS_PROD[1], + owner: ALPHA_GOERLI_TESTNET_OWNER, + }, + attestationsRegistry: { + address: '0x7c0F3ba8e29ad7e28CA805933d6d43b35983B2b3', + owner: ALPHA_GOERLI_TESTNET_OWNER, + }, + availableRootsRegistry: { + address: '0x3be8DF71fc13312411F0d20d26C08E822fE9cF1f', + owner: ALPHA_GOERLI_TESTNET_ROOTS_OWNER_RELAYER, + }, + commitmentMapper: { + address: '0x60021A3B6a2bC5b27FeAc52C091f5f672B6b7B53', + owner: ALPHA_GOERLI_TESTNET_OWNER, + EdDSAPubKeyX: COMMITMENT_MAPPER_EDDSA_PUB_KEY_PROD[0], + EdDSAPubKeyY: COMMITMENT_MAPPER_EDDSA_PUB_KEY_PROD[1], + }, + }, + // deployer: alpha-testnets-mumbai-mnemonic-deployer-dec-15-2022 + mumbaiTestnet: { + deployOptions: { + manualConfirm: true, + log: true, + behindProxy: true, + proxyAdmin: ALPHA_MUMBAI_TESTNET_PROXY_ADMIN, + }, + badges: { + address: '0xc3Ee5Aad6Fb987cF69a2EE7B3B2c92E21E42F34B', + owner: ALPHA_MUMBAI_TESTNET_OWNER, + // Badges Metadata URI for the Badges contract + uri: 'https://hub.testnets.sismo.io/badges/mumbai/{id}.json', + }, + front: { + address: '0xcAf720C39bcdF47476aDc0618e6d7B57B7533213', + collectionIdFirst: '0', + collectionIdLast: '10000000', + }, + hydraS1Verifier: { + address: '0x09f35a46C6863F5C8Cd887F690974DCaaDe0A2a5', + }, + hydraS1SimpleAttester: { + enableDeployment: false, + address: '', + collectionIdFirst: '', + collectionIdLast: '', + initialRoot: '0', + }, + hydraS1AccountboundAttester: { + address: '0xEe6c299A09d352caf53C81621f6D757c7C0B4d7c', + collectionIdFirst: '10000001', + collectionIdLast: '20000000', + initialRoot: '0', + owner: ALPHA_MUMBAI_TESTNET_OWNER, + }, + pythia1Verifier: { + address: '0xDA7124b003AeF27A1C44aEe4d6eB6E2Bb0eF9a08', + }, + synapsPythia1SimpleAttester: { + address: '0xBbb56145d961742b1f3E3fc2b91077639C8C302a', + collectionIdFirst: '30000001', + collectionIdLast: '30000100', + commitmentSignerPubKeyX: COMMITMENT_SIGNER_PUB_KEY_SYNAPS_PROD[0], + commitmentSignerPubKeyY: COMMITMENT_SIGNER_PUB_KEY_SYNAPS_PROD[1], + owner: ALPHA_MUMBAI_TESTNET_OWNER, + }, + attestationsRegistry: { + address: '0xc24F86a8D9f82401b693d4FFaa1DCf3109d88524', + owner: ALPHA_MUMBAI_TESTNET_OWNER, + }, + availableRootsRegistry: { + address: '0xe51e46177505c31CE33791066E17E11d9D180305', + owner: ALPHA_MUMBAI_TESTNET_ROOTS_OWNER_RELAYER, + }, + commitmentMapper: { + address: '0xE6C1f01C71A184A44A21B10A7FBEb3b1604B4f2a', + owner: ALPHA_MUMBAI_TESTNET_OWNER, + EdDSAPubKeyX: COMMITMENT_MAPPER_EDDSA_PUB_KEY_PROD[0], + EdDSAPubKeyY: COMMITMENT_MAPPER_EDDSA_PUB_KEY_PROD[1], + }, + }, + + ///////////////////////////////////////////////////////////////////////// + // STAGING // + ///////////////////////////////////////////////////////////////////////// // deployer "alpha-testnets-mumbai-mnemonic-deployer-october-13-2022" - mumbai: { + mumbaiStaging: { deployOptions: { manualConfirm: true, log: true, behindProxy: true, - proxyAdmin: ALPHA_MUMBAI_PROXY_ADMIN, + proxyAdmin: ALPHA_MUMBAI_STAGING_PROXY_ADMIN, }, badges: { address: '0x5722fEa81027533721BA161964622271560da1aC', - owner: ALPHA_MUMBAI_OWNER, + owner: ALPHA_MUMBAI_STAGING_OWNER, // Badges Metadata URI for the Badges contract uri: 'https://hub.staging.zikies.io/badges/mumbai/{id}.json', }, @@ -204,7 +339,7 @@ export const deploymentsConfig: DeploymentsConfigTypes = { collectionIdFirst: '10000001', collectionIdLast: '20000000', initialRoot: '0', - owner: ALPHA_MUMBAI_OWNER, + owner: ALPHA_MUMBAI_STAGING_OWNER, }, pythia1Verifier: { address: '0x115dFa344C877fF74e970F06BE10FF5A59EAba02', @@ -215,34 +350,34 @@ export const deploymentsConfig: DeploymentsConfigTypes = { collectionIdLast: '30000100', commitmentSignerPubKeyX: COMMITMENT_SIGNER_PUB_KEY_SYNAPS_STAGING[0], commitmentSignerPubKeyY: COMMITMENT_SIGNER_PUB_KEY_SYNAPS_STAGING[1], - owner: ALPHA_MUMBAI_OWNER, + owner: ALPHA_MUMBAI_STAGING_OWNER, }, attestationsRegistry: { address: '0xf576E42E5b2682B8f606B1840c3A982610C29a3f', - owner: ALPHA_MUMBAI_OWNER, + owner: ALPHA_MUMBAI_STAGING_OWNER, }, availableRootsRegistry: { address: '0x2c17e335d131dfd21238475Dd545B9B29Fb5A27D', - owner: ALPHA_MUMBAI_ROOTS_OWNER_RELAYER, + owner: ALPHA_MUMBAI_STAGING_ROOTS_OWNER_RELAYER, }, commitmentMapper: { address: '0x82B54988e4E3a2850501F91AC06CEA82bdb014D3', - owner: ALPHA_MUMBAI_OWNER, + owner: ALPHA_MUMBAI_STAGING_OWNER, EdDSAPubKeyX: COMMITMENT_MAPPER_EDDSA_PUB_KEY_STAGING[0], EdDSAPubKeyY: COMMITMENT_MAPPER_EDDSA_PUB_KEY_STAGING[1], }, }, // deployer "alpha-testnets-goerli-mnemonic-deployer-october-4-2022" - goerli: { + goerliStaging: { deployOptions: { manualConfirm: true, log: true, behindProxy: true, - proxyAdmin: ALPHA_GOERLI_PROXY_ADMIN, + proxyAdmin: ALPHA_GOERLI_STAGING_PROXY_ADMIN, }, badges: { address: '0xE06B14D5835925e1642d7216F4563a1273509F10', - owner: ALPHA_GOERLI_OWNER, + owner: ALPHA_GOERLI_STAGING_OWNER, // Badges Metadata URI for the Badges contract uri: 'https://hub.staging.zikies.io/badges/goerli/{id}.json', }, @@ -266,7 +401,7 @@ export const deploymentsConfig: DeploymentsConfigTypes = { collectionIdFirst: '10000001', collectionIdLast: '20000000', initialRoot: '0', - owner: ALPHA_GOERLI_OWNER, + owner: ALPHA_GOERLI_STAGING_OWNER, }, pythia1Verifier: { address: '0xEE077AD7a47e56F075f0C3bd41Cdc1629FdA3a9c', @@ -277,19 +412,19 @@ export const deploymentsConfig: DeploymentsConfigTypes = { collectionIdLast: '30000100', commitmentSignerPubKeyX: COMMITMENT_SIGNER_PUB_KEY_SYNAPS_STAGING[0], commitmentSignerPubKeyY: COMMITMENT_SIGNER_PUB_KEY_SYNAPS_STAGING[1], - owner: ALPHA_GOERLI_OWNER, + owner: ALPHA_GOERLI_STAGING_OWNER, }, attestationsRegistry: { address: '0xf85BA0afA375495eE625910Db61b6b1406756234', - owner: ALPHA_GOERLI_OWNER, + owner: ALPHA_GOERLI_STAGING_OWNER, }, availableRootsRegistry: { address: '0xdDa4c8d2933dAA21Aac75B88fF59725725ba813F', - owner: ALPHA_GOERLI_ROOTS_OWNER_RELAYER, + owner: ALPHA_GOERLI_STAGING_ROOTS_OWNER_RELAYER, }, commitmentMapper: { address: '0x0844662f25817B735BC9B6d9D11995F1A6c4dCB1', - owner: ALPHA_GOERLI_OWNER, + owner: ALPHA_GOERLI_STAGING_OWNER, EdDSAPubKeyX: COMMITMENT_MAPPER_EDDSA_PUB_KEY_STAGING[0], EdDSAPubKeyY: COMMITMENT_MAPPER_EDDSA_PUB_KEY_STAGING[1], }, diff --git a/tasks/deploy-tasks/full/3-new-hydra-s1-verifier-and-upgrade-hydra-s1-simple-proxy.test-fork.ts b/tasks/deploy-tasks/full/3-new-hydra-s1-verifier-and-upgrade-hydra-s1-simple-proxy.test-fork.ts index 42b7a6a..01b87ab 100644 --- a/tasks/deploy-tasks/full/3-new-hydra-s1-verifier-and-upgrade-hydra-s1-simple-proxy.test-fork.ts +++ b/tasks/deploy-tasks/full/3-new-hydra-s1-verifier-and-upgrade-hydra-s1-simple-proxy.test-fork.ts @@ -155,7 +155,7 @@ describe('FORK-Test New Hydra S1 Verifier and Upgrade HydraS1Simple proxy', () = const config = deploymentsConfig[process.env.FORK_NETWORK ?? hre.network.name]; const oldAttestersAddressesConfig = { - sandboxPolygon: { + polygonPlayground: { hydraS1SimpleAttester: { address: '0x0AB188c7260666146B300aD3ad5b2AB99eb91D45', },